netsuite 0.8.10 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.github/dependabot.yml +14 -0
  4. data/.github/workflows/codeql-analysis.yml +70 -0
  5. data/.github/workflows/main.yml +7 -4
  6. data/Gemfile +5 -3
  7. data/HISTORY.md +56 -2
  8. data/README.md +94 -38
  9. data/lib/netsuite/actions/add.rb +7 -2
  10. data/lib/netsuite/actions/attach_file.rb +87 -0
  11. data/lib/netsuite/actions/delete.rb +18 -1
  12. data/lib/netsuite/actions/delete_list.rb +1 -1
  13. data/lib/netsuite/actions/get.rb +1 -1
  14. data/lib/netsuite/actions/get_deleted.rb +1 -1
  15. data/lib/netsuite/actions/get_list.rb +1 -1
  16. data/lib/netsuite/actions/initialize.rb +2 -2
  17. data/lib/netsuite/actions/search.rb +20 -7
  18. data/lib/netsuite/configuration.rb +16 -3
  19. data/lib/netsuite/records/account.rb +0 -1
  20. data/lib/netsuite/records/accounting_period.rb +1 -1
  21. data/lib/netsuite/records/assembly_component.rb +0 -2
  22. data/lib/netsuite/records/assembly_item.rb +2 -2
  23. data/lib/netsuite/records/assembly_unbuild.rb +0 -1
  24. data/lib/netsuite/records/cash_refund.rb +0 -1
  25. data/lib/netsuite/records/cash_refund_item.rb +1 -1
  26. data/lib/netsuite/records/cash_sale.rb +1 -2
  27. data/lib/netsuite/records/contact.rb +0 -1
  28. data/lib/netsuite/records/credit_memo.rb +1 -1
  29. data/lib/netsuite/records/currency_rate.rb +0 -1
  30. data/lib/netsuite/records/custom_record.rb +1 -1
  31. data/lib/netsuite/records/customer.rb +224 -23
  32. data/lib/netsuite/records/customer_deposit.rb +0 -1
  33. data/lib/netsuite/records/customer_payment.rb +0 -1
  34. data/lib/netsuite/records/customer_refund.rb +1 -2
  35. data/lib/netsuite/records/deposit.rb +0 -1
  36. data/lib/netsuite/records/deposit_application.rb +0 -1
  37. data/lib/netsuite/records/description_item.rb +3 -3
  38. data/lib/netsuite/records/discount_item.rb +1 -1
  39. data/lib/netsuite/records/employee.rb +1 -1
  40. data/lib/netsuite/records/estimate.rb +0 -1
  41. data/lib/netsuite/records/file.rb +1 -1
  42. data/lib/netsuite/records/gift_certificate_item.rb +1 -1
  43. data/lib/netsuite/records/inbound_shipment.rb +0 -1
  44. data/lib/netsuite/records/inventory_item.rb +237 -38
  45. data/lib/netsuite/records/inventory_number.rb +0 -1
  46. data/lib/netsuite/records/invoice.rb +2 -2
  47. data/lib/netsuite/records/item_availability.rb +46 -0
  48. data/lib/netsuite/records/item_fulfillment.rb +4 -2
  49. data/lib/netsuite/records/item_fulfillment_package_fed_ex.rb +28 -0
  50. data/lib/netsuite/records/item_fulfillment_package_fed_ex_list.rb +32 -0
  51. data/lib/netsuite/records/item_fulfillment_package_ups.rb +27 -0
  52. data/lib/netsuite/records/item_fulfillment_package_ups_list.rb +32 -0
  53. data/lib/netsuite/records/item_fulfillment_package_usps.rb +26 -0
  54. data/lib/netsuite/records/item_fulfillment_package_usps_list.rb +32 -0
  55. data/lib/netsuite/records/item_group.rb +3 -3
  56. data/lib/netsuite/records/item_option_custom_field.rb +52 -0
  57. data/lib/netsuite/records/item_receipt.rb +0 -1
  58. data/lib/netsuite/records/item_vendor.rb +10 -1
  59. data/lib/netsuite/records/job.rb +0 -1
  60. data/lib/netsuite/records/kit_item.rb +2 -2
  61. data/lib/netsuite/records/location.rb +0 -1
  62. data/lib/netsuite/records/lot_numbered_assembly_item.rb +1 -1
  63. data/lib/netsuite/records/lot_numbered_inventory_item.rb +226 -82
  64. data/lib/netsuite/records/matrix_option_list.rb +16 -0
  65. data/lib/netsuite/records/non_inventory_purchase_item.rb +1 -1
  66. data/lib/netsuite/records/non_inventory_resale_item.rb +157 -21
  67. data/lib/netsuite/records/non_inventory_sale_item.rb +134 -22
  68. data/lib/netsuite/records/null_field_list.rb +15 -0
  69. data/lib/netsuite/records/opportunity.rb +0 -1
  70. data/lib/netsuite/records/other_charge_sale_item.rb +2 -2
  71. data/lib/netsuite/records/payment_item.rb +3 -3
  72. data/lib/netsuite/records/payroll_item.rb +0 -1
  73. data/lib/netsuite/records/purchase_order.rb +0 -1
  74. data/lib/netsuite/records/record_ref.rb +1 -1
  75. data/lib/netsuite/records/return_authorization.rb +1 -0
  76. data/lib/netsuite/records/sales_order.rb +2 -2
  77. data/lib/netsuite/records/sales_order_item.rb +2 -1
  78. data/lib/netsuite/records/serialized_assembly_item.rb +1 -1
  79. data/lib/netsuite/records/serialized_inventory_item.rb +2 -2
  80. data/lib/netsuite/records/serialized_inventory_item_location.rb +0 -1
  81. data/lib/netsuite/records/service_resale_item.rb +125 -21
  82. data/lib/netsuite/records/service_sale_item.rb +1 -2
  83. data/lib/netsuite/records/{customer_subscription.rb → subscription.rb} +1 -1
  84. data/lib/netsuite/records/subscriptions_list.rb +10 -0
  85. data/lib/netsuite/records/subsidiary.rb +0 -1
  86. data/lib/netsuite/records/subtotal_item.rb +3 -4
  87. data/lib/netsuite/records/transfer_order.rb +0 -1
  88. data/lib/netsuite/records/translation.rb +17 -0
  89. data/lib/netsuite/records/translation_list.rb +11 -0
  90. data/lib/netsuite/records/vendor.rb +0 -1
  91. data/lib/netsuite/records/vendor_bill.rb +0 -1
  92. data/lib/netsuite/records/work_order.rb +0 -1
  93. data/lib/netsuite/records/work_order_item.rb +0 -1
  94. data/lib/netsuite/support/actions.rb +2 -0
  95. data/lib/netsuite/support/fields.rb +2 -0
  96. data/lib/netsuite/support/records.rb +22 -5
  97. data/lib/netsuite/support/sublist.rb +2 -2
  98. data/lib/netsuite/utilities/strings.rb +15 -0
  99. data/lib/netsuite/utilities.rb +25 -13
  100. data/lib/netsuite/version.rb +1 -1
  101. data/lib/netsuite.rb +15 -3
  102. data/netsuite.gemspec +5 -2
  103. data/spec/netsuite/actions/add_spec.rb +39 -1
  104. data/spec/netsuite/actions/attach_file_spec.rb +59 -0
  105. data/spec/netsuite/actions/delete_spec.rb +74 -14
  106. data/spec/netsuite/actions/get_select_value_spec.rb +43 -0
  107. data/spec/netsuite/actions/search_spec.rb +205 -0
  108. data/spec/netsuite/configuration_spec.rb +35 -0
  109. data/spec/netsuite/records/cash_refund_item_spec.rb +1 -1
  110. data/spec/netsuite/records/credit_memo_spec.rb +14 -0
  111. data/spec/netsuite/records/customer_spec.rb +287 -20
  112. data/spec/netsuite/records/inventory_item_spec.rb +239 -22
  113. data/spec/netsuite/records/invoice_spec.rb +43 -0
  114. data/spec/netsuite/records/item_availability_spec.rb +59 -0
  115. data/spec/netsuite/records/item_fulfillment_package_fed_ex_list_spec.rb +27 -0
  116. data/spec/netsuite/records/item_fulfillment_package_ups_list_spec.rb +27 -0
  117. data/spec/netsuite/records/item_fulfillment_package_usps_list_spec.rb +27 -0
  118. data/spec/netsuite/records/item_option_custom_field_spec.rb +27 -0
  119. data/spec/netsuite/records/item_vendor_list_spec.rb +2 -5
  120. data/spec/netsuite/records/item_vendor_spec.rb +14 -2
  121. data/spec/netsuite/records/lot_numbered_inventory_item_spec.rb +247 -0
  122. data/spec/netsuite/records/matrix_option_list_spec.rb +26 -0
  123. data/spec/netsuite/records/non_inventory_resale_item_spec.rb +159 -24
  124. data/spec/netsuite/records/non_inventory_sale_item_spec.rb +135 -22
  125. data/spec/netsuite/records/null_field_list_spec.rb +30 -0
  126. data/spec/netsuite/records/return_authorization_spec.rb +62 -0
  127. data/spec/netsuite/records/sales_order_item_spec.rb +4 -3
  128. data/spec/netsuite/records/sales_order_spec.rb +46 -0
  129. data/spec/netsuite/records/service_resale_item_spec.rb +122 -17
  130. data/spec/netsuite/records/{customer_subscription_spec.rb → subscription_spec.rb} +2 -2
  131. data/spec/netsuite/records/{customer_subscriptions_list_spec.rb → subscriptions_list_spec.rb} +2 -2
  132. data/spec/netsuite/records/translation_list_spec.rb +34 -0
  133. data/spec/netsuite/records/translation_spec.rb +28 -0
  134. data/spec/netsuite/support/fields_spec.rb +16 -4
  135. data/spec/netsuite/support/records_spec.rb +33 -7
  136. data/spec/netsuite/support/search_result_spec.rb +12 -0
  137. data/spec/netsuite/utilities_spec.rb +10 -2
  138. data/spec/support/fixtures/add/add_file.xml +20 -0
  139. data/spec/support/fixtures/add/add_invoice.xml +9 -5
  140. data/spec/support/fixtures/attach/attach_file_to_sales_order.xml +16 -0
  141. data/spec/support/fixtures/attach/attach_file_to_sales_order_error.xml +20 -0
  142. data/spec/support/fixtures/delete/delete_customer_error.xml +21 -0
  143. data/spec/support/fixtures/delete/delete_customer_multiple_errors.xml +25 -0
  144. data/spec/support/fixtures/get_item_availability/get_item_availability.xml +46 -0
  145. data/spec/support/fixtures/get_select_value/empty_result.xml +22 -0
  146. data/spec/support/fixtures/get_select_value/item_fulfillment_ship_method.xml +43 -0
  147. data/spec/support/fixtures/search/basic_search_contact.xml +39 -0
  148. data/spec/support/fixtures/search/single_search_result.xml +46 -0
  149. metadata +78 -17
  150. data/lib/netsuite/core_ext/string/lower_camelcase.rb +0 -9
  151. data/lib/netsuite/records/customer_subscriptions_list.rb +0 -10
