netsuite 0.8.1 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.ruby-version +1 -1
  4. data/Gemfile +7 -2
  5. data/README.md +111 -31
  6. data/circle.yml +33 -13
  7. data/lib/netsuite.rb +40 -19
  8. data/lib/netsuite/actions/login.rb +25 -2
  9. data/lib/netsuite/actions/search.rb +1 -6
  10. data/lib/netsuite/actions/update.rb +6 -2
  11. data/lib/netsuite/actions/update_list.rb +109 -0
  12. data/lib/netsuite/actions/upsert.rb +2 -0
  13. data/lib/netsuite/configuration.rb +21 -4
  14. data/lib/netsuite/errors.rb +3 -0
  15. data/lib/netsuite/passports/token.rb +1 -1
  16. data/lib/netsuite/records/assembly_build.rb +4 -1
  17. data/lib/netsuite/records/assembly_item.rb +1 -0
  18. data/lib/netsuite/records/assembly_unbuild.rb +3 -0
  19. data/lib/netsuite/records/bin_number.rb +18 -0
  20. data/lib/netsuite/records/bin_number_list.rb +1 -20
  21. data/lib/netsuite/records/bin_transfer.rb +38 -0
  22. data/lib/netsuite/records/bin_transfer_inventory.rb +20 -0
  23. data/lib/netsuite/records/bin_transfer_inventory_list.rb +10 -0
  24. data/lib/netsuite/records/cash_refund.rb +3 -1
  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 +2 -1
  28. data/lib/netsuite/records/contact_addressbook.rb +64 -0
  29. data/lib/netsuite/records/contact_addressbook_list.rb +11 -0
  30. data/lib/netsuite/records/custom_field_list.rb +10 -2
  31. data/lib/netsuite/records/custom_record.rb +3 -3
  32. data/lib/netsuite/records/custom_record_ref.rb +1 -0
  33. data/lib/netsuite/records/customer.rb +5 -4
  34. data/lib/netsuite/records/customer_credit_cards.rb +36 -0
  35. data/lib/netsuite/records/customer_credit_cards_list.rb +10 -0
  36. data/lib/netsuite/records/customer_deposit.rb +5 -2
  37. data/lib/netsuite/records/customer_payment.rb +1 -0
  38. data/lib/netsuite/records/customer_sales_team.rb +24 -0
  39. data/lib/netsuite/records/customer_sales_team_list.rb +9 -0
  40. data/lib/netsuite/records/customer_status.rb +29 -0
  41. data/lib/netsuite/records/customer_subscription.rb +18 -0
  42. data/lib/netsuite/records/customer_subscriptions_list.rb +10 -0
  43. data/lib/netsuite/records/employee.rb +2 -2
  44. data/lib/netsuite/records/entity_custom_field.rb +53 -0
  45. data/lib/netsuite/records/estimate.rb +42 -0
  46. data/lib/netsuite/records/estimate_item.rb +40 -0
  47. data/lib/netsuite/records/estimate_item_list.rb +11 -0
  48. data/lib/netsuite/records/inbound_shipment.rb +33 -0
  49. data/lib/netsuite/records/inbound_shipment_item.rb +39 -0
  50. data/lib/netsuite/records/inbound_shipment_item_list.rb +11 -0
  51. data/lib/netsuite/records/inter_company_journal_entry.rb +48 -0
  52. data/lib/netsuite/records/inter_company_journal_entry_line.rb +28 -0
  53. data/lib/netsuite/records/inter_company_journal_entry_line_list.rb +14 -0
  54. data/lib/netsuite/records/inventory_adjustment.rb +1 -1
  55. data/lib/netsuite/records/inventory_adjustment_inventory.rb +1 -1
  56. data/lib/netsuite/records/inventory_item.rb +2 -2
  57. data/lib/netsuite/records/invoice.rb +1 -1
  58. data/lib/netsuite/records/item_fulfillment.rb +1 -1
  59. data/lib/netsuite/records/lot_numbered_assembly_item.rb +64 -0
  60. data/lib/netsuite/records/lot_numbered_inventory_item.rb +116 -0
  61. data/lib/netsuite/records/matrix_option_list.rb +12 -4
  62. data/lib/netsuite/records/message.rb +30 -0
  63. data/lib/netsuite/records/non_inventory_resale_item.rb +3 -2
  64. data/lib/netsuite/records/non_inventory_sale_item.rb +2 -1
  65. data/lib/netsuite/records/other_charge_sale_item.rb +2 -2
  66. data/lib/netsuite/records/partner.rb +1 -1
  67. data/lib/netsuite/records/price.rb +17 -0
  68. data/lib/netsuite/records/price_level.rb +26 -0
  69. data/lib/netsuite/records/price_list.rb +9 -0
  70. data/lib/netsuite/records/pricing.rb +20 -0
  71. data/lib/netsuite/records/pricing_matrix.rb +2 -2
  72. data/lib/netsuite/records/promotions.rb +26 -0
  73. data/lib/netsuite/records/promotions_list.rb +9 -0
  74. data/lib/netsuite/records/return_authorization_item.rb +1 -1
  75. data/lib/netsuite/records/sales_order.rb +1 -0
  76. data/lib/netsuite/records/sales_order_item.rb +12 -5
  77. data/lib/netsuite/records/sales_role.rb +26 -0
  78. data/lib/netsuite/records/sales_tax_item.rb +3 -1
  79. data/lib/netsuite/records/serialized_assembly_item.rb +239 -0
  80. data/lib/netsuite/records/service_resale_item.rb +1 -1
  81. data/lib/netsuite/records/service_sale_item.rb +2 -1
  82. data/lib/netsuite/records/support_case.rb +1 -1
  83. data/lib/netsuite/records/support_case_type.rb +26 -0
  84. data/lib/netsuite/records/task.rb +2 -1
  85. data/lib/netsuite/records/tax_group.rb +2 -2
  86. data/lib/netsuite/records/transaction_body_custom_field.rb +61 -0
  87. data/lib/netsuite/records/transaction_column_custom_field.rb +59 -0
  88. data/lib/netsuite/records/transfer_order_item.rb +2 -2
  89. data/lib/netsuite/records/vendor_credit.rb +2 -0
  90. data/lib/netsuite/records/work_order.rb +8 -0
  91. data/lib/netsuite/support/actions.rb +2 -0
  92. data/lib/netsuite/support/country.rb +27 -15
  93. data/lib/netsuite/support/search_result.rb +20 -5
  94. data/lib/netsuite/utilities.rb +86 -21
  95. data/lib/netsuite/version.rb +2 -2
  96. data/netsuite.gemspec +5 -4
  97. data/spec/netsuite/actions/login_spec.rb +23 -0
  98. data/spec/netsuite/actions/update_list_spec.rb +107 -0
  99. data/spec/netsuite/actions/update_spec.rb +42 -0
  100. data/spec/netsuite/configuration_spec.rb +79 -6
  101. data/spec/netsuite/records/address_spec.rb +10 -0
  102. data/spec/netsuite/records/basic_record_spec.rb +12 -1
  103. data/spec/netsuite/records/bin_number_spec.rb +23 -0
  104. data/spec/netsuite/records/classification_spec.rb +10 -1
  105. data/spec/netsuite/records/custom_field_list_spec.rb +39 -4
  106. data/spec/netsuite/records/custom_record_spec.rb +1 -1
  107. data/spec/netsuite/records/customer_credit_cards_list_spec.rb +23 -0
  108. data/spec/netsuite/records/customer_sales_team_list_spec.rb +41 -0
  109. data/spec/netsuite/records/customer_spec.rb +44 -2
  110. data/spec/netsuite/records/customer_subscription_spec.rb +41 -0
  111. data/spec/netsuite/records/customer_subscriptions_list_spec.rb +19 -0
  112. data/spec/netsuite/records/employee_spec.rb +2 -2
  113. data/spec/netsuite/records/entity_custom_field_spec.rb +34 -0
  114. data/spec/netsuite/records/estimate_item_list_spec.rb +26 -0
  115. data/spec/netsuite/records/estimate_item_spec.rb +40 -0
  116. data/spec/netsuite/records/estimate_spec.rb +216 -0
  117. data/spec/netsuite/records/inter_company_journal_entry_line_list_spec.rb +26 -0
  118. data/spec/netsuite/records/inter_company_journal_entry_line_spec.rb +60 -0
  119. data/spec/netsuite/records/inter_company_journal_entry_spec.rb +156 -0
  120. data/spec/netsuite/records/inventory_item_spec.rb +57 -0
  121. data/spec/netsuite/records/invoice_spec.rb +2 -2
  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 +141 -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_list_spec.rb +2 -2
  130. data/spec/netsuite/records/return_authorization_item_spec.rb +1 -1
  131. data/spec/netsuite/records/sales_order_item_spec.rb +11 -5
  132. data/spec/netsuite/records/service_resale_item_spec.rb +134 -0
  133. data/spec/netsuite/records/support_case_type_spec.rb +22 -0
  134. data/spec/netsuite/records/transaction_body_custom_field_spec.rb +32 -0
  135. data/spec/netsuite/records/transaction_column_custom_field_spec.rb +32 -0
  136. data/spec/netsuite/records/vendor_credit_spec.rb +29 -0
  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 +104 -8
