netsuite 0.8.2 → 0.8.7

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.
Files changed (143) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.ruby-version +1 -1
  4. data/.tool-versions +1 -0
  5. data/Gemfile +4 -3
  6. data/README.md +129 -38
  7. data/circle.yml +36 -13
  8. data/lib/netsuite.rb +40 -19
  9. data/lib/netsuite/actions/login.rb +20 -1
  10. data/lib/netsuite/actions/search.rb +1 -6
  11. data/lib/netsuite/actions/update.rb +6 -2
  12. data/lib/netsuite/actions/update_list.rb +109 -0
  13. data/lib/netsuite/actions/upsert.rb +2 -0
  14. data/lib/netsuite/configuration.rb +34 -4
  15. data/lib/netsuite/errors.rb +1 -0
  16. data/lib/netsuite/records/accounting_period.rb +2 -2
  17. data/lib/netsuite/records/assembly_build.rb +4 -1
  18. data/lib/netsuite/records/assembly_item.rb +1 -0
  19. data/lib/netsuite/records/assembly_unbuild.rb +3 -0
  20. data/lib/netsuite/records/bin_number.rb +18 -0
  21. data/lib/netsuite/records/bin_number_list.rb +1 -20
  22. data/lib/netsuite/records/bin_transfer.rb +38 -0
  23. data/lib/netsuite/records/bin_transfer_inventory.rb +20 -0
  24. data/lib/netsuite/records/bin_transfer_inventory_list.rb +10 -0
  25. data/lib/netsuite/records/cash_refund_item.rb +1 -1
  26. data/lib/netsuite/records/classification.rb +5 -2
  27. data/lib/netsuite/records/contact.rb +1 -1
  28. data/lib/netsuite/records/credit_memo.rb +1 -1
  29. data/lib/netsuite/records/custom_field_list.rb +10 -2
  30. data/lib/netsuite/records/custom_record.rb +3 -3
  31. data/lib/netsuite/records/custom_record_ref.rb +1 -0
  32. data/lib/netsuite/records/customer.rb +5 -4
  33. data/lib/netsuite/records/customer_credit_cards.rb +36 -0
  34. data/lib/netsuite/records/customer_credit_cards_list.rb +10 -0
  35. data/lib/netsuite/records/customer_deposit.rb +9 -6
  36. data/lib/netsuite/records/customer_payment.rb +6 -2
  37. data/lib/netsuite/records/customer_payment_credit.rb +17 -0
  38. data/lib/netsuite/records/customer_payment_credit_list.rb +12 -0
  39. data/lib/netsuite/records/customer_sales_team.rb +24 -0
  40. data/lib/netsuite/records/customer_sales_team_list.rb +9 -0
  41. data/lib/netsuite/records/customer_status.rb +29 -0
  42. data/lib/netsuite/records/customer_subscription.rb +18 -0
  43. data/lib/netsuite/records/customer_subscriptions_list.rb +10 -0
  44. data/lib/netsuite/records/employee.rb +1 -1
  45. data/lib/netsuite/records/entity_custom_field.rb +53 -0
  46. data/lib/netsuite/records/estimate.rb +42 -0
  47. data/lib/netsuite/records/estimate_item.rb +40 -0
  48. data/lib/netsuite/records/estimate_item_list.rb +11 -0
  49. data/lib/netsuite/records/inbound_shipment.rb +33 -0
  50. data/lib/netsuite/records/inbound_shipment_item.rb +39 -0
  51. data/lib/netsuite/records/inbound_shipment_item_list.rb +11 -0
  52. data/lib/netsuite/records/inter_company_journal_entry.rb +48 -0
  53. data/lib/netsuite/records/inter_company_journal_entry_line.rb +28 -0
  54. data/lib/netsuite/records/inter_company_journal_entry_line_list.rb +14 -0
  55. data/lib/netsuite/records/inventory_item.rb +3 -2
  56. data/lib/netsuite/records/invoice.rb +1 -1
  57. data/lib/netsuite/records/item_fulfillment.rb +1 -1
  58. data/lib/netsuite/records/lot_numbered_inventory_item.rb +116 -0
  59. data/lib/netsuite/records/matrix_option_list.rb +12 -4
  60. data/lib/netsuite/records/message.rb +30 -0
  61. data/lib/netsuite/records/non_inventory_resale_item.rb +3 -2
  62. data/lib/netsuite/records/non_inventory_sale_item.rb +1 -1
  63. data/lib/netsuite/records/other_charge_sale_item.rb +2 -2
  64. data/lib/netsuite/records/partner.rb +7 -5
  65. data/lib/netsuite/records/price.rb +17 -0
  66. data/lib/netsuite/records/price_level.rb +26 -0
  67. data/lib/netsuite/records/price_list.rb +9 -0
  68. data/lib/netsuite/records/pricing.rb +20 -0
  69. data/lib/netsuite/records/pricing_matrix.rb +2 -2
  70. data/lib/netsuite/records/promotions.rb +26 -0
  71. data/lib/netsuite/records/promotions_list.rb +9 -0
  72. data/lib/netsuite/records/return_authorization_item.rb +1 -1
  73. data/lib/netsuite/records/sales_order.rb +1 -0
  74. data/lib/netsuite/records/sales_order_item.rb +12 -5
  75. data/lib/netsuite/records/sales_role.rb +26 -0
  76. data/lib/netsuite/records/sales_tax_item.rb +3 -1
  77. data/lib/netsuite/records/serialized_assembly_item.rb +239 -0
  78. data/lib/netsuite/records/service_resale_item.rb +1 -1
  79. data/lib/netsuite/records/service_sale_item.rb +1 -1
  80. data/lib/netsuite/records/support_case.rb +1 -1
  81. data/lib/netsuite/records/support_case_type.rb +26 -0
  82. data/lib/netsuite/records/tax_group.rb +2 -2
  83. data/lib/netsuite/records/transaction_body_custom_field.rb +61 -0
  84. data/lib/netsuite/records/transaction_column_custom_field.rb +59 -0
  85. data/lib/netsuite/records/vendor.rb +2 -1
  86. data/lib/netsuite/records/vendor_credit.rb +2 -0
  87. data/lib/netsuite/records/vendor_currency.rb +26 -0
  88. data/lib/netsuite/records/vendor_currency_list.rb +9 -0
  89. data/lib/netsuite/records/work_order.rb +8 -0
  90. data/lib/netsuite/support/actions.rb +2 -0
  91. data/lib/netsuite/support/country.rb +27 -15
  92. data/lib/netsuite/support/search_result.rb +20 -5
  93. data/lib/netsuite/utilities.rb +83 -21
  94. data/lib/netsuite/version.rb +1 -1
  95. data/netsuite.gemspec +4 -3
  96. data/spec/netsuite/actions/login_spec.rb +23 -0
  97. data/spec/netsuite/actions/update_list_spec.rb +107 -0
  98. data/spec/netsuite/actions/update_spec.rb +42 -0
  99. data/spec/netsuite/configuration_spec.rb +111 -6
  100. data/spec/netsuite/records/address_spec.rb +10 -0
  101. data/spec/netsuite/records/basic_record_spec.rb +19 -2
  102. data/spec/netsuite/records/bin_number_spec.rb +23 -0
  103. data/spec/netsuite/records/classification_spec.rb +10 -1
  104. data/spec/netsuite/records/custom_field_list_spec.rb +39 -4
  105. data/spec/netsuite/records/custom_record_spec.rb +1 -1
  106. data/spec/netsuite/records/customer_credit_cards_list_spec.rb +23 -0
  107. data/spec/netsuite/records/customer_payment_credit_list_spec.rb +26 -0
  108. data/spec/netsuite/records/customer_payment_spec.rb +1 -6
  109. data/spec/netsuite/records/customer_sales_team_list_spec.rb +41 -0
  110. data/spec/netsuite/records/customer_spec.rb +44 -2
  111. data/spec/netsuite/records/customer_subscription_spec.rb +41 -0
  112. data/spec/netsuite/records/customer_subscriptions_list_spec.rb +19 -0
  113. data/spec/netsuite/records/employee_spec.rb +2 -2
  114. data/spec/netsuite/records/entity_custom_field_spec.rb +34 -0
  115. data/spec/netsuite/records/estimate_item_list_spec.rb +26 -0
  116. data/spec/netsuite/records/estimate_item_spec.rb +40 -0
  117. data/spec/netsuite/records/estimate_spec.rb +216 -0
  118. data/spec/netsuite/records/inter_company_journal_entry_line_list_spec.rb +26 -0
  119. data/spec/netsuite/records/inter_company_journal_entry_line_spec.rb +60 -0
  120. data/spec/netsuite/records/inter_company_journal_entry_spec.rb +156 -0
  121. data/spec/netsuite/records/inventory_item_spec.rb +57 -0
  122. data/spec/netsuite/records/matrix_option_list_spec.rb +15 -5
  123. data/spec/netsuite/records/message_spec.rb +49 -0
  124. data/spec/netsuite/records/non_inventory_resale_item_spec.rb +165 -0
  125. data/spec/netsuite/records/non_inventory_sale_item_spec.rb +1 -1
  126. data/spec/netsuite/records/partner_spec.rb +143 -0
  127. data/spec/netsuite/records/price_level_spec.rb +16 -0
  128. data/spec/netsuite/records/pricing_matrix_spec.rb +15 -13
  129. data/spec/netsuite/records/return_authorization_item_spec.rb +1 -1
  130. data/spec/netsuite/records/sales_order_item_spec.rb +11 -5
  131. data/spec/netsuite/records/service_resale_item_spec.rb +134 -0
  132. data/spec/netsuite/records/support_case_type_spec.rb +22 -0
  133. data/spec/netsuite/records/transaction_body_custom_field_spec.rb +32 -0
  134. data/spec/netsuite/records/transaction_column_custom_field_spec.rb +32 -0
  135. data/spec/netsuite/records/vendor_credit_spec.rb +29 -0
  136. data/spec/netsuite/records/vendor_spec.rb +1 -1
  137. data/spec/netsuite/support/search_result_spec.rb +24 -0
  138. data/spec/netsuite/utilities_spec.rb +44 -6
  139. data/spec/spec_helper.rb +5 -4
  140. data/spec/support/fixtures/update_list/update_list_items.xml +22 -0
  141. data/spec/support/fixtures/update_list/update_list_one_item.xml +18 -0
  142. data/spec/support/fixtures/update_list/update_list_with_errors.xml +32 -0
  143. metadata +111 -11
