netsuite 0.8.1 → 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/Gemfile +7 -2
- data/README.md +111 -31
- data/circle.yml +33 -13
- data/lib/netsuite.rb +40 -19
- data/lib/netsuite/actions/login.rb +25 -2
- data/lib/netsuite/actions/search.rb +1 -6
- data/lib/netsuite/actions/update.rb +6 -2
- data/lib/netsuite/actions/update_list.rb +109 -0
- data/lib/netsuite/actions/upsert.rb +2 -0
- data/lib/netsuite/configuration.rb +21 -4
- data/lib/netsuite/errors.rb +3 -0
- data/lib/netsuite/passports/token.rb +1 -1
- data/lib/netsuite/records/assembly_build.rb +4 -1
- data/lib/netsuite/records/assembly_item.rb +1 -0
- data/lib/netsuite/records/assembly_unbuild.rb +3 -0
- data/lib/netsuite/records/bin_number.rb +18 -0
- data/lib/netsuite/records/bin_number_list.rb +1 -20
- data/lib/netsuite/records/bin_transfer.rb +38 -0
- data/lib/netsuite/records/bin_transfer_inventory.rb +20 -0
- data/lib/netsuite/records/bin_transfer_inventory_list.rb +10 -0
- data/lib/netsuite/records/cash_refund.rb +3 -1
- data/lib/netsuite/records/cash_refund_item.rb +1 -1
- data/lib/netsuite/records/classification.rb +5 -2
- data/lib/netsuite/records/contact.rb +2 -1
- data/lib/netsuite/records/contact_addressbook.rb +64 -0
- data/lib/netsuite/records/contact_addressbook_list.rb +11 -0
- data/lib/netsuite/records/custom_field_list.rb +10 -2
- data/lib/netsuite/records/custom_record.rb +3 -3
- data/lib/netsuite/records/custom_record_ref.rb +1 -0
- data/lib/netsuite/records/customer.rb +5 -4
- data/lib/netsuite/records/customer_credit_cards.rb +36 -0
- data/lib/netsuite/records/customer_credit_cards_list.rb +10 -0
- data/lib/netsuite/records/customer_deposit.rb +5 -2
- data/lib/netsuite/records/customer_payment.rb +1 -0
- data/lib/netsuite/records/customer_sales_team.rb +24 -0
- data/lib/netsuite/records/customer_sales_team_list.rb +9 -0
- data/lib/netsuite/records/customer_status.rb +29 -0
- data/lib/netsuite/records/customer_subscription.rb +18 -0
- data/lib/netsuite/records/customer_subscriptions_list.rb +10 -0
- data/lib/netsuite/records/employee.rb +2 -2
- data/lib/netsuite/records/entity_custom_field.rb +53 -0
- data/lib/netsuite/records/estimate.rb +42 -0
- data/lib/netsuite/records/estimate_item.rb +40 -0
- data/lib/netsuite/records/estimate_item_list.rb +11 -0
- data/lib/netsuite/records/inbound_shipment.rb +33 -0
- data/lib/netsuite/records/inbound_shipment_item.rb +39 -0
- data/lib/netsuite/records/inbound_shipment_item_list.rb +11 -0
- data/lib/netsuite/records/inter_company_journal_entry.rb +48 -0
- data/lib/netsuite/records/inter_company_journal_entry_line.rb +28 -0
- data/lib/netsuite/records/inter_company_journal_entry_line_list.rb +14 -0
- data/lib/netsuite/records/inventory_adjustment.rb +1 -1
- data/lib/netsuite/records/inventory_adjustment_inventory.rb +1 -1
- data/lib/netsuite/records/inventory_item.rb +2 -2
- data/lib/netsuite/records/invoice.rb +1 -1
- data/lib/netsuite/records/item_fulfillment.rb +1 -1
- data/lib/netsuite/records/lot_numbered_assembly_item.rb +64 -0
- data/lib/netsuite/records/lot_numbered_inventory_item.rb +116 -0
- data/lib/netsuite/records/matrix_option_list.rb +12 -4
- data/lib/netsuite/records/message.rb +30 -0
- data/lib/netsuite/records/non_inventory_resale_item.rb +3 -2
- data/lib/netsuite/records/non_inventory_sale_item.rb +2 -1
- data/lib/netsuite/records/other_charge_sale_item.rb +2 -2
- data/lib/netsuite/records/partner.rb +1 -1
- data/lib/netsuite/records/price.rb +17 -0
- data/lib/netsuite/records/price_level.rb +26 -0
- data/lib/netsuite/records/price_list.rb +9 -0
- data/lib/netsuite/records/pricing.rb +20 -0
- data/lib/netsuite/records/pricing_matrix.rb +2 -2
- data/lib/netsuite/records/promotions.rb +26 -0
- data/lib/netsuite/records/promotions_list.rb +9 -0
- data/lib/netsuite/records/return_authorization_item.rb +1 -1
- data/lib/netsuite/records/sales_order.rb +1 -0
- data/lib/netsuite/records/sales_order_item.rb +12 -5
- data/lib/netsuite/records/sales_role.rb +26 -0
- data/lib/netsuite/records/sales_tax_item.rb +3 -1
- data/lib/netsuite/records/serialized_assembly_item.rb +239 -0
- data/lib/netsuite/records/service_resale_item.rb +1 -1
- data/lib/netsuite/records/service_sale_item.rb +2 -1
- data/lib/netsuite/records/support_case.rb +1 -1
- data/lib/netsuite/records/support_case_type.rb +26 -0
- data/lib/netsuite/records/task.rb +2 -1
- data/lib/netsuite/records/tax_group.rb +2 -2
- data/lib/netsuite/records/transaction_body_custom_field.rb +61 -0
- data/lib/netsuite/records/transaction_column_custom_field.rb +59 -0
- data/lib/netsuite/records/transfer_order_item.rb +2 -2
- data/lib/netsuite/records/vendor_credit.rb +2 -0
- data/lib/netsuite/records/work_order.rb +8 -0
- data/lib/netsuite/support/actions.rb +2 -0
- data/lib/netsuite/support/country.rb +27 -15
- data/lib/netsuite/support/search_result.rb +20 -5
- data/lib/netsuite/utilities.rb +86 -21
- data/lib/netsuite/version.rb +2 -2
- data/netsuite.gemspec +5 -4
- data/spec/netsuite/actions/login_spec.rb +23 -0
- data/spec/netsuite/actions/update_list_spec.rb +107 -0
- data/spec/netsuite/actions/update_spec.rb +42 -0
- data/spec/netsuite/configuration_spec.rb +79 -6
- data/spec/netsuite/records/address_spec.rb +10 -0
- data/spec/netsuite/records/basic_record_spec.rb +12 -1
- data/spec/netsuite/records/bin_number_spec.rb +23 -0
- data/spec/netsuite/records/classification_spec.rb +10 -1
- data/spec/netsuite/records/custom_field_list_spec.rb +39 -4
- data/spec/netsuite/records/custom_record_spec.rb +1 -1
- data/spec/netsuite/records/customer_credit_cards_list_spec.rb +23 -0
- data/spec/netsuite/records/customer_sales_team_list_spec.rb +41 -0
- data/spec/netsuite/records/customer_spec.rb +44 -2
- data/spec/netsuite/records/customer_subscription_spec.rb +41 -0
- data/spec/netsuite/records/customer_subscriptions_list_spec.rb +19 -0
- data/spec/netsuite/records/employee_spec.rb +2 -2
- data/spec/netsuite/records/entity_custom_field_spec.rb +34 -0
- data/spec/netsuite/records/estimate_item_list_spec.rb +26 -0
- data/spec/netsuite/records/estimate_item_spec.rb +40 -0
- data/spec/netsuite/records/estimate_spec.rb +216 -0
- data/spec/netsuite/records/inter_company_journal_entry_line_list_spec.rb +26 -0
- data/spec/netsuite/records/inter_company_journal_entry_line_spec.rb +60 -0
- data/spec/netsuite/records/inter_company_journal_entry_spec.rb +156 -0
- data/spec/netsuite/records/inventory_item_spec.rb +57 -0
- data/spec/netsuite/records/invoice_spec.rb +2 -2
- data/spec/netsuite/records/matrix_option_list_spec.rb +15 -5
- data/spec/netsuite/records/message_spec.rb +49 -0
- data/spec/netsuite/records/non_inventory_resale_item_spec.rb +165 -0
- data/spec/netsuite/records/non_inventory_sale_item_spec.rb +1 -1
- data/spec/netsuite/records/partner_spec.rb +141 -0
- data/spec/netsuite/records/price_level_spec.rb +16 -0
- data/spec/netsuite/records/pricing_matrix_spec.rb +15 -13
- data/spec/netsuite/records/return_authorization_item_list_spec.rb +2 -2
- data/spec/netsuite/records/return_authorization_item_spec.rb +1 -1
- data/spec/netsuite/records/sales_order_item_spec.rb +11 -5
- data/spec/netsuite/records/service_resale_item_spec.rb +134 -0
- data/spec/netsuite/records/support_case_type_spec.rb +22 -0
- data/spec/netsuite/records/transaction_body_custom_field_spec.rb +32 -0
- data/spec/netsuite/records/transaction_column_custom_field_spec.rb +32 -0
- data/spec/netsuite/records/vendor_credit_spec.rb +29 -0
- data/spec/netsuite/support/search_result_spec.rb +24 -0
- data/spec/netsuite/utilities_spec.rb +44 -6
- data/spec/spec_helper.rb +5 -4
- data/spec/support/fixtures/update_list/update_list_items.xml +22 -0
- data/spec/support/fixtures/update_list/update_list_one_item.xml +18 -0
- data/spec/support/fixtures/update_list/update_list_with_errors.xml +32 -0
- metadata +104 -8
@@ -1,5 +1,6 @@
|
|
1
1
|
# https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/login.html
|
2
2
|
|
3
|
+
|
3
4
|
module NetSuite
|
4
5
|
module Actions
|
5
6
|
class Login
|
@@ -27,10 +28,32 @@ module NetSuite
|
|
27
28
|
# </platformCore:wsRoleList>
|
28
29
|
|
29
30
|
def self.call(credentials)
|
30
|
-
|
31
|
+
|
32
|
+
soap_header = {}
|
33
|
+
if !credentials[:application_id].nil? && !credentials[:application_id].empty?
|
34
|
+
soap_header = NetSuite::Configuration.soap_header.dup
|
35
|
+
soap_header['platformMsgs:ApplicationInfo'] ||= {}
|
36
|
+
soap_header['platformMsgs:ApplicationInfo']['platformMsgs:applicationId'] = credentials[:application_id]
|
37
|
+
end
|
38
|
+
|
39
|
+
passport = NetSuite::Configuration.auth_header.dup
|
40
|
+
|
41
|
+
|
42
|
+
passport['platformMsgs:passport'] ||= {}
|
43
|
+
passport['platformMsgs:passport']['platformCore:email'] = credentials[:email] || ''
|
44
|
+
passport['platformMsgs:passport']['platformCore:password'] = credentials[:password] || ''
|
45
|
+
passport['platformMsgs:passport']['platformCore:role'] = credentials[:role] || ''
|
46
|
+
|
47
|
+
if passport['platformMsgs:tokenPassport']
|
48
|
+
passport['platformMsgs:passport']['platformCore:account'] ||= passport['platformMsgs:tokenPassport']['platformCore:account']
|
49
|
+
end
|
50
|
+
|
51
|
+
passport['platformMsgs:passport']['platformCore:account'] = credentials[:account] if !credentials[:account].nil?
|
52
|
+
|
53
|
+
passport.delete('platformMsgs:tokenPassport')
|
31
54
|
|
32
55
|
begin
|
33
|
-
response = NetSuite::Configuration.connection(soap_header:
|
56
|
+
response = NetSuite::Configuration.connection(soap_header: soap_header).call :login, message: passport
|
34
57
|
rescue Savon::SOAPFault => e
|
35
58
|
error_details = e.to_hash[:fault]
|
36
59
|
|
@@ -232,11 +232,6 @@ module NetSuite
|
|
232
232
|
@success ||= search_result[:status][:@is_success] == 'true'
|
233
233
|
end
|
234
234
|
|
235
|
-
protected
|
236
|
-
def method_name
|
237
|
-
|
238
|
-
end
|
239
|
-
|
240
235
|
module Support
|
241
236
|
def self.included(base)
|
242
237
|
base.extend(ClassMethods)
|
@@ -247,7 +242,7 @@ module NetSuite
|
|
247
242
|
response = NetSuite::Actions::Search.call([self, options], credentials)
|
248
243
|
|
249
244
|
if response.success?
|
250
|
-
NetSuite::Support::SearchResult.new(response, self)
|
245
|
+
NetSuite::Support::SearchResult.new(response, self, credentials)
|
251
246
|
else
|
252
247
|
false
|
253
248
|
end
|
@@ -71,8 +71,12 @@ module NetSuite
|
|
71
71
|
|
72
72
|
module Support
|
73
73
|
def update(options = {}, credentials={})
|
74
|
-
options
|
75
|
-
|
74
|
+
options[:internal_id] = internal_id if respond_to?(:internal_id) && internal_id
|
75
|
+
|
76
|
+
if !options.include?(:external_id) && (respond_to?(:external_id) && external_id)
|
77
|
+
options[:external_id] = external_id
|
78
|
+
end
|
79
|
+
|
76
80
|
response = NetSuite::Actions::Update.call([self.class, options], credentials)
|
77
81
|
@errors = response.errors
|
78
82
|
response.success?
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/updateList.html
|
2
|
+
module NetSuite
|
3
|
+
module Actions
|
4
|
+
class UpdateList
|
5
|
+
include Support::Requests
|
6
|
+
|
7
|
+
def initialize(*objects)
|
8
|
+
@objects = objects
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def request(credentials={})
|
14
|
+
NetSuite::Configuration.connection(
|
15
|
+
{ element_form_default: :unqualified }, credentials
|
16
|
+
).call(:update_list, message: request_body)
|
17
|
+
end
|
18
|
+
|
19
|
+
# <soap:Body>
|
20
|
+
# <updateList>
|
21
|
+
# <record xsi:type="listRel:Customer" externalId="ext1">
|
22
|
+
# <listRel:entityId>Shutter Fly</listRel:entityId>
|
23
|
+
# <listRel:companyName>Shutter Fly, Inc</listRel:companyName>
|
24
|
+
# </record>
|
25
|
+
# <record xsi:type="listRel:Customer" externalId="ext2">
|
26
|
+
# <listRel:entityId>Target</listRel:entityId>
|
27
|
+
# <listRel:companyName>Target</listRel:companyName>
|
28
|
+
# </record>
|
29
|
+
# </updateList>
|
30
|
+
# </soap:Body>
|
31
|
+
def request_body
|
32
|
+
attrs = @objects.map do |o|
|
33
|
+
hash = o.to_record.merge({
|
34
|
+
'@xsi:type' => o.record_type
|
35
|
+
})
|
36
|
+
|
37
|
+
if o.respond_to?(:internal_id) && o.internal_id
|
38
|
+
hash['@internalId'] = o.internal_id
|
39
|
+
end
|
40
|
+
|
41
|
+
if o.respond_to?(:external_id) && o.external_id
|
42
|
+
hash['@externalId'] = o.external_id
|
43
|
+
end
|
44
|
+
|
45
|
+
hash
|
46
|
+
end
|
47
|
+
|
48
|
+
{ 'record' => attrs }
|
49
|
+
end
|
50
|
+
|
51
|
+
def response_hash
|
52
|
+
@response_hash ||= Array[@response.body[:update_list_response][:write_response_list][:write_response]].flatten
|
53
|
+
end
|
54
|
+
|
55
|
+
def response_body
|
56
|
+
@response_body ||= response_hash.map { |h| h[:base_ref] }
|
57
|
+
end
|
58
|
+
|
59
|
+
def response_errors
|
60
|
+
if response_hash.any? { |h| h[:status] && h[:status][:status_detail] }
|
61
|
+
@response_errors ||= errors
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def errors
|
66
|
+
errors = response_hash.select { |h| h[:status] && h[:status][:status_detail] }.map do |obj|
|
67
|
+
error_obj = obj[:status][:status_detail]
|
68
|
+
error_obj = [error_obj] if error_obj.class == Hash
|
69
|
+
errors = error_obj.map do |error|
|
70
|
+
NetSuite::Error.new(error)
|
71
|
+
end
|
72
|
+
|
73
|
+
[obj[:base_ref][:@internal_id], errors]
|
74
|
+
end
|
75
|
+
Hash[errors]
|
76
|
+
end
|
77
|
+
|
78
|
+
def success?
|
79
|
+
@success ||= response_hash.all? { |h| h[:status][:@is_success] == 'true' }
|
80
|
+
end
|
81
|
+
|
82
|
+
module Support
|
83
|
+
|
84
|
+
def self.included(base)
|
85
|
+
base.extend(ClassMethods)
|
86
|
+
end
|
87
|
+
|
88
|
+
module ClassMethods
|
89
|
+
def update_list(records, credentials = {})
|
90
|
+
netsuite_records = records.map do |r|
|
91
|
+
if r.kind_of?(self)
|
92
|
+
r
|
93
|
+
else
|
94
|
+
self.new(r)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
response = NetSuite::Actions::UpdateList.call(netsuite_records, credentials)
|
98
|
+
|
99
|
+
if response.success?
|
100
|
+
netsuite_records
|
101
|
+
else
|
102
|
+
false
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -18,6 +18,7 @@ module NetSuite
|
|
18
18
|
client = Savon.client({
|
19
19
|
wsdl: cached_wsdl || wsdl,
|
20
20
|
read_timeout: read_timeout,
|
21
|
+
open_timeout: open_timeout,
|
21
22
|
namespaces: namespaces,
|
22
23
|
soap_header: auth_header(credentials).update(soap_header),
|
23
24
|
pretty_print_xml: true,
|
@@ -326,6 +327,18 @@ module NetSuite
|
|
326
327
|
end
|
327
328
|
end
|
328
329
|
|
330
|
+
def open_timeout=(timeout)
|
331
|
+
attributes[:open_timeout] = timeout
|
332
|
+
end
|
333
|
+
|
334
|
+
def open_timeout(timeout = nil)
|
335
|
+
if timeout
|
336
|
+
self.open_timeout = timeout
|
337
|
+
else
|
338
|
+
attributes[:open_timeout]
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
329
342
|
def log=(path)
|
330
343
|
attributes[:log] = path
|
331
344
|
end
|
@@ -337,7 +350,10 @@ module NetSuite
|
|
337
350
|
|
338
351
|
def logger(value = nil)
|
339
352
|
if value.nil?
|
340
|
-
|
353
|
+
# if passed a IO object (like StringIO) `empty?` won't exist
|
354
|
+
valid_log = log && !(log.respond_to?(:empty?) && log.empty?)
|
355
|
+
|
356
|
+
attributes[:logger] ||= ::Logger.new(valid_log ? log : $stdout)
|
341
357
|
else
|
342
358
|
attributes[:logger] = value
|
343
359
|
end
|
@@ -357,12 +373,13 @@ module NetSuite
|
|
357
373
|
end
|
358
374
|
|
359
375
|
def log_level(value = nil)
|
360
|
-
self.log_level = value
|
361
|
-
|
376
|
+
self.log_level = value if value
|
377
|
+
|
378
|
+
attributes[:log_level] || :debug
|
362
379
|
end
|
363
380
|
|
364
381
|
def log_level=(value)
|
365
|
-
attributes[:log_level]
|
382
|
+
attributes[:log_level] = value
|
366
383
|
end
|
367
384
|
end
|
368
385
|
end
|
data/lib/netsuite/errors.rb
CHANGED
@@ -3,6 +3,7 @@ module NetSuite
|
|
3
3
|
class InitializationError < StandardError; end
|
4
4
|
class ConfigurationError < StandardError; end
|
5
5
|
|
6
|
+
# NOTE not an exception, used as a wrapped around NetSuite SOAP error
|
6
7
|
class Error
|
7
8
|
attr_accessor :type, :code, :message
|
8
9
|
|
@@ -11,5 +12,7 @@ module NetSuite
|
|
11
12
|
@code = args[:code]
|
12
13
|
@message = args[:message]
|
13
14
|
end
|
15
|
+
|
16
|
+
alias_method :to_s, :inspect
|
14
17
|
end
|
15
18
|
end
|
@@ -19,7 +19,7 @@ module NetSuite
|
|
19
19
|
'platformCore:token' => token_id,
|
20
20
|
'platformCore:nonce' => nonce,
|
21
21
|
'platformCore:timestamp' => timestamp,
|
22
|
-
'platformCore:signature' => signature
|
22
|
+
'platformCore:signature' => signature,
|
23
23
|
:attributes! => { 'platformCore:signature' => { 'algorithm' => 'HMAC-SHA256' } }
|
24
24
|
}
|
25
25
|
}
|
@@ -5,15 +5,18 @@ module NetSuite
|
|
5
5
|
include Support::RecordRefs
|
6
6
|
include Support::Actions
|
7
7
|
include Support::Records
|
8
|
+
include Support::Fields
|
8
9
|
include Namespaces::TranInvt
|
9
10
|
|
10
11
|
actions :get, :add, :initialize, :delete, :update, :upsert, :upsert_list,
|
11
12
|
:search
|
12
13
|
|
13
14
|
fields :bin_numbers, :buildable, :created_date, :expiration_date,
|
14
|
-
:last_modified_date, :memo, :quantity, :serial_numbers,
|
15
|
+
:last_modified_date, :memo, :quantity, :serial_numbers,
|
15
16
|
:tran_date, :tran_id
|
16
17
|
|
18
|
+
read_only_fields :total
|
19
|
+
|
17
20
|
record_refs :klass, :created_from, :item, :custom_form,
|
18
21
|
:department, :job, :location, :posting_period, :revision,
|
19
22
|
:subsidiary, :units
|
@@ -5,6 +5,7 @@ module NetSuite
|
|
5
5
|
include Support::RecordRefs
|
6
6
|
include Support::Records
|
7
7
|
include Support::Actions
|
8
|
+
include Support::Fields
|
8
9
|
include Namespaces::TranInvt
|
9
10
|
|
10
11
|
actions :get, :add, :initialize, :delete, :update, :upsert, :upsert_list,
|
@@ -14,6 +15,8 @@ module NetSuite
|
|
14
15
|
:last_modified_date, :memo, :quantity, :serial_numbers, :total,
|
15
16
|
:tran_date, :tran_id
|
16
17
|
|
18
|
+
read_only_fields :total
|
19
|
+
|
17
20
|
field :component_list, AssemblyComponentList
|
18
21
|
field :inventory_detail, InventoryDetail
|
19
22
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class BinNumber
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Records
|
6
|
+
include Support::RecordRefs
|
7
|
+
include Namespaces::ListAcct
|
8
|
+
|
9
|
+
record_ref :bin_number
|
10
|
+
|
11
|
+
fields :preferred_bin, :location
|
12
|
+
|
13
|
+
def initialize(attributes = {})
|
14
|
+
initialize_from_attributes_hash(attributes)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,30 +1,11 @@
|
|
1
1
|
module NetSuite
|
2
2
|
module Records
|
3
|
-
# TODO this is fairly messy: shouldn't mix multiple classes in one file
|
4
|
-
# might be possible to trash the GenericField as well
|
5
|
-
|
6
|
-
class GenericField
|
7
|
-
include Support::Attributes
|
8
|
-
include Support::Fields
|
9
|
-
|
10
|
-
def initialize(attributes = {})
|
11
|
-
self.attributes = attributes
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
class BinNumber < GenericField
|
16
|
-
include Support::Records
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
3
|
class BinNumberList < Support::Sublist
|
21
|
-
include Namespaces::
|
22
|
-
# include Namespaces::ListAcct
|
4
|
+
include Namespaces::ListAcct
|
23
5
|
|
24
6
|
sublist :bin_number, BinNumber
|
25
7
|
|
26
8
|
alias :bin_numbers :bin_number
|
27
|
-
|
28
9
|
end
|
29
10
|
end
|
30
11
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class BinTransfer
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Support::Actions
|
8
|
+
include Namespaces::TranInvt
|
9
|
+
|
10
|
+
actions :get, :get_list, :add, :initialize, :delete, :update, :upsert, :search
|
11
|
+
|
12
|
+
fields :created_date, :last_modified_date, :memo, :subsidiary, :tran_date, :tran_id
|
13
|
+
|
14
|
+
record_refs :location
|
15
|
+
|
16
|
+
field :custom_field_list, CustomFieldList
|
17
|
+
field :inventory_list, BinTransferInventoryList
|
18
|
+
|
19
|
+
attr_reader :internal_id
|
20
|
+
attr_accessor :external_id
|
21
|
+
|
22
|
+
def initialize(attributes = {})
|
23
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
24
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
25
|
+
initialize_from_attributes_hash(attributes)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.search_class_name
|
29
|
+
"Transaction"
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.search_class_namespace
|
33
|
+
'tranSales'
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class BinTransferInventory
|
4
|
+
include Support::Records
|
5
|
+
include Support::Fields
|
6
|
+
include Support::RecordRefs
|
7
|
+
include Namespaces::TranInvt
|
8
|
+
|
9
|
+
fields :description, :from_bins, :item_units_label, :line, :preferred_bin, :quantity, :to_bins
|
10
|
+
|
11
|
+
field :inventory_detail, InventoryDetail
|
12
|
+
|
13
|
+
record_refs :item
|
14
|
+
|
15
|
+
def initialize(attributes = {})
|
16
|
+
initialize_from_attributes_hash(attributes)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|