@@ -11,7 +11,6 @@ module NetSuite
11
11
 
12
12
  fields :alt_handling_cost,
13
13
  :alt_shipping_cost,
14
- :billing_address,
15
14
  :cc_approved,
16
15
  :cc_expire_date,
17
16
  :cc_is_purchase_card_bin,
@@ -78,6 +77,9 @@ module NetSuite
78
77
  :vat_reg_num,
79
78
  :vsoe_auto_calc
80
79
 
80
+ # NOTE only `Address` record in >= 2014_2
81
+ field :billing_address, Address
82
+
81
83
  field :item_list, CashRefundItemList
82
84
  field :custom_field_list, CustomFieldList
83
85
  # partnersList CashRefundPartnersList
@@ -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
@@ -13,7 +13,7 @@ module NetSuite
13
13
  :entity_id, :phonetic_name, :alt_email, :office_phone, :home_phone, :mobile_phone, :supervisor_phone,
14
14
  :assistant_phone, :comments, :bill_pay, :is_private, :is_inactive
15
15
 
16
- field :addressbook_list, CustomerAddressbookList
16
+ field :addressbook_list, ContactAddressbookList
17
17
  field :custom_field_list, CustomFieldList
18
18
  # field :subscriptions_list, SubscriptionsList
19
19
  # field :category_list, CategoryList
