netsuite 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ODNjODA3MjM1ZDkyNWJkYWZkZWQ3NWIxNTFiMDJjODYxNzY0MWJiYw==
5
+ data.tar.gz: !binary |-
6
+ ZmE3YTNhMjRhNTRiZmRiY2Q5MzJkMDJkYWNkNWI0MzY5MTcyY2QyZg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZjBlOGYzODFkNzg3NjQxZTdlYmExMmRmNmRkMzI5YzBkMDFiYjAzOWQ5ZWMw
10
+ YTIyNWRkYWQ5Y2MxNjNmNGNkYmJkZDM5ZDllMjc1YWJkZTk4MjM2MzZhMjU4
11
+ NmJhYjQyYmVmZmJjMjkzN2UwMzYwM2QzMTk1YjE1Nzk4NWNmODg=
12
+ data.tar.gz: !binary |-
13
+ YjZiZDAxYWY5ZWRkNjg4OTY0NWIxYzY1MjUxYzQwZjdjZDEzM2FmNjM3ZGYw
14
+ NmMxNzQxYzQ5OTcxYmNhNzgwNjJiMjQwNzc0ZGVhOTE0MzA3ODJiOTMxMzcz
15
+ ZTA4Mjk5MjU3MzdlMGViYjg4OTRiZWE5YWY4ZjY4YzJjOWZkMTU=
data/README.md CHANGED
@@ -254,6 +254,8 @@ NetSuite::Configuration.connection.call :get_customization_id, message: {
254
254
  'platformMsgs:includeInactives' => 'false'
255
255
  }
256
256
 
