netsuite 0.8.9 → 0.8.12
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 +45 -5
- data/README.md +95 -39
- data/lib/netsuite/actions/add.rb +5 -1
- data/lib/netsuite/actions/attach_file.rb +87 -0
- data/lib/netsuite/actions/delete.rb +1 -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/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 +1 -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 +0 -1
- 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 +0 -1
- 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 +95 -15
- 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 +1 -2
- data/lib/netsuite/records/inventory_transfer.rb +1 -0
- data/lib/netsuite/records/invoice.rb +2 -2
- data/lib/netsuite/records/item_fulfillment.rb +0 -1
- 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_receipt_item.rb +2 -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 +1 -2
- 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/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 +1 -1
- data/lib/netsuite/utilities/strings.rb +15 -0
- data/lib/netsuite/utilities.rb +5 -0
- data/lib/netsuite/version.rb +1 -1
- data/lib/netsuite.rb +6 -1
- data/netsuite.gemspec +4 -3
- data/spec/netsuite/actions/add_spec.rb +36 -0
- data/spec/netsuite/actions/attach_file_spec.rb +59 -0
- data/spec/netsuite/actions/search_spec.rb +205 -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/estimate_spec.rb +103 -13
- data/spec/netsuite/records/inventory_item_spec.rb +239 -22
- data/spec/netsuite/records/invoice_spec.rb +43 -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_spec.rb +29 -0
- data/spec/netsuite/records/service_resale_item_spec.rb +122 -17
- 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/field_matcher.rb +8 -6
- data/spec/support/fixtures/add/add_file.xml +20 -0
- 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/search/basic_search_contact.xml +39 -0
- data/spec/support/fixtures/search/single_search_result.xml +46 -0
- metadata +43 -16
- data/lib/netsuite/core_ext/string/lower_camelcase.rb +0 -9
@@ -26,7 +26,7 @@ module NetSuite
|
|
26
26
|
.update(NetSuite::Configuration.soap_header)
|
27
27
|
.merge(
|
28
28
|
(@options.delete(:preferences) || {}).inject({'platformMsgs:SearchPreferences' => {}}) do |h, (k, v)|
|
29
|
-
h['platformMsgs:SearchPreferences'][k.to_s
|
29
|
+
h['platformMsgs:SearchPreferences'][NetSuite::Utilities::Strings.lower_camelcase(k.to_s)] = v
|
30
30
|
h
|
31
31
|
end
|
32
32
|
)
|
@@ -144,12 +144,23 @@ module NetSuite
|
|
144
144
|
h[element_name] = {
|
145
145
|
'@operator' => condition[:operator],
|
146
146
|
'@xsi:type' => 'platformCore:SearchMultiSelectField',
|
147
|
-
"platformCore:searchValue" =>
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
147
|
+
"platformCore:searchValue" => condition[:value].map do |value|
|
148
|
+
search_value = {
|
149
|
+
:content! => value.to_record,
|
150
|
+
'@xsi:type' => 'platformCore:RecordRef',
|
151
|
+
'@type' => 'account'
|
152
|
+
}
|
153
|
+
|
154
|
+
if value.internal_id
|
155
|
+
search_value['@internalId'] = value.internal_id
|
156
|
+
end
|
157
|
+
|
158
|
+
if value.external_id
|
159
|
+
search_value['@externalId'] = value.external_id
|
160
|
+
end
|
161
|
+
|
162
|
+
search_value
|
163
|
+
end
|
153
164
|
}
|
154
165
|
elsif condition[:value].is_a?(Array) && condition[:type] == 'SearchDateField'
|
155
166
|
# date ranges are handled via searchValue (start range) and searchValue2 (end range)
|
@@ -235,6 +246,8 @@ module NetSuite
|
|
235
246
|
module Support
|
236
247
|
def self.included(base)
|
237
248
|
base.extend(ClassMethods)
|
249
|
+
|
250
|
+
attr_accessor :search_joins
|
238
251
|
end
|
239
252
|
|
240
253
|
module ClassMethods
|
@@ -13,7 +13,7 @@ module NetSuite
|
|
13
13
|
record_refs :parent
|
14
14
|
|
15
15
|
attr_reader :internal_id
|
16
|
-
attr_accessor :external_id
|
16
|
+
attr_accessor :external_id
|
17
17
|
|
18
18
|
def initialize(attributes = {})
|
19
19
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
@@ -15,7 +15,6 @@ module NetSuite
|
|
15
15
|
|
16
16
|
attr_reader :internal_id
|
17
17
|
attr_accessor :external_id
|
18
|
-
attr_accessor :search_joins
|
19
18
|
|
20
19
|
def initialize(attributes = {})
|
21
20
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
@@ -25,4 +24,3 @@ module NetSuite
|
|
25
24
|
end
|
26
25
|
end
|
27
26
|
end
|
28
|
-
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::ListAcct
|
9
9
|
|
10
|
-
actions :get, :get_list, :get_select_value, :add, :delete, :update, :upsert, :upsert_list, :search
|
10
|
+
actions :get, :get_deleted, :get_list, :get_select_value, :add, :delete, :update, :upsert, :upsert_list, :search
|
11
11
|
|
12
12
|
fields :auto_lead_time, :auto_preferred_stock_level, :auto_reorder_point, :available_to_partners, :average_cost, :build_entire_assembly,
|
13
13
|
:copy_description, :cost, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :cost_units, :costing_method,
|
@@ -50,7 +50,6 @@ module NetSuite
|
|
50
50
|
|
51
51
|
attr_reader :internal_id
|
52
52
|
attr_accessor :external_id
|
53
|
-
attr_accessor :search_joins
|
54
53
|
|
55
54
|
def initialize(attributes = {})
|
56
55
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
@@ -6,7 +6,7 @@ module NetSuite
|
|
6
6
|
include Support::Records
|
7
7
|
include Namespaces::TranCust
|
8
8
|
|
9
|
-
fields :amount, :rate, :quantity, :is_taxable, :order_line, :line, :description
|
9
|
+
fields :amount, :gross_amt, :rate, :quantity, :is_taxable, :order_line, :line, :description
|
10
10
|
field :custom_field_list, CustomFieldList
|
11
11
|
|
12
12
|
record_refs :item, :klass, :price
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::TranSales
|
9
9
|
|
10
|
-
actions :get, :add, :initialize, :delete, :update, :upsert, :search
|
10
|
+
actions :get, :add, :initialize, :delete, :update, :upsert, :upsert_list, :search
|
11
11
|
|
12
12
|
fields :alt_handling_cost, :alt_shipping_cost, :auth_code, :bill_address, :cc_approved, :cc_expire_date, :cc_is_purchase_card_bin,
|
13
13
|
:cc_name, :cc_number, :cc_process_as_purchas_card, :cc_security_code, :cc_street, :cc_zip_code, :charge_it, :contrib_pct, :created_date,
|
@@ -36,7 +36,6 @@ module NetSuite
|
|
36
36
|
|
37
37
|
attr_reader :internal_id
|
38
38
|
attr_accessor :external_id
|
39
|
-
attr_accessor :search_joins
|
40
39
|
|
41
40
|
def initialize(attributes = {})
|
42
41
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
@@ -23,6 +23,7 @@ module NetSuite
|
|
23
23
|
field :item_list, CreditMemoItemList
|
24
24
|
field :apply_list, CreditMemoApplyList
|
25
25
|
field :ship_group_list, SalesOrderShipGroupList
|
26
|
+
field :null_field_list, NullFieldList
|
26
27
|
|
27
28
|
# field :bill_address_list,
|
28
29
|
field :transaction_bill_address, BillAddress
|
@@ -38,7 +39,6 @@ module NetSuite
|
|
38
39
|
|
39
40
|
attr_reader :internal_id
|
40
41
|
attr_accessor :external_id
|
41
|
-
attr_accessor :search_joins
|
42
42
|
|
43
43
|
def initialize(attributes = {})
|
44
44
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
@@ -17,12 +17,12 @@ module NetSuite
|
|
17
17
|
:show_last_modified, :show_notes, :show_owner, :show_owner_allow_change, :show_owner_on_list, :use_permissions
|
18
18
|
|
19
19
|
field :custom_field_list, CustomFieldList
|
20
|
+
field :translations_list, TranslationList
|
20
21
|
|
21
22
|
record_refs :custom_form, :owner, :rec_type, :parent
|
22
23
|
|
23
24
|
attr_reader :internal_id
|
24
25
|
attr_accessor :external_id
|
25
|
-
attr_accessor :search_joins
|
26
26
|
|
27
27
|
def initialize(attributes = {})
|
28
28
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
@@ -7,15 +7,15 @@ 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, :upsert
|
11
11
|
|
12
12
|
fields :available_to_partners, :created_date, :description, :display_name, :include_children, :is_inactive, :item_id, :last_modified_date
|
13
13
|
|
14
14
|
record_refs :custom_form, :department, :issue_product, :klass, :location
|
15
|
-
|
15
|
+
|
16
16
|
field :custom_field_list, CustomFieldList
|
17
17
|
field :subsidiary_list, RecordRefList
|
18
|
-
|
18
|
+
field :translations_list, TranslationList
|
19
19
|
|
20
20
|
attr_reader :internal_id
|
21
21
|
attr_accessor :external_id
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::ListAcct
|
9
9
|
|
10
|
-
actions :get, :get_list, :add, :update, :delete, :search, :upsert
|
10
|
+
actions :get, :get_deleted, :get_list, :add, :update, :delete, :search, :upsert
|
11
11
|
|
12
12
|
fields :available_to_partners, :created_date, :description, :display_name, :include_children, :is_inactive, :is_pre_tax,
|
13
13
|
:item_id, :last_modified_date, :non_posting, :rate, :upc_code, :vendor_name
|
@@ -9,7 +9,7 @@ module NetSuite
|
|
9
9
|
|
10
10
|
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/script/record/employee.html
|
11
11
|
|
12
|
-
actions :get, :get_list, :add, :update, :upsert, :upsert_list, :delete, :search
|
12
|
+
actions :get, :get_deleted, :get_list, :add, :update, :upsert, :upsert_list, :delete, :search
|
13
13
|
|
14
14
|
fields :alt_name, :phone, :first_name, :last_name, :is_inactive, :email, :give_access, :send_email, :is_support_rep,
|
15
15
|
:birth_date, :hire_date, :last_review_date, :next_review_date, :title, :home_phone, :office_phone,
|
@@ -9,28 +9,108 @@ module NetSuite
|
|
9
9
|
|
10
10
|
actions :get, :get_list, :add, :initialize, :delete, :update, :upsert, :search
|
11
11
|
|
12
|
-
fields :alt_handling_cost,
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
fields :alt_handling_cost,
|
13
|
+
:alt_sales_total,
|
14
|
+
:alt_shipping_cost,
|
15
|
+
:can_have_stackable,
|
16
|
+
:contrib_pct,
|
17
|
+
:created_date,
|
18
|
+
:currency_name,
|
19
|
+
:discount_rate,
|
20
|
+
:discount_total,
|
21
|
+
:due_date,
|
22
|
+
:email,
|
23
|
+
:end_date,
|
24
|
+
:est_gross_profit,
|
25
|
+
:est_gross_profit_percent,
|
26
|
+
:exchange_rate,
|
27
|
+
:expected_close_date,
|
28
|
+
:fax,
|
29
|
+
:fob,
|
30
|
+
:handling_cost,
|
31
|
+
:handling_tax1_rate,
|
32
|
+
:handling_tax2_rate,
|
33
|
+
:include_in_forecast,
|
34
|
+
:is_taxable,
|
35
|
+
:last_modified_date,
|
36
|
+
:linked_tracking_numbers,
|
37
|
+
:memo,
|
38
|
+
:message,
|
39
|
+
:one_time,
|
40
|
+
:other_ref_num,
|
41
|
+
:probability,
|
42
|
+
:recur_annually,
|
43
|
+
:recur_monthly,
|
44
|
+
:recur_quarterly,
|
45
|
+
:recur_weekly,
|
46
|
+
:ship_date,
|
47
|
+
:ship_is_residential,
|
48
|
+
:shipping_cost,
|
49
|
+
:shipping_tax1_rate,
|
50
|
+
:shipping_tax2_rate,
|
51
|
+
:source,
|
52
|
+
:start_date,
|
53
|
+
:status,
|
54
|
+
:sub_total,
|
55
|
+
:sync_partner_teams,
|
56
|
+
:sync_sales_teams,
|
57
|
+
:tax2_total,
|
58
|
+
:tax_details_override,
|
59
|
+
:tax_point_date,
|
60
|
+
:tax_rate,
|
61
|
+
:tax_reg_override,
|
62
|
+
:tax_total,
|
63
|
+
:title,
|
64
|
+
:to_be_emailed,
|
65
|
+
:to_be_faxed,
|
66
|
+
:to_be_printed,
|
67
|
+
:total,
|
68
|
+
:total_cost_estimate,
|
69
|
+
:tracking_numbers,
|
70
|
+
:tran_date,
|
71
|
+
:tran_id,
|
72
|
+
:vat_reg_num,
|
73
|
+
:visible_to_customer
|
20
74
|
|
21
|
-
field :shipping_address, Address
|
22
75
|
field :billing_address, Address
|
23
|
-
|
24
|
-
field :item_list, EstimateItemList
|
25
76
|
field :custom_field_list, CustomFieldList
|
77
|
+
field :item_list, EstimateItemList
|
78
|
+
field :promotions_list, PromotionsList
|
79
|
+
field :shipping_address, Address
|
26
80
|
|
27
|
-
record_refs :bill_address_list,
|
28
|
-
|
29
|
-
|
81
|
+
record_refs :bill_address_list,
|
82
|
+
:billing_schedule,
|
83
|
+
:klass,
|
84
|
+
:created_from,
|
85
|
+
:currency,
|
86
|
+
:custom_form,
|
87
|
+
:department,
|
88
|
+
:discount_item,
|
89
|
+
:entity,
|
90
|
+
:entity_status,
|
91
|
+
:entity_tax_reg_num,
|
92
|
+
:forecast_type,
|
93
|
+
:handling_tax_code,
|
94
|
+
:job,
|
95
|
+
:lead_source,
|
96
|
+
:location,
|
97
|
+
:message_sel,
|
98
|
+
:nexus,
|
99
|
+
:opportunity,
|
100
|
+
:partner,
|
101
|
+
:promo_code,
|
102
|
+
:sales_group,
|
103
|
+
:sales_rep,
|
104
|
+
:ship_address_list,
|
105
|
+
:ship_method,
|
106
|
+
:shipping_tax_code,
|
107
|
+
:subsidiary,
|
108
|
+
:subsidiary_tax_reg_num,
|
109
|
+
:tax_item,
|
110
|
+
:terms
|
30
111
|
|
31
112
|
attr_reader :internal_id
|
32
113
|
attr_accessor :external_id
|
33
|
-
attr_accessor :search_joins
|
34
114
|
|
35
115
|
def initialize(attributes = {})
|
36
116
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|