@@ -20,30 +20,171 @@ module NetSuite
20
20
  # }
21
21
  # ]
22
22
  #
23
- actions :get, :get_list, :add, :delete, :search, :update, :upsert, :update_list
23
+ actions :get, :get_deleted, :get_list, :add, :delete, :search, :update, :upsert, :update_list
24
24
 
25
- fields :auto_lead_time, :auto_preferred_stock_level, :auto_reorder_point, :available_to_partners, :average_cost,
26
- :copy_description, :cost, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :cost_units, :costing_method,
27
- :costing_method_display, :country_of_manufacture, :created_date, :currency, :date_converted_to_inv,
28
- :default_return_cost, :demand_modifier, :display_name, :dont_show_price, :enforce_min_qty_internally,
29
- :exclude_from_sitemap, :featured_description, :fixed_lot_size, :handling_cost, :handling_cost_units, :include_children,
30
- :is_donation_item, :is_drop_ship_item, :is_gco_compliant, :is_inactive, :is_online, :is_special_order_item, :is_taxable,
31
- :item_id, :last_modified_date, :last_purchase_price, :lead_time, :manufacturer, :manufacturer_addr1, :manufacturer_city,
32
- :manufacturer_state, :manufacturer_tariff, :manufacturer_tax_id, :manufacturer_zip, :match_bill_to_receipt,
33
- :matrix_type, :max_donation_amount, :meta_tag_html, :minimum_quantity, :minimum_quantity_units, :mpn,
34
- :mult_manufacture_addr, :nex_tag_category, :no_price_message, :offer_support, :on_hand_value_mli, :on_special,
35
- :original_item_subtype, :original_item_type, :out_of_stock_behavior, :out_of_stock_message,
36
- :overall_quantity_pricing_type, :page_title, :preference_criterion, :preferred_stock_level, :preferred_stock_level_days,
37
- :preferred_stock_level_units, :prices_include_tax, :producer, :purchase_description, :quantity_available,
38
- :quantity_available_units, :quantity_back_ordered, :quantity_committed, :quantity_committed_units, :quantity_on_hand,
39
- :quantity_on_hand_units, :quantity_on_order, :quantity_on_order_units, :quantity_reorder_units, :rate,
40
- :related_items_description, :reorder_multiple, :reorder_point, :reorder_point_units, :safety_stock_level,
41
- :safety_stock_level_days, :safety_stock_level_units, :sales_description, :schedule_b_code, :schedule_b_number,
42
- :schedule_b_quantity, :search_keywords, :seasonal_demand, :ship_individually, :shipping_cost, :shipping_cost_units,
43
- :shopping_dot_com_category, :shopzilla_category_id, :show_default_donation_amount, :sitemap_priority,
44
- :specials_description, :stock_description, :store_description, :store_detailed_description, :store_display_name,
45
- :total_value, :track_landed_cost, :transfer_price, :upc_code, :url_component, :use_bins, :use_marginal_rates,
46
- :vendor_name, :vsoe_deferral, :vsoe_delivered, :vsoe_permit_discount, :vsoe_price, :weight, :weight_unit, :weight_units
25
+ fields :auto_lead_time,
26
+ :auto_preferred_stock_level,
27
+ :auto_reorder_point,
28
+ :available_to_partners,
29
+ :average_cost,
30
+ :backward_consumption_days,
31
+ :contingent_revenue_handling,
32
+ :conversion_rate,
33
+ :copy_description,
34
+ :cost,
35
+ :cost_estimate,
36
+ :cost_estimate_type,
37
+ :cost_estimate_units,
38
+ :costing_method,
39
+ :costing_method_display,
40
+ :cost_units,
41
+ :country_of_manufacture,
42
+ :created_date,
43
+ :currency,
44
+ :date_converted_to_inv,
45
+ :default_return_cost,
46
+ :defer_rev_rec,
47
+ :demand_modifier,
48
+ :demand_time_fence,
49
+ :direct_revenue_posting,
50
+ :display_name,
51
+ :dont_show_price,
52
+ :enable_catch_weight,
53
+ :enforce_min_qty_internally,
54
+ :exclude_from_sitemap,
55
+ :featured_description,
56
+ :fixed_lot_size,
57
+ :forward_consumption_days,
58
+ :fraud_risk,
59
+ :future_horizon,
60
+ :handling_cost,
61
+ :handling_cost_units,
62
+ :hazmat_hazard_class,
63
+ :hazmat_id,
64
+ :hazmat_item_units,
65
+ :hazmat_item_units_qty,
66
+ :hazmat_packing_group,
67
+ :hazmat_shipping_name,
68
+ :include_children,
69
+ :invt_classification,
70
+ :invt_count_interval,
71
+ :is_donation_item,
72
+ :is_drop_ship_item,
73
+ :is_gco_compliant,
74
+ :is_hazmat_item,
75
+ :is_inactive,
76
+ :is_online,
77
+ :is_special_order_item,
78
+ :is_store_pickup_allowed,
79
+ :is_taxable,
80
+ :item_carrier,
81
+ :item_id,
82
+ :last_invt_count_date,
83
+ :last_modified_date,
84
+ :last_purchase_price,
85
+ :lead_time,
86
+ :lower_warning_limit,
87
+ :manufacturer,
88
+ :manufacturer_addr1,
89
+ :manufacturer_city,
90
+ :manufacturer_state,
91
+ :manufacturer_tariff,
92
+ :manufacturer_tax_id,
93
+ :manufacturer_zip,
94
+ :match_bill_to_receipt,
95
+ :matrix_item_name_template,
96
+ :matrix_type,
97
+ :max_donation_amount,
98
+ :maximum_quantity,
99
+ :meta_tag_html,
100
+ :minimum_quantity,
101
+ :minimum_quantity_units,
102
+ :mpn,
103
+ :mult_manufacture_addr,
104
+ :nex_tag_category,
105
+ :next_invt_count_date,
106
+ :no_price_message,
107
+ :offer_support,
108
+ :on_hand_value_mli,
109
+ :on_special,
110
+ :original_item_subtype,
111
+ :original_item_type,
112
+ :out_of_stock_behavior,
113
+ :out_of_stock_message,
114
+ :overall_quantity_pricing_type,
115
+ :page_title,
116
+ :periodic_lot_size_days,
117
+ :periodic_lot_size_type,
118
+ :preference_criterion,
119
+ :preferred_stock_level,
120
+ :preferred_stock_level_days,
121
+ :preferred_stock_level_units,
122
+ :prices_include_tax,
123
+ :producer,
124
+ :purchase_description,
125
+ :purchase_order_amount,
126
+ :purchase_order_quantity,
127
+ :purchase_order_quantity_diff,
128
+ :quantity_available,
129
+ :quantity_available_units,
130
+ :quantity_back_ordered,
131
+ :quantity_committed,
132
+ :quantity_committed_units,
133
+ :quantity_on_hand,
134
+ :quantity_on_hand_units,
135
+ :quantity_on_order,
136
+ :quantity_on_order_units,
137
+ :quantity_reorder_units,
138
+ :rate,
139
+ :receipt_amount,
140
+ :receipt_quantity,
141
+ :receipt_quantity_diff,
142
+ :related_items_description,
143
+ :reorder_multiple,
144
+ :reorder_point,
145
+ :reorder_point_units,
146
+ :reschedule_in_days,
147
+ :reschedule_out_days,
148
+ :round_up_as_component,
149
+ :safety_stock_level,
150
+ :safety_stock_level_days,
151
+ :safety_stock_level_units,
152
+ :sales_description,
153
+ :schedule_b_code,
154
+ :schedule_b_number,
155
+ :schedule_b_quantity,
156
+ :search_keywords,
157
+ :seasonal_demand,
158
+ :ship_individually,
159
+ :shipping_cost,
160
+ :shipping_cost_units,
161
+ :shopping_dot_com_category,
162
+ :shopzilla_category_id,
163
+ :show_default_donation_amount,
164
+ :sitemap_priority,
165
+ :specials_description,
166
+ :stock_description,
167
+ :store_description,
168
+ :store_detailed_description,
169
+ :store_display_name,
170
+ :supply_time_fence,
171
+ :total_value,
172
+ :track_landed_cost,
173
+ :transfer_price,
174
+ :upc_code,
175
+ :upper_warning_limit,
176
+ :url_component,
177
+ :use_bins,
178
+ :use_marginal_rates,
179
+ :vendor_name,
180
+ :vsoe_deferral,
181
+ :vsoe_delivered,
182
+ :vsoe_permit_discount,
183
+ :vsoe_price,
184
+ :vsoe_sop_group,
185
+ :weight,
186
+ :weight_unit,
187
+ :weight_units
47
188
 