@@ -24,6 +24,7 @@ module NetSuite
24
24
 
25
25
  attr_reader :internal_id
26
26
  attr_accessor :external_id
27
+ attr_accessor :search_joins
27
28
 
28
29
  def initialize(attributes = {})
29
30
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -0,0 +1,64 @@
1
+ module NetSuite
2
+ module Records
3
+ class ContactAddressbook
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Namespaces::ListRel
7
+
8
+ # address implementation changed
9
+ # https://github.com/NetSweet/netsuite/pull/213
10
+
11
+ # https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2015_1/schema/other/customeraddressbook.html?mode=package
12
+
13
+ fields :default_shipping, :default_billing, :is_residential, :label, :internal_id
14
+
15
+ # NOTE API < 2014_2
16
+ fields :attention, :addressee, :phone, :addr1, :addr2, :addr3, :city, :zip, :override, :state
17
+ field :country, NetSuite::Support::Country
18
+ read_only_fields :addr_text
19
+
20
+ # NOTE API >= 2014_2
21
+ field :addressbook_address, NetSuite::Records::Address
22
+
23
+ def initialize(attributes_or_record = {})
24
+ case attributes_or_record
25
+ when self.class
26
+ initialize_from_record(attributes_or_record)
27
+ when Hash
28
+ attributes_or_record = attributes_or_record[:addressbook] if attributes_or_record[:addressbook]
29
+ initialize_from_attributes_hash(attributes_or_record)
30
+ end
31
+ end
32
+
33
+ def initialize_from_record(obj)
34
+ if NetSuite::Configuration.api_version < "2014_2"
35
+ self.default_shipping = obj.default_shipping
36
+ self.default_billing = obj.default_billing
37
+ self.is_residential = obj.is_residential
38
+ self.label = obj.label
39
+ self.attention = obj.attention
40
+ self.addressee = obj.addressee
41
+ self.phone = obj.phone
42
+ self.addr1 = obj.addr1
43
+ self.addr2 = obj.addr2
44
+ self.addr3 = obj.addr3
45
+ self.city = obj.city
46
+ self.zip = obj.zip
47
+ self.country = obj.country
48
+ self.addr_text = obj.addr_text
49
+ self.override = obj.override
50
+ self.state = obj.state
51
+ self.internal_id = obj.internal_id
52
+ else
53
+ self.addressbook_address = obj.addressbook_address
54
+ self.default_billing = obj.default_billing
55
+ self.default_shipping = obj.default_shipping
56
+ self.internal_id = obj.internal_id
57
+ self.is_residential = obj.is_residential
58
+ self.label = obj.label
59
+ end
60
+ end
61
+
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,11 @@
1
+ module NetSuite
2
+ module Records
3
+ class ContactAddressbookList < Support::Sublist
4
+ include Namespaces::ListRel
5
+
6
+ sublist :addressbook, ContactAddressbook
7
+
8
+ alias :addressbooks :addressbook
9
+ end
10
+ end
11
+ end
@@ -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,13 +13,16 @@ 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
24
  record_refs :customer, :sales_order, :account, :department, :payment_method,
22
- :custom_form, :currency, :posting_period, :subsidiary,
25
+ :custom_form, :currency, :posting_period, :subsidiary, :location,
23
26
 
24
27
  # only available in an advanced search result
25
28
  :deposit_transaction
@@ -25,6 +25,7 @@ module NetSuite
25
25
 
26
26
  attr_reader :internal_id
27
27
  attr_accessor :external_id
28
+ attr_accessor :search_joins
28
29
 
29
30
  def initialize(attributes = {})
30
31
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -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
@@ -11,7 +11,7 @@ module NetSuite
11
11
 
12
12
  actions :get, :get_list, :add, :update, :upsert, :upsert_list, :delete, :search
13
13
 
14
- fields :phone, :first_name, :last_name, :is_inactive, :email, :give_access, :send_email, :is_support_rep,
14
+ fields :alt_name, :phone, :first_name, :last_name, :is_inactive, :email, :give_access, :send_email, :is_support_rep,
15
15
  :birth_date, :hire_date, :last_review_date, :next_review_date, :title, :home_phone, :office_phone,
16
16
  :eligible_for_commission, :is_sales_rep, :klass, :middle_name, :account_number, :alien_number, :approval_limit,
17
17
  :bill_pay, :comments, :date_created, :direct_deposit, :entity_id, :password, :password2,
@@ -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