netsuite 0.2.6 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. data/.travis.yml +3 -0
  2. data/Gemfile +2 -0
  3. data/README.md +132 -54
  4. data/lib/netsuite.rb +123 -76
  5. data/lib/netsuite/actions/add.rb +1 -0
  6. data/lib/netsuite/actions/delete.rb +1 -0
  7. data/lib/netsuite/actions/get.rb +1 -0
  8. data/lib/netsuite/actions/get_all.rb +67 -0
  9. data/lib/netsuite/actions/get_list.rb +2 -1
  10. data/lib/netsuite/actions/get_select_value.rb +1 -0
  11. data/lib/netsuite/actions/initialize.rb +1 -0
  12. data/lib/netsuite/actions/login.rb +2 -0
  13. data/lib/netsuite/actions/search.rb +3 -2
  14. data/lib/netsuite/actions/update.rb +18 -0
  15. data/lib/netsuite/actions/upsert.rb +1 -0
  16. data/lib/netsuite/actions/upsert_list.rb +114 -0
  17. data/lib/netsuite/configuration.rb +5 -0
  18. data/lib/netsuite/namespaces/file_cabinet.rb +11 -0
  19. data/lib/netsuite/namespaces/list_emp.rb +12 -0
  20. data/lib/netsuite/namespaces/list_mkt.rb +12 -0
  21. data/lib/netsuite/namespaces/list_website.rb +11 -0
  22. data/lib/netsuite/namespaces/tran_invt.rb +11 -0
  23. data/lib/netsuite/records/accounting_period.rb +1 -1
  24. data/lib/netsuite/records/assembly_item.rb +10 -4
  25. data/lib/netsuite/records/billing_schedule.rb +33 -0
  26. data/lib/netsuite/records/billing_schedule_milestone.rb +28 -0
  27. data/lib/netsuite/records/billing_schedule_milestone_list.rb +33 -0
  28. data/lib/netsuite/records/billing_schedule_recurrence.rb +28 -0
  29. data/lib/netsuite/records/billing_schedule_recurrence_list.rb +33 -0
  30. data/lib/netsuite/records/bin.rb +22 -0
  31. data/lib/netsuite/records/campaign.rb +28 -0
  32. data/lib/netsuite/records/cash_refund.rb +1 -1
  33. data/lib/netsuite/records/classification.rb +1 -1
  34. data/lib/netsuite/records/contact.rb +1 -1
  35. data/lib/netsuite/records/contact_access_roles.rb +14 -0
  36. data/lib/netsuite/records/contact_access_roles_list.rb +9 -0
  37. data/lib/netsuite/records/custom_field.rb +2 -1
  38. data/lib/netsuite/records/custom_field_list.rb +23 -4
  39. data/lib/netsuite/records/custom_list.rb +27 -0
  40. data/lib/netsuite/records/custom_list_custom_value.rb +14 -0
  41. data/lib/netsuite/records/custom_list_custom_value_list.rb +13 -0
  42. data/lib/netsuite/records/custom_record.rb +1 -1
  43. data/lib/netsuite/records/custom_record_type.rb +1 -1
  44. data/lib/netsuite/records/customer.rb +4 -4
  45. data/lib/netsuite/records/customer_addressbook.rb +8 -5
  46. data/lib/netsuite/records/customer_addressbook_list.rb +13 -1
  47. data/lib/netsuite/records/customer_deposit.rb +3 -2
  48. data/lib/netsuite/records/customer_payment.rb +1 -1
  49. data/lib/netsuite/records/customer_refund.rb +1 -1
  50. data/lib/netsuite/records/department.rb +4 -2
  51. data/lib/netsuite/records/deposit.rb +1 -1
  52. data/lib/netsuite/records/deposit_cash_back.rb +2 -2
  53. data/lib/netsuite/records/deposit_other.rb +2 -2
  54. data/lib/netsuite/records/discount_item.rb +32 -0
  55. data/lib/netsuite/records/employee.rb +20 -0
  56. data/lib/netsuite/records/file.rb +28 -0
  57. data/lib/netsuite/records/inventory_assignment.rb +24 -0
  58. data/lib/netsuite/records/inventory_assignment_list.rb +32 -0
  59. data/lib/netsuite/records/inventory_detail.rb +18 -0
  60. data/lib/netsuite/records/inventory_transfer.rb +29 -0
  61. data/lib/netsuite/records/inventory_transfer_inventory.rb +21 -0
  62. data/lib/netsuite/records/inventory_transfer_inventory_list.rb +33 -0
  63. data/lib/netsuite/records/item_fulfillment.rb +1 -1
  64. data/lib/netsuite/records/item_fulfillment_item_list.rb +3 -21
  65. data/lib/netsuite/records/item_member.rb +21 -0
  66. data/lib/netsuite/records/journal_entry.rb +1 -1
  67. data/lib/netsuite/records/kit_item.rb +1 -1
  68. data/lib/netsuite/records/location.rb +3 -1
  69. data/lib/netsuite/records/member_list.rb +32 -0
  70. data/lib/netsuite/records/non_inventory_sale_item.rb +4 -1
  71. data/lib/netsuite/records/partner.rb +21 -0
  72. data/lib/netsuite/records/promotion_code.rb +38 -0
  73. data/lib/netsuite/records/record_ref_list.rb +40 -0
  74. data/lib/netsuite/records/role_list.rb +25 -0
  75. data/lib/netsuite/records/sales_order.rb +6 -2
  76. data/lib/netsuite/records/sales_tax_item.rb +32 -0
  77. data/lib/netsuite/records/site_category.rb +33 -0
  78. data/lib/netsuite/records/subsidiary.rb +38 -0
  79. data/lib/netsuite/records/tax_type.rb +22 -0
  80. data/lib/netsuite/records/term.rb +1 -1
  81. data/lib/netsuite/records/units_type.rb +25 -0
  82. data/lib/netsuite/records/units_type_uom.rb +20 -0
  83. data/lib/netsuite/records/units_type_uom_list.rb +33 -0
  84. data/lib/netsuite/records/work_order.rb +38 -0
  85. data/lib/netsuite/records/work_order_item.rb +31 -0
  86. data/lib/netsuite/records/work_order_item_list.rb +31 -0
  87. data/lib/netsuite/support/actions.rb +4 -0
  88. data/lib/netsuite/support/base.rb +21 -0
  89. data/lib/netsuite/support/country.rb +273 -0
  90. data/lib/netsuite/support/search_result.rb +4 -0
  91. data/lib/netsuite/support/sublist.rb +54 -0
  92. data/lib/netsuite/version.rb +1 -1
  93. data/spec/netsuite/actions/search_spec.rb +1 -1
  94. data/spec/netsuite/actions/update_spec.rb +62 -31
  95. data/spec/netsuite/actions/upsert_list_spec.rb +112 -0
  96. data/spec/netsuite/records/account_spec.rb +4 -4
  97. data/spec/netsuite/records/accounting_period_spec.rb +4 -4
  98. data/spec/netsuite/records/assembly_item_spec.rb +38 -0
  99. data/spec/netsuite/records/billing_schedule_milestone_list_spec.rb +24 -0
  100. data/spec/netsuite/records/billing_schedule_milestone_spec.rb +51 -0
  101. data/spec/netsuite/records/billing_schedule_recurrence_list_spec.rb +24 -0
  102. data/spec/netsuite/records/billing_schedule_recurrence_spec.rb +49 -0
  103. data/spec/netsuite/records/billing_schedule_spec.rb +164 -0
  104. data/spec/netsuite/records/campaign_spec.rb +43 -0
  105. data/spec/netsuite/records/cash_refund_spec.rb +1 -1
  106. data/spec/netsuite/records/classification_spec.rb +2 -2
  107. data/spec/netsuite/records/credit_memo_spec.rb +4 -4
  108. data/spec/netsuite/records/custom_field_list_spec.rb +10 -0
  109. data/spec/netsuite/records/custom_list_spec.rb +21 -0
  110. data/spec/netsuite/records/custom_record_spec.rb +5 -5
  111. data/spec/netsuite/records/custom_record_type_spec.rb +5 -5
  112. data/spec/netsuite/records/customer_addressbook_list_spec.rb +19 -1
  113. data/spec/netsuite/records/customer_addressbook_spec.rb +42 -13
  114. data/spec/netsuite/records/customer_payment_spec.rb +4 -4
  115. data/spec/netsuite/records/customer_refund_spec.rb +4 -4
  116. data/spec/netsuite/records/customer_spec.rb +80 -6
  117. data/spec/netsuite/records/department_spec.rb +4 -4
  118. data/spec/netsuite/records/deposit_spec.rb +22 -4
  119. data/spec/netsuite/records/discount_item_spec.rb +124 -0
  120. data/spec/netsuite/records/inventory_item_spec.rb +4 -4
  121. data/spec/netsuite/records/inventory_transfer_spec.rb +58 -0
  122. data/spec/netsuite/records/invoice_spec.rb +4 -4
  123. data/spec/netsuite/records/job_spec.rb +7 -7
  124. data/spec/netsuite/records/journal_entry_spec.rb +5 -5
  125. data/spec/netsuite/records/non_inventory_sale_item_spec.rb +4 -4
  126. data/spec/netsuite/records/payment_method_spec.rb +1 -1
  127. data/spec/netsuite/records/pomo_code_spec.rb +40 -0
  128. data/spec/netsuite/records/sales_order_spec.rb +18 -18
  129. data/spec/netsuite/records/sales_tax_item_spec.rb +30 -0
  130. data/spec/netsuite/records/service_sale_item_spec.rb +4 -4
  131. data/spec/netsuite/records/site_category_spec.rb +51 -0
  132. data/spec/netsuite/records/subsidiary_spec.rb +25 -0
  133. data/spec/netsuite/records/support_case_spec.rb +8 -8
  134. data/spec/netsuite/records/tax_type_spec.rb +11 -0
  135. data/spec/netsuite/records/term_spec.rb +4 -4
  136. data/spec/netsuite/records/units_type_spec.rb +33 -0
  137. data/spec/netsuite/records/units_type_uom_list_spec.rb +23 -0
  138. data/spec/netsuite/records/units_type_uom_spec.rb +14 -0
  139. data/spec/netsuite/records/work_order_item_list_spec.rb +26 -0
  140. data/spec/netsuite/records/work_order_item_spec.rb +45 -0
  141. data/spec/netsuite/records/work_order_spec.rb +92 -0
  142. data/spec/netsuite/support/record_refs_spec.rb +1 -1
  143. data/spec/netsuite/support/sublist_spec.rb +36 -0
  144. data/spec/spec_helper.rb +1 -0
  145. data/spec/support/fixtures/update/update_customer_error.xml +21 -0
  146. data/spec/support/fixtures/update/update_customer_multiple_errors.xml +25 -0
  147. data/spec/support/fixtures/upsert_list/upsert_list_customers.xml +21 -0
  148. data/spec/support/fixtures/upsert_list/upsert_list_one_customer.xml +17 -0
  149. data/spec/support/fixtures/upsert_list/upsert_list_with_errors.xml +32 -0
  150. data/spec/support/read_only_field_matcher.rb +1 -1
  151. metadata +115 -5
  152. checksums.yaml +0 -15