48
189
  # https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2020_2/schema/search/itemsearchrowbasic.html?mode=package
49
190
  search_only_fields :acc_book_rev_rec_forecast_rule, :accounting_book,
@@ -105,28 +246,86 @@ module NetSuite
105
246
  :vendor_price_currency, :vendor_schedule, :vend_return_variance_account,
106
247
  :web_site, :wip_acct, :wip_variance_acct, :yahoo_product_feed
107
248
 
108
- record_refs :alternate_demand_source_item, :asset_account, :bill_exch_rate_variance_acct, :bill_price_variance_acct,
109
- :bill_qty_variance_acct, :billing_schedule, :cogs_account, :cost_category, :custom_form, :deferred_revenue_account,
110
- :demand_source, :department, :expense_account, :gain_loss_account, :income_account, :issue_product, :klass, :location,
111
- :parent, :preferred_location, :pricing_group, :purchase_price_variance_acct, :purchase_tax_code, :purchase_unit,
112
- :quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :ship_package, :soft_descriptor,
113
- :stock_unit, :store_display_image, :store_display_thumbnail, :store_item_template, :supply_lot_sizing_method,
114
- :supply_replenishment_method, :supply_type, :tax_schedule, :units_type, :vendor, :create_revenue_plans_on,
115
- :revenue_recognition_rule, :rev_rec_forecast_rule
249
+ record_refs :alternate_demand_source_item,
250
+ :asset_account,
251
+ :bill_exch_rate_variance_acct,
252
+ :billing_schedule,
253
+ :bill_price_variance_acct,
254
+ :bill_qty_variance_acct,
255
+ :klass,
256
+ :cogs_account,
257
+ :consumption_unit,
258
+ :cost_category,
259
+ :create_revenue_plans_on,
260
+ :custom_form,
261
+ :default_item_ship_method,
262
+ :deferred_revenue_account,
263
+ :demand_source,
264
+ :department,
265
+ :distribution_category,
266
+ :distribution_network,
267
+ :dropship_expense_account,
268
+ :expense_account,
269
+ :gain_loss_account,
270
+ :income_account,
271
+ :interco_cogs_account,
272
+ :interco_def_rev_account,
273
+ :interco_income_account,
274
+ :issue_product,
275
+ :item_revenue_category,
276
+ :location,
277
+ :parent,
278
+ :planning_item_category,
279
+ :preferred_location,
280
+ :pricing_group,
281
+ :purchase_price_variance_acct,
282
+ :purchase_tax_code,
283
+ :purchase_unit,
284
+ :quantity_pricing_schedule,
285
+ :revenue_allocation_group,
286
+ :revenue_recognition_rule,
287
+ :rev_rec_forecast_rule,
288
+ :rev_reclass_f_x_account,
289
+ :rev_rec_schedule,
290
+ :sales_tax_code,
291
+ :sale_unit,
292
+ :secondary_base_unit,
293
+ :secondary_consumption_unit,
294
+ :secondary_purchase_unit,
295
+ :secondary_sale_unit,
296
+ :secondary_stock_unit,
297
+ :secondary_units_type,
298
+ :ship_package,
299
+ :soft_descriptor,
300
+ :stock_unit,
301
+ :store_display_image,
302
+ :store_display_thumbnail,
303
+ :store_item_template,
304
+ :supply_lot_sizing_method,
305
+ :supply_replenishment_method,
306
+ :supply_type,
307
+ :tax_schedule,
308
+ :units_type,
309
+ :vendor
116
310
 
