netsuite 0.8.3 → 0.8.4

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/README.md +3 -2
  4. data/circle.yml +3 -2
  5. data/lib/netsuite.rb +17 -0
  6. data/lib/netsuite/actions/login.rb +11 -0
  7. data/lib/netsuite/actions/update.rb +6 -2
  8. data/lib/netsuite/errors.rb +1 -0
  9. data/lib/netsuite/records/assembly_build.rb +4 -1
  10. data/lib/netsuite/records/assembly_item.rb +1 -0
  11. data/lib/netsuite/records/assembly_unbuild.rb +3 -0
  12. data/lib/netsuite/records/bin_number.rb +18 -0
  13. data/lib/netsuite/records/bin_number_list.rb +1 -20
  14. data/lib/netsuite/records/classification.rb +1 -1
  15. data/lib/netsuite/records/custom_field_list.rb +10 -2
  16. data/lib/netsuite/records/custom_record.rb +2 -2
  17. data/lib/netsuite/records/custom_record_ref.rb +1 -0
  18. data/lib/netsuite/records/customer.rb +3 -3
  19. data/lib/netsuite/records/customer_deposit.rb +5 -2
  20. data/lib/netsuite/records/customer_sales_team.rb +24 -0
  21. data/lib/netsuite/records/customer_sales_team_list.rb +9 -0
  22. data/lib/netsuite/records/customer_status.rb +29 -0
  23. data/lib/netsuite/records/customer_subscription.rb +18 -0
  24. data/lib/netsuite/records/customer_subscriptions_list.rb +10 -0
  25. data/lib/netsuite/records/entity_custom_field.rb +53 -0
  26. data/lib/netsuite/records/non_inventory_resale_item.rb +2 -2
  27. data/lib/netsuite/records/price.rb +17 -0
  28. data/lib/netsuite/records/price_list.rb +9 -0
  29. data/lib/netsuite/records/pricing.rb +20 -0
  30. data/lib/netsuite/records/pricing_matrix.rb +2 -2
  31. data/lib/netsuite/records/promotions.rb +26 -0
  32. data/lib/netsuite/records/promotions_list.rb +9 -0
  33. data/lib/netsuite/records/sales_order.rb +1 -0
  34. data/lib/netsuite/records/sales_role.rb +26 -0
  35. data/lib/netsuite/records/sales_tax_item.rb +3 -1
  36. data/lib/netsuite/records/serialized_assembly_item.rb +239 -0
  37. data/lib/netsuite/records/service_sale_item.rb +1 -1
  38. data/lib/netsuite/records/tax_group.rb +2 -2
  39. data/lib/netsuite/records/transaction_body_custom_field.rb +61 -0
  40. data/lib/netsuite/records/transaction_column_custom_field.rb +59 -0
  41. data/lib/netsuite/records/vendor_credit.rb +2 -0
  42. data/lib/netsuite/records/work_order.rb +8 -0
  43. data/lib/netsuite/support/country.rb +27 -15
  44. data/lib/netsuite/utilities.rb +45 -20
  45. data/lib/netsuite/version.rb +1 -1
  46. data/spec/netsuite/actions/login_spec.rb +23 -0
  47. data/spec/netsuite/actions/update_spec.rb +42 -0
  48. data/spec/netsuite/records/address_spec.rb +10 -0
  49. data/spec/netsuite/records/basic_record_spec.rb +6 -1
  50. data/spec/netsuite/records/bin_number_spec.rb +23 -0
  51. data/spec/netsuite/records/custom_field_list_spec.rb +33 -0
  52. data/spec/netsuite/records/customer_sales_team_list_spec.rb +41 -0
  53. data/spec/netsuite/records/customer_spec.rb +22 -1
  54. data/spec/netsuite/records/customer_subscription_spec.rb +41 -0
  55. data/spec/netsuite/records/customer_subscriptions_list_spec.rb +19 -0
  56. data/spec/netsuite/records/entity_custom_field_spec.rb +34 -0
  57. data/spec/netsuite/records/pricing_matrix_spec.rb +15 -13
  58. data/spec/netsuite/records/transaction_body_custom_field_spec.rb +32 -0
  59. data/spec/netsuite/records/transaction_column_custom_field_spec.rb +32 -0
  60. data/spec/netsuite/records/vendor_credit_spec.rb +29 -0
  61. data/spec/netsuite/utilities_spec.rb +15 -3
  62. data/spec/spec_helper.rb +5 -4
  63. metadata +34 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cda0456bc8a4964f260bb7e484b64524728ea57a