@@ -1,3 +1,4 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/add.html
1
2
  module NetSuite
2
3
  module Actions
3
4
  class Add
@@ -1,3 +1,4 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/delete.html
1
2
  module NetSuite
2
3
  module Actions
3
4
  class Delete
@@ -1,3 +1,4 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/get.html
1
2
  module NetSuite
2
3
  module Actions
3
4
  class Get
@@ -0,0 +1,67 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/getAll.html
2
+ module NetSuite
3
+ module Actions
4
+ class GetAll
5
+ include Support::Requests
6
+
7
+ def initialize(klass)
8
+ @klass = klass
9
+ end
10
+
11
+ private
12
+
13
+ def request(credentials={})
14
+ NetSuite::Configuration.connection(
15
+ { element_form_default: :unqualified }, credentials
16
+ ).call(:get_all, message: request_body)
17
+ end
18
+
19
+ # <soap:Body>
20
+ # <platformMsgs:getAll>
21
+ # <record>
22
+ # <recordType>salesTaxItem</recordType>
23
+ # </record>
24
+ # </platformMsgs:getAll>
25
+ # </soap:Body>
26
+ def request_body
27
+ type = @klass.to_s.split('::').last.sub(/[A-Z]/) { |m| m[0].downcase }
28
+
29
+ {
30
+ record: [
31
+ record_type: type
32
+ ]
33
+ }
34
+ end
35
+
36
+ def success?
37
+ @success ||= response_hash[:status][:@is_success] == 'true'
38
+ end
39
+
40
+ def response_body
41
+ @response_body ||= response_hash[:record_list][:record]
42
+ end
43
+
44
+ def response_hash
45
+ @response_hash = @response.body[:get_all_response][:get_all_result]
46
+ end
47
+
48
+ module Support
49
+
50
+ def self.included(base)
51
+ base.extend(ClassMethods)
52
+ end
53
+
54
+ module ClassMethods
55
+ def get_all(credentials = {})
56
+ response = NetSuite::Actions::GetAll.call([self], credentials)
57
+ if response.success?
58
+ response.body.map { |attr| new(attr) }
59
+ else
60
+ raise RecordNotFound, "#{self} with OPTIONS=#{options.inspect} could not be found"
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -1,3 +1,4 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/getList.html
1
2
  module NetSuite
