netsuite 0.8.8 → 0.8.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.github/dependabot.yml +14 -0
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/.github/workflows/main.yml +7 -4
- data/Gemfile +5 -3
- data/HISTORY.md +42 -5
- data/README.md +18 -20
- data/lib/netsuite/actions/add.rb +5 -1
- data/lib/netsuite/actions/attach_file.rb +87 -0
- data/lib/netsuite/actions/search.rb +19 -6
- data/lib/netsuite/records/account.rb +0 -1
- data/lib/netsuite/records/accounting_period.rb +1 -1
- data/lib/netsuite/records/assembly_component.rb +0 -2
- data/lib/netsuite/records/assembly_item.rb +0 -1
- data/lib/netsuite/records/assembly_unbuild.rb +1 -4
- data/lib/netsuite/records/cash_refund.rb +0 -1
- data/lib/netsuite/records/cash_sale.rb +1 -2
- data/lib/netsuite/records/contact.rb +0 -1
- data/lib/netsuite/records/credit_memo.rb +0 -1
- data/lib/netsuite/records/currency_rate.rb +1 -2
- data/lib/netsuite/records/custom_record.rb +1 -1
- data/lib/netsuite/records/customer.rb +0 -1
- data/lib/netsuite/records/customer_deposit.rb +0 -1
- data/lib/netsuite/records/customer_payment.rb +0 -1
- data/lib/netsuite/records/customer_refund.rb +0 -1
- data/lib/netsuite/records/deposit.rb +0 -1
- data/lib/netsuite/records/deposit_application.rb +0 -1
- data/lib/netsuite/records/description_item.rb +1 -1
- data/lib/netsuite/records/estimate.rb +95 -15
- data/lib/netsuite/records/inbound_shipment.rb +0 -1
- data/lib/netsuite/records/inventory_item.rb +239 -40
- data/lib/netsuite/records/inventory_number.rb +1 -2
- data/lib/netsuite/records/inventory_transfer.rb +1 -0
- data/lib/netsuite/records/invoice.rb +7 -8
- data/lib/netsuite/records/invoice_item.rb +1 -1
- data/lib/netsuite/records/item_fulfillment.rb +0 -1
- data/lib/netsuite/records/item_fulfillment_item.rb +1 -1
- data/lib/netsuite/records/item_group.rb +1 -1
- data/lib/netsuite/records/item_option_custom_field.rb +52 -0
- data/lib/netsuite/records/item_receipt.rb +0 -1
- data/lib/netsuite/records/item_receipt_item.rb +3 -2
- data/lib/netsuite/records/item_vendor.rb +10 -1
- data/lib/netsuite/records/job.rb +0 -1
- data/lib/netsuite/records/kit_item.rb +1 -1
- data/lib/netsuite/records/location.rb +0 -1
- data/lib/netsuite/records/lot_numbered_inventory_item.rb +225 -81
- data/lib/netsuite/records/matrix_option_list.rb +16 -0
- data/lib/netsuite/records/member_list.rb +0 -2
- data/lib/netsuite/records/non_inventory_purchase_item.rb +1 -1
- data/lib/netsuite/records/non_inventory_resale_item.rb +156 -20
- data/lib/netsuite/records/non_inventory_sale_item.rb +133 -21
- data/lib/netsuite/records/opportunity.rb +2 -3
- data/lib/netsuite/records/other_charge_sale_item.rb +1 -1
- data/lib/netsuite/records/payment_item.rb +1 -1
- data/lib/netsuite/records/payroll_item.rb +0 -1
- data/lib/netsuite/records/phone_call.rb +1 -1
- data/lib/netsuite/records/purchase_order.rb +0 -1
- data/lib/netsuite/records/return_authorization.rb +1 -0
- data/lib/netsuite/records/sales_order.rb +1 -2
- data/lib/netsuite/records/serialized_assembly_item.rb +0 -1
- data/lib/netsuite/records/serialized_inventory_item.rb +1 -1
- data/lib/netsuite/records/serialized_inventory_item_location.rb +0 -1
- data/lib/netsuite/records/service_resale_item.rb +123 -19
- data/lib/netsuite/records/service_sale_item.rb +1 -2
- data/lib/netsuite/records/subsidiary.rb +0 -1
- data/lib/netsuite/records/subtotal_item.rb +1 -1
- data/lib/netsuite/records/transfer_order.rb +0 -1
- data/lib/netsuite/records/transfer_order_item.rb +1 -1
- data/lib/netsuite/records/translation.rb +17 -0
- data/lib/netsuite/records/translation_list.rb +11 -0
- data/lib/netsuite/records/vendor.rb +4 -5
- data/lib/netsuite/records/vendor_bill.rb +0 -1
- data/lib/netsuite/records/work_order.rb +0 -1
- data/lib/netsuite/records/work_order_item.rb +0 -1
- data/lib/netsuite/support/actions.rb +2 -0
- data/lib/netsuite/support/fields.rb +3 -0
- data/lib/netsuite/support/records.rb +9 -1
- data/lib/netsuite/utilities.rb +5 -0
- data/lib/netsuite/version.rb +1 -1
- data/lib/netsuite.rb +4 -0
- data/netsuite.gemspec +4 -3
- data/spec/netsuite/actions/add_spec.rb +36 -0
- data/spec/netsuite/actions/attach_file_spec.rb +59 -0
- data/spec/netsuite/actions/search_spec.rb +205 -0
- data/spec/netsuite/records/estimate_spec.rb +103 -13
- data/spec/netsuite/records/inventory_item_spec.rb +242 -25
- data/spec/netsuite/records/invoice_spec.rb +30 -1
- data/spec/netsuite/records/item_option_custom_field_spec.rb +27 -0
- data/spec/netsuite/records/item_vendor_list_spec.rb +2 -5
- data/spec/netsuite/records/item_vendor_spec.rb +14 -2
- data/spec/netsuite/records/lot_numbered_inventory_item_spec.rb +247 -0
- data/spec/netsuite/records/matrix_option_list_spec.rb +26 -0
- data/spec/netsuite/records/non_inventory_resale_item_spec.rb +159 -24
- data/spec/netsuite/records/non_inventory_sale_item_spec.rb +135 -22
- data/spec/netsuite/records/return_authorization_spec.rb +62 -0
- data/spec/netsuite/records/sales_order_spec.rb +29 -0
- data/spec/netsuite/records/service_resale_item_spec.rb +122 -17
- data/spec/netsuite/records/translation_list_spec.rb +34 -0
- data/spec/netsuite/records/translation_spec.rb +28 -0
- data/spec/netsuite/support/fields_spec.rb +48 -1
- data/spec/netsuite/support/search_result_spec.rb +12 -0
- data/spec/netsuite/utilities_spec.rb +10 -2
- data/spec/support/field_matcher.rb +8 -6
- data/spec/support/fixtures/add/add_file.xml +20 -0
- data/spec/support/fixtures/attach/attach_file_to_sales_order.xml +16 -0
- data/spec/support/fixtures/attach/attach_file_to_sales_order_error.xml +20 -0
- data/spec/support/fixtures/search/basic_search_contact.xml +39 -0
- data/spec/support/fixtures/search/single_search_result.xml +46 -0
- metadata +39 -15
data/lib/netsuite.rb
CHANGED
@@ -49,6 +49,7 @@ module NetSuite
|
|
49
49
|
|
50
50
|
module Actions
|
51
51
|
autoload :Add, 'netsuite/actions/add'
|
52
|
+
autoload :AttachFile, 'netsuite/actions/attach_file'
|
52
53
|
autoload :Delete, 'netsuite/actions/delete'
|
53
54
|
autoload :DeleteList, 'netsuite/actions/delete_list'
|
54
55
|
autoload :Get, 'netsuite/actions/get'
|
@@ -200,6 +201,7 @@ module NetSuite
|
|
200
201
|
autoload :ItemGroup, 'netsuite/records/item_group'
|
201
202
|
autoload :ItemMember, 'netsuite/records/item_member'
|
202
203
|
autoload :ItemMemberList, 'netsuite/records/item_member_list'
|
204
|
+
autoload :ItemOptionCustomField, 'netsuite/records/item_option_custom_field'
|
203
205
|
autoload :ItemReceipt, 'netsuite/records/item_receipt'
|
204
206
|
autoload :ItemReceiptItemList, 'netsuite/records/item_receipt_item_list'
|
205
207
|
autoload :ItemReceiptItem, 'netsuite/records/item_receipt_item'
|
@@ -283,6 +285,8 @@ module NetSuite
|
|
283
285
|
autoload :TransferOrder, 'netsuite/records/transfer_order'
|
284
286
|
autoload :TransferOrderItemList, 'netsuite/records/transfer_order_item_list'
|
285
287
|
autoload :TransferOrderItem, 'netsuite/records/transfer_order_item'
|
288
|
+
autoload :Translation, 'netsuite/records/translation'
|
289
|
+
autoload :TranslationList, 'netsuite/records/translation_list'
|
286
290
|
autoload :UnitsType, 'netsuite/records/units_type'
|
287
291
|
autoload :UnitsTypeUomList, 'netsuite/records/units_type_uom_list'
|
288
292
|
autoload :UnitsTypeUom, 'netsuite/records/units_type_uom'
|
data/netsuite.gemspec
CHANGED
@@ -15,9 +15,10 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.name = 'netsuite'
|
16
16
|
gem.require_paths = ['lib']
|
17
17
|
gem.version = NetSuite::VERSION
|
18
|
+
gem.metadata['changelog_uri'] = 'https://github.com/netsweet/netsuite/blob/master/HISTORY.md'
|
18
19
|
|
19
|
-
gem.add_dependency 'savon', '>= 2.3.0'
|
20
|
+
gem.add_dependency 'savon', '>= 2.3.0'
|
20
21
|
|
21
|
-
gem.add_development_dependency 'rspec', '~> 3.
|
22
|
-
gem.add_development_dependency 'rake'
|
22
|
+
gem.add_development_dependency 'rspec', '~> 3.11.0'
|
23
|
+
gem.add_development_dependency 'rake', '~> 13'
|
23
24
|
end
|
@@ -114,4 +114,40 @@ describe NetSuite::Actions::Add do
|
|
114
114
|
end
|
115
115
|
end
|
116
116
|
|
117
|
+
context 'File' do
|
118
|
+
let(:file) do
|
119
|
+
NetSuite::Records::File.new(name: 'foo.pdf', content: 'abc123')
|
120
|
+
end
|
121
|
+
|
122
|
+
context 'when successful' do
|
123
|
+
before do
|
124
|
+
savon.expects(:add).with(:message => {
|
125
|
+
'platformMsgs:record' => {
|
126
|
+
:content! => {
|
127
|
+
'fileCabinet:name' => 'foo.pdf',
|
128
|
+
'fileCabinet:content' => 'abc123',
|
129
|
+
},
|
130
|
+
'@xsi:type' => 'fileCabinet:File'
|
131
|
+
},
|
132
|
+
}).returns(File.read('spec/support/fixtures/add/add_file.xml'))
|
133
|
+
end
|
134
|
+
|
135
|
+
it 'makes a valid request to the NetSuite API' do
|
136
|
+
NetSuite::Actions::Add.call([file])
|
137
|
+
end
|
138
|
+
|
139
|
+
it 'returns a valid Response object' do
|
140
|
+
response = NetSuite::Actions::Add.call([file])
|
141
|
+
expect(response).to be_kind_of(NetSuite::Response)
|
142
|
+
expect(response).to be_success
|
143
|
+
end
|
144
|
+
|
145
|
+
it 'properly extracts internal ID from response' do
|
146
|
+
file.add
|
147
|
+
|
148
|
+
expect(file.internal_id).to eq('23556')
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
117
153
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe NetSuite::Actions::AttachFile do
|
4
|
+
before(:all) { savon.mock! }
|
5
|
+
after(:all) { savon.unmock! }
|
6
|
+
|
7
|
+
let(:sales_order) { NetSuite::Records::SalesOrder.new(internal_id: 999) }
|
8
|
+
let(:file) { double('file', internal_id: 111) }
|
9
|
+
let(:message) do
|
10
|
+
{
|
11
|
+
'platformCore:attachReference' => {
|
12
|
+
'@xsi:type' => 'platformCore:AttachBasicReference',
|
13
|
+
'platformCore:attachTo' => {
|
14
|
+
'@internalId' => sales_order.internal_id,
|
15
|
+
'@type' => 'salesOrder',
|
16
|
+
'@xsi:type' => 'platformCore:RecordRef'
|
17
|
+
},
|
18
|
+
'platformCore:attachedRecord' => {
|
19
|
+
'@internalId' => file.internal_id,
|
20
|
+
'@type' => 'file',
|
21
|
+
'@xsi:type' => 'platformCore:RecordRef'
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
before do
|
28
|
+
savon.expects(:attach).with(:message => message).returns(envelope)
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'when successful' do
|
32
|
+
let(:envelope) { File.read('spec/support/fixtures/attach/attach_file_to_sales_order.xml') }
|
33
|
+
|
34
|
+
it 'returns a valid Response object' do
|
35
|
+
response = NetSuite::Actions::AttachFile.call([sales_order, file])
|
36
|
+
expect(response).to be_kind_of(NetSuite::Response)
|
37
|
+
expect(response).to be_success
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'when not successful' do
|
42
|
+
let(:envelope) { File.read('spec/support/fixtures/attach/attach_file_to_sales_order_error.xml') }
|
43
|
+
|
44
|
+
it 'provides an error method on the object with details about the error' do
|
45
|
+
sales_order.attach_file(file)
|
46
|
+
error = sales_order.errors.first
|
47
|
+
|
48
|
+
expect(error).to be_kind_of(NetSuite::Error)
|
49
|
+
expect(error.type).to eq('ERROR')
|
50
|
+
expect(error.code).to eq('INVALID')
|
51
|
+
expect(error.message).to eq('Invalid request.')
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'provides an error method on the response' do
|
55
|
+
response = NetSuite::Actions::AttachFile.call([sales_order, file])
|
56
|
+
expect(response.errors.first).to be_kind_of(NetSuite::Error)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -193,6 +193,30 @@ describe NetSuite::Actions::Search do
|
|
193
193
|
expect(search.results.first.location_re_order_point).to eq('2565.0')
|
194
194
|
expect(search.results.first.location_quantity_on_order).to eq('40000.0')
|
195
195
|
end
|
196
|
+
|
197
|
+
it "should handle an ID search with basic non-field result columns" do
|
198
|
+
response = File.read('spec/support/fixtures/search/saved_search_item_2.xml')
|
199
|
+
savon.expects(:search)
|
200
|
+
.with(message: {
|
201
|
+
"searchRecord"=>{
|
202
|
+
"@xsi:type" =>"listAcct:ItemSearchAdvanced",
|
203
|
+
"@savedSearchId" =>42,
|
204
|
+
:content! =>{"listAcct:criteria"=>{}},
|
205
|
+
}
|
206
|
+
}).returns(response)
|
207
|
+
|
208
|
+
search = NetSuite::Records::InventoryItem.search(saved: 42)
|
209
|
+
|
210
|
+
results = search.results
|
211
|
+
custom_fields = results.map do |record|
|
212
|
+
record.custom_field_list.custom_fields.map(&:internal_id)
|
213
|
+
end.flatten.uniq
|
214
|
+
[
|
215
|
+
:location_quantity_available,
|
216
|
+
:location_re_order_point,
|
217
|
+
:location_quantity_on_order,
|
218
|
+
].each {|field| expect(custom_fields).to include(field)}
|
219
|
+
end
|
196
220
|
end
|
197
221
|
|
198
222
|
context "advanced search" do
|
@@ -201,6 +225,187 @@ describe NetSuite::Actions::Search do
|
|
201
225
|
end
|
202
226
|
|
203
227
|
context "basic search" do
|
228
|
+
it "should handle a basic search matching on RecordRef using internalId" do
|
229
|
+
response = File.read('spec/support/fixtures/search/basic_search_contact.xml')
|
230
|
+
savon.expects(:search)
|
231
|
+
.with(message: {
|
232
|
+
"searchRecord" => {
|
233
|
+
:content! => {
|
234
|
+
"listRel:basic" => {
|
235
|
+
"platformCommon:company" => {
|
236
|
+
"@operator" => "anyOf",
|
237
|
+
"@xsi:type" => "platformCore:SearchMultiSelectField",
|
238
|
+
"platformCore:searchValue" => [
|
239
|
+
{
|
240
|
+
:content! => {},
|
241
|
+
"@xsi:type" => "platformCore:RecordRef",
|
242
|
+
"@type" => "account",
|
243
|
+
"@internalId" => 7497,
|
244
|
+
},
|
245
|
+
{
|
246
|
+
:content! => {},
|
247
|
+
"@xsi:type" => "platformCore:RecordRef",
|
248
|
+
"@type" => "account",
|
249
|
+
"@internalId" => 7270,
|
250
|
+
},
|
251
|
+
],
|
252
|
+
},
|
253
|
+
},
|
254
|
+
},
|
255
|
+
"@xsi:type" => "listRel:ContactSearch",
|
256
|
+
},
|
257
|
+
}).returns(response)
|
258
|
+
|
259
|
+
search = NetSuite::Records::Contact.search(
|
260
|
+
basic: [{
|
261
|
+
field: 'company',
|
262
|
+
operator: 'anyOf',
|
263
|
+
value: [
|
264
|
+
NetSuite::Records::RecordRef.new(internal_id: 7497),
|
265
|
+
NetSuite::Records::RecordRef.new(internal_id: 7270),
|
266
|
+
],
|
267
|
+
}],
|
268
|
+
)
|
269
|
+
|
270
|
+
expect(search.results.size).to eq(1)
|
271
|
+
end
|
272
|
+
|
273
|
+
it "should handle a basic search matching on RecordRef using externalId" do
|
274
|
+
response = File.read('spec/support/fixtures/search/basic_search_contact.xml')
|
275
|
+
savon.expects(:search)
|
276
|
+
.with(message: {
|
277
|
+
"searchRecord" => {
|
278
|
+
:content! => {
|
279
|
+
"listRel:basic" => {
|
280
|
+
"platformCommon:company" => {
|
281
|
+
"@operator" => "anyOf",
|
282
|
+
"@xsi:type" => "platformCore:SearchMultiSelectField",
|
283
|
+
"platformCore:searchValue" => [
|
284
|
+
{
|
285
|
+
:content! => {},
|
286
|
+
"@xsi:type" => "platformCore:RecordRef",
|
287
|
+
"@type" => "account",
|
288
|
+
"@externalId" => "external_abc",
|
289
|
+
},
|
290
|
+
{
|
291
|
+
:content! => {},
|
292
|
+
"@xsi:type" => "platformCore:RecordRef",
|
293
|
+
"@type" => "account",
|
294
|
+
"@externalId" => "external_xyz",
|
295
|
+
},
|
296
|
+
],
|
297
|
+
},
|
298
|
+
},
|
299
|
+
},
|
300
|
+
"@xsi:type" => "listRel:ContactSearch",
|
301
|
+
},
|
302
|
+
}).returns(response)
|
303
|
+
|
304
|
+
search = NetSuite::Records::Contact.search(
|
305
|
+
basic: [{
|
306
|
+
field: 'company',
|
307
|
+
operator: 'anyOf',
|
308
|
+
value: [
|
309
|
+
NetSuite::Records::RecordRef.new(external_id: "external_abc"),
|
310
|
+
NetSuite::Records::RecordRef.new(external_id: "external_xyz"),
|
311
|
+
],
|
312
|
+
}],
|
313
|
+
)
|
314
|
+
|
315
|
+
expect(search.results.size).to eq(1)
|
316
|
+
end
|
317
|
+
|
318
|
+
it "should handle a basic search matching on RecordRef using mix of internalId and externalId" do
|
319
|
+
response = File.read('spec/support/fixtures/search/basic_search_contact.xml')
|
320
|
+
savon.expects(:search)
|
321
|
+
.with(message: {
|
322
|
+
"searchRecord" => {
|
323
|
+
:content! => {
|
324
|
+
"listRel:basic" => {
|
325
|
+
"platformCommon:company" => {
|
326
|
+
"@operator" => "anyOf",
|
327
|
+
"@xsi:type" => "platformCore:SearchMultiSelectField",
|
328
|
+
"platformCore:searchValue" => [
|
329
|
+
{
|
330
|
+
:content! => {},
|
331
|
+
"@xsi:type" => "platformCore:RecordRef",
|
332
|
+
"@type" => "account",
|
333
|
+
"@internalId" => 7497,
|
334
|
+
},
|
335
|
+
{
|
336
|
+
:content! => {},
|
337
|
+
"@xsi:type" => "platformCore:RecordRef",
|
338
|
+
"@type" => "account",
|
339
|
+
"@externalId" => "external_xyz",
|
340
|
+
},
|
341
|
+
],
|
342
|
+
},
|
343
|
+
},
|
344
|
+
},
|
345
|
+
"@xsi:type" => "listRel:ContactSearch",
|
346
|
+
},
|
347
|
+
}).returns(response)
|
348
|
+
|
349
|
+
search = NetSuite::Records::Contact.search(
|
350
|
+
basic: [{
|
351
|
+
field: 'company',
|
352
|
+
operator: 'anyOf',
|
353
|
+
value: [
|
354
|
+
NetSuite::Records::RecordRef.new(internal_id: 7497),
|
355
|
+
NetSuite::Records::RecordRef.new(external_id: "external_xyz"),
|
356
|
+
],
|
357
|
+
}],
|
358
|
+
)
|
359
|
+
|
360
|
+
expect(search.results.size).to eq(1)
|
361
|
+
end
|
362
|
+
|
363
|
+
it "should handle a basic search matching on RecordRef using both internalId and externalId" do
|
364
|
+
response = File.read('spec/support/fixtures/search/basic_search_contact.xml')
|
365
|
+
savon.expects(:search)
|
366
|
+
.with(message: {
|
367
|
+
"searchRecord" => {
|
368
|
+
:content! => {
|
369
|
+
"listRel:basic" => {
|
370
|
+
"platformCommon:company" => {
|
371
|
+
"@operator" => "anyOf",
|
372
|
+
"@xsi:type" => "platformCore:SearchMultiSelectField",
|
373
|
+
"platformCore:searchValue" => [
|
374
|
+
{
|
375
|
+
:content! => {},
|
376
|
+
"@xsi:type" => "platformCore:RecordRef",
|
377
|
+
"@type" => "account",
|
378
|
+
"@internalId" => 7497,
|
379
|
+
"@externalId" => "external_abc",
|
380
|
+
},
|
381
|
+
{
|
382
|
+
:content! => {},
|
383
|
+
"@xsi:type" => "platformCore:RecordRef",
|
384
|
+
"@type" => "account",
|
385
|
+
"@externalId" => 7270,
|
386
|
+
},
|
387
|
+
],
|
388
|
+
},
|
389
|
+
},
|
390
|
+
},
|
391
|
+
"@xsi:type" => "listRel:ContactSearch",
|
392
|
+
},
|
393
|
+
}).returns(response)
|
394
|
+
|
395
|
+
search = NetSuite::Records::Contact.search(
|
396
|
+
basic: [{
|
397
|
+
field: 'company',
|
398
|
+
operator: 'anyOf',
|
399
|
+
value: [
|
400
|
+
NetSuite::Records::RecordRef.new(internal_id: 7497, external_id: "external_abc"),
|
401
|
+
NetSuite::Records::RecordRef.new(external_id: 7270),
|
402
|
+
],
|
403
|
+
}],
|
404
|
+
)
|
405
|
+
|
406
|
+
expect(search.results.size).to eq(1)
|
407
|
+
end
|
408
|
+
|
204
409
|
skip "should handle searching basic fields"
|
205
410
|
skip "should handle searching with joined fields"
|
206
411
|
end
|
@@ -7,27 +7,117 @@ describe NetSuite::Records::Estimate do
|
|
7
7
|
|
8
8
|
it 'has all the right fields' do
|
9
9
|
[
|
10
|
-
:alt_handling_cost,
|
11
|
-
:
|
12
|
-
:
|
10
|
+
:alt_handling_cost,
|
11
|
+
:alt_sales_total,
|
12
|
+
:alt_shipping_cost,
|
13
|
+
:can_have_stackable,
|
14
|
+
:contrib_pct,
|
15
|
+
:created_date,
|
16
|
+
:currency_name,
|
17
|
+
:discount_rate,
|
18
|
+
:discount_total,
|
19
|
+
:due_date,
|
20
|
+
:email,
|
21
|
+
:end_date,
|
22
|
+
:est_gross_profit,
|
23
|
+
:est_gross_profit_percent,
|
13
24
|
:exchange_rate,
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
25
|
+
:expected_close_date,
|
26
|
+
:fax,
|
27
|
+
:fob,
|
28
|
+
:handling_cost,
|
29
|
+
:handling_tax1_rate,
|
30
|
+
:handling_tax2_rate,
|
31
|
+
:include_in_forecast,
|
32
|
+
:is_taxable,
|
33
|
+
:last_modified_date,
|
34
|
+
:linked_tracking_numbers,
|
35
|
+
:memo,
|
36
|
+
:message,
|
37
|
+
:one_time,
|
38
|
+
:other_ref_num,
|
39
|
+
:probability,
|
40
|
+
:recur_annually,
|
41
|
+
:recur_monthly,
|
42
|
+
:recur_quarterly,
|
43
|
+
:recur_weekly,
|
44
|
+
:ship_date,
|
45
|
+
:ship_is_residential,
|
46
|
+
:shipping_cost,
|
47
|
+
:shipping_tax1_rate,
|
48
|
+
:shipping_tax2_rate,
|
49
|
+
:source,
|
50
|
+
:start_date,
|
51
|
+
:status,
|
52
|
+
:sub_total,
|
53
|
+
:sync_partner_teams,
|
54
|
+
:sync_sales_teams,
|
55
|
+
:tax2_total,
|
56
|
+
:tax_details_override,
|
57
|
+
:tax_point_date,
|
58
|
+
:tax_rate,
|
59
|
+
:tax_reg_override,
|
60
|
+
:tax_total,
|
61
|
+
:title,
|
62
|
+
:to_be_emailed,
|
63
|
+
:to_be_faxed,
|
64
|
+
:to_be_printed,
|
65
|
+
:total,
|
66
|
+
:total_cost_estimate,
|
67
|
+
:tracking_numbers,
|
68
|
+
:tran_date,
|
69
|
+
:tran_id,
|
70
|
+
:vat_reg_num,
|
71
|
+
:visible_to_customer,
|
20
72
|
].each do |field|
|
21
73
|
expect(estimate).to have_field(field)
|
22
74
|
end
|
23
75
|
end
|
24
76
|
|
77
|
+
it 'has all the right fields with specific classes' do
|
78
|
+
{
|
79
|
+
billing_address: NetSuite::Records::Address,
|
80
|
+
custom_field_list: NetSuite::Records::CustomFieldList,
|
81
|
+
item_list: NetSuite::Records::EstimateItemList,
|
82
|
+
promotions_list: NetSuite::Records::PromotionsList,
|
83
|
+
shipping_address: NetSuite::Records::Address,
|
84
|
+
}.each do |field, klass|
|
85
|
+
expect(estimate).to have_field(field, klass)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
25
89
|
it 'has all the right record refs' do
|
26
90
|
[
|
27
|
-
:bill_address_list,
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
91
|
+
:bill_address_list,
|
92
|
+
:billing_schedule,
|
93
|
+
:klass,
|
94
|
+
:created_from,
|
95
|
+
:currency,
|
96
|
+
:custom_form,
|
97
|
+
:department,
|
98
|
+
:discount_item,
|
99
|
+
:entity,
|
100
|
+
:entity_status,
|
101
|
+
:entity_tax_reg_num,
|
102
|
+
:forecast_type,
|
103
|
+
:handling_tax_code,
|
104
|
+
:job,
|
105
|
+
:lead_source,
|
106
|
+
:location,
|
107
|
+
:message_sel,
|
108
|
+
:nexus,
|
109
|
+
:opportunity,
|
110
|
+
:partner,
|
111
|
+
:promo_code,
|
112
|
+
:sales_group,
|
113
|
+
:sales_rep,
|
114
|
+
:ship_address_list,
|
115
|
+
:ship_method,
|
116
|
+
:shipping_tax_code,
|
117
|
+
:subsidiary,
|
118
|
+
:subsidiary_tax_reg_num,
|
119
|
+
:tax_item,
|
120
|
+
:terms,
|
31
121
|
].each do |record_ref|
|
32
122
|
expect(estimate).to have_record_ref(record_ref)
|
33
123
|
end
|