netsuite 0.8.5 → 0.8.9

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 (84) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/main.yml +20 -0
  3. data/.ruby-version +1 -1
  4. data/.tool-versions +1 -0
  5. data/Gemfile +1 -5
  6. data/HISTORY.md +32 -0
  7. data/README.md +48 -21
  8. data/Rakefile +1 -1
  9. data/lib/netsuite/configuration.rb +21 -4
  10. data/lib/netsuite/records/accounting_period.rb +2 -2
  11. data/lib/netsuite/records/assembly_unbuild.rb +1 -3
  12. data/lib/netsuite/records/classification.rb +4 -1
  13. data/lib/netsuite/records/contact.rb +1 -1
  14. data/lib/netsuite/records/cost_category.rb +28 -0
  15. data/lib/netsuite/records/credit_memo.rb +1 -1
  16. data/lib/netsuite/records/currency_rate.rb +1 -1
  17. data/lib/netsuite/records/custom_field_list.rb +9 -3
  18. data/lib/netsuite/records/custom_record.rb +1 -1
  19. data/lib/netsuite/records/customer.rb +2 -1
  20. data/lib/netsuite/records/customer_credit_cards.rb +36 -0
  21. data/lib/netsuite/records/customer_credit_cards_list.rb +10 -0
  22. data/lib/netsuite/records/customer_deposit.rb +5 -5
  23. data/lib/netsuite/records/customer_payment.rb +6 -2
  24. data/lib/netsuite/records/customer_payment_credit.rb +17 -0
  25. data/lib/netsuite/records/customer_payment_credit_list.rb +12 -0
  26. data/lib/netsuite/records/employee.rb +1 -1
  27. data/lib/netsuite/records/estimate.rb +42 -0
  28. data/lib/netsuite/records/estimate_item.rb +40 -0
  29. data/lib/netsuite/records/estimate_item_list.rb +11 -0
  30. data/lib/netsuite/records/inventory_item.rb +62 -1
  31. data/lib/netsuite/records/invoice.rb +97 -4
  32. data/lib/netsuite/records/invoice_item.rb +1 -1
  33. data/lib/netsuite/records/item_fulfillment.rb +1 -1
  34. data/lib/netsuite/records/item_fulfillment_item.rb +1 -1
  35. data/lib/netsuite/records/item_receipt_item.rb +1 -1
  36. data/lib/netsuite/records/member_list.rb +0 -2
  37. data/lib/netsuite/records/non_inventory_purchase_item.rb +1 -1
  38. data/lib/netsuite/records/non_inventory_resale_item.rb +2 -1
  39. data/lib/netsuite/records/non_inventory_sale_item.rb +1 -1
  40. data/lib/netsuite/records/opportunity.rb +2 -2
  41. data/lib/netsuite/records/partner.rb +7 -5
  42. data/lib/netsuite/records/phone_call.rb +1 -1
  43. data/lib/netsuite/records/serialized_assembly_item.rb +3 -2
  44. data/lib/netsuite/records/service_resale_item.rb +2 -2
  45. data/lib/netsuite/records/service_sale_item.rb +1 -1
  46. data/lib/netsuite/records/transfer_order_item.rb +1 -1
  47. data/lib/netsuite/records/vendor.rb +6 -5
  48. data/lib/netsuite/records/vendor_currency.rb +26 -0
  49. data/lib/netsuite/records/vendor_currency_list.rb +9 -0
  50. data/lib/netsuite/support/fields.rb +17 -0
  51. data/lib/netsuite/support/records.rb +1 -1
  52. data/lib/netsuite/support/search_result.rb +23 -4
  53. data/lib/netsuite/utilities.rb +2 -1
  54. data/lib/netsuite/version.rb +1 -1
  55. data/lib/netsuite.rb +10 -0
  56. data/netsuite.gemspec +5 -3
  57. data/spec/netsuite/actions/search_spec.rb +22 -0
  58. data/spec/netsuite/configuration_spec.rb +93 -6
  59. data/spec/netsuite/records/basic_record_spec.rb +8 -1
  60. data/spec/netsuite/records/classification_spec.rb +10 -1
  61. data/spec/netsuite/records/cost_category_spec.rb +105 -0
  62. data/spec/netsuite/records/custom_field_list_spec.rb +46 -6
  63. data/spec/netsuite/records/custom_record_spec.rb +1 -1
  64. data/spec/netsuite/records/customer_credit_cards_list_spec.rb +23 -0
  65. data/spec/netsuite/records/customer_payment_credit_list_spec.rb +26 -0
  66. data/spec/netsuite/records/customer_payment_spec.rb +1 -6
  67. data/spec/netsuite/records/customer_spec.rb +22 -1
  68. data/spec/netsuite/records/employee_spec.rb +2 -2
  69. data/spec/netsuite/records/estimate_item_list_spec.rb +26 -0
  70. data/spec/netsuite/records/estimate_item_spec.rb +40 -0
  71. data/spec/netsuite/records/estimate_spec.rb +216 -0
  72. data/spec/netsuite/records/inventory_item_spec.rb +65 -0
  73. data/spec/netsuite/records/invoice_spec.rb +94 -0
  74. data/spec/netsuite/records/non_inventory_resale_item_spec.rb +165 -0
  75. data/spec/netsuite/records/partner_spec.rb +143 -0
  76. data/spec/netsuite/records/service_resale_item_spec.rb +134 -0
  77. data/spec/netsuite/records/vendor_spec.rb +1 -1
  78. data/spec/netsuite/support/fields_spec.rb +36 -1
  79. data/spec/support/fixtures/custom_fields/multi_select.xml +47 -0
  80. data/spec/support/fixtures/search/saved_search_item.xml +55 -0
  81. data/spec/support/fixtures/search/saved_search_joined_custom_customer.xml +15 -1
  82. data/spec/support/search_only_field_matcher.rb +7 -0
  83. metadata +68 -12
  84. data/circle.yml +0 -17
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe NetSuite::Records::CustomerPaymentCreditList do
4
+ let(:list) { NetSuite::Records::CustomerPaymentCreditList.new }
5
+ let(:apply) { NetSuite::Records::CustomerPaymentCredit.new }
6
+
7
+ it 'can have credits be added to it' do
8
+ list.credits << apply
9
+ credit_list = list.credits
10
+ expect(credit_list).to be_kind_of(Array)
11
+ expect(credit_list.length).to eql(1)
12
+ credit_list.each { |i| expect(i).to be_kind_of(NetSuite::Records::CustomerPaymentCredit) }
13
+ end
14
+
15
+ describe '#to_record' do
16
+ it 'can represent itself as a SOAP record' do
17
+ record = {
18
+ 'tranCust:credit' => [{},{}]
19
+ }
20
+
21
+ list.credits.concat([apply, apply])
22
+ expect(list.to_record).to eql(record)
23
+ end
24
+ end
25
+
26
+ end
@@ -18,7 +18,7 @@ describe NetSuite::Records::CustomerPayment do
18
18
 
