netsuite 0.8.4 → 0.8.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/main.yml +20 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/.tool-versions +1 -0
- data/Gemfile +2 -5
- data/HISTORY.md +26 -0
- data/README.md +72 -29
- data/Rakefile +1 -1
- data/lib/netsuite.rb +13 -19
- data/lib/netsuite/actions/login.rb +10 -2
- data/lib/netsuite/actions/upsert.rb +2 -0
- data/lib/netsuite/configuration.rb +34 -4
- data/lib/netsuite/records/accounting_period.rb +2 -2
- data/lib/netsuite/records/classification.rb +4 -1
- data/lib/netsuite/records/contact.rb +1 -1
- data/lib/netsuite/records/cost_category.rb +28 -0
- data/lib/netsuite/records/credit_memo.rb +1 -1
- data/lib/netsuite/records/custom_field_list.rb +9 -3
- data/lib/netsuite/records/custom_record.rb +1 -1
- data/lib/netsuite/records/customer.rb +2 -1
- data/lib/netsuite/records/customer_credit_cards.rb +36 -0
- data/lib/netsuite/records/customer_credit_cards_list.rb +10 -0
- data/lib/netsuite/records/customer_deposit.rb +5 -5
- data/lib/netsuite/records/customer_payment.rb +6 -2
- data/lib/netsuite/records/customer_payment_credit.rb +17 -0
- data/lib/netsuite/records/customer_payment_credit_list.rb +12 -0
- data/lib/netsuite/records/employee.rb +1 -1
- data/lib/netsuite/records/estimate.rb +42 -0
- data/lib/netsuite/records/estimate_item.rb +40 -0
- data/lib/netsuite/records/estimate_item_list.rb +11 -0
- data/lib/netsuite/records/inventory_item.rb +62 -1
- data/lib/netsuite/records/invoice.rb +94 -1
- data/lib/netsuite/records/item_fulfillment.rb +1 -1
- data/lib/netsuite/records/lot_numbered_inventory_item.rb +116 -0
- data/lib/netsuite/records/matrix_option_list.rb +12 -4
- data/lib/netsuite/records/message.rb +30 -0
- data/lib/netsuite/records/non_inventory_resale_item.rb +1 -0
- data/lib/netsuite/records/non_inventory_sale_item.rb +1 -1
- data/lib/netsuite/records/other_charge_sale_item.rb +2 -2
- data/lib/netsuite/records/partner.rb +7 -5
- data/lib/netsuite/records/serialized_assembly_item.rb +3 -1
- data/lib/netsuite/records/service_resale_item.rb +1 -1
- data/lib/netsuite/records/support_case_type.rb +26 -0
- data/lib/netsuite/records/tax_group.rb +2 -2
- data/lib/netsuite/records/vendor.rb +2 -1
- data/lib/netsuite/records/vendor_currency.rb +26 -0
- data/lib/netsuite/records/vendor_currency_list.rb +9 -0
- data/lib/netsuite/support/fields.rb +16 -0
- data/lib/netsuite/support/records.rb +1 -1
- data/lib/netsuite/support/search_result.rb +36 -6
- data/lib/netsuite/utilities.rb +18 -6
- data/lib/netsuite/version.rb +1 -1
- data/netsuite.gemspec +5 -3
- data/spec/netsuite/actions/search_spec.rb +22 -0
- data/spec/netsuite/configuration_spec.rb +111 -6
- data/spec/netsuite/records/basic_record_spec.rb +9 -1
- data/spec/netsuite/records/classification_spec.rb +10 -1
- data/spec/netsuite/records/cost_category_spec.rb +105 -0
- data/spec/netsuite/records/custom_field_list_spec.rb +46 -6
- data/spec/netsuite/records/custom_record_spec.rb +1 -1
- data/spec/netsuite/records/customer_credit_cards_list_spec.rb +23 -0
- data/spec/netsuite/records/customer_payment_credit_list_spec.rb +26 -0
- data/spec/netsuite/records/customer_payment_spec.rb +1 -6
- data/spec/netsuite/records/customer_spec.rb +22 -1
- data/spec/netsuite/records/employee_spec.rb +2 -2
- data/spec/netsuite/records/estimate_item_list_spec.rb +26 -0
- data/spec/netsuite/records/estimate_item_spec.rb +40 -0
- data/spec/netsuite/records/estimate_spec.rb +216 -0
- data/spec/netsuite/records/inventory_item_spec.rb +65 -0
- data/spec/netsuite/records/invoice_spec.rb +94 -0
- data/spec/netsuite/records/matrix_option_list_spec.rb +15 -5
- data/spec/netsuite/records/message_spec.rb +49 -0
- data/spec/netsuite/records/non_inventory_resale_item_spec.rb +165 -0
- data/spec/netsuite/records/non_inventory_sale_item_spec.rb +1 -1
- data/spec/netsuite/records/partner_spec.rb +143 -0
- data/spec/netsuite/records/service_resale_item_spec.rb +134 -0
- data/spec/netsuite/records/support_case_type_spec.rb +22 -0
- data/spec/netsuite/records/vendor_spec.rb +1 -1
- data/spec/netsuite/support/search_result_spec.rb +24 -0
- data/spec/netsuite/utilities_spec.rb +20 -15
- data/spec/support/fixtures/custom_fields/multi_select.xml +47 -0
- data/spec/support/fixtures/search/saved_search_item.xml +55 -0
- data/spec/support/fixtures/search/saved_search_joined_custom_customer.xml +15 -1
- data/spec/support/search_only_field_matcher.rb +7 -0
- metadata +77 -12
- data/circle.yml +0 -17
@@ -0,0 +1,143 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe NetSuite::Records::Partner do
|
4
|
+
let(:partner) { NetSuite::Records::Partner.new }
|
5
|
+
|
6
|
+
it 'has all the right fields' do
|
7
|
+
[
|
8
|
+
:alt_email, :alt_name, :bcn, :comments, :company_name, :date_created, :default_address,
|
9
|
+
:eligible_for_commission, :email, :entity_id, :fax, :first_name, :give_access, :home_phone, :is_inactive,
|
10
|
+
:is_person, :last_modified_date, :last_name, :login_as, :middle_name, :mobile_phone, :partner_code,
|
11
|
+
:password, :password2, :phone, :phonetic_name, :print_on_check_as, :referring_url, :require_pwd_change,
|
12
|
+
:salutation, :send_email, :sub_partner_login, :tax_id_num, :title, :url, :vat_reg_number
|
13
|
+
].each do |field|
|
14
|
+
expect(partner).to have_field(field)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'has all the right record refs' do
|
19
|
+
[
|
20
|
+
:access_role, :klass, :custom_form, :default_tax_reg, :department, :image, :location, :parent, :subsidiary
|
21
|
+
].each do |record_ref|
|
22
|
+
expect(partner).to have_record_ref(record_ref)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '.get' do
|
27
|
+
context 'when the response is successful' do
|
28
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :account_number => 7 }) }
|
29
|
+
|
30
|
+
it 'returns an Partner instance populated with the data from the response object' do
|
31
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Partner, { :external_id => 1 }], {}).and_return(response)
|
32
|
+
Partner = NetSuite::Records::Partner.get(:external_id => 1)
|
33
|
+
expect(Partner).to be_kind_of(NetSuite::Records::Partner)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'when the response is unsuccessful' do
|
38
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
39
|
+
|
40
|
+
it 'raises a RecordNotFound exception' do
|
41
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Partner, { :external_id => 1 }], {}).and_return(response)
|
42
|
+
expect {
|
43
|
+
NetSuite::Records::Partner.get(:external_id => 1)
|
44
|
+
}.to raise_error(NetSuite::RecordNotFound,
|
45
|
+
/NetSuite::Records::Partner with OPTIONS=(.*) could not be found/)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe '#add' do
|
51
|
+
let(:partner) { NetSuite::Records::Partner.new(:email => 'dale.cooper@example.com') }
|
52
|
+
|
53
|
+
context 'when the response is successful' do
|
54
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
55
|
+
|
56
|
+
it 'returns true' do
|
57
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
58
|
+
with([partner], {}).
|
59
|
+
and_return(response)
|
60
|
+
expect(partner.add).to be_truthy
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context 'when the response is unsuccessful' do
|
65
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
66
|
+
|
67
|
+
it 'returns false' do
|
68
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
69
|
+
with([partner], {}).
|
70
|
+
and_return(response)
|
71
|
+
expect(partner.add).to be_falsey
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe '#delete' do
|
77
|
+
context 'when the response is successful' do
|
78
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
79
|
+
|
80
|
+
it 'returns true' do
|
81
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
82
|
+
with([partner], {}).
|
83
|
+
and_return(response)
|
84
|
+
expect(partner.delete).to be_truthy
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
context 'when the response is unsuccessful' do
|
89
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
90
|
+
|
91
|
+
it 'returns false' do
|
92
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
93
|
+
with([partner], {}).
|
94
|
+
and_return(response)
|
95
|
+
expect(partner.delete).to be_falsey
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe '.update' do
|
101
|
+
context 'when the response is successful' do
|
102
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :email => 'leland.palmer@example.com' }) }
|
103
|
+
|
104
|
+
it 'returns true' do
|
105
|
+
expect(NetSuite::Actions::Update).to receive(:call).with([NetSuite::Records::Partner, { :internal_id => 1, :email => 'leland.palmer@example.com' }], {}).and_return(response)
|
106
|
+
partner = NetSuite::Records::Partner.new(:internal_id => 1)
|
107
|
+
expect(partner.update(:email => 'leland.palmer@example.com')).to be_truthy
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
context 'when the response is unsuccessful' do
|
112
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
113
|
+
|
114
|
+
it 'raises a RecordNotFound exception' do
|
115
|
+
expect(NetSuite::Actions::Update).to receive(:call).with([NetSuite::Records::Partner, { :internal_id => 1, :account_number => 7 }], {}).and_return(response)
|
116
|
+
partner = NetSuite::Records::Partner.new(:internal_id => 1)
|
117
|
+
expect(partner.update(:account_number => 7)).to be_falsey
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
describe '#to_record' do
|
123
|
+
let(:partner) { NetSuite::Records::Partner.new(:email => 'bob@example.com') }
|
124
|
+
|
125
|
+
it 'returns a hash of attributes that can be used in a SOAP request' do
|
126
|
+
expect(partner.to_record).to eql({ 'listRel:email' => 'bob@example.com' })
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
describe '#record_type' do
|
131
|
+
it 'returns a string type for the record to be used in a SOAP request' do
|
132
|
+
expect(partner.record_type).to eql('listRel:Partner')
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
it 'has the right record_refs' do
|
137
|
+
[
|
138
|
+
:klass, :access_role, :department, :subsidiary
|
139
|
+
].each do |record_ref|
|
140
|
+
expect(partner).to have_record_ref(record_ref)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
@@ -0,0 +1,134 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe NetSuite::Records::ServiceResaleItem do
|
4
|
+
let(:item) { NetSuite::Records::ServiceResaleItem.new }
|
5
|
+
|
6
|
+
it 'has the right fields' do
|
7
|
+
[
|
8
|
+
:available_to_partners, :cost, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :create_job, :created_date,
|
9
|
+
:display_name, :dont_show_price, :enforce_min_qty_internally, :exclude_from_sitemap, :featured_description,
|
10
|
+
:include_children, :is_donation_item, :is_fulfillable, :is_gco_compliant, :is_inactive, :is_online, :is_taxable,
|
11
|
+
:item_id, :last_modified_date, :matrix_option_list, :matrix_type, :max_donation_amount, :meta_tag_html,
|
12
|
+
:minimum_quantity, :minimum_quantity_units, :no_price_message, :offer_support, :on_special, :out_of_stock_behavior,
|
13
|
+
:out_of_stock_message, :overall_quantity_pricing_type, :page_title, :presentation_item_list, :prices_include_tax,
|
14
|
+
:show_default_donation_amount, :site_category_list, :sitemap_priority, :soft_descriptor, :specials_description,
|
15
|
+
:store_description, :store_detailed_description, :store_display_name, :translations_list, :upc_code, :url_component,
|
16
|
+
:use_marginal_rates, :vsoe_deferral, :vsoe_delivered, :vsoe_permit_discount, :vsoe_price, :vsoe_sop_group
|
17
|
+
].each do |field|
|
18
|
+
expect(item).to have_field(field)
|
19
|
+
end
|
20
|
+
|
21
|
+
# TODO there is a probably a more robust way to test this
|
22
|
+
expect(item.custom_field_list.class).to eq(NetSuite::Records::CustomFieldList)
|
23
|
+
expect(item.pricing_matrix.class).to eq(NetSuite::Records::PricingMatrix)
|
24
|
+
expect(item.subsidiary_list.class).to eq(NetSuite::Records::RecordRefList)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'has the right record_refs' do
|
28
|
+
[
|
29
|
+
:billing_schedule, :cost_category, :custom_form, :deferred_revenue_account, :department, :income_account,
|
30
|
+
:issue_product, :item_options_list, :klass, :location, :parent, :pricing_group, :purchase_tax_code,
|
31
|
+
:quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :store_display_image,
|
32
|
+
:store_display_thumbnail, :store_item_template, :tax_schedule, :units_type
|
33
|
+
].each do |record_ref|
|
34
|
+
expect(item).to have_record_ref(record_ref)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe '.get' do
|
39
|
+
context 'when the response is successful' do
|
40
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :item_id => 'penguins' }) }
|
41
|
+
|
42
|
+
it 'returns a ServiceResaleItem instance populated with the data from the response object' do
|
43
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::ServiceResaleItem, :external_id => 20], {}).and_return(response)
|
44
|
+
customer = NetSuite::Records::ServiceResaleItem.get(:external_id => 20)
|
45
|
+
expect(customer).to be_kind_of(NetSuite::Records::ServiceResaleItem)
|
46
|
+
expect(customer.item_id).to eql('penguins')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context 'when the response is unsuccessful' do
|
51
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
52
|
+
|
53
|
+
it 'raises a RecordNotFound exception' do
|
54
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::ServiceResaleItem, :external_id => 20], {}).and_return(response)
|
55
|
+
expect {
|
56
|
+
NetSuite::Records::ServiceResaleItem.get(:external_id => 20)
|
57
|
+
}.to raise_error(NetSuite::RecordNotFound,
|
58
|
+
/NetSuite::Records::ServiceResaleItem with OPTIONS=(.*) could not be found/)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe '#add' do
|
64
|
+
let(:item) { NetSuite::Records::ServiceResaleItem.new(:cost => 100, :is_inactive => false) }
|
65
|
+
|
66
|
+
context 'when the response is successful' do
|
67
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
68
|
+
|
69
|
+
it 'returns true' do
|
70
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
71
|
+
with([item], {}).
|
72
|
+
and_return(response)
|
73
|
+
expect(item.add).to be_truthy
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
context 'when the response is unsuccessful' do
|
78
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
79
|
+
|
80
|
+
it 'returns false' do
|
81
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
82
|
+
with([item], {}).
|
83
|
+
and_return(response)
|
84
|
+
expect(item.add).to be_falsey
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
describe '#delete' do
|
90
|
+
context 'when the response is successful' do
|
91
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
92
|
+
|
93
|
+
it 'returns true' do
|
94
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
95
|
+
with([item], {}).
|
96
|
+
and_return(response)
|
97
|
+
expect(item.delete).to be_truthy
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
context 'when the response is unsuccessful' do
|
102
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
103
|
+
|
104
|
+
it 'returns false' do
|
105
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
106
|
+
with([item], {}).
|
107
|
+
and_return(response)
|
108
|
+
expect(item.delete).to be_falsey
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
describe '#to_record' do
|
114
|
+
before do
|
115
|
+
item.item_id = 'penguins'
|
116
|
+
item.is_online = true
|
117
|
+
end
|
118
|
+
|
119
|
+
it 'can represent itself as a SOAP record' do
|
120
|
+
record = {
|
121
|
+
'listAcct:itemId' => 'penguins',
|
122
|
+
'listAcct:isOnline' => true
|
123
|
+
}
|
124
|
+
expect(item.to_record).to eql(record)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
describe '#record_type' do
|
129
|
+
it 'returns a string of the SOAP type' do
|
130
|
+
expect(item.record_type).to eql('listAcct:ServiceResaleItem')
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe NetSuite::Records::SupportCaseType do
|
4
|
+
let(:support_case_type) { NetSuite::Records::SupportCaseType.new }
|
5
|
+
|
6
|
+
it 'has all the right fields' do
|
7
|
+
[
|
8
|
+
:description, :is_inactive, :name
|
9
|
+
].each do |field|
|
10
|
+
expect(support_case_type).to have_field(field)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'has the right record_refs' do
|
15
|
+
[
|
16
|
+
:insert_before
|
17
|
+
].each do |record_ref|
|
18
|
+
expect(support_case_type).to have_record_ref(record_ref)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -7,7 +7,7 @@ describe NetSuite::Records::Vendor do
|
|
7
7
|
[
|
8
8
|
:account_number, :alt_email, :alt_name, :alt_phone, :balance,
|
9
9
|
:balance_primary, :bcn, :bill_pay, :comments, :company_name, :credit_limit,
|
10
|
-
:
|
10
|
+
:date_created, :default_address, :eligible_for_commission,
|
11
11
|
:email, :email_preference, :email_transactions, :entity_id, :fax, :fax_transactions,
|
12
12
|
:first_name, :give_access, :global_subscription_status, :home_phone, :is1099_eligible,
|
13
13
|
:is_accountant, :is_inactive, :is_job_resource_vend, :is_person, :labor_cost,
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe NetSuite::Support::SearchResult do
|
4
|
+
describe '#results' do
|
5
|
+
context 'empty page' do
|
6
|
+
it 'returns empty array' do
|
7
|
+
response_body = {
|
8
|
+
:status => {:@is_success=>"true"},
|
9
|
+
:total_records => "242258",
|
10
|
+
:page_size => "10",
|
11
|
+
:total_pages => "24226",
|
12
|
+
:page_index => "99",
|
13
|
+
:search_id => "WEBSERVICES_4132604_SB1_051620191060155623420663266_336cbf12",
|
14
|
+
:record_list => nil,
|
15
|
+
:"@xmlns:platform_core" => "urn:core_2016_2.platform.webservices.netsuite.com"
|
16
|
+
}
|
17
|
+
response = NetSuite::Response.new(body: response_body)
|
18
|
+
|
19
|
+
results = described_class.new(response, NetSuite::Actions::Search, {}).results
|
20
|
+
expect(results).to eq []
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -3,24 +3,29 @@ require 'spec_helper'
|
|
3
3
|
describe NetSuite::Utilities do
|
4
4
|
describe 'time utilities' do
|
5
5
|
it '#normalize_time_to_netsuite_date' do
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
['Etc/UTC', 'America/Los_Angeles', 'America/Denver'].each do |zone|
|
7
|
+
ENV['TZ'] = zone
|
8
|
+
puts "In zone: #{zone}"
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
stamp = DateTime.parse('Wed, 27 Jul 2016 00:00:00 -0000')
|
11
|
+
formatted_date = NetSuite::Utilities.normalize_time_to_netsuite_date(stamp.to_time.to_i)
|
12
|
+
expect(formatted_date).to eq('2016-07-27T00:00:00-07:00')
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
no_dst_stamp = DateTime.parse('Sun, November 6 2017 00:00:00 -0000')
|
15
|
+
formatted_date = NetSuite::Utilities.normalize_time_to_netsuite_date(no_dst_stamp.to_time.to_i)
|
16
|
+
expect(formatted_date).to eq('2017-11-06T00:00:00-08:00')
|
17
|
+
|
18
|
+
no_dst_stamp_with_time = DateTime.parse('Sun, November 6 2017 12:11:10 -0000')
|
19
|
+
formatted_date = NetSuite::Utilities.normalize_time_to_netsuite_date(no_dst_stamp_with_time.to_time.to_i)
|
20
|
+
expect(formatted_date).to eq('2017-11-06T00:00:00-08:00')
|
21
|
+
end
|
17
22
|
end
|
18
23
|
end
|
19
24
|
|
20
25
|
it "#netsuite_data_center_urls" do
|
21
26
|
domains = NetSuite::Utilities.netsuite_data_center_urls('TSTDRV1576318')
|
22
|
-
expect(domains[:webservices_domain]).to eq('https://
|
23
|
-
expect(domains[:system_domain]).to eq('https://
|
27
|
+
expect(domains[:webservices_domain]).to eq('https://tstdrv1576318.suitetalk.api.netsuite.com')
|
28
|
+
expect(domains[:system_domain]).to eq('https://tstdrv1576318.app.netsuite.com')
|
24
29
|
|
25
30
|
# ensure domains returned don't change when sandbox is enabled
|
26
31
|
NetSuite.configure do
|
@@ -29,8 +34,8 @@ describe NetSuite::Utilities do
|
|
29
34
|
end
|
30
35
|
|
31
36
|
domains = NetSuite::Utilities.netsuite_data_center_urls('TSTDRV1576318')
|
32
|
-
expect(domains[:webservices_domain]).to eq('https://
|
33
|
-
expect(domains[:system_domain]).to eq('https://
|
37
|
+
expect(domains[:webservices_domain]).to eq('https://tstdrv1576318.suitetalk.api.netsuite.com')
|
38
|
+
expect(domains[:system_domain]).to eq('https://tstdrv1576318.app.netsuite.com')
|
34
39
|
|
35
40
|
NetSuite.configure do
|
36
41
|
reset!
|
@@ -38,8 +43,8 @@ describe NetSuite::Utilities do
|
|
38
43
|
end
|
39
44
|
|
40
45
|
domains = NetSuite::Utilities.netsuite_data_center_urls('TSTDRV1576318')
|
41
|
-
expect(domains[:webservices_domain]).to eq('https://
|
42
|
-
expect(domains[:system_domain]).to eq('https://
|
46
|
+
expect(domains[:webservices_domain]).to eq('https://tstdrv1576318.suitetalk.api.netsuite.com')
|
47
|
+
expect(domains[:system_domain]).to eq('https://tstdrv1576318.app.netsuite.com')
|
43
48
|
|
44
49
|
domains = NetSuite::Utilities.netsuite_data_center_urls('4810331')
|
45
50
|
expect(domains[:webservices_domain]).to eq('https://4810331.suitetalk.api.netsuite.com')
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
2
|
+
<soapenv:Header>
|
3
|
+
<platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2017_2.platform.webservices.netsuite.com">
|
4
|
+
<platformMsgs:nsId>WEBSERVICES_4384362_0714202114843454571284681300_c8529d78de5</platformMsgs:nsId>
|
5
|
+
</platformMsgs:documentInfo>
|
6
|
+
</soapenv:Header>
|
7
|
+
<soapenv:Body>
|
8
|
+
<getResponse xmlns="urn:messages_2017_2.platform.webservices.netsuite.com">
|
9
|
+
<readResponse>
|
10
|
+
<platformCore:status xmlns:platformCore="urn:core_2017_2.platform.webservices.netsuite.com" isSuccess="true"/>
|
11
|
+
<record xmlns:tranCust="urn:customers_2017_2.transactions.webservices.netsuite.com" internalId="9948394" xsi:type="tranCust:CreditMemo">
|
12
|
+
<tranCust:createdDate>2021-07-14T12:45:42.000-07:00</tranCust:createdDate>
|
13
|
+
<tranCust:lastModifiedDate>2021-07-14T14:56:35.000-07:00</tranCust:lastModifiedDate>
|
14
|
+
<tranCust:customFieldList xmlns:platformCore="urn:core_2017_2.platform.webservices.netsuite.com">
|
15
|
+
<platformCore:customField internalId="520" scriptId="custbody_standard_select" xsi:type="platformCore:SelectCustomFieldRef">
|
16
|
+
<platformCore:value internalId="2" typeId="142">
|
17
|
+
<platformCore:name>Manual</platformCore:name>
|
18
|
+
</platformCore:value>
|
19
|
+
</platformCore:customField>
|
20
|
+
<platformCore:customField internalId="26" scriptId="custbody_date_field" xsi:type="platformCore:DateCustomFieldRef">
|
21
|
+
<platformCore:value>2021-07-13T22:00:00.000-07:00</platformCore:value>
|
22
|
+
</platformCore:customField>
|
23
|
+
<platformCore:customField internalId="1371" scriptId="custbody_string_field" xsi:type="platformCore:StringCustomFieldRef">
|
24
|
+
<platformCore:value>a very nice string</platformCore:value>
|
25
|
+
</platformCore:customField>
|
26
|
+
<platformCore:customField internalId="1593" scriptId="custbody_boolean_field" xsi:type="platformCore:BooleanCustomFieldRef">
|
27
|
+
<platformCore:value>false</platformCore:value>
|
28
|
+
</platformCore:customField>
|
29
|
+
<platformCore:customField internalId="1552" scriptId="custbody_multi_select_field" xsi:type="platformCore:MultiSelectCustomFieldRef">
|
30
|
+
<platformCore:value internalId="7623" typeId="164">
|
31
|
+
<platformCore:name>selection value</platformCore:name>
|
32
|
+
</platformCore:value>
|
33
|
+
</platformCore:customField>
|
34
|
+
<platformCore:customField internalId="1553" scriptId="custbody_multi_select_with_multiple" xsi:type="platformCore:MultiSelectCustomFieldRef">
|
35
|
+
<platformCore:value internalId="7613" typeId="164">
|
36
|
+
<platformCore:name>selection value 1</platformCore:name>
|
37
|
+
</platformCore:value>
|
38
|
+
<platformCore:value internalId="7614" typeId="165">
|
39
|
+
<platformCore:name>selection value 2</platformCore:name>
|
40
|
+
</platformCore:value>
|
41
|
+
</platformCore:customField>
|
42
|
+
</tranCust:customFieldList>
|
43
|
+
</record>
|
44
|
+
</readResponse>
|
45
|
+
</getResponse>
|
46
|
+
</soapenv:Body>
|
47
|
+
</soapenv:Envelope>
|