@@ -0,0 +1,10 @@
1
+ module NetSuite
2
+ module Records
3
+ class BinTransferInventoryList < Support::Sublist
4
+ include Namespaces::TranInvt
5
+
6
+ sublist :inventory, BinTransferInventory
7
+
8
+ end
9
+ end
10
+ end
@@ -6,7 +6,7 @@ module NetSuite
6
6
  include Support::Records
7
7
  include Namespaces::TranCust
8
8
 
9
- fields :amount, :rate, :quantity
9
+ fields :amount, :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,11 +7,14 @@ module NetSuite
7
7
  include Support::Actions
8
8
  include Namespaces::ListAcct
9
9
 
10
- actions :get, :get_list, :delete, :upsert, :search
10
+ actions :add, :get, :get_list, :delete, :upsert, :search
11
11
 
12
- fields :name, :include_children, :is_inactive, :class_translation_list, :custom_field_list
12
+ fields :name, :include_children, :is_inactive, :class_translation_list
13
13
 
14
14
  field :subsidiary_list, RecordRefList
15
+ field :custom_field_list, CustomFieldList
16
+
17
+ record_refs :parent
15
18
 
16
19
  attr_reader :internal_id
17
20
  attr_accessor :external_id
@@ -7,7 +7,7 @@ module NetSuite
7
7
  include Support::Actions