19
19
  it 'has all the right record refs' do
20
20
  [
21
- :account, :ar_acct, :credit_card, :credit_card_processor, :custom_form, :customer, :department, :klass, :location, :payment_method, :posting_period, :subsidiary
21
+ :account, :ar_acct, :credit_card, :credit_card_processor, :custom_form, :customer, :department, :klass, :location, :payment_method, :payment_option, :posting_period, :subsidiary
22
22
  ].each do |record_ref|
23
23
  expect(payment).to have_record_ref(record_ref)
24
24
  end
@@ -49,11 +49,6 @@ describe NetSuite::Records::CustomerPayment do
49
49
  it 'can be set from a CustomerPaymentApplyList object'
50
50
  end
51
51
 
52
- describe '#credit_list' do
53
- it 'can be set from attributes'
54
- it 'can be set from a CustomerPaymentCreditList object'
55
- end
56
-
57
52
  describe '#deposit_list' do
58
53
  it 'can be set from attributes'
59
54
  it 'can be set from a CustomerPaymentDepositList object'
@@ -8,7 +8,7 @@ describe NetSuite::Records::Customer do
8
8
  :account_number, :aging, :alt_email, :alt_name, :alt_phone, :balance, :bill_pay,
9
9
  :buying_reason, :buying_time_frame, :campaign_category, :click_stream, :comments, :company_name,