117
- field :pricing_matrix, PricingMatrix
118
- field :custom_field_list, CustomFieldList
119
311
  field :bin_number_list, BinNumberList
120
- field :locations_list, LocationsList
312
+ field :custom_field_list, CustomFieldList
313
+ field :item_ship_method_list, RecordRefList
121
314
  field :item_vendor_list, ItemVendorList
315
+ field :locations_list, LocationsList
122
316
  field :matrix_option_list, MatrixOptionList
317
+ field :pricing_matrix, PricingMatrix
123
318
  field :subsidiary_list, RecordRefList
124
-
125
- # for Assembly/Kit
126
- field :member_list, MemberList
319
+ # TODO: :accounting_book_detail_list, ItemAccountingBookDetailList
320
+ # TODO: :hierarchy_versions_list, InventoryItemHierarchyVersionsList
321
+ # TODO: :item_options_list, ItemOptionsList
322
+ # TODO: :presentation_item_list, PresentationItemList
323
+ # TODO: :product_feed_list, ProductFeedList
324
+ # TODO: :site_category_list, SiteCategoryList
325
+ field :translations_list, TranslationList
127
326
 
128
327
  attr_reader :internal_id
129
- attr_accessor :external_id, :search_joins
328
+ attr_accessor :external_id
130
329
 