8
8
  include Namespaces::ListRel
9
9
 
10
- actions :get, :get_list, :add, :delete, :delete_list, :search, :update, :upsert
10
+ actions :get, :get_deleted, :get_list, :add, :delete, :delete_list, :search, :update, :upsert, :upsert_list
11
11
 
12
12
  fields :salutation, :first_name, :middle_name, :last_name, :title, :phone, :fax, :email, :default_address,
13
13
  :entity_id, :phonetic_name, :alt_email, :office_phone, :home_phone, :mobile_phone, :supervisor_phone,
@@ -17,7 +17,7 @@ module NetSuite
17
17
  :sales_effective_date, :shipping_cost, :shipping_tax1_rate, :shipping_tax2_rate, :source, :status,
18
18
  :sync_partner_teams, :sync_sales_teams, :tax2_total, :tax_rate, :to_be_emailed, :to_be_faxed,
19
19
  :to_be_printed, :total_cost_estimate, :tran_date, :tran_id, :tran_is_vsoe_bundle, :vat_reg_num,
20
- :vsoe_auto_calc
20
+ :vsoe_auto_calc, :tax_details_override, :tax_reg_override
21
21
 
22
22
  field :custom_field_list, CustomFieldList
23
23
  field :item_list, CreditMemoItemList