10
10
  :consol_aging, :consol_balance, :consol_days_overdue, :consol_deposit_balance, :consol_overdue_balance,
11
- :consol_unbilled_orders, :contrib_pct, :credit_cards_list, :credit_hold_override, :credit_limit,
11
+ :consol_unbilled_orders, :contrib_pct, :credit_hold_override, :credit_limit,
12
12
  :date_created, :days_overdue, :default_address,
13
13
  :deposit_balance, :download_list, :email, :email_preference, :email_transactions, :end_date, :entity_id,
14
14
  :estimated_budget, :fax, :fax_transactions, :first_name, :first_visit, :give_access, :global_subscription_status,
@@ -65,6 +65,27 @@ describe NetSuite::Records::Customer do
65
65
  end
66
66
  end
67
67
 
68
+ describe '#credit_cards_list' do
69
+ it 'can be set from attributes' do
70
+ customer.credit_cards_list = {
71
+ :credit_cards => {
72
+ :internal_id => '1234567',
73
+ :cc_default => true,
74
+ :cc_expire_date => '2099-12-01T00:00:00.000-08:00'
75
+ }
76
+ }
77
+
78
+ expect(customer.credit_cards_list).to be_kind_of(NetSuite::Records::CustomerCreditCardsList)
79
+ expect(customer.credit_cards_list.credit_cards.length).to eql(1)
80
+ end
81
+
82
+ it 'can be set from a CustomerCreditCardsList object' do
83
+ customer_credit_cards_list = NetSuite::Records::CustomerCreditCardsList.new
84
+ customer.credit_cards_list = customer_credit_cards_list
85
+ expect(customer.credit_cards_list).to eql(customer_credit_cards_list)
86
+ end
87
+ end
88
+
68
89
  describe '#custom_field_list' do
69
90
  it 'can be set from attributes' do