131
330
  def initialize(attributes = {})
132
331
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -19,7 +19,6 @@ module NetSuite
19
19
 
20
20
  attr_reader :internal_id
21
21
  attr_accessor :external_id
22
- attr_accessor :search_joins
23
22
 
24
23
  def initialize(attributes = {})
25
24
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -9,7 +9,7 @@ module NetSuite
9
9
 
10
10
  # https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/record/invoice.html?mode=package
11
11
 
12
- actions :get, :get_deleted, :get_list, :initialize, :add, :update, :delete, :upsert, :upsert_list, :search
12
+ actions :attach_file, :get, :get_deleted, :get_list, :initialize, :add, :update, :delete, :upsert, :upsert_list, :search
13
13
 
14
14
  fields :balance,
15
15
  :billing_schedule, :contrib_pct, :created_date, :currency_name,
@@ -38,6 +38,7 @@ module NetSuite
38
38
  field :custom_field_list, CustomFieldList
39
39
  field :shipping_address, Address
40
40
  field :billing_address, Address
41
+ field :null_field_list, NullFieldList
41
42
 
42
43
  read_only_fields :sub_total, :discount_total, :total, :recognized_revenue, :amount_remaining, :amount_paid,
43
44
  :alt_shipping_cost, :gift_cert_applied, :handling_cost, :alt_handling_cost