@@ -13,7 +13,9 @@ module NetSuite
13
13
 
14
14
  @custom_fields_assoc = Hash.new
15
15
  custom_fields.each do |custom_field|
16
- # not all custom fields have an id; https://github.com/NetSweet/netsuite/issues/182
16
+ # not all custom fields have an id
17
+ # https://github.com/NetSweet/netsuite/issues/182
18
+
17
19
  if reference_id = custom_field.send(reference_id_type)
18
20
  @custom_fields_assoc[reference_id.to_sym] = custom_field
19
21
  end
@@ -96,6 +98,7 @@ module NetSuite
96
98
  end
97
99
 
98
100
  private
101
+
99
102
  def reference_id_type
100
103
  @reference_id_type ||= Configuration.api_version >= '2013_2' ? :script_id : :internal_id
101
104
  end
@@ -105,9 +108,14 @@ module NetSuite
105
108
  custom_fields << custom_field_data
106
109
  else
107
110
  attrs = custom_field_data.clone
111
+ type = (custom_field_data[:"@xsi:type"] || custom_field_data[:type])
108
112
 
109
- if (custom_field_data[:"@xsi:type"] || custom_field_data[:type]) == "platformCore:SelectCustomFieldRef"
113
+ if type == "platformCore:SelectCustomFieldRef"
110
114
  attrs[:value] = CustomRecordRef.new(custom_field_data[:value])
115
+ elsif type == 'platformCore:MultiSelectCustomFieldRef'
116
+ attrs[:value] = custom_field_data[:value].map do |entry|
117
+ CustomRecordRef.new(entry)
118
+ end
111
119
  end
112
120
 
113
121
  custom_fields << CustomField.new(attrs)
@@ -9,8 +9,8 @@ module NetSuite
9
9
 
10
10
  actions :get, :update, :get_list, :add, :delete, :search, :upsert
11
11
 
12
- fields :allow_attachments, :allow_inline_editing, :allow_numbering_override, :allow_quick_search, :created,
13
- :custom_record_id, :description, :disclaimer, :enabl_email_merge, :enable_numbering, :include_name,
12
+ fields :allow_attachments, :allow_inline_editing, :allow_numbering_override, :allow_quick_search, :alt_name, :auto_name,
13
+ :created, :custom_record_id, :description, :disclaimer, :enabl_email_merge, :enable_numbering, :include_name,
14
14
  :is_available_offline, :is_inactive, :is_numbering_updateable, :is_ordered, :last_modified, :name,