4
- data.tar.gz: cbf7749dc5c04d32f6bb2c59f71bb3693a1fdda5
3
+ metadata.gz: 4706d84cf53e7897cc7f420a4af5c22230f764d0
4
+ data.tar.gz: a0e4db30c9a0288633a73988b7bd74916a3dbc20
5
5
  SHA512:
6
- metadata.gz: f7e304a05344e3611a0f84741d9acf258bd10b4a6599735778514408dbd3dd1b02d5e697f07a798ab613af3ba3e77238ae394f661c66324ec2eaa38cdbf0d107
7
- data.tar.gz: f083d2d5c1b982a378a151b47a8e423524727dc9fc346e25093f9f53bbc4e8e3a0cd0b49b16196643ea5cc8e1918af363e04a0ecb742ed09ed169de9f0d9ae3c
6
+ metadata.gz: 2afc60b0287c25b4a9cb4d271a363da58c5089ee0eb60d10d6f2334b06ac1bd1bbd902fce592034f53f0fe0a600147184a51668b3bf7c903513d3a1c1e310069
7
+ data.tar.gz: 5dadd1b9eae507ff201e01f3ab7f2d49e6e6a930d5ec1825fcc7ee2dd8087b71025a9e66700aa491b598a61606085b2c37a1f2f6f29457ade3693fe2809db925
data/Gemfile CHANGED
@@ -6,6 +6,9 @@ gem 'simplecov', :require => false
6
6
  gem 'pry-nav'
7
7
  gem 'pry-rescue'
8
8
 
9
+ # optional dependency for more accurate timezone conversion
10
+ gem 'tzinfo'
11
+
9
12
  # required for CircleCI to build properly with ruby 1.9.3
10
13
  gem 'json', '~> 1.8.3'
11
14
  gem 'rack', '~> 1.6.4'