2
3
  module Actions
3
4
  class GetList
@@ -87,4 +88,4 @@ module NetSuite
87
88
  end
88
89
  end
89
90
  end
90
- end
91
+ end
@@ -1,3 +1,4 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/getSelectValue.html
1
2
  module NetSuite
2
3
  module Actions
3
4
  class GetSelectValue
@@ -1,3 +1,4 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/initializeinitializeList.html
1
2
  module NetSuite
2
3
  module Actions
3
4
  class Initialize
@@ -1,3 +1,4 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/login.html
1
2
  module NetSuite
2
3
  module Actions
3
4
  class Login
@@ -6,6 +7,7 @@ module NetSuite
6
7
  passport = NetSuite::Configuration.auth_header.dup
7
8
  passport['platformMsgs:passport']['platformCore:email'] = credentials[:email] || ''
8
9
  passport['platformMsgs:passport']['platformCore:password'] = credentials[:password] || ''
10
+ passport['platformMsgs:passport']['platformCore:role'] = credentials[:role] || ''
9
11
 
10
12
  begin
11
13
  response = NetSuite::Configuration.connection(soap_header: {}).call :login, message: passport
@@ -1,3 +1,4 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/search.html
1
2
  module NetSuite
2
3
  module Actions
3
4
  class Search