15
15
  :numbering_current_number, :numbering_init, :numbering_min_digits, :numbering_prefix, :numbering_suffix,
16
16
  :record_name, :script_id, :show_creation_date, :show_creation_date_on_list, :show_id, :show_last_modified_on_list,
@@ -18,7 +18,7 @@ module NetSuite
18
18
 
19
19
  field :custom_field_list, CustomFieldList
20
20
 
21
- record_refs :custom_form, :owner, :rec_type
21
+ record_refs :custom_form, :owner, :rec_type, :parent
22
22
 
23
23
  attr_reader :internal_id
24
24
  attr_accessor :external_id
@@ -40,6 +40,7 @@ module NetSuite
40
40
  def to_record
41
41
  rec = super
42
42
  rec[:@internalId] = @internal_id if @internal_id
43
+ rec[:@externalId] = @external_id if @external_id
43
44
  rec[:@typeId] = @type_id if @type_id
44
45
  rec
45
46
  end
@@ -13,7 +13,7 @@ module NetSuite
13
13
 
14
14
  fields :account_number, :aging, :alt_email, :alt_name, :alt_phone, :bill_pay,
15
15
  :buying_reason, :buying_time_frame, :campaign_category, :click_stream, :comments, :company_name,
16
- :consol_aging, :consol_days_overdue, :contrib_pct, :credit_cards_list, :credit_hold_override,
16
+ :consol_aging, :consol_days_overdue, :contrib_pct, :credit_hold_override,
17
17
  :credit_limit, :date_created, :days_overdue, :default_address,
18
18
  :download_list, :email, :email_preference, :email_transactions, :end_date, :entity_id,
19
19
  :estimated_budget, :fax, :fax_transactions, :first_name, :first_visit, :give_access, :global_subscription_status,
@@ -22,18 +22,19 @@ module NetSuite
22
22
  :opening_balance, :opening_balance_account, :opening_balance_date,
23
23
  :password, :password2, :phone, :phonetic_name, :pref_cc_processor, :print_on_check_as,
24
24
  :print_transactions, :referrer, :reminder_days, :representing_subsidiary, :require_pwd_change, :resale_number,
25
- :sales_group, :sales_readiness, :sales_team_list, :salutation, :send_email, :ship_complete,
25
+ :sales_group, :sales_readiness, :salutation, :send_email, :ship_complete,
26
26
  :stage, :start_date, :sync_partner_teams, :tax_exempt, :taxable,
27
27
  :third_party_acct, :third_party_country, :third_party_zipcode, :title, :url,
28
28
  :vat_reg_number, :visits, :web_lead
29
29
 
30
30
  field :addressbook_list, CustomerAddressbookList
31
+ field :credit_cards_list, CustomerCreditCardsList
31
32
  field :custom_field_list, CustomFieldList
32
33
  field :contact_roles_list, ContactAccessRolesList
33
34
  field :currency_list, CustomerCurrencyList
34
35
  field :partners_list, CustomerPartnersList
35
-
36
- # TODO subscriptions_list
36
+ field :subscriptions_list, CustomerSubscriptionsList
37
+ field :sales_team_list, CustomerSalesTeamList
37
38
 
38
39
  read_only_fields :balance, :consol_balance, :deposit_balance, :consol_deposit_balance, :overdue_balance,
39
40
  :consol_overdue_balance, :unbilled_orders, :consol_unbilled_orders