@@ -141,7 +142,6 @@ module NetSuite
141
142
 
142
143
  attr_reader :internal_id
143
144
  attr_accessor :external_id
144
- attr_accessor :search_joins
145
145
 
146
146
  def initialize(attributes = {})
147
147
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -0,0 +1,46 @@
1
+ module NetSuite
2
+ module Records
3
+ class ItemAvailability
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+
8
+ field :item, InventoryItem
9
+ field :location_id, Location
10
+ alias_method :location, :location_id
11
+
12
+ field :quantity_on_hand
13
+ field :on_hand_value_mli
14
+ field :reorder_point
15
+ field :quantity_on_order
16
+ field :quantity_committed
17
+ field :quantity_available
18
+
19
+ def self.get_item_availability(ref_list, credentials={})
20
+ connection = NetSuite::Configuration.connection({}, credentials)
21
+ response = connection.call :get_item_availability, message: {
22
+ "platformMsgs:itemAvailabilityFilter" => {
23
+ "platformCore:item" => ref_list.to_record
24
+ }
25
+ }
26
+ return false unless response.success?
27
+
28
+ result = response.body[:get_item_availability_response][:get_item_availability_result]
29
+ unless result[:status][:@is_success] == "true"
30
+ return false
31
+ end
32
+ if result[:item_availability_list]
33
+ result[:item_availability_list][:item_availability].map do |row|
34
+ NetSuite::Records::ItemAvailability.new(row)
35
+ end
36
+ else
37
+ []
38
+ end
39
+ end
40
+
41
+ def initialize(attributes = {})
42
+ initialize_from_attributes_hash(attributes)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -9,7 +9,7 @@ module NetSuite
9
9
 
10
10
  actions :get, :get_list, :add, :initialize, :update, :delete, :search, :upsert, :upsert_list
11
11
 