data/README.md CHANGED
@@ -20,7 +20,6 @@
20
20
  [![Circle CI](https://circleci.com/gh/NetSweet/netsuite/tree/master.svg?style=svg)](https://circleci.com/gh/NetSweet/netsuite/tree/master)
21
21
  [![Slack Status](https://opensuite-slackin.herokuapp.com/badge.svg)](http://opensuite-slackin.herokuapp.com)
22
22
  [![Gem Version](https://badge.fury.io/rb/netsuite.svg)](http://badge.fury.io/rb/netsuite)
23
- [![Dependency Status](https://gemnasium.com/roidrage/lograge.svg)](https://gemnasium.com/netsweet/netsuite)
24
23
 
25
24
  # NetSuite SuiteTalk API Ruby Gem
26
25
 
@@ -55,6 +54,8 @@ Add this line to your application's Gemfile:
55
54
  gem 'netsuite'
56
55
  ```
57
56
 
57
+ If you'd like more accurate time conversion support, include the `tzinfo` gem.
58
+
58
59
  This gem is built for ruby 1.9.x+, checkout the [1-8-stable](https://github.com/NetSweet/netsuite/tree/1-8-stable) branch for ruby 1.8.x support.
59
60
 
60
61
  ## Configuration
@@ -570,4 +571,4 @@ states.to_array.first[:get_all_response][:get_all_result][:record_list][:record]
570
571
 
571
572
  # About SuiteSync
572
573
 
573
- [SuiteSync, the Stripe-NetSuite integration](http://suitesync.io) uses this gem and funds the majority of it's development and maintenance.
574
+ [SuiteSync, the Stripe-NetSuite integration](http://suitesync.io) uses this gem and funds the majority of it's development and maintenance.
data/circle.yml CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  machine:
4
4
  environment:
5
- RUBY_VERSIONS: 2.0.0,2.1.10,2.2.5,2.3.1,2.4.0
5
+ RUBY_VERSIONS: 2.0.0,2.1.10,2.2.9,2.3.7,2.4.4,2.5.1,2.6.1
6
6
 
7
7
  dependencies:
8
8
  override:
9
+ - gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
9
10
  - rvm get head
10
11
  - rvm install $RUBY_VERSIONS
11
- - rvm $RUBY_VERSIONS --verbose do gem install bundler
12
+ - rvm $RUBY_VERSIONS --verbose do gem install bundler -v 1.17.3
12
13
  - rvm $RUBY_VERSIONS --verbose do bundle install
13
14
 
14
15
  test:
@@ -82,6 +82,7 @@ module NetSuite
82
82
  autoload :BillingScheduleRecurrence, 'netsuite/records/billing_schedule_recurrence'
83
83
  autoload :BillingScheduleRecurrenceList, 'netsuite/records/billing_schedule_recurrence_list'
84
84
  autoload :Bin, 'netsuite/records/bin'
85
+ autoload :BinNumber, 'netsuite/records/bin_number'
85
86
  autoload :BinNumberList, 'netsuite/records/bin_number_list'
86
87
  autoload :BinTransfer, 'netsuite/records/bin_transfer'
87
88
  autoload :BinTransferInventory, 'netsuite/records/bin_transfer_inventory'
@@ -120,12 +121,18 @@ module NetSuite
120
121
  autoload :CustomerPayment, 'netsuite/records/customer_payment'
121
122
  autoload :CustomerPaymentApply, 'netsuite/records/customer_payment_apply'
122
123
  autoload :CustomerPaymentApplyList, 'netsuite/records/customer_payment_apply_list'
124
+ autoload :CustomerPartner, 'netsuite/records/customer_partner'
123
125
  autoload :CustomerRefund, 'netsuite/records/customer_refund'
124
126
  autoload :CustomerRefundApply, 'netsuite/records/customer_refund_apply'
125
127
  autoload :CustomerRefundApplyList, 'netsuite/records/customer_refund_apply_list'
126
128
  autoload :CustomerRefundDeposit, 'netsuite/records/customer_refund_deposit'
127
129
  autoload :CustomerRefundDepositList, 'netsuite/records/customer_refund_deposit_list'
130
+ autoload :CustomerSubscription, 'netsuite/records/customer_subscription'
131
+ autoload :CustomerSubscriptionsList, 'netsuite/records/customer_subscriptions_list'
132
+ autoload :CustomerStatus, 'netsuite/records/customer_status'
128
133
  autoload :CustomerPartner, 'netsuite/records/customer_partner'
134
+ autoload :CustomerSalesTeam, 'netsuite/records/customer_sales_team'
135
+ autoload :CustomerSalesTeamList, 'netsuite/records/customer_sales_team_list'
129
136
  autoload :ContactList, 'netsuite/records/contact_list'
130
137
  autoload :Contact, 'netsuite/records/contact'
131
138
  autoload :ContactAddressbook, 'netsuite/records/contact_addressbook'
@@ -148,6 +155,7 @@ module NetSuite
148
155
  autoload :DiscountItem, 'netsuite/records/discount_item'
149
156
  autoload :Duration, 'netsuite/records/duration'
150
157
  autoload :Employee, 'netsuite/records/employee'
158
+ autoload :EntityCustomField, 'netsuite/records/entity_custom_field'
151
159
  autoload :File, 'netsuite/records/file'
152
160
  autoload :GiftCertificate, 'netsuite/records/gift_certificate'
153
161
  autoload :GiftCertificateItem, 'netsuite/records/gift_certificate_item'
@@ -214,9 +222,14 @@ module NetSuite
214
222
  autoload :PaymentMethod, 'netsuite/records/payment_method'
215
223
  autoload :PayrollItem, 'netsuite/records/payroll_item'
216
224
  autoload :PhoneCall, 'netsuite/records/phone_call'
225
+ autoload :Price, 'netsuite/records/price'
217
226
  autoload :PriceLevel, 'netsuite/records/price_level'
227
+ autoload :PriceList, 'netsuite/records/price_list'
228
+ autoload :Pricing, 'netsuite/records/pricing'
218
229
  autoload :PricingMatrix, 'netsuite/records/pricing_matrix'
219
230
  autoload :PromotionCode, 'netsuite/records/promotion_code'
231
+ autoload :PromotionsList, 'netsuite/records/promotions_list'
232
+ autoload :Promotions, 'netsuite/records/promotions'
220
233
  autoload :PurchaseOrder, 'netsuite/records/purchase_order'
221
234
  autoload :PurchaseOrderItemList, 'netsuite/records/purchase_order_item_list'
222
235
  autoload :PurchaseOrderItem, 'netsuite/records/purchase_order_item'
@@ -233,9 +246,11 @@ module NetSuite
233
246
  autoload :SalesOrderShipGroupList, 'netsuite/records/sales_order_ship_group_list'
234
247
  autoload :SalesOrderItem, 'netsuite/records/sales_order_item'
235
248
  autoload :SalesOrderItemList, 'netsuite/records/sales_order_item_list'
249
+ autoload :SalesRole, 'netsuite/records/sales_role'
236
250
  autoload :SalesTaxItem, 'netsuite/records/sales_tax_item'
237
251
  autoload :ServiceResaleItem, 'netsuite/records/service_resale_item'
238
252
  autoload :ServiceSaleItem, 'netsuite/records/service_sale_item'
253
+ autoload :SerializedAssemblyItem, 'netsuite/records/serialized_assembly_item'
239
254
  autoload :SerializedInventoryItem, 'netsuite/records/serialized_inventory_item'
240
255
  autoload :SerializedInventoryItemNumbers, 'netsuite/records/serialized_inventory_item_numbers'
241
256
  autoload :SerializedInventoryItemNumbersList, 'netsuite/records/serialized_inventory_item_numbers_list'
@@ -251,6 +266,8 @@ module NetSuite
251
266
  autoload :Task, 'netsuite/records/task'
252
267
  autoload :Term, 'netsuite/records/term'
253
268
  autoload :TimeBill, 'netsuite/records/time_bill'
269
+ autoload :TransactionBodyCustomField, 'netsuite/records/transaction_body_custom_field'
270
+ autoload :TransactionColumnCustomField, 'netsuite/records/transaction_column_custom_field'
254
271
  autoload :TransactionShipGroup, 'netsuite/records/transaction_ship_group'
255
272
  autoload :TransferOrder, 'netsuite/records/transfer_order'
256
273
  autoload :TransferOrderItemList, 'netsuite/records/transfer_order_item_list'
@@ -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
@@ -28,11 +29,21 @@ module NetSuite
28
29
 
29
30
  def self.call(credentials)
30
31
  passport = NetSuite::Configuration.auth_header.dup
32
+
33
+
34
+ passport['platformMsgs:passport'] ||= {}
31
35
  passport['platformMsgs:passport']['platformCore:email'] = credentials[:email] || ''
32
36
  passport['platformMsgs:passport']['platformCore:password'] = credentials[:password] || ''
33
37
  passport['platformMsgs:passport']['platformCore:role'] = credentials[:role] || ''
38
+
39
+ if passport['platformMsgs:tokenPassport']
40
+ passport['platformMsgs:passport']['platformCore:account'] ||= passport['platformMsgs:tokenPassport']['platformCore:account']
41
+ end
42
+
34
43
  passport['platformMsgs:passport']['platformCore:account'] = credentials[:account] if !credentials[:account].nil?
35
44
 
45
+ passport.delete('platformMsgs:tokenPassport')
46
+
36
47
  begin
37
48
  response = NetSuite::Configuration.connection(soap_header: {}).call :login, message: passport
38
49
  rescue Savon::SOAPFault => e
@@ -71,8 +71,12 @@ module NetSuite
71
71
 
72
72
  module Support
73
73
  def update(options = {}, credentials={})
74
- options.merge!(:internal_id => internal_id) if respond_to?(:internal_id) && internal_id
75
- options.merge!(:external_id => external_id) if respond_to?(:external_id) && external_id
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?
@@ -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
 
@@ -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, :total,
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
@@ -50,6 +50,7 @@ module NetSuite
50
50
 
51
51
  attr_reader :internal_id
52
52
  attr_accessor :external_id
53
+ attr_accessor :search_joins
53
54
 
54
55
  def initialize(attributes = {})
55
56
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -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::PlatformCore
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
@@ -7,7 +7,7 @@ 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
12
  fields :name, :include_children, :is_inactive, :class_translation_list, :custom_field_list, :parent
13
13
 
@@ -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,
@@ -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
@@ -22,7 +22,7 @@ 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
@@ -32,8 +32,8 @@ module NetSuite
32
32
  field :contact_roles_list, ContactAccessRolesList
33
33
  field :currency_list, CustomerCurrencyList
34
34
  field :partners_list, CustomerPartnersList
35
-
36
- # TODO subscriptions_list
35
+ field :subscriptions_list, CustomerSubscriptionsList
36
+ field :sales_team_list, CustomerSalesTeamList
37
37
 
38
38
  read_only_fields :balance, :consol_balance, :deposit_balance, :consol_deposit_balance, :overdue_balance,
39
39
  :consol_overdue_balance, :unbilled_orders, :consol_unbilled_orders
@@ -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
@@ -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