netsuite 0.8.12 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/codeql-analysis.yml +3 -3
- data/Gemfile +7 -0
- data/HISTORY.md +24 -0
- data/README.md +26 -0
- data/lib/netsuite/actions/add.rb +2 -1
- data/lib/netsuite/actions/delete.rb +17 -0
- data/lib/netsuite/configuration.rb +37 -4
- data/lib/netsuite/records/assembly_item.rb +2 -1
- data/lib/netsuite/records/customer.rb +225 -23
- data/lib/netsuite/records/customer_refund.rb +1 -1
- data/lib/netsuite/records/description_item.rb +1 -1
- data/lib/netsuite/records/discount_item.rb +1 -1
- data/lib/netsuite/records/file.rb +1 -1
- data/lib/netsuite/records/gift_certificate_item.rb +1 -1
- data/lib/netsuite/records/item_availability.rb +46 -0
- data/lib/netsuite/records/item_fulfillment.rb +4 -1
- 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 +1 -1
- data/lib/netsuite/records/kit_item.rb +1 -1
- data/lib/netsuite/records/lot_numbered_assembly_item.rb +1 -1
- data/lib/netsuite/records/non_inventory_purchase_item.rb +1 -1
- data/lib/netsuite/records/non_inventory_resale_item.rb +1 -1
- data/lib/netsuite/records/non_inventory_sale_item.rb +1 -1
- data/lib/netsuite/records/other_charge_sale_item.rb +1 -1
- data/lib/netsuite/records/payment_item.rb +1 -1
- data/lib/netsuite/records/sales_order.rb +1 -0
- 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 +1 -1
- data/lib/netsuite/records/service_resale_item.rb +1 -1
- data/lib/netsuite/records/service_sale_item.rb +1 -1
- data/lib/netsuite/records/{customer_subscription.rb → subscription.rb} +1 -1
- data/lib/netsuite/records/subscriptions_list.rb +10 -0
- data/lib/netsuite/records/subtotal_item.rb +1 -1
- data/lib/netsuite/support/sublist.rb +1 -1
- data/lib/netsuite/utilities.rb +35 -13
- data/lib/netsuite/version.rb +1 -1
- data/lib/netsuite.rb +9 -2
- data/netsuite.gemspec +6 -3
- data/spec/netsuite/actions/add_spec.rb +4 -2
- data/spec/netsuite/actions/delete_spec.rb +74 -14
- data/spec/netsuite/actions/get_select_value_spec.rb +43 -0
- data/spec/netsuite/configuration_spec.rb +62 -3
- data/spec/netsuite/records/customer_spec.rb +287 -20
- 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/sales_order_item_spec.rb +4 -3
- data/spec/netsuite/records/sales_order_spec.rb +17 -0
- 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/support/fixtures/add/add_invoice.xml +9 -5
- 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
- metadata +46 -9
- data/lib/netsuite/records/customer_subscriptions_list.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3429c5cb6575fd1e62738eaf1270a0c585d82bc302975e435491af2a8a5dd7b5
|
4
|
+
data.tar.gz: 41a481e39865f46c5a0b8d61c3ab44e4c547ccfb8cc2de4c9621634ec331eb2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df1a9202d4ccdfaff26031b7f1ae957403d374e90115f063ac107e0f59fc890a4b254bc559e06eb87a2768575827bde20917bf00ae4986e52ad48acf0043c45f
|
7
|
+
data.tar.gz: 07de35d4a530d8decc1344a0ed6cdf1d198260bd3ae84dae45b00e2324837172062fc071c0f3a05bf685423e8a0b4da910e865e7cc00f878098ec125c7dcc5c7
|
@@ -42,7 +42,7 @@ jobs:
|
|
42
42
|
|
43
43
|
# Initializes the CodeQL tools for scanning.
|
44
44
|
- name: Initialize CodeQL
|
45
|
-
uses: github/codeql-action/init@
|
45
|
+
uses: github/codeql-action/init@v2
|
46
46
|
with:
|
47
47
|
languages: ${{ matrix.language }}
|
48
48
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
@@ -53,7 +53,7 @@ jobs:
|
|
53
53
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
54
54
|
# If this step fails, then you should remove it and run the build manually (see below)
|
55
55
|
- name: Autobuild
|
56
|
-
uses: github/codeql-action/autobuild@
|
56
|
+
uses: github/codeql-action/autobuild@v2
|
57
57
|
|
58
58
|
# ℹ️ Command-line programs to run using the OS shell.
|
59
59
|
# 📚 https://git.io/JvXDl
|
@@ -67,4 +67,4 @@ jobs:
|
|
67
67
|
# make release
|
68
68
|
|
69
69
|
- name: Perform CodeQL Analysis
|
70
|
-
uses: github/codeql-action/analyze@
|
70
|
+
uses: github/codeql-action/analyze@v2
|
data/Gemfile
CHANGED
@@ -11,3 +11,10 @@ if ENV.fetch('BUNDLE_TZINFO', 'false') == 'true'
|
|
11
11
|
# optional dependency for more accurate timezone conversion
|
12
12
|
gem 'tzinfo', '>= 1.2.5'
|
13
13
|
end
|
14
|
+
|
15
|
+
if RUBY_VERSION >= '3.1.0'
|
16
|
+
# Savon v2.13 adds a dependency on mail, which has an implicit dependency on
|
17
|
+
# net-smtp. Ruby 3.1 removed net-smtp as a default gem. mail v2.8.0.rc1 is the
|
18
|
+
# first to make that dependency explicit to support Ruby 3.1.
|
19
|
+
gem 'mail', '>= 2.8.0.rc1'
|
20
|
+
end
|
data/HISTORY.md
CHANGED
@@ -1,8 +1,32 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
|
3
4
|
### Added
|
5
|
+
* Add `Configuration#multi_tenant!` for opting into multi-tentant support where configuration/caching is per-thread (#556)
|
4
6
|
|
5
7
|
### Fixed
|
8
|
+
* Avoid Savon version `2.13.0` to prevent generating invalid envelopes. (#558, #563)
|
9
|
+
|
10
|
+
### Breaking Changes
|
11
|
+
|
12
|
+
## 0.9.0
|
13
|
+
|
14
|
+
### Added
|
15
|
+
|
16
|
+
* Update `Customer` record fields/record refs for 2021.2. (#535)
|
17
|
+
The following were moved from `fields` to `record_refs`: `buying_reason`, `buying_time_frame`, `campaign_category`, `image`, `opening_balance_account`, `pref_cc_processor`, `representing_subsidiary`, `sales_group`, `sales_readiness`
|
18
|
+
The following were removed as `fields` since their sublist class is not yet implemented: `download_list`, `group_pricing_list`, `item_pricing_list`
|
19
|
+
* Add search-only fields to `Customer` (#535)
|
20
|
+
* Add `attach_file` action to `Customer` records (#544)
|
21
|
+
* Add `update` action to `File` records (#544)
|
22
|
+
* Expose `errors` after calls to `delete` action (#545)
|
23
|
+
* Add `update_list` action where missing on supported item records (#546)
|
24
|
+
* Ignore `after_submit_failed` status details (>= 2018.2) when collating errors in add action (#550)
|
25
|
+
* Add `NullFieldList` to `SalesOrder` (#552)
|
26
|
+
* Add thread safety to NetSuite configuration and utilities (#549)
|
27
|
+
|
28
|
+
### Breaking Changes
|
29
|
+
* Rename `CustomerSubscriptionsList` to `SubscriptionsList` and `CustomerSubscription` to `Subscription` to match NetSuite naming (#535)
|
6
30
|
|
7
31
|
## 0.8.12
|
8
32
|
|
data/README.md
CHANGED
@@ -159,6 +159,32 @@ NetSuite.configure do
|
|
159
159
|
end
|
160
160
|
```
|
161
161
|
|
162
|
+
### Multi-Tenancy
|
163
|
+
|
164
|
+
If you're interacting with multiple NetSuite accounts, each in separate threads, you can enable multi-tenancy to prevent your configuration and caches from being shared between threads.
|
165
|
+
|
166
|
+
From your main thread, you'd want to enable multi-tenancy:
|
167
|
+
|
168
|
+
```ruby
|
169
|
+
NetSuite.configure do
|
170
|
+
multi_tentant!
|
171
|
+
end
|
172
|
+
```
|
173
|
+
|
174
|
+
Note that `multi_tenant!` is a special configuration option which is _not_ effected by `reset!`.
|
175
|
+
|
176
|
+
Then in each child thread, you'd perform any configuration specific to the NetSuite account you're interacting with for that thread, all of which will be specific to that thread only:
|
177
|
+
|
178
|
+
```ruby
|
179
|
+
NetSuite.configure do
|
180
|
+
reset!
|
181
|
+
|
182
|
+
account ENV['NETSUITE_ACCOUNT']
|
183
|
+
|
184
|
+
# The rest of your usual configuration...
|
185
|
+
end
|
186
|
+
```
|
187
|
+
|
162
188
|
# Usage
|
163
189
|
|
164
190
|
## CRUD Operations
|
data/lib/netsuite/actions/add.rb
CHANGED
@@ -70,8 +70,9 @@ module NetSuite
|
|
70
70
|
error_obj = response_hash[:status][:status_detail]
|
71
71
|
error_obj = [error_obj] if error_obj.class == Hash
|
72
72
|
error_obj.map do |error|
|
73
|
+
next if error.keys == [:after_submit_failed]
|
73
74
|
NetSuite::Error.new(error)
|
74
|
-
end
|
75
|
+
end.compact
|
75
76
|
end
|
76
77
|
|
77
78
|
module Support
|
@@ -65,6 +65,20 @@ module NetSuite
|
|
65
65
|
@response_body ||= response_hash[:base_ref]
|
66
66
|
end
|
67
67
|
|
68
|
+
def response_errors
|
69
|
+
if response_hash[:status] && response_hash[:status][:status_detail]
|
70
|
+
@response_errors ||= errors
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def errors
|
75
|
+
error_obj = response_hash[:status][:status_detail]
|
76
|
+
error_obj = [error_obj] if error_obj.class == Hash
|
77
|
+
error_obj.map do |error|
|
78
|
+
NetSuite::Error.new(error)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
68
82
|
module Support
|
69
83
|
def delete(options = {}, credentials={})
|
70
84
|
response = if options.empty?
|
@@ -72,6 +86,9 @@ module NetSuite
|
|
72
86
|
else
|
73
87
|
NetSuite::Actions::Delete.call([self, options], credentials)
|
74
88
|
end
|
89
|
+
|
90
|
+
@errors = response.errors
|
91
|
+
|
75
92
|
response.success?
|
76
93
|
end
|
77
94
|
end
|
@@ -11,7 +11,11 @@ module NetSuite
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def attributes
|
14
|
-
|
14
|
+
if multi_tenant?
|
15
|
+
Thread.current[:netsuite_gem_attributes] ||= {}
|
16
|
+
else
|
17
|
+
@attributes ||= {}
|
18
|
+
end
|
15
19
|
end
|
16
20
|
|
17
21
|
def connection(params={}, credentials={})
|
@@ -27,6 +31,7 @@ module NetSuite
|
|
27
31
|
logger: logger,
|
28
32
|
log_level: log_level,
|
29
33
|
log: !silent, # turn off logging entirely if configured
|
34
|
+
proxy: proxy,
|
30
35
|
}.update(params))
|
31
36
|
cache_wsdl(client)
|
32
37
|
return client
|
@@ -50,11 +55,19 @@ module NetSuite
|
|
50
55
|
end
|
51
56
|
|
52
57
|
def wsdl_cache
|
53
|
-
|
58
|
+
if multi_tenant?
|
59
|
+
Thread.current[:netsuite_gem_wsdl_cache] ||= {}
|
60
|
+
else
|
61
|
+
@wsdl_cache ||= {}
|
62
|
+
end
|
54
63
|
end
|
55
64
|
|
56
65
|
def clear_wsdl_cache
|
57
|
-
|
66
|
+
if multi_tenant?
|
67
|
+
Thread.current[:netsuite_gem_wsdl_cache] = {}
|
68
|
+
else
|
69
|
+
@wsdl_cache = {}
|
70
|
+
end
|
58
71
|
end
|
59
72
|
|
60
73
|
def cached_wsdl
|
@@ -82,7 +95,7 @@ module NetSuite
|
|
82
95
|
if version
|
83
96
|
self.api_version = version
|
84
97
|
else
|
85
|
-
attributes[:api_version] ||= '
|
98
|
+
attributes[:api_version] ||= '2016_2'
|
86
99
|
end
|
87
100
|
end
|
88
101
|
|
@@ -394,5 +407,25 @@ module NetSuite
|
|
394
407
|
def log_level=(value)
|
395
408
|
attributes[:log_level] = value
|
396
409
|
end
|
410
|
+
|
411
|
+
def proxy=(proxy)
|
412
|
+
attributes[:proxy] = proxy
|
413
|
+
end
|
414
|
+
|
415
|
+
def proxy(proxy = nil)
|
416
|
+
if proxy
|
417
|
+
self.proxy = proxy
|
418
|
+
else
|
419
|
+
attributes[:proxy]
|
420
|
+
end
|
421
|
+
end
|
422
|
+
|
423
|
+
def multi_tenant!
|
424
|
+
@multi_tenant = true
|
425
|
+
end
|
426
|
+
|
427
|
+
def multi_tenant?
|
428
|
+
@multi_tenant
|
429
|
+
end
|
397
430
|
end
|
398
431
|
end
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::ListAcct
|
9
9
|
|
10
|
-
actions :get, :get_deleted, :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, :update_list, :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,
|
@@ -47,6 +47,7 @@ module NetSuite
|
|
47
47
|
field :pricing_matrix, PricingMatrix
|
48
48
|
field :member_list, MemberList
|
49
49
|
field :subsidiary_list, RecordRefList
|
50
|
+
field :translations_list, TranslationList
|
50
51
|
|
51
52
|
attr_reader :internal_id
|
52
53
|
attr_accessor :external_id
|
@@ -7,40 +7,242 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::ListRel
|
9
9
|
|
10
|
-
actions :get, :get_list, :add, :update, :upsert, :upsert_list, :delete, :delete_list, :search
|
10
|
+
actions :get, :get_list, :add, :update, :upsert, :upsert_list, :delete, :delete_list, :search, :attach_file
|
11
11
|
|
12
12
|
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/record/customer.html
|
13
13
|
|
14
|
-
fields :account_number,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
14
|
+
fields :account_number,
|
15
|
+
:aging,
|
16
|
+
:aging1,
|
17
|
+
:aging2,
|
18
|
+
:aging3,
|
19
|
+
:aging4,
|
20
|
+
:alcohol_recipient_type,
|
21
|
+
:alt_email,
|
22
|
+
:alt_name,
|
23
|
+
:alt_phone,
|
24
|
+
:bill_pay,
|
25
|
+
:click_stream,
|
26
|
+
:comments,
|
27
|
+
:company_name,
|
28
|
+
:consol_aging,
|
29
|
+
:consol_aging1,
|
30
|
+
:consol_aging2,
|
31
|
+
:consol_aging3,
|
32
|
+
:consol_aging4,
|
33
|
+
:consol_days_overdue,
|
34
|
+
:contrib_pct,
|
35
|
+
:credit_hold_override,
|
36
|
+
:credit_limit,
|
37
|
+
:date_created,
|
38
|
+
:days_overdue,
|
39
|
+
:default_address,
|
40
|
+
:default_order_priority,
|
41
|
+
:display_symbol,
|
42
|
+
:email,
|
43
|
+
:email_preference,
|
44
|
+
:email_transactions,
|
45
|
+
:end_date,
|
46
|
+
:entity_id,
|
47
|
+
:estimated_budget,
|
48
|
+
:fax,
|
49
|
+
:fax_transactions,
|
50
|
+
:first_name,
|
51
|
+
:first_visit,
|
52
|
+
:give_access,
|
53
|
+
:global_subscription_status,
|
54
|
+
:home_phone,
|
55
|
+
:is_budget_approved,
|
56
|
+
:is_inactive,
|
57
|
+
:is_person,
|
58
|
+
:keywords,
|
59
|
+
:language,
|
60
|
+
:last_modified_date,
|
61
|
+
:last_name,
|
62
|
+
:last_page_visited,
|
63
|
+
:last_visit,
|
64
|
+
:middle_name,
|
65
|
+
:mobile_phone,
|
66
|
+
:monthly_closing,
|
67
|
+
:negative_number_format,
|
68
|
+
:number_format,
|
69
|
+
:opening_balance,
|
70
|
+
:opening_balance_date,
|
71
|
+
:override_currency_format,
|
72
|
+
:password,
|
73
|
+
:password2,
|
74
|
+
:phone,
|
75
|
+
:phonetic_name,
|
76
|
+
:print_on_check_as,
|
77
|
+
:print_transactions,
|
78
|
+
:referrer,
|
79
|
+
:reminder_days,
|
80
|
+
:require_pwd_change,
|
81
|
+
:resale_number,
|
82
|
+
:salutation,
|
83
|
+
:send_email,
|
84
|
+
:ship_complete,
|
85
|
+
:stage,
|
86
|
+
:start_date,
|
87
|
+
:symbol_placement,
|
88
|
+
:sync_partner_teams,
|
89
|
+
:taxable,
|
90
|
+
:tax_exempt,
|
91
|
+
:third_party_acct,
|
92
|
+
:third_party_country,
|
93
|
+
:third_party_zipcode,
|
94
|
+
:title,
|
95
|
+
:url,
|
96
|
+
:vat_reg_number,
|
97
|
+
:visits,
|
98
|
+
:web_lead
|
99
|
+
|
100
|
+
field :addressbook_list, CustomerAddressbookList
|
33
101
|
field :contact_roles_list, ContactAccessRolesList
|
102
|
+
field :credit_cards_list, CustomerCreditCardsList
|
34
103
|
field :currency_list, CustomerCurrencyList
|
104
|
+
field :custom_field_list, CustomFieldList
|
105
|
+
# field :download_list, CustomerDownloadList # TODO Implement me
|
106
|
+
# field :group_pricing_list, CustomerGroupPricingList # TODO: Implement me
|
107
|
+
# field :item_pricing_list, CustomerItemPricingList # TODO: Implement me
|
35
108
|
field :partners_list, CustomerPartnersList
|
36
|
-
field :subscriptions_list, CustomerSubscriptionsList
|
37
109
|
field :sales_team_list, CustomerSalesTeamList
|
110
|
+
field :subscriptions_list, SubscriptionsList
|
111
|
+
# field :tax_registration_list, CustomerTaxRegistrationList # TODO: Implement me
|
38
112
|
|
39
113
|
read_only_fields :balance, :consol_balance, :deposit_balance, :consol_deposit_balance, :overdue_balance,
|
40
114
|
:consol_overdue_balance, :unbilled_orders, :consol_unbilled_orders
|
41
115
|
|
42
|
-
|
43
|
-
|
116
|
+
search_only_fields :address,
|
117
|
+
:address1,
|
118
|
+
:address2,
|
119
|
+
:address3,
|
120
|
+
:addressee,
|
121
|
+
:address_internal_id,
|
122
|
+
:address_label,
|
123
|
+
:address_phone,
|
124
|
+
:alt_contact,
|
125
|
+
:assigned_site,
|
126
|
+
:assigned_site_id,
|
127
|
+
:attention,
|
128
|
+
:available_offline,
|
129
|
+
:bill_address,
|
130
|
+
:bill_address1,
|
131
|
+
:bill_address2,
|
132
|
+
:bill_address3,
|
133
|
+
:bill_addressee,
|
134
|
+
:bill_attention,
|
135
|
+
:bill_city,
|
136
|
+
:bill_country,
|
137
|
+
:bill_country_code,
|
138
|
+
:bill_phone,
|
139
|
+
:bill_state,
|
140
|
+
:bill_zip_code,
|
141
|
+
:cc_customer_code,
|
142
|
+
:cc_default,
|
143
|
+
:cc_exp_date,
|
144
|
+
:cc_holder_name,
|
145
|
+
:cc_internal_id,
|
146
|
+
:cc_number,
|
147
|
+
:cc_state,
|
148
|
+
:cc_state_from,
|
149
|
+
:cc_type,
|
150
|
+
:city,
|
151
|
+
:contact,
|
152
|
+
:contribution,
|
153
|
+
:contribution_primary,
|
154
|
+
:conversion_date,
|
155
|
+
:country,
|
156
|
+
:country_code,
|
157
|
+
:credit_hold,
|
158
|
+
:date_closed,
|
159
|
+
:entity_number,
|
160
|
+
:explicit_conversion,
|
161
|
+
:first_order_date,
|
162
|
+
:first_sale_date,
|
163
|
+
:fx_balance,
|
164
|
+
:fx_consol_balance,
|
165
|
+
:fx_consol_unbilled_orders,
|
166
|
+
:fx_unbilled_orders,
|
167
|
+
:group_pricing_level,
|
168
|
+
:has_duplicates,
|
169
|
+
:is_default_billing,
|
170
|
+
:is_default_shipping,
|
171
|
+
:is_ship_address,
|
172
|
+
:item_pricing_level,
|
173
|
+
:item_pricing_unit_price,
|
174
|
+
:job_end_date,
|
175
|
+
:job_projected_end,
|
176
|
+
:job_start_date,
|
177
|
+
:job_type,
|
178
|
+
:last_order_date,
|
179
|
+
:last_sale_date,
|
180
|
+
:lead_date,
|
181
|
+
:level,
|
182
|
+
:manual_credit_hold,
|
183
|
+
:on_credit_hold,
|
184
|
+
:partner_contribution,
|
185
|
+
:partner_role,
|
186
|
+
:partner_team_member,
|
187
|
+
:pec,
|
188
|
+
:permission,
|
189
|
+
:pricing_group,
|
190
|
+
:pricing_item,
|
191
|
+
:prospect_date,
|
192
|
+
:role,
|
193
|
+
:sales_team_member,
|
194
|
+
:sales_team_role,
|
195
|
+
:ship_address,
|
196
|
+
:ship_address1,
|
197
|
+
:ship_address2,
|
198
|
+
:ship_address3,
|
199
|
+
:ship_addressee,
|
200
|
+
:ship_attention,
|
201
|
+
:ship_city,
|
202
|
+
:ship_country,
|
203
|
+
:ship_country_code,
|
204
|
+
:ship_phone,
|
205
|
+
:ship_state,
|
206
|
+
:ship_zip,
|
207
|
+
:source_site,
|
208
|
+
:source_site_id,
|
209
|
+
:state,
|
210
|
+
:subscription,
|
211
|
+
:subscription_date,
|
212
|
+
:subscription_status,
|
213
|
+
:zip_code
|
214
|
+
|
215
|
+
record_refs :access_role,
|
216
|
+
:assigned_web_site,
|
217
|
+
:buying_reason,
|
218
|
+
:buying_time_frame,
|
219
|
+
:campaign_category,
|
220
|
+
:category,
|
221
|
+
:currency,
|
222
|
+
:custom_form,
|
223
|
+
:default_allocation_strategy,
|
224
|
+
:default_tax_reg,
|
225
|
+
:dr_account,
|
226
|
+
:entity_status,
|
227
|
+
:fx_account,
|
228
|
+
:image,
|
229
|
+
:lead_source,
|
230
|
+
:opening_balance_account,
|
231
|
+
:parent,
|
232
|
+
:partner,
|
233
|
+
:pref_cc_processor,
|
234
|
+
:price_level,
|
235
|
+
:receivables_account,
|
236
|
+
:representing_subsidiary,
|
237
|
+
:sales_group,
|
238
|
+
:sales_readiness,
|
239
|
+
:sales_rep,
|
240
|
+
:shipping_item,
|
241
|
+
:source_web_site,
|
242
|
+
:subsidiary,
|
243
|
+
:tax_item,
|
244
|
+
:terms,
|
245
|
+
:territory
|
44
246
|
|
45
247
|
attr_reader :internal_id
|
46
248
|
attr_accessor :external_id
|
@@ -20,7 +20,7 @@ module NetSuite
|
|
20
20
|
read_only_fields :balance, :total
|
21
21
|
|
22
22
|
record_refs :account, :ar_acct, :credit_card, :credit_card_processor, :custom_form, :customer, :department, :klass,
|
23
|
-
:location, :payment_method, :posting_period, :subsidiary, :void_journal, :currency
|
23
|
+
:location, :payment_method, :posting_period, :subsidiary, :void_journal, :currency, :payment_option
|
24
24
|
|
25
25
|
attr_reader :internal_id
|
26
26
|
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_deleted, :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, :is_inactive, :item_id, :last_modified_date
|
13
13
|
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::ListAcct
|
9
9
|
|
10
|
-
actions :get, :get_deleted, :get_list, :add, :update, :delete, :search, :upsert
|
10
|
+
actions :get, :get_deleted, :get_list, :add, :update, :update_list, :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/schema/record/file.html
|
11
11
|
|
12
|
-
actions :get, :add, :delete, :search, :get_list
|
12
|
+
actions :get, :add, :delete, :search, :get_list, :update
|
13
13
|
|
14
14
|
fields :content, :description, :name, :media_type_name, :file_type, :text_file_encoding, :created_date, :last_modified_date
|
15
15
|
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::ListAcct
|
9
9
|
|
10
|
-
actions :get, :get_list, :add, :delete, :search, :upsert
|
10
|
+
actions :get, :get_list, :add, :delete, :search, :update_list, :upsert
|
11
11
|
|
12
12
|
fields :auth_codes_list,
|
13
13
|
:available_to_partners,
|
@@ -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,6 +26,9 @@ 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
|
@@ -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
|