12
- fields :tran_date, :tran_id, :shipping_cost, :memo, :ship_company, :ship_attention, :ship_addr1,
12
+ fields :created_from_ship_group, :tran_date, :tran_id, :shipping_cost, :memo, :ship_company, :ship_attention, :ship_addr1,
13
13
  :ship_addr2, :ship_city, :ship_state, :ship_zip, :ship_phone, :ship_is_residential,
14
14
  :ship_status, :last_modified_date, :created_date, :status
15
15
 
@@ -26,11 +26,13 @@ module NetSuite
26
26
 
27
27
  field :item_list, ItemFulfillmentItemList
28
28
  field :package_list, ItemFulfillmentPackageList
29
+ field :package_fed_ex_list, ItemFulfillmentPackageFedExList
30
+ field :package_ups_list, ItemFulfillmentPackageUpsList
31
+ field :package_usps_list, ItemFulfillmentPackageUspsList
29
32
  field :custom_field_list, CustomFieldList
30
33
 
31
34
  attr_reader :internal_id
32
35
  attr_accessor :external_id
33
- attr_accessor :search_joins
34
36
 
35
37
  def initialize(attributes = {})
36
38
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -0,0 +1,28 @@
1
+ module NetSuite
2
+ module Records
3
+ class ItemFulfillmentPackageFedEx
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Namespaces::TranSales
7
+
8
+ fields :authorization_number_fed_ex, :cod_amount_fed_ex, :dry_ice_weight_fed_ex, :insured_value_fed_ex, :is_alcohol_fed_ex,
9
+ :is_non_haz_lithium_fed_ex, :is_non_standard_container_fed_ex, :package_height_fed_ex, :package_length_fed_ex,
10
+ :package_tracking_number_fed_ex, :package_weight_fed_ex, :package_width_fed_ex, :priority_alert_content_fed_ex,
11
+ :reference1_fed_ex, :signature_releasefed_ex, :use_cod_fed_ex, :use_insured_value_fed_ex
12
+
13
+
14
+ def initialize(attributes_or_record = {})
15
+ case attributes_or_record
16
+ when Hash
17
+ initialize_from_attributes_hash(attributes_or_record)
18
+ when self.class
19
+ initialize_from_record(attributes_or_record)
20
+ end
21
+ end
22
+
23
+ def initialize_from_record(record)
24
+ self.attributes = record.send(:attributes)
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,32 @@
1
+ module NetSuite
2
+ module Records
3
+ class ItemFulfillmentPackageFedExList
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Namespaces::TranSales
7
+
8
+ fields :package_fed_ex
9
+
10
+ def initialize(attributes = {})
11
+ initialize_from_attributes_hash(attributes)
12
+ end
13
+
14
+ def package_fed_ex=(packages)
15
+ case packages
16
+ when Hash
17
+ self.packages << ItemFulfillmentPackageFedEx.new(packages)
18
+ when Array
19
+ packages.each { |package| self.packages << ItemFulfillmentPackageFedEx.new(package) }
20
+ end
21
+ end
22
+
23
+ def packages
24
+ @packages ||= []
25
+ end
26
+
27
+ def to_record
28
+ { "#{record_namespace}:packageFedEx" => packages.map(&:to_record) }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,27 @@
1
+ module NetSuite
2
+ module Records
3
+ class ItemFulfillmentPackageUps
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Namespaces::TranSales
7
+
8
+ fields :additional_handling_ups, :cod_amount_ups, :cod_method_ups, :delivery_conf_ups, :insured_value_ups, :package_descr_ups,
9
+ :package_height_ups, :package_length_ups, :package_tracking_number_ups, :package_weight_ups, :package_width_ups,
10
+ :packaging_ups, :reference1_ups, :reference2_ups, :use_cod_ups
11
+
12
+
13
+ def initialize(attributes_or_record = {})
14
+ case attributes_or_record
15
+ when Hash
16
+ initialize_from_attributes_hash(attributes_or_record)
17
+ when self.class
18
+ initialize_from_record(attributes_or_record)
19
+ end
20
+ end
21
+
22
+ def initialize_from_record(record)
23
+ self.attributes = record.send(:attributes)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,32 @@
1
+ module NetSuite
2
+ module Records
3
+ class ItemFulfillmentPackageUpsList
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Namespaces::TranSales
7
+
8
+ fields :package_ups
9
+
10
+ def initialize(attributes = {})
11
+ initialize_from_attributes_hash(attributes)
12
+ end
13
+
14
+ def package_ups=(packages)
15
+ case packages
16
+ when Hash
17
+ self.packages << ItemFulfillmentPackageUps.new(packages)
18
+ when Array
19
+ packages.each { |package| self.packages << ItemFulfillmentPackageUps.new(package) }
20
+ end
21
+ end
22
+
23
+ def packages
24
+ @packages ||= []
25
+ end
26
+
27
+ def to_record
28
+ { "#{record_namespace}:packageUps" => packages.map(&:to_record) }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,26 @@
1
+ module NetSuite
2
+ module Records
3
+ class ItemFulfillmentPackageUsps
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Namespaces::TranSales
7
+
8
+ fields :insured_value_usps, :package_descr_usps, :package_height_usps, :package_length_usps,
9
+ :package_tracking_number_usps, :package_weight_usps, :package_width_usps, :reference1_usps, :reference2_usps, :use_insured_value_usps
10
+
11
+
12
+ def initialize(attributes_or_record = {})
13
+ case attributes_or_record
14
+ when Hash
15
+ initialize_from_attributes_hash(attributes_or_record)
16
+ when self.class
17
+ initialize_from_record(attributes_or_record)
18
+ end
19
+ end
20
+
21
+ def initialize_from_record(record)
22
+ self.attributes = record.send(:attributes)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,32 @@
1
+ module NetSuite
2
+ module Records
3
+ class ItemFulfillmentPackageUspsList
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Namespaces::TranSales
7
+
8
+ fields :package_usps
9
+
10
+ def initialize(attributes = {})
11
+ initialize_from_attributes_hash(attributes)
12
+ end
13
+
14
+ def package_usps=(packages)
15
+ case packages
16
+ when Hash
17
+ self.packages << ItemFulfillmentPackageUsps.new(packages)
18
+ when Array
19
+ packages.each { |package| self.packages << ItemFulfillmentPackageUsps.new(package) }
20
+ end
21
+ end
22
+
23
+ def packages
24
+ @packages ||= []
25
+ end
26
+
27
+ def to_record
28
+ { "#{record_namespace}:packageUsps" => packages.map(&:to_record) }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -7,18 +7,18 @@ module NetSuite
7
7
  include Support::Actions