@@ -0,0 +1,36 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerCreditCards
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+
8
+ # https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_1/schema/other/customercreditcards.html?mode=package
9
+
10
+ fields :cc_default, :cc_expire_date, :cc_memo, :cc_name, :cc_number, :debitcard_issue_no, :state_from, :validfrom
11
+ record_refs :card_state, :payment_method
12
+
13
+ attr_reader :internal_id
14
+
15
+ def initialize(attributes_or_record = {})
16
+ case attributes_or_record
17
+ when self.class
18
+ initialize_from_record(attributes_or_record)
19
+ when Hash
20
+ initialize_from_attributes_hash(attributes_or_record)
21
+ end
22
+ end
23
+
24
+ def initialize_from_record(obj)
25
+ self.cc_default = obj.cc_default
26
+ self.cc_expire_date = obj.cc_expire_date
27
+ self.cc_memo = obj.cc_memo
28
+ self.cc_name = obj.cc_name
29
+ self.cc_number = obj.cc_number
30
+ self.debitcard_issue_no = obj.debitcard_issue_no
31
+ self.state_from = obj.state_from
32
+ self.validfrom = obj.validfrom
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,10 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerCreditCardsList < Support::Sublist
4
+ include Namespaces::ListRel
5
+
6
+ sublist :credit_cards, CustomerCreditCards
7
+ alias :credit_card :credit_cards
8
+ end
9
+ end
10
+ end
@@ -13,16 +13,19 @@ module NetSuite
13
13
  actions :get, :get_list, :initialize, :add, :delete, :update, :upsert, :search
14
14
 
15
15
  fields :created_date, :last_modified_date, :status, :payment, :tran_date, :exchange_rate, :undep_funds, :memo,
16
- :check_num, :klass, :currency_name, :is_recurring_payment, :charge_it
16
+ :check_num, :klass, :currency_name, :is_recurring_payment, :tran_id, :auth_code,
17
+ :cc_approved, :cc_avs_street_match, :cc_avs_zip_match, :cc_expire_date, :cc_is_purchase_card_bin, :cc_name, :cc_number,
18
+ :cc_process_as_purchase_card, :cc_security_code, :cc_security_code_match, :cc_street, :cc_zip_code, :charge_it
17
19
 
18
20
  field :custom_field_list, CustomFieldList
19
21
  field :apply_list, CustomerDepositApplyList
22
+ # accountingBookDetailList
20
23
 
21
- record_refs :customer, :sales_order, :account, :department, :payment_method,
22
- :custom_form, :currency, :posting_period, :subsidiary,
23
-
24
- # only available in an advanced search result
25
- :deposit_transaction
24
+ record_refs :customer, :sales_order, :account, :department,
25
+ :payment_method, :payment_option, :custom_form, :currency,
26
+ :posting_period, :subsidiary, :location,
27
+ # only available in an advanced search result
28
+ :deposit_transaction
26
29
 
27
30
  attr_reader :internal_id
28
31
  attr_accessor :external_id
@@ -17,14 +17,18 @@ module NetSuite
17
17
 
18
18
  field :custom_field_list, CustomFieldList
19
19
  field :apply_list, CustomerPaymentApplyList
20
+ field :credit_list, CustomerPaymentCreditList
20
21
 
21
22
  read_only_fields :applied, :balance, :pending, :total, :unapplied
22
23
 
23
- record_refs :account, :ar_acct, :credit_card, :credit_card_processor, :custom_form, :customer, :department, :klass,
24
- :location, :payment_method, :posting_period, :subsidiary, :currency
24
+ record_refs :account, :ar_acct, :credit_card, :credit_card_processor,
25
+ :custom_form, :customer, :department, :klass, :location,
26
+ :payment_method, :payment_option, :posting_period, :subsidiary,
27
+ :currency
25
28
 
26
29
  attr_reader :internal_id
27
30
  attr_accessor :external_id
31
+ attr_accessor :search_joins
28
32
 
29
33
  def initialize(attributes = {})
