netsuite 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +32 -0
- data/lib/netsuite.rb +5 -1
- data/lib/netsuite/actions/add.rb +4 -4
- data/lib/netsuite/actions/delete.rb +7 -7
- data/lib/netsuite/actions/get.rb +5 -5
- data/lib/netsuite/actions/get_list.rb +24 -11
- data/lib/netsuite/actions/get_select_value.rb +5 -5
- data/lib/netsuite/actions/initialize.rb +5 -5
- data/lib/netsuite/actions/login.rb +33 -0
- data/lib/netsuite/actions/search.rb +5 -5
- data/lib/netsuite/actions/update.rb +5 -5
- data/lib/netsuite/actions/upsert.rb +4 -4
- data/lib/netsuite/configuration.rb +9 -9
- data/lib/netsuite/records/account.rb +1 -1
- data/lib/netsuite/records/custom_field_list.rb +2 -0
- data/lib/netsuite/records/custom_record.rb +1 -1
- data/lib/netsuite/records/customer.rb +9 -6
- data/lib/netsuite/records/deposit.rb +2 -2
- data/lib/netsuite/records/deposit_cash_back.rb +42 -0
- data/lib/netsuite/records/deposit_cash_back_list.rb +32 -0
- data/lib/netsuite/records/deposit_other.rb +45 -0
- data/lib/netsuite/records/deposit_other_list.rb +32 -0
- data/lib/netsuite/records/item_fulfillment.rb +7 -1
- data/lib/netsuite/records/item_fulfillment_item.rb +1 -1
- data/lib/netsuite/records/item_fulfillment_package_list.rb +22 -1
- data/lib/netsuite/records/sales_order.rb +1 -1
- data/lib/netsuite/records/service_sale_item.rb +1 -1
- data/lib/netsuite/support/requests.rb +5 -4
- data/lib/netsuite/version.rb +1 -1
- data/netsuite.gemspec +1 -1
- data/spec/netsuite/actions/add_spec.rb +5 -5
- data/spec/netsuite/actions/delete_spec.rb +2 -2
- data/spec/netsuite/actions/get_spec.rb +4 -4
- data/spec/netsuite/actions/initialize_spec.rb +2 -2
- data/spec/netsuite/actions/search_spec.rb +6 -6
- data/spec/netsuite/actions/update_spec.rb +4 -4
- data/spec/netsuite/actions/upsert_spec.rb +5 -5
- data/spec/netsuite/records/account_spec.rb +6 -6
- data/spec/netsuite/records/accounting_period_spec.rb +6 -6
- data/spec/netsuite/records/classification_spec.rb +4 -4
- data/spec/netsuite/records/credit_memo_spec.rb +8 -8
- data/spec/netsuite/records/custom_field_list_spec.rb +10 -0
- data/spec/netsuite/records/custom_field_spec.rb +1 -1
- data/spec/netsuite/records/custom_record_ref_spec.rb +1 -1
- data/spec/netsuite/records/custom_record_spec.rb +6 -6
- data/spec/netsuite/records/custom_record_type_spec.rb +6 -6
- data/spec/netsuite/records/customer_payment_spec.rb +9 -9
- data/spec/netsuite/records/customer_refund_spec.rb +8 -8
- data/spec/netsuite/records/customer_spec.rb +10 -10
- data/spec/netsuite/records/department_spec.rb +6 -6
- data/spec/netsuite/records/deposit_spec.rb +10 -10
- data/spec/netsuite/records/inventory_item_spec.rb +6 -6
- data/spec/netsuite/records/invoice_spec.rb +8 -8
- data/spec/netsuite/records/item_fulfillment_package_list_spec.rb +27 -0
- data/spec/netsuite/records/item_fulfillment_spec.rb +49 -0
- data/spec/netsuite/records/job_spec.rb +8 -8
- data/spec/netsuite/records/journal_entry_spec.rb +6 -6
- data/spec/netsuite/records/location_spec.rb +2 -2
- data/spec/netsuite/records/non_inventory_sale_item_spec.rb +6 -6
- data/spec/netsuite/records/payment_method_spec.rb +2 -2
- data/spec/netsuite/records/rev_rec_template_spec.rb +2 -2
- data/spec/netsuite/records/sales_order_spec.rb +9 -9
- data/spec/netsuite/records/service_sale_item_spec.rb +6 -6
- data/spec/netsuite/records/support_case_spec.rb +8 -8
- data/spec/netsuite/records/term_spec.rb +6 -6
- data/spec/netsuite/support/actions_spec.rb +1 -1
- data/spec/netsuite/support/attributes_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +13 -5
- data/lib/netsuite/actions/search_more_with_id.rb +0 -107
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netsuite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Moran
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-06-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -30,13 +30,13 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2.
|
33
|
+
version: '2.99'
|
34
34
|
prerelease: false
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - ~>
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '2.
|
39
|
+
version: '2.99'
|
40
40
|
name: rspec
|
41
41
|
type: :development
|
42
42
|
description: NetSuite SuiteTalk API Wrapper
|
@@ -60,8 +60,8 @@ files:
|
|
60
60
|
- lib/netsuite/actions/get_list.rb
|
61
61
|
- lib/netsuite/actions/get_select_value.rb
|
62
62
|
- lib/netsuite/actions/initialize.rb
|
63
|
+
- lib/netsuite/actions/login.rb
|
63
64
|
- lib/netsuite/actions/search.rb
|
64
|
-
- lib/netsuite/actions/search_more_with_id.rb
|
65
65
|
- lib/netsuite/actions/update.rb
|
66
66
|
- lib/netsuite/actions/upsert.rb
|
67
67
|
- lib/netsuite/configuration.rb
|
@@ -112,6 +112,10 @@ files:
|
|
112
112
|
- lib/netsuite/records/customer_refund_deposit_list.rb
|
113
113
|
- lib/netsuite/records/department.rb
|
114
114
|
- lib/netsuite/records/deposit.rb
|
115
|
+
- lib/netsuite/records/deposit_cash_back.rb
|
116
|
+
- lib/netsuite/records/deposit_cash_back_list.rb
|
117
|
+
- lib/netsuite/records/deposit_other.rb
|
118
|
+
- lib/netsuite/records/deposit_other_list.rb
|
115
119
|
- lib/netsuite/records/deposit_payment.rb
|
116
120
|
- lib/netsuite/records/deposit_payment_list.rb
|
117
121
|
- lib/netsuite/records/duration.rb
|
@@ -196,6 +200,8 @@ files:
|
|
196
200
|
- spec/netsuite/records/invoice_item_list_spec.rb
|
197
201
|
- spec/netsuite/records/invoice_item_spec.rb
|
198
202
|
- spec/netsuite/records/invoice_spec.rb
|
203
|
+
- spec/netsuite/records/item_fulfillment_package_list_spec.rb
|
204
|
+
- spec/netsuite/records/item_fulfillment_spec.rb
|
199
205
|
- spec/netsuite/records/job_spec.rb
|
200
206
|
- spec/netsuite/records/journal_entry_line_list_spec.rb
|
201
207
|
- spec/netsuite/records/journal_entry_line_spec.rb
|
@@ -308,6 +314,8 @@ test_files:
|
|
308
314
|
- spec/netsuite/records/invoice_item_list_spec.rb
|
309
315
|
- spec/netsuite/records/invoice_item_spec.rb
|
310
316
|
- spec/netsuite/records/invoice_spec.rb
|
317
|
+
- spec/netsuite/records/item_fulfillment_package_list_spec.rb
|
318
|
+
- spec/netsuite/records/item_fulfillment_spec.rb
|
311
319
|
- spec/netsuite/records/job_spec.rb
|
312
320
|
- spec/netsuite/records/journal_entry_line_list_spec.rb
|
313
321
|
- spec/netsuite/records/journal_entry_line_spec.rb
|
@@ -1,107 +0,0 @@
|
|
1
|
-
# TODO Tests
|
2
|
-
# TODO this is broken with the current search implementation
|
3
|
-
|
4
|
-
module NetSuite
|
5
|
-
module Actions
|
6
|
-
class SearchMoreWithId
|
7
|
-
include Support::Requests
|
8
|
-
|
9
|
-
def initialize(klass, options = { })
|
10
|
-
@klass = klass
|
11
|
-
|
12
|
-
@options = options
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def request
|
18
|
-
connection.request(:search_more_with_id) do
|
19
|
-
soap.namespaces['xmlns:platformMsgs'] = "urn:messages_#{NetSuite::Configuration.api_version}.platform.webservices.netsuite.com"
|
20
|
-
soap.namespaces['xmlns:platformCore'] = "urn:core_#{NetSuite::Configuration.api_version}.platform.webservices.netsuite.com"
|
21
|
-
soap.namespaces['xmlns:platformCommon'] = "urn:common_#{NetSuite::Configuration.api_version}.platform.webservices.netsuite.com"
|
22
|
-
soap.namespaces['xmlns:listRel'] = "urn:relationships_#{NetSuite::Configuration.api_version}.lists.webservices.netsuite.com"
|
23
|
-
soap.namespaces['xmlns:tranSales'] = "urn:sales_#{NetSuite::Configuration.api_version}.transactions.webservices.netsuite.com"
|
24
|
-
|
25
|
-
soap.header = auth_header
|
26
|
-
|
27
|
-
soap.body = request_body
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# TODO: Consistent use of namespace qualifying
|
32
|
-
def request_body
|
33
|
-
buffer = ''
|
34
|
-
|
35
|
-
xml = Builder::XmlMarkup.new(target: buffer)
|
36
|
-
|
37
|
-
xml.platformMsgs(:searchId, @options[:search_id])
|
38
|
-
xml.platformMsgs(:pageIndex, @options[:page].present? ? @options[:page] : 2)
|
39
|
-
|
40
|
-
buffer
|
41
|
-
end
|
42
|
-
|
43
|
-
def response_body
|
44
|
-
@response_body ||= response_body_hash
|
45
|
-
end
|
46
|
-
|
47
|
-
def response_body_hash
|
48
|
-
@response_body_hash = @response[:search_more_with_id_response][:search_result]
|
49
|
-
end
|
50
|
-
|
51
|
-
def success?
|
52
|
-
@success ||= response_body_hash[:status][:@is_success] == 'true'
|
53
|
-
end
|
54
|
-
|
55
|
-
# TODO: Refactor
|
56
|
-
def more?
|
57
|
-
@more ||= response_body_hash[:page_index] < response_body_hash[:total_pages]
|
58
|
-
end
|
59
|
-
|
60
|
-
module Support
|
61
|
-
def self.included(base)
|
62
|
-
base.extend(ClassMethods)
|
63
|
-
end
|
64
|
-
|
65
|
-
# TODO: Rename page_index to page
|
66
|
-
module ClassMethods
|
67
|
-
# Preconditions
|
68
|
-
# => options[:search_id] is a string
|
69
|
-
# => options[:page], optional, is an integer
|
70
|
-
# Postconditions
|
71
|
-
# => Hash with the following keys:
|
72
|
-
# * page_index which is an integer
|
73
|
-
# * total_pages which is an integer
|
74
|
-
# * search_results containing array of SearchResult's
|
75
|
-
def search_more_with_id(options = { })
|
76
|
-
response = NetSuite::Actions::SearchMoreWithId.call(self, options)
|
77
|
-
|
78
|
-
response_hash = { }
|
79
|
-
|
80
|
-
if response.success?
|
81
|
-
search_results = []
|
82
|
-
|
83
|
-
if response.body[:search_row_list].present?
|
84
|
-
response.body[:search_row_list][:search_row].each do |record|
|
85
|
-
search_result = NetSuite::Support::SearchResult.new(record)
|
86
|
-
|
87
|
-
search_results << search_result
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
page_index = response.body[:page_index]
|
92
|
-
total_pages = response.body[:total_pages]
|
93
|
-
|
94
|
-
response_hash[:page_index] = page_index
|
95
|
-
response_hash[:total_pages] = total_pages
|
96
|
-
response_hash[:search_results] = search_results
|
97
|
-
|
98
|
-
response_hash
|
99
|
-
else
|
100
|
-
raise ArgumentError
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|