netsuite 0.8.10 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.github/dependabot.yml +14 -0
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/.github/workflows/main.yml +7 -4
- data/Gemfile +5 -3
- data/HISTORY.md +56 -2
- data/README.md +94 -38
- data/lib/netsuite/actions/add.rb +7 -2
- data/lib/netsuite/actions/attach_file.rb +87 -0
- data/lib/netsuite/actions/delete.rb +18 -1
- data/lib/netsuite/actions/delete_list.rb +1 -1
- data/lib/netsuite/actions/get.rb +1 -1
- data/lib/netsuite/actions/get_deleted.rb +1 -1
- data/lib/netsuite/actions/get_list.rb +1 -1
- data/lib/netsuite/actions/initialize.rb +2 -2
- data/lib/netsuite/actions/search.rb +20 -7
- data/lib/netsuite/configuration.rb +16 -3
- data/lib/netsuite/records/account.rb +0 -1
- data/lib/netsuite/records/accounting_period.rb +1 -1
- data/lib/netsuite/records/assembly_component.rb +0 -2
- data/lib/netsuite/records/assembly_item.rb +2 -2
- data/lib/netsuite/records/assembly_unbuild.rb +0 -1
- data/lib/netsuite/records/cash_refund.rb +0 -1
- data/lib/netsuite/records/cash_refund_item.rb +1 -1
- data/lib/netsuite/records/cash_sale.rb +1 -2
- data/lib/netsuite/records/contact.rb +0 -1
- data/lib/netsuite/records/credit_memo.rb +1 -1
- data/lib/netsuite/records/currency_rate.rb +0 -1
- data/lib/netsuite/records/custom_record.rb +1 -1
- data/lib/netsuite/records/customer.rb +224 -23
- data/lib/netsuite/records/customer_deposit.rb +0 -1
- data/lib/netsuite/records/customer_payment.rb +0 -1
- data/lib/netsuite/records/customer_refund.rb +1 -2
- data/lib/netsuite/records/deposit.rb +0 -1
- data/lib/netsuite/records/deposit_application.rb +0 -1
- data/lib/netsuite/records/description_item.rb +3 -3
- data/lib/netsuite/records/discount_item.rb +1 -1
- data/lib/netsuite/records/employee.rb +1 -1
- data/lib/netsuite/records/estimate.rb +0 -1
- data/lib/netsuite/records/file.rb +1 -1
- data/lib/netsuite/records/gift_certificate_item.rb +1 -1
- data/lib/netsuite/records/inbound_shipment.rb +0 -1
- data/lib/netsuite/records/inventory_item.rb +237 -38
- data/lib/netsuite/records/inventory_number.rb +0 -1
- data/lib/netsuite/records/invoice.rb +2 -2
- data/lib/netsuite/records/item_availability.rb +46 -0
- data/lib/netsuite/records/item_fulfillment.rb +4 -2
- data/lib/netsuite/records/item_fulfillment_package_fed_ex.rb +28 -0
- data/lib/netsuite/records/item_fulfillment_package_fed_ex_list.rb +32 -0
- data/lib/netsuite/records/item_fulfillment_package_ups.rb +27 -0
- data/lib/netsuite/records/item_fulfillment_package_ups_list.rb +32 -0
- data/lib/netsuite/records/item_fulfillment_package_usps.rb +26 -0
- data/lib/netsuite/records/item_fulfillment_package_usps_list.rb +32 -0
- data/lib/netsuite/records/item_group.rb +3 -3
- data/lib/netsuite/records/item_option_custom_field.rb +52 -0
- data/lib/netsuite/records/item_receipt.rb +0 -1
- data/lib/netsuite/records/item_vendor.rb +10 -1
- data/lib/netsuite/records/job.rb +0 -1
- data/lib/netsuite/records/kit_item.rb +2 -2
- data/lib/netsuite/records/location.rb +0 -1
- data/lib/netsuite/records/lot_numbered_assembly_item.rb +1 -1
- data/lib/netsuite/records/lot_numbered_inventory_item.rb +226 -82
- data/lib/netsuite/records/matrix_option_list.rb +16 -0
- data/lib/netsuite/records/non_inventory_purchase_item.rb +1 -1
- data/lib/netsuite/records/non_inventory_resale_item.rb +157 -21
- data/lib/netsuite/records/non_inventory_sale_item.rb +134 -22
- data/lib/netsuite/records/null_field_list.rb +15 -0
- data/lib/netsuite/records/opportunity.rb +0 -1
- data/lib/netsuite/records/other_charge_sale_item.rb +2 -2
- data/lib/netsuite/records/payment_item.rb +3 -3
- data/lib/netsuite/records/payroll_item.rb +0 -1
- data/lib/netsuite/records/purchase_order.rb +0 -1
- data/lib/netsuite/records/record_ref.rb +1 -1
- data/lib/netsuite/records/return_authorization.rb +1 -0
- data/lib/netsuite/records/sales_order.rb +2 -2
- data/lib/netsuite/records/sales_order_item.rb +2 -1
- data/lib/netsuite/records/serialized_assembly_item.rb +1 -1
- data/lib/netsuite/records/serialized_inventory_item.rb +2 -2
- data/lib/netsuite/records/serialized_inventory_item_location.rb +0 -1
- data/lib/netsuite/records/service_resale_item.rb +125 -21
- data/lib/netsuite/records/service_sale_item.rb +1 -2
- data/lib/netsuite/records/{customer_subscription.rb → subscription.rb} +1 -1
- data/lib/netsuite/records/subscriptions_list.rb +10 -0
- data/lib/netsuite/records/subsidiary.rb +0 -1
- data/lib/netsuite/records/subtotal_item.rb +3 -4
- data/lib/netsuite/records/transfer_order.rb +0 -1
- data/lib/netsuite/records/translation.rb +17 -0
- data/lib/netsuite/records/translation_list.rb +11 -0
- data/lib/netsuite/records/vendor.rb +0 -1
- data/lib/netsuite/records/vendor_bill.rb +0 -1
- data/lib/netsuite/records/work_order.rb +0 -1
- data/lib/netsuite/records/work_order_item.rb +0 -1
- data/lib/netsuite/support/actions.rb +2 -0
- data/lib/netsuite/support/fields.rb +2 -0
- data/lib/netsuite/support/records.rb +22 -5
- data/lib/netsuite/support/sublist.rb +2 -2
- data/lib/netsuite/utilities/strings.rb +15 -0
- data/lib/netsuite/utilities.rb +25 -13
- data/lib/netsuite/version.rb +1 -1
- data/lib/netsuite.rb +15 -3
- data/netsuite.gemspec +5 -2
- data/spec/netsuite/actions/add_spec.rb +39 -1
- data/spec/netsuite/actions/attach_file_spec.rb +59 -0
- data/spec/netsuite/actions/delete_spec.rb +74 -14
- data/spec/netsuite/actions/get_select_value_spec.rb +43 -0
- data/spec/netsuite/actions/search_spec.rb +205 -0
- data/spec/netsuite/configuration_spec.rb +35 -0
- data/spec/netsuite/records/cash_refund_item_spec.rb +1 -1
- data/spec/netsuite/records/credit_memo_spec.rb +14 -0
- data/spec/netsuite/records/customer_spec.rb +287 -20
- data/spec/netsuite/records/inventory_item_spec.rb +239 -22
- data/spec/netsuite/records/invoice_spec.rb +43 -0
- data/spec/netsuite/records/item_availability_spec.rb +59 -0
- data/spec/netsuite/records/item_fulfillment_package_fed_ex_list_spec.rb +27 -0
- data/spec/netsuite/records/item_fulfillment_package_ups_list_spec.rb +27 -0
- data/spec/netsuite/records/item_fulfillment_package_usps_list_spec.rb +27 -0
- data/spec/netsuite/records/item_option_custom_field_spec.rb +27 -0
- data/spec/netsuite/records/item_vendor_list_spec.rb +2 -5
- data/spec/netsuite/records/item_vendor_spec.rb +14 -2
- data/spec/netsuite/records/lot_numbered_inventory_item_spec.rb +247 -0
- data/spec/netsuite/records/matrix_option_list_spec.rb +26 -0
- data/spec/netsuite/records/non_inventory_resale_item_spec.rb +159 -24
- data/spec/netsuite/records/non_inventory_sale_item_spec.rb +135 -22
- data/spec/netsuite/records/null_field_list_spec.rb +30 -0
- data/spec/netsuite/records/return_authorization_spec.rb +62 -0
- data/spec/netsuite/records/sales_order_item_spec.rb +4 -3
- data/spec/netsuite/records/sales_order_spec.rb +46 -0
- data/spec/netsuite/records/service_resale_item_spec.rb +122 -17
- data/spec/netsuite/records/{customer_subscription_spec.rb → subscription_spec.rb} +2 -2
- data/spec/netsuite/records/{customer_subscriptions_list_spec.rb → subscriptions_list_spec.rb} +2 -2
- data/spec/netsuite/records/translation_list_spec.rb +34 -0
- data/spec/netsuite/records/translation_spec.rb +28 -0
- data/spec/netsuite/support/fields_spec.rb +16 -4
- data/spec/netsuite/support/records_spec.rb +33 -7
- data/spec/netsuite/support/search_result_spec.rb +12 -0
- data/spec/netsuite/utilities_spec.rb +10 -2
- data/spec/support/fixtures/add/add_file.xml +20 -0
- data/spec/support/fixtures/add/add_invoice.xml +9 -5
- data/spec/support/fixtures/attach/attach_file_to_sales_order.xml +16 -0
- data/spec/support/fixtures/attach/attach_file_to_sales_order_error.xml +20 -0
- data/spec/support/fixtures/delete/delete_customer_error.xml +21 -0
- data/spec/support/fixtures/delete/delete_customer_multiple_errors.xml +25 -0
- data/spec/support/fixtures/get_item_availability/get_item_availability.xml +46 -0
- data/spec/support/fixtures/get_select_value/empty_result.xml +22 -0
- data/spec/support/fixtures/get_select_value/item_fulfillment_ship_method.xml +43 -0
- data/spec/support/fixtures/search/basic_search_contact.xml +39 -0
- data/spec/support/fixtures/search/single_search_result.xml +46 -0
- metadata +78 -17
- data/lib/netsuite/core_ext/string/lower_camelcase.rb +0 -9
- 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,
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
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,
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
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 :
|
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
|
-
#
|
126
|
-
|
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
|
328
|
+
attr_accessor :external_id
|
130
329
|
|
131
330
|
def initialize(attributes = {})
|
132
331
|
@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
|
-
|
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
|