8
8
  include Namespaces::ListAcct
9
9
 
10
- actions :get, :get_list, :add, :delete, :search, :update, :upsert
10
+ actions :get, :get_deleted, :get_list, :add, :delete, :search, :update, :update_list, :upsert
11
11
 
12
12
  fields :available_to_partners, :created_date, :description, :display_name, :include_children, :include_start_end_lines,
13
13
  :is_inactive, :is_vsoe_bundle, :item_id, :last_modified_date, :print_items, :upc_code, :vendor_name
14
14
 
15
15
  record_refs :custom_form, :default_item_ship_method, :department, :issue_product, :item_ship_method_list, :klass, :location, :parent
16
-
16
+
17
17
  field :custom_field_list, CustomFieldList
18
18
  # TODO field :item_carrier, ShippingCarrier
19
19
  field :member_list, ItemMemberList
20
20
  field :subsidiary_list, RecordRefList
21
- # TODO field :translations_list, TranslationList
21
+ field :translations_list, TranslationList
22
22
 
23
23
  attr_reader :internal_id
24
24
  attr_accessor :external_id
@@ -0,0 +1,52 @@
1
+ module NetSuite
2
+ module Records
3
+ class ItemOptionCustomField
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Support::Actions
8
+ include Namespaces::SetupCustom
9
+
10
+ actions :get, :get_list, :add, :delete, :update, :upsert, :upsert_list
11
+
12
+ # http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_1/schema/record/ItemOptionCustomField.html
13
+ fields(
14
+ :access_level,
15
+ :col_all_items,
16
+ :col_kit_item,
17
+ :col_opportunity,
18
+ :col_option_label,
19
+ :col_purchase,
20
+ :col_sale,
21
+ :col_store,
22
+ :col_store_hidden,
23
+ :col_transfer_order,
24
+ :default_checked,
25
+ :default_value,
26
+ :description,
27
+ :display_height,
28
+ :display_width,
29
+ :help,
30
+ :is_formula,
31
+ :is_mandatory,
32
+ :label,
33
+ :link_text,
34
+ :max_length,
35
+ :max_value,
36
+ :min_value,
37
+ :store_value
38
+ )
39
+
40
+ record_refs :owner, :source_list, :select_record_type, :source_filter_by, :source_from, :search_default, :search_compare_field, :insert_before, :default_selection
41
+
42
+ attr_reader :internal_id
43
+ attr_accessor :external_id
44
+
45
+ def initialize(attributes = {})
46
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
47
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
48
+ initialize_from_attributes_hash(attributes)
49
+ end
50
+ end
51
+ end
52
+ end
@@ -26,7 +26,6 @@ module NetSuite
26
26
 
27
27
  attr_reader :internal_id
28
28
  attr_accessor :external_id
29
- attr_accessor :search_joins
30
29
 
31
30
  def initialize(attributes = {})
32
31
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)