30
34
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -0,0 +1,17 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerPaymentCredit
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Namespaces::TranCust
7
+
8
+ fields :amount, :applied_to, :apply, :credit_date, :currency, :doc, :due, :line,
9
+ :ref_num, :total, :type
10
+
11
+ def initialize(attributes = {})
12
+ initialize_from_attributes_hash(attributes)
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerPaymentCreditList < Support::Sublist
4
+ include Namespaces::TranCust
5
+
6
+ sublist :credit, CustomerPaymentCredit
7
+
8
+ alias :credits :credit
9
+
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,24 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerSalesTeam
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Namespaces::ListRel
8
+
9
+ fields :is_primary, :contribution
10
+
11
+ record_refs :sales_role, :employee
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
+ end
23
+ end
24
+ end
@@ -0,0 +1,9 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerSalesTeamList < Support::Sublist
4
+ include Namespaces::ListRel
5
+
6
+ sublist :sales_team, NetSuite::Records::CustomerSalesTeam
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,29 @@
1
+ # http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_2/schema/record/customerstatus.html
2
+
3
+ module NetSuite
4
+ module Records
5
+
6
+ class CustomerStatus
7
+ include Support::Records
8
+ include Support::Fields
9
+ include Support::RecordRefs
10
+ include Support::Actions
11
+ include Namespaces::ListRel
12
+
13
+ actions :get, :add, :delete, :search, :update, :upsert
14
+
15
+ fields :description, :include_in_lead_reports, :is_inactive, :name,
16
+ :probability, :stage
17
+
18
+ attr_reader :internal_id
19
+ attr_accessor :external_id
20
+
21
+ def initialize(attributes = {})
22
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
23
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
24
+ initialize_from_attributes_hash(attributes)
25
+ end
26
+ end
27
+
28
+ end
29
+ end
@@ -0,0 +1,18 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerSubscription
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Support::RecordRefs
7
+ include Namespaces::ListRel
8
+
9
+ fields :subscribed, :last_modified_date
10
+ record_refs :subscription
11
+
12
+ def initialize(attributes_or_record = {})
13
+ initialize_from_attributes_hash(attributes_or_record)
14
+ end
15
+
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,10 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerSubscriptionsList < Support::Sublist
4
+ include Namespaces::ListRel
5
+
6
+ sublist :subscriptions, CustomerSubscription
7
+
8
+ end
9
+ end
10
+ end
@@ -19,7 +19,7 @@ module NetSuite
19
19
  :phonetic_name, :purchase_order_approval_limit, :purchase_order_approver, :purchase_order_limit, :release_date,
20
20
  :resident_status, :salutation, :social_security_number, :visa_exp_date, :visa_type
21
21
 
22
- record_refs :currency, :department, :location, :subsidiary, :employee_type, :employee_status, :supervisor
22
+ record_refs :currency, :department, :location, :sales_role, :subsidiary, :employee_type, :employee_status, :supervisor
23
23
 
24
24
  field :custom_field_list, CustomFieldList
25
25
  field :roles_list, RoleList
@@ -0,0 +1,53 @@
1
+ module NetSuite
2
+ module Records
3
+ class EntityCustomField
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
+ # https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_1/schema/record/entitycustomfield.html
13
+ fields(
14
+ :access_level,
15
+ :applies_to_contact,
16
+ :applies_to_customer,
17
+ :applies_to_employee,
18
+ :applies_to_group,
19
+ :applies_to_other_name,
20
+ :applies_to_partner,
21
+ :applies_to_price_list,
22
+ :applies_to_statement,
23
+ :applies_to_vendor,
24
+ :applies_to_web_site,
25
+ :available_externally,
26
+ :check_spelling,
27
+ :default_checked,
28
+ :display_type,
29
+ :field_type,
30
+ :global_search,
31
+ :is_formula,
32
+ :is_mandatory,
33
+ :is_parent,
34
+ :label,
35
+ :script_id,
36
+ :search_level,
37
+ :show_in_list,
38
+ :store_value,
39
+ )
40
+
41
+ record_refs :owner
42
+
43
+ attr_reader :internal_id
44
+ attr_accessor :external_id
45
+
46
+ def initialize(attributes = {})
47
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
48
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
49
+ initialize_from_attributes_hash(attributes)
50
+ end
51
+ end
52
+ end
53
+ end