@@ -21,7 +22,7 @@ module NetSuite
21
22
  # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/SettingSearchPreferences.html
22
23
  # https://webservices.netsuite.com/xsd/platform/v2012_2_0/messages.xsd
23
24
 
24
- preferences = NetSuite::Configuration.auth_header(credentials).update(
25
+ preferences = NetSuite::Configuration.auth_header(credentials).merge(
25
26
  (@options.delete(:preferences) || {}).inject({'platformMsgs:SearchPreferences' => {}}) do |h, (k, v)|
26
27
  h['platformMsgs:SearchPreferences'][k.to_s.lower_camelcase] = v
27
28
  h
@@ -116,7 +117,7 @@ module NetSuite
116
117
  'platformCore:customField' => custom_field_list,
117
118
  :attributes! => {
118
119
  'platformCore:customField' => {
119
- 'internalId' => condition[:value].map { |h| h[:field] },
120
+ 'scriptId' => condition[:value].map { |h| h[:field] },
120
121
  'operator' => condition[:value].map { |h| h[:operator] },
121
122
  'xsi:type' => condition[:value].map { |h| "platformCore:#{h[:type]}" }
122
123
  }
@@ -1,8 +1,11 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/update.html
1
2
  module NetSuite
2
3
  module Actions
3
4
  class Update
4
5
  include Support::Requests
5
6
 
7
+ attr_reader :response_hash
8
+
6
9
  def initialize(klass, attributes)
7
10
  @klass = klass
8
11
  @attributes = attributes
@@ -48,15 +51,30 @@ module NetSuite
48
51
  @response_body ||= response_hash[:base_ref]
49
52
  end
50
53
 
54
+ def response_errors
55
+ if response_hash[:status] && response_hash[:status][:status_detail]
56
+ @response_errors ||= errors
57
+ end
58
+ end
59
+
51
60
  def response_hash
52
61
  @response_hash ||= @response.to_hash[:update_response][:write_response]
53
62
  end
54
63
 
64
+ def errors
65
+ error_obj = response_hash[:status][:status_detail]
66
+ error_obj = [error_obj] if error_obj.class == Hash
67
+ error_obj.map do |error|
68
+ NetSuite::Error.new(error)
69
+ end
70
+ end
71
+
55
72
  module Support
56
73
  def update(options = {}, credentials={})
57
74
  options.merge!(:internal_id => internal_id) if respond_to?(:internal_id) && internal_id
58
75
  options.merge!(:external_id => external_id) if respond_to?(:external_id) && external_id
59
76
  response = NetSuite::Actions::Update.call([self.class, options], credentials)
77
+ @errors = response.errors
60
78
  response.success?
61
79
  end
62
80
  end
@@ -1,3 +1,4 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/upsert.html
1
2
  module NetSuite
2
3
  module Actions
3
4
  class Upsert
@@ -0,0 +1,114 @@
1
+ # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/upsertList.html
2
+ module NetSuite
3
+ module Actions
4
+ class UpsertList
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(:upsert_list, message: request_body)
17
+ end
18
+
19
+ # <soap:Body>
20
+ # <upsertList>
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
+ # </upsertList>
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?(:external_id) && o.external_id
38
+ hash['@externalId'] = o.external_id
39
+ end
40
+
41
+ hash
42
+ end
43
+
44
+ { 'record' => attrs }
45
+ end
46
+
47
+ def response_hash
48
+ @response_hash ||= Array[@response.body[:upsert_list_response][:write_response_list][:write_response]].flatten
49
+ end
50
+
51
+ def response_body
52
+ @response_body ||= response_hash.map { |h| h[:base_ref] }
53
+ end
54
+
55
+ def response_errors
56
+ if response_hash.any? { |h| h[:status] && h[:status][:status_detail] }
57
+ @response_errors ||= errors
58
+ end
59
+ end
60
+
61
+ def errors
62
+ errors = response_hash.select { |h| h[:status] && h[:status][:status_detail] }.map do |obj|
63
+ error_obj = obj[:status][:status_detail]
64
+ error_obj = [error_obj] if error_obj.class == Hash
65
+ errors = error_obj.map do |error|
66
+ NetSuite::Error.new(error)
67
+ end
68
+
69
+ [obj[:base_ref][:@external_id], errors]
70
+ end
71
+ Hash[errors]
72
+ end
73
+
74
+ def success?
75
+ @success ||= response_hash.all? { |h| h[:status][:@is_success] == 'true' }
76
+ end
77
+
78
+ module Support
79
+
80
+ def self.included(base)
81
+ base.extend(ClassMethods)
82
+ end
83
+
84
+ module ClassMethods
85
+ def upsert_list(records, credentials = {})
86
+ netsuite_records = records.map do |r|
87
+ if r.kind_of?(self)
88
+ r
89
+ else
90
+ self.new(r)
91
+ end
92
+ end
93
+
94
+ response = NetSuite::Actions::UpsertList.call(netsuite_records, credentials)
95
+
96
+ if response.success?
97
+ response.body.map do |attr|
98
+ record = netsuite_records.find do |r|
99
+ r.external_id == attr[:@external_id]
100
+ end
101
+
102
+ record.instance_variable_set('@internal_id', attr[:@internal_id])
103
+ end
104
+
105
+ netsuite_records
106
+ else
107
+ false
108
+ end
109
+ end
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
@@ -101,8 +101,13 @@ module NetSuite
101
101
  'xmlns:listAcct' => "urn:accounting_#{api_version}.lists.webservices.netsuite.com",
102
102
  'xmlns:tranBank' => "urn:bank_#{api_version}.transactions.webservices.netsuite.com",
103
103
  'xmlns:tranCust' => "urn:customers_#{api_version}.transactions.webservices.netsuite.com",
104
+ 'xmlns:tranInvt' => "urn:inventory_#{api_version}.transactions.webservices.netsuite.com",
104
105
  'xmlns:listSupport' => "urn:support_#{api_version}.lists.webservices.netsuite.com",
105
106
  'xmlns:tranGeneral' => "urn:general_#{api_version}.transactions.webservices.netsuite.com",
107
+ 'xmlns:listMkt' => "urn:marketing_#{api_version}.lists.webservices.netsuite.com",
108
+ 'xmlns:listWebsite' => "urn:website_#{api_version}.lists.webservices.netsuite.com",
109
+ 'xmlns:fileCabinet' => "urn:filecabinet_#{api_version}.documents.webservices.netsuite.com",
110
+ 'xmlns:listEmp' => "urn:employees_#{api_version}.lists.webservices.netsuite.com"
106
111
  }
107
112
  end
108
113
 
@@ -0,0 +1,11 @@
1
+ module NetSuite
2
+ module Namespaces
3
+ module FileCabinet
4
+
5
+ def record_namespace
6
+ 'fileCabinet'
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ module NetSuite
2
+ module Namespaces
3
+ module ListEmp
4
+
5
+ # https://webservices.sandbox.netsuite.com/xsd/lists/v2013_2_0/employees.xsd
6
+ def record_namespace
7
+ 'listEmp'
8
+ end
9
+
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module NetSuite
2
+ module Namespaces
3
+ module ListMkt
4
+
5
+ # https://webservices.sandbox.netsuite.com/xsd/lists/v2013_2_0/marketing.xsd
6
+ def record_namespace
7
+ 'listMkt'
8
+ end
9
+
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ module NetSuite
2
+ module Namespaces
3
+ module ListWebsite
4
+
5
+ def record_namespace
6
+ 'listWebsite'
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module NetSuite
2
+ module Namespaces
3
+ module TranInvt
4
+
5
+ def record_namespace
6
+ 'tranInvt'
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -6,7 +6,7 @@ module NetSuite
6
6
  include Support::Actions
7
7
  include Namespaces::ListAcct
8
8
 
9
- actions :get, :add, :delete, :search
9
+ actions :get, :add, :delete, :upsert, :search
10
10
 
11
11
  fields :allow_non_gl_changes, :end_date, :is_adjust, :is_quarter, :is_year, :period_name, :start_date
12
12
 
@@ -7,14 +7,14 @@ module NetSuite
7
7
  include Support::Actions
8
8
  include Namespaces::ListAcct
9
9
 
10
- actions :get, :add, :delete
10
+ actions :get, :get_list, :get_select_value, :add, :delete, :update, :upsert, :upsert_list, :search
11
11
 
12
- fields :auto_lead_time, :auto_preferred_stock_level, :auto_reorder_point, :available_to_partners, :average_cost,
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,
14
- :costing_method_display, :country_of_manufacture, :created_date, :currency, :date_converted_to_inv,
14
+ :costing_method_display, :country_of_manufacture, :created_date, :currency, :date_converted_to_inv, :description,
15
15
  :default_return_cost, :demand_modifier, :display_name, :dont_show_price, :enforce_min_qty_internally,
16
16
  :exclude_from_sitemap, :featured_description, :fixed_lot_size, :handling_cost, :handling_cost_units, :include_children,
17
- :is_donation_item, :is_drop_ship_item, :is_gco_compliant, :is_inactive, :is_online, :is_special_order_item, :is_taxable,
17
+ :is_donation_item, :is_drop_ship_item, :is_gco_compliant, :is_inactive, :is_online, :is_special_order_item, :is_special_work_order_item, :is_taxable,
18
18
  :item_id, :last_modified_date, :last_purchase_price, :lead_time, :manufacturer, :manufacturer_addr1, :manufacturer_city,
19
19
  :manufacturer_state, :manufacturer_tariff, :manufacturer_tax_id, :manufacturer_zip, :match_bill_to_receipt,
20
20
  :matrix_type, :max_donation_amount, :meta_tag_html, :minimum_quantity, :minimum_quantity_units, :mpn,
@@ -43,6 +43,8 @@ module NetSuite
43
43
  field :custom_field_list, CustomFieldList
44
44
  field :bin_number_list, BinNumberList
45
45
  field :pricing_matrix, PricingMatrix
46
+ field :member_list, MemberList
47
+ field :subsidiary_list, RecordRefList
46
48
 
47
49
  attr_reader :internal_id
48
50
  attr_accessor :external_id
@@ -52,6 +54,10 @@ module NetSuite
52
54
  @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
53
55
  initialize_from_attributes_hash(attributes)
54
56
  end
57
+
58
+ def self.search_class_name
59
+ "Item"
60
+ end
55
61
  end
56
62
  end
57
63
  end
@@ -0,0 +1,33 @@
1
+ module NetSuite
2
+ module Records
3
+ class BillingSchedule
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Support::Actions
8
+ include Namespaces::ListAcct
9
+
10
+ actions :get, :add, :delete, :upsert, :search
11
+
12
+ fields :bill_for_actuals, :day_period, :frequency, :in_arrears, :initial_amount, :is_inactive,
13
+ :is_public, :month_dom, :month_dow, :month_dowim, :month_mode, :name,
14
+ :number_remaining, :recurrence_dow_mask_list, :repeat_every, :schedule_type,
15
+ :series_start_date, :year_dom, :year_dow, :year_dowim, :year_dowim_month,
16
+ :year_mode, :year_month
17
+
18
+ record_refs :initial_terms, :project, :recurrence_terms, :transaction
19
+
20
+ attr_reader :internal_id
21
+ attr_accessor :external_id
22
+
23
+ field :milestone_list, BillingScheduleMilestoneList
24
+ field :recurrence_list, BillingScheduleRecurrenceList
25
+
26
+ def initialize(attributes = {})
27
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
28
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
29
+ initialize_from_attributes_hash(attributes)
30
+ end
31
+ end
32
+ end
33
+ end