257
+ server_time_response = NetSuite::Configuration.connection.call :get_server_time
258
+ server_time_response.body[:get_server_time_response][:get_server_time_result][:server_time]
257
259
  ```
258
260
 
259
261
 
@@ -66,6 +66,7 @@ module NetSuite
66
66
  autoload :Customer, 'netsuite/records/customer'
67
67
  autoload :CustomerAddressbook, 'netsuite/records/customer_addressbook'
68
68
  autoload :CustomerAddressbookList, 'netsuite/records/customer_addressbook_list'
69
+ autoload :CustomerDeposit, 'netsuite/records/customer_deposit'
69
70
  autoload :CustomerPayment, 'netsuite/records/customer_payment'
70
71
  autoload :CustomerPaymentApply, 'netsuite/records/customer_payment_apply'
71
72
  autoload :CustomerPaymentApplyList, 'netsuite/records/customer_payment_apply_list'
@@ -91,6 +92,7 @@ module NetSuite
91
92
  autoload :JournalEntryLineList, 'netsuite/records/journal_entry_line_list'
92
93
  autoload :KitItem, 'netsuite/records/kit_item'
93
94
  autoload :Location, 'netsuite/records/location'
95
+ autoload :LocationsList, 'netsuite/records/locations_list'
94
96
  autoload :NonInventorySaleItem, 'netsuite/records/non_inventory_sale_item'
95
97
  autoload :PaymentMethod, 'netsuite/records/payment_method'
96
98
  autoload :PhoneCall, 'netsuite/records/phone_call'
@@ -3,6 +3,8 @@ module NetSuite
3
3
  class Add
4
4
  include Support::Requests
5
5
 
6
+ attr_reader :response_hash
7
+
6
8
  def initialize(object = nil)
7
9
  @object = object
8
10
  end
@@ -37,7 +39,7 @@ module NetSuite
37
39
  if @object.respond_to?(:external_id) && @object.external_id
38
40
  hash['platformMsgs:record']['@platformMsgs:externalId'] = @object.external_id
39
41
  end
40
-
42
+
41
43
  hash
42
44
  end
43
45
 
@@ -49,14 +51,30 @@ module NetSuite
49
51
  @response_body ||= response_hash[:base_ref]
50
52
  end
51
53
 
54
+ def response_errors
55
+ if response_hash[:status] && response_hash[:status][:status_detail]
56
+ @response_errors ||= errors
57
+ end
58
+ end
59
+
52
60
  def response_hash
53
61
  @response_hash ||= @response.to_hash[:add_response][:write_response]
54
62
  end
55
63
 
64
+ def errors
65
+ error_obj = response_hash[:status][:status_detail]
66
+ error_obj = [error_obj] if error_obj.class == Hash
67
+ error_obj.map do |error|
68
+ NetSuite::Error.new(error)
69
+ end
70
+ end
71
+
56
72
  module Support
57
73
  def add
58
74
  response = NetSuite::Actions::Add.call(self)
59
75
 
76
+ @errors = response.errors
77
+
60
78
  if response.success?
61
79
  @internal_id = response.body[:@internal_id]
62
80
  true
@@ -8,15 +8,21 @@ module NetSuite
8
8
  @options = options
9
9
  end
10
10
 
11
- private
11
+ def class_name
12
+ @class_name ||= if @klass.respond_to? :search_class_name
13
+ @klass.search_class_name
14
+ else
15
+ @klass.to_s.split("::").last
16
+ end
17
+ end
12
18
 
19
+ private
13
20
  def request
14
21
  # https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/SettingSearchPreferences.html
15
22
  # https://webservices.netsuite.com/xsd/platform/v2012_2_0/messages.xsd
16
-
17
23
  preferences = NetSuite::Configuration.auth_header
18
24
  preferences = preferences.merge(
19
- (@options[:preferences] || {}).inject({'platformMsgs:SearchPreferences' => {}}) do |h, (k, v)|
25
+ (@options.delete(:preferences) || {}).inject({'platformMsgs:SearchPreferences' => {}}) do |h, (k, v)|
20
26
  h['platformMsgs:SearchPreferences'][k.to_s.lower_camelcase] = v
21
27
  h
22
28
  end
@@ -56,9 +62,7 @@ module NetSuite
56
62
  # TODO find cleaner solution for pulling the namespace of the record, which is a instance method
57
63
  example_instance = @klass.new
58
64
  namespace = example_instance.record_namespace
59
-
60
65
  # extract the class name
61
- class_name = @klass.to_s.split("::").last
62
66
 
63
67
  criteria_structure = {}
64
68
  columns_structure = columns
@@ -237,4 +241,4 @@ module NetSuite
237
241
  end
238
242
  end
239
243
  end
240
- end
244
+ end
@@ -9,21 +9,7 @@ module NetSuite
9
9
  end
10
10
 
11
11
  def request
12
- api_version = NetSuite::Configuration.api_version
13
-
14
- NetSuite::Configuration.connection(
15
- namespaces: {
16
- 'xmlns:platformMsgs' => "urn:messages_#{api_version}.platform.webservices.netsuite.com",
17
- 'xmlns:platformCore' => "urn:core_#{api_version}.platform.webservices.netsuite.com",
18
- 'xmlns:listRel' => "urn:relationships_#{api_version}.lists.webservices.netsuite.com",
19
- 'xmlns:tranSales' => "urn:sales_#{api_version}.transactions.webservices.netsuite.com",
20
- 'xmlns:platformCommon' => "urn:common_#{api_version}.platform.webservices.netsuite.com",
21
- 'xmlns:listAcct' => "urn:accounting_#{api_version}.lists.webservices.netsuite.com",
22
- 'xmlns:actSched' => "urn:scheduling_#{api_version}.activities.webservices.netsuite.com",
23
- 'xmlns:tranCust' => "urn:customers_#{api_version}.transactions.webservices.netsuite.com",
24
- 'xmlns:setupCustom' => "urn:customization_#{api_version}.setup.webservices.netsuite.com",
25
- },
26
- ).call :update, :message => request_body
12
+ NetSuite::Configuration.connection.call :update, :message => request_body
27
13
  end
28
14
 
29
15
  # <platformMsgs:update>
@@ -17,8 +17,8 @@ module NetSuite
17
17
  namespaces: namespaces,
18
18
  soap_header: auth_header,
19
19
  pretty_print_xml: true,
20
- logger: logger
21
- # open_timeout: ???
20
+ logger: logger,
21
+ log_level: log_level,
22
22
  }.merge(params))
23
23
  end
24
24
 
@@ -167,9 +167,21 @@ module NetSuite
167
167
  attributes[:log]
168
168
  end
169
169
 
170
- def logger
171
- attributes[:logger] ||= ::Logger.new (log && !log.empty?) ? log : $stdout
170
+ def logger(value = nil)
171
+ attributes[:logger] = if value.nil?
172
+ ::Logger.new((log && !log.empty?) ? log : $stdout)
173
+ else
174
+ value
175
+ end
172
176
  end
173
177
 
178
+ def log_level(value = nil)
179
+ self.log_level = value || :debug
180
+ attributes[:log_level]
181
+ end
182
+
183
+ def log_level=(value)
184
+ attributes[:log_level] ||= value
185
+ end
174
186
  end
175
187
  end
@@ -2,4 +2,14 @@ module NetSuite
2
2
  class RecordNotFound < StandardError; end
3
3
  class InitializationError < StandardError; end
4
4
  class ConfigurationError < StandardError; end
5
+
6
+ class Error
7
+ attr_accessor :type, :code, :message
8
+
9
+ def initialize(args = {})
10
+ @type = args[:@type]
11
+ @code = args[:code]
12
+ @message = args[:message]
13
+ end
14
+ end
5
15
  end
@@ -0,0 +1,34 @@
1
+ module NetSuite
2
+ module Records
3
+ # Adding a Customer Deposit example. The customer associated with the sales
4
+ # order would be linked to the deposit.
5
+ #
6
+ # deposit = CustomerDeposit.new
7
+ # deposit.sales_order = RecordRef.new(internal_id: 7279)
8
+ # deposit.payment = 20
9
+ # deposit.add
10
+ #
11
+ class CustomerDeposit
12
+ include Support::Actions
13
+ include Support::RecordRefs
14
+ include Support::Fields
15
+ include Support::Records
16
+ include Namespaces::TranCust
17
+
18
+ actions :add, :get
19
+
20
+ fields :custom_form, :payment, :tran_date, :exchange_rate
21
+
22
+ record_refs :customer, :sales_order, :account
23
+
24
+ attr_reader :internal_id
25
+ attr_accessor :external_id
26
+
27
+ def initialize(attributes = {})
28
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
29
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
30
+ initialize_from_attributes_hash(attributes)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,10 +1,14 @@
1
1
  module NetSuite
2
2
  module Records
3
3
  class CustomerRefundDepositList
4
+ include Support::Fields
4
5
  include Support::Records
5
6
  include Namespaces::TranCust
6
-
7
+
8
+ fields :replace_all
9
+
7
10
  def initialize(attributes = {})
11
+ initialize_from_attributes_hash(attributes)
8
12
  case attributes[:customer_refund_deposit]
9
13
  when Hash
10
14
  deposits << CustomerRefundDeposit.new(attributes[:customer_refund_deposit])
@@ -12,17 +16,14 @@ module NetSuite
12
16
  attributes[:customer_refund_deposit].each { |deposit| deposits << CustomerRefundDeposit.new(deposit) }
13
17
  end
14
18
  end
15
-
19
+
16
20
  def deposits
17
21
  @deposits ||= []
18
22
  end
19
-
23
+
20
24
  def to_record
21
- deposits.map do |deposit|
22
- { "#{record_namespace}:customerRefundDeposit" => deposit.to_record }
23
- end
25
+ super.merge({ "#{record_namespace}:customerRefundDeposit" => deposits.map(&:to_record) })
24
26
  end
25
-
26
27
  end
27
28
  end
28
- end
29
+ end
@@ -7,7 +7,20 @@ module NetSuite
7
7
  include Support::Actions
8
8
  include Namespaces::ListAcct
9
9
 
10
- actions :get, :add, :delete
10
+ # NOTE NetSuite doesn't have a InventoryItemSearch object. So we use
11
+ # the ItemSearch instead. In order to actually get Inventory Items only
12
+ # you will still have to specify the type:
13
+ #
14
+ # basic: [
15
+ # {
16
+ # field: 'type',
17
+ # operator: 'anyOf',
18
+ # type: 'SearchEnumMultiSelectField',
19
+ # value: ['_inventoryItem']
20
+ # }
21
+ # ]
22
+ #
23
+ actions :get, :add, :delete, :search, :update
11
24
 
12
25
  fields :auto_lead_time, :auto_preferred_stock_level, :auto_reorder_point, :available_to_partners, :average_cost,
13
26
  :copy_description, :cost, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :cost_units, :costing_method,
@@ -43,7 +56,7 @@ module NetSuite
43
56
  field :pricing_matrix, PricingMatrix
44
57
  field :custom_field_list, CustomFieldList
45
58
  field :bin_number_list, BinNumberList
46
- field :pricing_matrix, PricingMatrix
59
+ field :locations_list, LocationsList
47
60
 
48
61
  attr_reader :internal_id
49
62
  attr_accessor :external_id
@@ -54,6 +67,9 @@ module NetSuite
54
67
  initialize_from_attributes_hash(attributes)
55
68
  end
56
69
 
70
+ def self.search_class_name
71
+ "Item"
72
+ end
57
73
  end
58
74
  end
59
75
  end
@@ -20,7 +20,7 @@ module NetSuite
20
20
  :item_cost_disc_rate, :item_cost_disc_tax_1_amt, :item_cost_disc_taxable, :item_cost_discount, :item_cost_list,
21
21
  :item_cost_tax_code, :item_cost_tax_rate_1, :item_cost_tax_rate_2, :item_list, :job, :last_modified_date,
22
22
  :lead_source, :linked_tracking_numbers, :memo, :message, :message_sel, :on_credit_hold, :opportunity,
23
- :other_ref_name, :partners_list, :promo_code, :rev_rec_end_date,
23
+ :other_ref_num, :partners_list, :promo_code, :rev_rec_end_date,
24
24
  :rev_rec_on_rev_commitment, :rev_rec_schedule, :rev_rec_start_date, :revenue_status, :sales_effective_date,
25
25
  :sales_group, :sales_team_list, :ship_address, :ship_date, :ship_group_list,
26
26
  :shipping_cost, :shipping_tax_1_rate, :shipping_tax_2_rate, :shipping_tax_code, :source, :start_date,
@@ -0,0 +1,15 @@
1
+ module NetSuite
2
+ module Records
3
+ class LocationsList
4
+ def initialize(attributes = {})
5
+ attributes[:locations].each do |location|
6
+ locations << location
7
+ end if attributes[:locations]
8
+ end
9
+
10
+ def locations
11
+ @locations ||= []
12
+ end
13
+ end
14
+ end
15
+ end
@@ -19,6 +19,7 @@ module NetSuite
19
19
  :to_be_printed, :total_cost_estimate, :tran_date, :tran_id, :tran_is_vsoe_bundle, :vat_reg_num,
20
20
  :vsoe_auto_calc
21
21
 
22
+ field :transaction_ship_address, ShipAddress
22
23
  field :transaction_bill_address, BillAddress
23
24
  field :item_list, SalesOrderItemList
24
25
  field :custom_field_list, CustomFieldList
@@ -1,11 +1,12 @@
1
1
  module NetSuite
2
2
  class Response
3
- attr_accessor :header, :body
3
+ attr_accessor :header, :body, :errors
4
4
 
5
5
  def initialize(attributes = {})
6
- @success = attributes[:success]
7
- @header = attributes[:header]
8
- @body = attributes[:body]
6
+ @success = attributes[:success]
7
+ @header = attributes[:header]
8
+ @body = attributes[:body]
9
+ @errors = attributes[:errors]
9
10
  end
10
11
 
11
12
  def success!
@@ -2,6 +2,8 @@ module NetSuite
2
2
  module Support
3
3
  module Actions
4
4
 
5
+ attr_accessor :errors
6
+
5
7
  def self.included(base)
6
8
  base.send(:extend, ClassMethods)
7
9
  end
@@ -26,7 +26,7 @@ module NetSuite
26
26
  end
27
27
 
28
28
  def build_response
29
- Response.new(:success => success?, header: response_header, :body => response_body)
29
+ Response.new(success: success?, header: response_header, body: response_body, errors: response_errors)
30
30
  end
31
31
 
32
32
  def success?
@@ -38,6 +38,10 @@ module NetSuite
38
38
  nil
39
39
  end
40
40
 
41
+ def response_errors
42
+ nil
43
+ end
44
+
41
45
  def response_body
42
46
  raise NotImplementedError, 'Please implement a #response_body method'
43
47
  end
@@ -71,6 +71,8 @@ module NetSuite
71
71
  end
72
72
 
73
73
  def results_in_batches
74
+ return if self.total_records.zero?
75
+
74
76
  while @response.body[:total_pages] != @response.body[:page_index]
75
77
  yield results
76
78
 
@@ -1,3 +1,3 @@
1
1
  module Netsuite
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -37,25 +37,80 @@ describe NetSuite::Actions::Add do
37
37
  NetSuite::Records::Invoice.new(:source => 'Google', :total => 100.0)
38
38
  end
39
39
 
40
- before do
41
- savon.expects(:add).with(:message => {
42
- 'platformMsgs:record' => {
43
- :content! => {
44
- 'tranSales:source' => 'Google'
40
+ context 'when successful' do
41
+ before do
42
+ savon.expects(:add).with(:message => {
43
+ 'platformMsgs:record' => {
44
+ :content! => {
45
+ 'tranSales:source' => 'Google'
46
+ },
47
+ '@xsi:type' => 'tranSales:Invoice'
45
48
  },
46
- '@xsi:type' => 'tranSales:Invoice'
47
- },
48
- }).returns(File.read('spec/support/fixtures/add/add_invoice.xml'))
49
+ }).returns(File.read('spec/support/fixtures/add/add_invoice.xml'))
50
+ end
51
+
52
+ it 'makes a valid request to the NetSuite API' do
53
+ NetSuite::Actions::Add.call(invoice)
54
+ end
55
+
56
+ it 'returns a valid Response object' do
57
+ response = NetSuite::Actions::Add.call(invoice)
58
+ response.should be_kind_of(NetSuite::Response)
59
+ response.should be_success
60
+ end
49
61
  end
50
62
 
51
- it 'makes a valid request to the NetSuite API' do
52
- NetSuite::Actions::Add.call(invoice)
63
+ context 'when not successful' do
64
+ before do
65
+ savon.expects(:add).with(:message => {
66
+ 'platformMsgs:record' => {
67
+ :content! => {
68
+ 'tranSales:source' => 'Google'
69
+ },
70
+ '@xsi:type' => 'tranSales:Invoice'
71
+ },
72
+ }).returns(File.read('spec/support/fixtures/add/add_invoice_error.xml'))
73
+ end
74
+
75
+ it 'provides an error method on the object with details about the error' do
76
+ invoice.add
77
+ error = invoice.errors.first
78
+
79
+ error.should be_kind_of(NetSuite::Error)
80
+ error.type.should eq('ERROR')
81
+ error.code.should eq('INVALID_INITIALIZE_REF')
82
+ error.message.should eq('You can not initialize invoice: invalid reference 7281.')
83
+ end
84
+
85
+ it 'provides an error method on the response' do
86
+ response = NetSuite::Actions::Add.call(invoice)
87
+ response.errors.first.should be_kind_of(NetSuite::Error)
88
+ end
53
89
  end
54
90
 
55
- it 'returns a valid Response object' do
56
- response = NetSuite::Actions::Add.call(invoice)
57
- response.should be_kind_of(NetSuite::Response)
58
- response.should be_success
91
+ context 'when not successful with multiple errors' do
92
+ before do
93
+ savon.expects(:add).with(:message => {
94
+ 'platformMsgs:record' => {
95
+ :content! => {
96
+ 'tranSales:source' => 'Google'
97
+ },
98
+ '@xsi:type' => 'tranSales:Invoice'
99
+ },
100
+ }).returns(File.read('spec/support/fixtures/add/add_invoice_multiple_errors.xml'))
101
+ end
102
+
103
+ it 'provides an error method on the object with details about the error' do
104
+ invoice.add
105
+ invoice.errors.length.should eq(2)
106
+
107
+ error = invoice.errors.first
108
+
109
+ error.should be_kind_of(NetSuite::Error)
110
+ error.type.should eq('ERROR')
111
+ error.code.should eq('ERROR')
112
+ error.message.should eq('Some message')
113
+ end
59
114
  end
60
115
  end
61
116
 
@@ -4,8 +4,20 @@ describe NetSuite::Actions::Search do
4
4
  before(:all) { savon.mock! }
5
5
  after(:all) { savon.unmock! }
6
6
 
7
+ context "search class name" do
8
+ it "infers class name if class doesn't specify search class" do
9
+ instance = described_class.new NetSuite::Records::Customer
10
+ expect(instance.class_name).to eq "Customer"
11
+ end
12
+
13
+ it "gets class name from search class specified" do
14
+ instance = described_class.new NetSuite::Records::InventoryItem
15
+ expect(instance.class_name).to eq NetSuite::Records::InventoryItem.search_class_name
16
+ end
17
+ end
18
+
7
19
  context "saved search" do
8
- it "should handle a ID only search" do
20
+ before do
9
21
  savon.expects(:search).with(:message => {
10
22
  'searchRecord' => {
11
23
  '@xsi:type' => 'listRel:CustomerSearchAdvanced',
@@ -13,19 +25,25 @@ describe NetSuite::Actions::Search do
13
25
  :content! => { "listRel:criteria" => {} }
14
26
  },
15
27
  }).returns(File.read('spec/support/fixtures/search/saved_search_customer.xml'))
28
+ end
16
29
 
30
+ it "should handle a ID only search" do
17
31
  result = NetSuite::Records::Customer.search(saved: 500)
18
32
  result.results.size.should == 1
19
33
  result.results.first.email.should == 'aemail@gmail.com'
20
34
  end
21
35
 
22
- it "should handle a ID search with basic params" do
23
-
36
+ it "merges preferences gracefully" do
37
+ expect {
38
+ NetSuite::Records::Customer.search(
39
+ saved: 500,
40
+ preferences: { page_size: 20 }
41
+ )
42
+ }.not_to raise_error
24
43
  end
25
44
 
26
- it "should handle a search with joined params" do
27
-
28
- end
45
+ pending "should handle a ID search with basic params"
46
+ pending "should handle a search with joined params"
29
47
 
30
48
  it "should handle a search with joined params containing custom field search" do
31
49
  savon.expects(:search).with(:message => {
@@ -128,22 +146,12 @@ describe NetSuite::Actions::Search do
128
146
  end
129
147
 
130
148
  context "advanced search" do
131
- it "should handle search column definitions" do
132
-
133
- end
134
-
135
- it "should handle joined search results" do
136
-
137
- end
149
+ pending "should handle search column definitions"
150
+ pending "should handle joined search results"
138
151
  end
139
152
 
140
153
  context "basic search" do
141
- it "should handle searching basic fields" do
142
-
143
- end
144
-
145
- it "should handle searching with joined fields" do
146
-
147
- end
154
+ pending "should handle searching basic fields"
155
+ pending "should handle searching with joined fields"
148
156
  end
149
157
  end
@@ -13,13 +13,11 @@ describe NetSuite::Records::CustomerRefundDepositList do
13
13
  end
14
14
 
15
15
  it 'can represent itself as a SOAP record' do
16
- record = [
17
- {
18
- 'tranCust:customerRefundDeposit' => {
19
- 'tranCust:apply' => false
20
- }
21
- }
22
- ]
16
+ record = {
17
+ 'tranCust:customerRefundDeposit' => [{
18
+ 'tranCust:apply' => false
19
+ }]
20
+ }
23
21
  list.to_record.should eql(record)
24
22
  end
25
23
  end
@@ -18,7 +18,7 @@ describe NetSuite::Records::Invoice do
18
18
  :item_cost_disc_rate, :item_cost_disc_tax_1_amt, :item_cost_disc_taxable, :item_cost_discount, :item_cost_list,
19
19
  :item_cost_tax_code, :item_cost_tax_rate_1, :item_cost_tax_rate_2, :job, :last_modified_date,
20
20
  :lead_source, :linked_tracking_numbers, :memo, :message, :message_sel, :on_credit_hold, :opportunity,
21
- :other_ref_name, :partners_list, :promo_code, :rev_rec_end_date,
21
+ :other_ref_num, :partners_list, :promo_code, :rev_rec_end_date,
22
22
  :rev_rec_on_rev_commitment, :rev_rec_schedule, :rev_rec_start_date, :revenue_status, :sales_effective_date,
23
23
  :sales_group, :sales_team_list, :ship_address, :ship_date, :ship_group_list,
24
24
  :shipping_cost, :shipping_tax_1_rate, :shipping_tax_2_rate, :shipping_tax_code, :source, :start_date,
@@ -63,6 +63,11 @@ describe NetSuite::Records::SalesOrder do
63
63
  it 'can be set from a BillAddress object'
64
64
  end
65
65
 
66
+ describe '#transaction_ship_address' do
67
+ it 'can be set from attributes'
68
+ it 'can be set from a ShipAddress object'
69
+ end
70
+
66
71
  describe '#revenue_status' do
67
72
  it 'can be set from attributes'
68
73
  it 'can be set from a RevenueStatus object'
@@ -0,0 +1,19 @@
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_2011_2.platform.webservices.netsuite.com">
4
+ <platformMsgs:nsId>WEBSERVICES_TSTDRV1141558_0120201413459254121612426069_c2488</platformMsgs:nsId>
5
+ </platformMsgs:documentInfo>
6
+ </soapenv:Header>
7
+ <soapenv:Body>
8
+ <addResponse xmlns="urn:messages_2011_2.platform.webservices.netsuite.com">
9
+ <writeResponse>
10
+ <platformCore:status xmlns:platformCore="urn:core_2011_2.platform.webservices.netsuite.com" isSuccess="false">
11
+ <platformCore:statusDetail type="ERROR">
12
+ <platformCore:code>INVALID_INITIALIZE_REF</platformCore:code>
13
+ <platformCore:message>You can not initialize invoice: invalid reference 7281.</platformCore:message>
14
+ </platformCore:statusDetail>
15
+ </platformCore:status>
16
+ </writeResponse>
17
+ </addResponse>
18
+ </soapenv:Body>
19
+ </soapenv:Envelope>
@@ -0,0 +1,24 @@
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_2011_2.platform.webservices.netsuite.com">
4
+ <platformMsgs:nsId>WEBSERVICES_TSTDRV1141558_012020141341351370832200514_6a6fc5</platformMsgs:nsId>
5
+ </platformMsgs:documentInfo>
6
+ </soapenv:Header>
7
+ <soapenv:Body>
8
+ <addResponse xmlns="urn:messages_2011_2.platform.webservices.netsuite.com">
9
+ <writeResponse>
10
+ <platformCore:status xmlns:platformCore="urn:core_2011_2.platform.webservices.netsuite.com" isSuccess="false">
11
+ <platformCore:statusDetail type="ERROR">
12
+ <platformCore:code>ERROR</platformCore:code>
13
+ <platformCore:message>Some message</platformCore:message>
14
+ </platformCore:statusDetail>
15
+ <platformCore:statusDetail type="ERROR">
16
+ <platformCore:code>ERROR</platformCore:code>
17
+ <platformCore:message>Some message 2</platformCore:message>
18
+ </platformCore:statusDetail>
19
+ </platformCore:status>
20
+ <baseRef internalId="999" type="invoice" xsi:type="ns2:RecordRef" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:core_2_5.platform.webservices.netsuite.com"/>
21
+ </writeResponse>
22
+ </addResponse>
23
+ </soapenv:Body>
24
+ </soapenv:Envelope>
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netsuite
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.2.0
4
+ version: 0.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ryan Moran
@@ -10,40 +9,36 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-11-07 00:00:00.000000000 Z
12
+ date: 2014-02-03 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
- version_requirements: !ruby/object:Gem::Requirement
15
+ name: savon
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
20
  version: 2.3.0
21
- none: false
22
- name: savon
23
21
  type: :runtime
24
22
  prerelease: false
25
- requirement: !ruby/object:Gem::Requirement
23
+ version_requirements: !ruby/object:Gem::Requirement
26
24
  requirements:
27
25
  - - ~>
28
26
  - !ruby/object:Gem::Version
29
27
  version: 2.3.0
30
- none: false
31
28
  - !ruby/object:Gem::Dependency
32
- version_requirements: !ruby/object:Gem::Requirement
29
+ name: rspec
30
+ requirement: !ruby/object:Gem::Requirement
33
31
  requirements:
34
32
  - - ~>
35
33
  - !ruby/object:Gem::Version
36
34
  version: '2.10'
37
- none: false
38
- name: rspec
39
35
  type: :development
40
36
  prerelease: false
41
- requirement: !ruby/object:Gem::Requirement
37
+ version_requirements: !ruby/object:Gem::Requirement
42
38
  requirements:
43
39
  - - ~>
44
40
  - !ruby/object:Gem::Version
45
41
  version: '2.10'
46
- none: false
47
42
  description: NetSuite SuiteTalk API Wrapper
48
43
  email:
49
44
  - ryan.moran@gmail.com
@@ -105,6 +100,7 @@ files:
105
100
  - lib/netsuite/records/customer.rb
106
101
  - lib/netsuite/records/customer_addressbook.rb
107
102
  - lib/netsuite/records/customer_addressbook_list.rb
103
+ - lib/netsuite/records/customer_deposit.rb
108
104
  - lib/netsuite/records/customer_payment.rb
109
105
  - lib/netsuite/records/customer_payment_apply.rb
110
106
  - lib/netsuite/records/customer_payment_apply_list.rb
@@ -128,6 +124,7 @@ files:
128
124
  - lib/netsuite/records/journal_entry_line_list.rb
129
125
  - lib/netsuite/records/kit_item.rb
130
126
  - lib/netsuite/records/location.rb
127
+ - lib/netsuite/records/locations_list.rb
131
128
  - lib/netsuite/records/non_inventory_sale_item.rb
132
129
  - lib/netsuite/records/payment_method.rb
133
130
  - lib/netsuite/records/phone_call.rb
@@ -217,6 +214,8 @@ files:
217
214
  - spec/support/field_matcher.rb
218
215
  - spec/support/fixtures/add/add_customer.xml
219
216
  - spec/support/fixtures/add/add_invoice.xml
217
+ - spec/support/fixtures/add/add_invoice_error.xml
218
+ - spec/support/fixtures/add/add_invoice_multiple_errors.xml
220
219
  - spec/support/fixtures/delete/delete_customer.xml
221
220
  - spec/support/fixtures/get/get_customer.xml
222
221
  - spec/support/fixtures/get/get_invoice.xml
@@ -232,6 +231,7 @@ files:
232
231
  - wsdl/2012_1.wsdl
233
232
  homepage: https://github.com/RevolutionPrep/netsuite
234
233
  licenses: []
234
+ metadata: {}
235
235
  post_install_message:
236
236
  rdoc_options: []
237
237
  require_paths:
@@ -241,18 +241,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
241
241
  - - ! '>='
242
242
  - !ruby/object:Gem::Version
243
243
  version: '0'
244
- none: false
245
244
  required_rubygems_version: !ruby/object:Gem::Requirement
246
245
  requirements:
247
246
  - - ! '>='
248
247
  - !ruby/object:Gem::Version
249
248
  version: '0'
250
- none: false
251
249
  requirements: []
252
250
  rubyforge_project:
253
- rubygems_version: 1.8.23
251
+ rubygems_version: 2.1.11
254
252
  signing_key:
255
- specification_version: 3
253
+ specification_version: 4
256
254
  summary: NetSuite SuiteTalk API Wrapper
257
255
  test_files:
258
256
  - spec/netsuite/actions/add_spec.rb
@@ -320,6 +318,8 @@ test_files:
320
318
  - spec/support/field_matcher.rb
321
319
  - spec/support/fixtures/add/add_customer.xml
322
320
  - spec/support/fixtures/add/add_invoice.xml
321
+ - spec/support/fixtures/add/add_invoice_error.xml
322
+ - spec/support/fixtures/add/add_invoice_multiple_errors.xml
323
323
  - spec/support/fixtures/delete/delete_customer.xml
324
324
  - spec/support/fixtures/get/get_customer.xml
325
325
  - spec/support/fixtures/get/get_invoice.xml