70
91
  attributes = {
@@ -21,7 +21,7 @@ describe NetSuite::Records::Employee do
21
21
 
22
22
  it 'has all the right record refs' do
23
23
  [
24
- :location, :employee_status, :employee_type
24
+ :currency, :department, :location, :sales_role, :subsidiary, :employee_type, :employee_status, :supervisor
25
25
  ].each do |record_ref|
26
26
  expect(employee).to have_record_ref(record_ref)
27
27
  end
@@ -144,7 +144,7 @@ describe NetSuite::Records::Employee do
144
144
 
145
145
  it 'has the right record_refs' do
146
146
  [
147
- :currency, :department, :location, :subsidiary
147
+ :currency, :department, :location, :sales_role, :subsidiary, :employee_type, :employee_status, :supervisor
148
148
  ].each do |record_ref|
149
149
  expect(employee).to have_record_ref(record_ref)
150
150
  end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe NetSuite::Records::EstimateItemList do
4
+ let(:list) { NetSuite::Records::EstimateItemList.new }
5
+
6
+ it 'has a items attribute' do
7
+ expect(list.items).to be_kind_of(Array)
8
+ end
9
+
10
+ describe '#to_record' do
11
+ before do
12
+ list.items << NetSuite::Records::EstimateItem.new(
13
+ :rate => 10
14
+ )
15
+ end
16
+
17
+ it 'can represent itself as a SOAP record' do
18
+ record = {
19
+ 'tranSales:item' => [{
20
+ 'tranSales:rate' => 10
21
+ }]
22
+ }
23
+ expect(list.to_record).to eql(record)
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+
3
+ describe NetSuite::Records::EstimateItem do
4
+ let(:item) { NetSuite::Records::EstimateItem.new }
5
+
6
+ it 'has all the right fields' do
7
+ [
8
+ :amount, :cost_estimate, :cost_estimate_type,
9
+ :defer_rev_rec, :description,
10
+ :is_taxable, :line, :quantity,
11
+ :rate, :tax_rate1
12
+ ].each do |field|
13
+ expect(item).to have_field(field)
14
+ end
15
+ end
16
+
17
+ it 'has all the right record refs' do
18
+ [
19
+ :item, :job, :price, :tax_code, :units
20
+ ].each do |record_ref|
21
+ expect(item).to have_record_ref(record_ref)
22
+ end
23
+ end
24
+
25
+ describe '#options' do
26
+ it 'can be set from attributes'
27
+ it 'can be set from a CustomFieldList object'
28
+ end
29
+
30
+ describe '#inventory_detail' do
31
+ it 'can be set from attributes'
32
+ it 'can be set from an InventoryDetail object'
33
+ end
34
+
35
+ describe '#custom_field_list' do
36
+ it 'can be set from attributes'
37
+ it 'can be set from a CustomFieldList object'
38
+ end
39
+
40
+ end
@@ -0,0 +1,216 @@
1
+ require 'spec_helper'
2
+
3
+ describe NetSuite::Records::Estimate do
4
+ let(:estimate) { NetSuite::Records::Estimate.new }
5
+ let(:customer) { NetSuite::Records::Customer.new }
6
+ let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
7
+
8
+ it 'has all the right fields' do
9
+ [
10
+ :alt_handling_cost, :alt_shipping_cost,
11
+ :balance, :bill_address, :created_date, :currency_name,
12
+ :discount_rate, :email, :end_date, :est_gross_profit,
13
+ :exchange_rate,
14
+ :handling_cost, :handling_tax1_rate, :is_taxable,
15
+ :last_modified_date, :memo, :message, :other_ref_num,
16
+ :shipping_cost, :shipping_tax1_rate,
17
+ :source, :start_date, :status, :sync_partner_teams,
18
+ :sync_sales_teams, :to_be_emailed, :to_be_faxed, :to_be_printed,
19
+ :total_cost_estimate, :tran_date, :tran_id
20
+ ].each do |field|
21
+ expect(estimate).to have_field(field)
22
+ end
23
+ end
24
+
25
+ it 'has all the right record refs' do
26
+ [
27
+ :bill_address_list, :created_from, :currency, :custom_form, :department, :discount_item,
28
+ :entity, :handling_tax_code, :job, :klass, :lead_source, :location, :message_sel,
29
+ :opportunity, :partner, :promo_code, :sales_group, :sales_rep,
30
+ :ship_method, :shipping_tax_code, :subsidiary
31
+ ].each do |record_ref|
32
+ expect(estimate).to have_record_ref(record_ref)
33
+ end
34
+ end
35
+
36
+ describe '#order_status' do
37
+ it 'can be set from attributes'
38
+ it 'can be set from a EstimateStatus object'
39
+ end
40
+
41
+ describe '#item_list' do
42
+ it 'can be set from attributes' do
43
+ attributes = {
44
+ :item => {
45
+ :amount => 10
46
+ }
47
+ }
48
+ estimate.item_list = attributes
49
+ expect(estimate.item_list).to be_kind_of(NetSuite::Records::EstimateItemList)
50
+ expect(estimate.item_list.items.length).to eql(1)
51
+ end
52
+
53
+ it 'can be set from a EstimateItemList object' do
54
+ item_list = NetSuite::Records::EstimateItemList.new
55
+ estimate.item_list = item_list
56
+ expect(estimate.item_list).to eql(item_list)
57
+ end
58
+ end
59
+
60
+ describe '#transaction_bill_address' do
61
+ it 'can be set from attributes'
62
+ it 'can be set from a BillAddress object'
63
+ end
64
+
65
+ describe '#transaction_ship_address' do
66
+ it 'can be set from attributes'
67
+ it 'can be set from a ShipAddress object'
68
+ end
69
+
70
+ describe '#revenue_status' do
71
+ it 'can be set from attributes'
72
+ it 'can be set from a RevenueStatus object'
73
+ end
74
+
75
+ describe '#sales_team_list' do
76
+ it 'can be set from attributes'
77
+ it 'can be set from a EstimateSalesTeamList object'
78
+ end
79
+
80
+ describe '#partners_list' do
81
+ it 'can be set from attributes'
82
+ it 'can be set from a EstimatePartnersList object'
83
+ end
84
+
85
+ describe '#custom_field_list' do
86
+ it 'can be set from attributes'
87
+ it 'can be set from a CustomFieldList object'
88
+ end
89
+
90
+ describe '.get' do
91
+ context 'when the response is successful' do
92
+ let(:response) { NetSuite::Response.new(:success => true, :body => { :alt_shipping_cost => 100 }) }
93
+
94
+ it 'returns a Estimate instance populated with the data from the response object' do
95
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Estimate, :external_id => 1], {}).and_return(response)
96
+ estimate = NetSuite::Records::Estimate.get(:external_id => 1)
97
+ expect(estimate).to be_kind_of(NetSuite::Records::Estimate)
98
+ expect(estimate.alt_shipping_cost).to eql(100)
99
+ end
100
+ end
101
+
102
+ context 'when the response is unsuccessful' do
103
+ let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
104
+
105
+ it 'raises a RecordNotFound exception' do
106
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Estimate, :external_id => 1], {}).and_return(response)
107
+ expect {
108
+ NetSuite::Records::Estimate.get(:external_id => 1)
109
+ }.to raise_error(NetSuite::RecordNotFound,
110
+ /NetSuite::Records::Estimate with OPTIONS=(.*) could not be found/)
111
+ end
112
+ end
113
+ end
114
+
115
+ describe '.initialize' do
116
+ context 'when the request is successful' do
117
+ it 'returns an initialized sales order from the customer entity' do
118
+ expect(NetSuite::Actions::Initialize).to receive(:call).with([NetSuite::Records::Estimate, customer], {}).and_return(response)
119
+ estimate = NetSuite::Records::Estimate.initialize(customer)
120
+ expect(estimate).to be_kind_of(NetSuite::Records::Estimate)
121
+ end
122
+ end
123
+
124
+ context 'when the response is unsuccessful' do
125
+ skip
126
+ end
127
+ end
128
+
129
+ describe '#add' do
130
+ let(:test_data) { { :email => 'test@example.com', :fax => '1234567890' } }
131
+
132
+ context 'when the response is successful' do
133
+ let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
134
+
135
+ it 'returns true' do
136
+ estimate = NetSuite::Records::Estimate.new(test_data)
137
+ expect(NetSuite::Actions::Add).to receive(:call).
138
+ with([estimate], {}).
139
+ and_return(response)
140
+ expect(estimate.add).to be_truthy
141
+ end
142
+ end
143
+
144
+ context 'when the response is unsuccessful' do
145
+ let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
146
+
147
+ it 'returns false' do
148
+ estimate = NetSuite::Records::Estimate.new(test_data)
149
+ expect(NetSuite::Actions::Add).to receive(:call).
150
+ with([estimate], {}).
151
+ and_return(response)
152
+ expect(estimate.add).to be_falsey
153
+ end
154
+ end
155
+ end
156
+
157
+ describe '#delete' do
158
+ let(:test_data) { { :internal_id => '1' } }
159
+
160
+ context 'when the response is successful' do
161
+ let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
162
+
163
+ it 'returns true' do
164
+ estimate = NetSuite::Records::Estimate.new(test_data)
165
+ expect(NetSuite::Actions::Delete).to receive(:call).
166
+ with([estimate], {}).
167
+ and_return(response)
168
+ expect(estimate.delete).to be_truthy
169
+ end
170
+ end
171
+
172
+ context 'when the response is unsuccessful' do
173
+ let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
174
+
175
+ it 'returns false' do
176
+ estimate = NetSuite::Records::Estimate.new(test_data)
177
+ expect(NetSuite::Actions::Delete).to receive(:call).
178
+ with([estimate], {}).
179
+ and_return(response)
180
+ expect(estimate.delete).to be_falsey
181
+ end
182
+ end
183
+ end
184
+
185
+ describe '#to_record' do
186
+ before do
187
+ estimate.email = 'something@example.com'
188
+ estimate.tran_id = '4'
189
+ end
190
+ it 'can represent itself as a SOAP record' do
191
+ record = {
192
+ 'tranSales:email' => 'something@example.com',
193
+ 'tranSales:tranId' => '4'
194
+ }
195
+ expect(estimate.to_record).to eql(record)
196
+ end
197
+ end
198
+
199
+ describe '#record_type' do
200
+ it 'returns a string representation of the SOAP type' do
201
+ expect(estimate.record_type).to eql('tranSales:Estimate')
202
+ end
203
+ end
204
+
205
+ skip "closing a sales order" do
206
+ it "closes each line to close the sales order" do
207
+ attributes = sales_order.attributes
208
+ attributes[:item_list].items.each do |item|
209
+ item.is_closed = true
210
+ item.attributes = item.attributes.slice(:line, :is_closed)
211
+ end
212
+
213
+ sales_order.update({ item_list: attributes[:item_list] })
214
+ end
215
+ end
216
+ end
@@ -31,6 +31,70 @@ describe NetSuite::Records::InventoryItem do
31
31
  end
32
32
  end
33
33
 
34
+ it 'has all the right search_only_fields' do
35
+ [
36
+ :acc_book_rev_rec_forecast_rule, :accounting_book,
37
+ :accounting_book_amortization, :accounting_book_create_plans_on,
38
+ :accounting_book_rev_rec_rule, :accounting_book_rev_rec_schedule,
39
+ :allowed_shipping_method, :atp_lead_time, :atp_method, :base_price,
40
+ :bin_number, :bin_on_hand_avail, :bin_on_hand_count, :bom_quantity,
41
+ :build_entire_assembly, :build_time, :buy_it_now_price, :category,
42
+ :category_preferred, :component_yield, :correlated_item,
43
+ :correlated_item_correlation, :correlated_item_count,
44
+ :correlated_item_lift, :correlated_item_purchase_rate,
45
+ :cost_accounting_status, :created, :create_job,
46
+ :cust_return_variance_account, :date_viewed, :days_before_expiration,
47
+ :default_shipping_method, :deferred_expense_account,
48
+ :departmentnohierarchy, :display_ine_bay_store, :e_bay_item_description,
49
+ :e_bay_item_subtitle, :e_bay_item_title, :ebay_relisting_option,
50
+ :effective_bom_control, :effective_date, :effective_revision,
51
+ :end_auctions_when_out_of_stock, :feed_description, :feed_name,
52
+ :froogle_product_feed, :fx_cost, :generate_accruals, :gift_cert_auth_code,
53
+ :gift_cert_email, :gift_cert_expiration_date, :gift_cert_from,
54
+ :gift_cert_message, :gift_cert_original_amount, :gift_cert_recipient,
55
+ :hierarchy_node, :hierarchy_version, :hits, :image_url,
56
+ :interco_expense_account, :inventory_location, :is_available,
57
+ :is_fulfillable, :is_lot_item, :is_serial_item,
58
+ :is_special_work_order_item, :is_vsoe_bundle, :is_wip, :item_url,
59
+ :last_quantity_available_change, :liability_account, :listing_duration,
60
+ :location_allow_store_pickup, :location_atp_lead_time,
61
+ :location_average_cost, :location_bin_quantity_available,
62
+ :location_build_time, :location_cost, :location_cost_accounting_status,
63
+ :location_default_return_cost, :location_demand_source,
64
+ :location_demand_time_fence, :location_fixed_lot_size,
65
+ :location_inventory_cost_template, :location_invt_classification,
66
+ :location_invt_count_interval, :location_last_invt_count_date,
67
+ :location_lead_time, :location_next_invt_count_date,
68
+ :location_periodic_lot_size_days, :location_periodic_lot_size_type,
69
+ :location_preferred_stock_level, :location_qty_avail_for_store_pickup,
70
+ :location_quantity_available, :location_quantity_back_ordered,
71
+ :location_quantity_committed, :location_quantity_in_transit,
72
+ :location_quantity_on_hand, :location_quantity_on_order,
73
+ :location_re_order_point, :location_reschedule_in_days,
74
+ :location_reschedule_out_days, :location_safety_stock_level,
75
+ :location_store_pickup_buffer_stock, :location_supply_lot_sizing_method,
76
+ :location_supply_time_fence, :location_supply_type, :location_total_value,
77
+ :loc_backward_consumption_days, :loc_forward_consumption_days,
78
+ :manufacturing_charge_item, :member_item, :member_quantity, :modified,
79
+ :moss_applies, :nextag_product_feed, :num_active_listings,
80
+ :number_allowed_downloads, :num_currently_listed, :obsolete_date,
81
+ :obsolete_revision, :online_customer_price, :online_price, :other_prices,
82
+ :other_vendor, :overhead_type, :preferred_bin, :primary_category,
83
+ :prod_price_variance_acct, :prod_qty_variance_acct,
84
+ :reserve_price,
85
+ :same_as_primary_book_amortization, :same_as_primary_book_rev_rec,
86
+ :scrap_acct, :sell_on_ebay, :serial_number, :serial_number_location,
87
+ :shipping_carrier, :shipping_rate, :shopping_product_feed,
88
+ :shopzilla_product_feed, :starting_price, :subsidiary,
89
+ :sub_type, :thumb_nail_url, :type, :unbuild_variance_account,
90
+ :use_component_yield, :vendor_code, :vendor_cost, :vendor_cost_entered,
91
+ :vendor_price_currency, :vendor_schedule, :vend_return_variance_account,
92
+ :web_site, :wip_acct, :wip_variance_acct, :yahoo_product_feed,
93
+ ].each do |field|
94
+ expect(NetSuite::Records::InventoryItem).to have_search_only_field(field)
95
+ end
96
+ end
97
+
34
98
  it 'has all the right record refs' do
35
99
  [
36
100
  :alternate_demand_source_item, :asset_account, :bill_exch_rate_variance_acct, :bill_price_variance_acct, :bill_qty_variance_acct, :billing_schedule, :cogs_account, :cost_category, :custom_form, :deferred_revenue_account, :demand_source, :department, :expense_account, :gain_loss_account, :income_account, :issue_product, :klass, :location, :parent, :preferred_location, :pricing_group, :purchase_price_variance_acct, :purchase_tax_code, :purchase_unit, :quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :ship_package, :soft_descriptor, :stock_unit, :store_display_image, :store_display_thumbnail, :store_item_template, :supply_lot_sizing_method, :supply_replenishment_method, :supply_type, :tax_schedule, :units_type, :vendor
@@ -215,6 +279,7 @@ describe NetSuite::Records::InventoryItem do
215
279
  before do
216
280
  item.cost = 100
217
281
  item.is_inactive = false
282
+ item.location_quantity_available = '1.0' # Search only, excluded
218
283
  end
219
284
  it 'can represent itself as a SOAP record' do
220
285
  record = {