netsuite 0.7.8 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-version +1 -1
- data/Gemfile +2 -0
- data/lib/netsuite.rb +6 -0
- data/lib/netsuite/actions/search.rb +12 -16
- data/lib/netsuite/configuration.rb +21 -5
- data/lib/netsuite/core_ext/string/lower_camelcase.rb +2 -2
- data/lib/netsuite/records/custom_field_list.rb +10 -5
- data/lib/netsuite/records/custom_record_ref.rb +1 -1
- data/lib/netsuite/records/customer.rb +1 -1
- data/lib/netsuite/records/inventory_adjustment.rb +30 -0
- data/lib/netsuite/records/inventory_adjustment_inventory.rb +21 -0
- data/lib/netsuite/records/inventory_adjustment_inventory_list.rb +10 -0
- data/lib/netsuite/records/inventory_transfer.rb +1 -1
- data/lib/netsuite/records/item_member.rb +5 -0
- data/lib/netsuite/records/member_list.rb +0 -1
- data/lib/netsuite/records/vendor_return_authorization.rb +30 -0
- data/lib/netsuite/records/vendor_return_authorization_item.rb +23 -0
- data/lib/netsuite/records/vendor_return_authorization_item_list.rb +12 -0
- data/lib/netsuite/version.rb +1 -1
- data/spec/netsuite/actions/search_spec.rb +50 -40
- data/spec/netsuite/configuration_spec.rb +17 -10
- data/spec/netsuite/records/basic_record_spec.rb +2 -0
- data/spec/netsuite/records/custom_field_list_spec.rb +36 -0
- metadata +20 -20
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 37636c6c1899441452fd3042cf52037b76680616
|
4
|
+
data.tar.gz: 15c8900ac424109bdece121e2abbc3902a47bf7e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 08d79d1b7ee99dde3b063afab044f47a4d21e2628d15d9bd0119fc81de3fca087e6d5c85b882e5ae6b844e66e9016cfebd204b61cd0656e9b09c02c6880e23e1
|
7
|
+
data.tar.gz: df7df5ffb7fd5a7815241ef70ac3d29ff46d07d9f26c770e079e663a2450f45e33f535a603d8dfb1221d091297b902472c2c66ba9404d3cc880faaa5341e8e7e
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.3.0
|
data/Gemfile
CHANGED
data/lib/netsuite.rb
CHANGED
@@ -141,6 +141,9 @@ module NetSuite
|
|
141
141
|
autoload :GiftCertRedemption, 'netsuite/records/gift_cert_redemption'
|
142
142
|
autoload :GiftCertRedemptionList, 'netsuite/records/gift_cert_redemption_list'
|
143
143
|
autoload :Folder, 'netsuite/records/folder'
|
144
|
+
autoload :InventoryAdjustment, 'netsuite/records/inventory_adjustment'
|
145
|
+
autoload :InventoryAdjustmentInventory, 'netsuite/records/inventory_adjustment_inventory'
|
146
|
+
autoload :InventoryAdjustmentInventoryList, 'netsuite/records/inventory_adjustment_inventory_list'
|
144
147
|
autoload :InventoryAssignment, 'netsuite/records/inventory_assignment'
|
145
148
|
autoload :InventoryAssignmentList, 'netsuite/records/inventory_assignment_list'
|
146
149
|
autoload :InventoryDetail, 'netsuite/records/inventory_detail'
|
@@ -239,6 +242,9 @@ module NetSuite
|
|
239
242
|
autoload :VendorCreditItemList, 'netsuite/records/vendor_credit_item_list'
|
240
243
|
autoload :VendorCreditExpense, 'netsuite/records/vendor_credit_expense'
|
241
244
|
autoload :VendorCreditExpenseList, 'netsuite/records/vendor_credit_expense_list'
|
245
|
+
autoload :VendorReturnAuthorization, 'netsuite/records/vendor_return_authorization'
|
246
|
+
autoload :VendorReturnAuthorizationItem, 'netsuite/records/vendor_return_authorization_item'
|
247
|
+
autoload :VendorReturnAuthorizationItemList, 'netsuite/records/vendor_return_authorization_item_list'
|
242
248
|
autoload :VendorPayment, 'netsuite/records/vendor_payment'
|
243
249
|
autoload :VendorPaymentApply, 'netsuite/records/vendor_payment_apply'
|
244
250
|
autoload :VendorPaymentApplyList, 'netsuite/records/vendor_payment_apply_list'
|
@@ -179,29 +179,25 @@ module NetSuite
|
|
179
179
|
end
|
180
180
|
end
|
181
181
|
|
182
|
-
|
183
|
-
|
184
|
-
if saved_search_id
|
185
|
-
{
|
182
|
+
if saved_search_id || !columns_structure.empty?
|
183
|
+
search_structure = {
|
186
184
|
'searchRecord' => {
|
187
|
-
'@savedSearchId' => saved_search_id,
|
188
185
|
'@xsi:type' => "#{namespace}:#{class_name}SearchAdvanced",
|
189
186
|
:content! => {
|
190
187
|
"#{namespace}:criteria" => criteria_structure
|
191
|
-
# TODO need to optionally support columns here
|
192
|
-
}
|
193
|
-
}
|
194
|
-
}
|
195
|
-
elsif !columns_structure.empty?
|
196
|
-
{
|
197
|
-
'searchRecord' => {
|
198
|
-
'@xsi:type' => "#{namespace}:#{class_name}SearchAdvanced",
|
199
|
-
:content! => {
|
200
|
-
"#{namespace}:criteria" => criteria_structure,
|
201
|
-
"#{namespace}:columns" => columns_structure
|
202
188
|
}
|
203
189
|
}
|
204
190
|
}
|
191
|
+
|
192
|
+
if saved_search_id
|
193
|
+
search_structure['searchRecord']['@savedSearchId'] = saved_search_id
|
194
|
+
end
|
195
|
+
|
196
|
+
if !columns_structure.empty?
|
197
|
+
search_structure['searchRecord'][:content!]["#{namespace}:columns"] = columns_structure
|
198
|
+
end
|
199
|
+
|
200
|
+
search_structure
|
205
201
|
else
|
206
202
|
{
|
207
203
|
'searchRecord' => {
|
@@ -4,6 +4,7 @@ module NetSuite
|
|
4
4
|
|
5
5
|
def reset!
|
6
6
|
NetSuite::Utilities.clear_cache!
|
7
|
+
|
7
8
|
clear_wsdl_cache
|
8
9
|
|
9
10
|
attributes.clear
|
@@ -55,11 +56,11 @@ module NetSuite
|
|
55
56
|
end
|
56
57
|
|
57
58
|
def cached_wsdl
|
58
|
-
cached = wsdl_cache.fetch(
|
59
|
+
cached = wsdl_cache.fetch(wsdl, nil)
|
59
60
|
if cached.is_a? String
|
60
61
|
cached
|
61
62
|
elsif cached.is_a? Savon::Client
|
62
|
-
wsdl_cache[
|
63
|
+
wsdl_cache[wsdl] = cached.instance_eval { @wsdl.xml }
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
@@ -72,7 +73,7 @@ module NetSuite
|
|
72
73
|
# For reference, see:
|
73
74
|
# https://github.com/savonrb/savon/blob/d64925d3add33fa5531577ce9e3a28a7a93618b1/lib/savon/client.rb#L35-L37
|
74
75
|
# https://github.com/savonrb/savon/blob/d64925d3add33fa5531577ce9e3a28a7a93618b1/lib/savon/operation.rb#L22
|
75
|
-
wsdl_cache[
|
76
|
+
wsdl_cache[wsdl] ||= client
|
76
77
|
end
|
77
78
|
|
78
79
|
def api_version(version = nil)
|
@@ -84,16 +85,26 @@ module NetSuite
|
|
84
85
|
end
|
85
86
|
|
86
87
|
def api_version=(version)
|
88
|
+
if attributes[:api_version] != version
|
89
|
+
attributes[:wsdl] = nil
|
90
|
+
attributes[:wsdl_domain] = nil
|
91
|
+
end
|
92
|
+
|
87
93
|
attributes[:api_version] = version
|
88
94
|
end
|
89
95
|
|
90
96
|
def sandbox=(flag)
|
91
|
-
attributes[:
|
97
|
+
if attributes[:sandbox] != flag
|
98
|
+
attributes[:wsdl] = nil
|
99
|
+
attributes[:wsdl_domain] = nil
|
100
|
+
end
|
101
|
+
|
102
|
+
attributes[:sandbox] = flag
|
92
103
|
end
|
93
104
|
|
94
105
|
def sandbox(flag = nil)
|
95
106
|
if flag.nil?
|
96
|
-
attributes[:
|
107
|
+
attributes[:sandbox] ||= false
|
97
108
|
else
|
98
109
|
self.sandbox = flag
|
99
110
|
end
|
@@ -135,6 +146,11 @@ module NetSuite
|
|
135
146
|
end
|
136
147
|
|
137
148
|
def wsdl_domain=(wsdl_domain)
|
149
|
+
if attributes[:wsdl_domain] != wsdl_domain
|
150
|
+
# reset full wsdl url to ensure it's regenerated with the updated `wsdl_domain` next time it's needed
|
151
|
+
attributes[:wsdl] = nil
|
152
|
+
end
|
153
|
+
|
138
154
|
attributes[:wsdl_domain] = wsdl_domain
|
139
155
|
end
|
140
156
|
|
@@ -96,12 +96,17 @@ module NetSuite
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def extract_custom_field(custom_field_data)
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
99
|
+
if custom_field_data.kind_of?(CustomField)
|
100
|
+
custom_fields << custom_field_data
|
101
|
+
else
|
102
|
+
attrs = custom_field_data.clone
|
103
103
|
|
104
|
-
|
104
|
+
if (custom_field_data[:"@xsi:type"] || custom_field_data[:type]) == "platformCore:SelectCustomFieldRef"
|
105
|
+
attrs[:value] = CustomRecordRef.new(custom_field_data[:value])
|
106
|
+
end
|
107
|
+
|
108
|
+
custom_fields << CustomField.new(attrs)
|
109
|
+
end
|
105
110
|
end
|
106
111
|
|
107
112
|
def create_custom_field(reference_id, field_value)
|
@@ -13,7 +13,7 @@ module NetSuite
|
|
13
13
|
def initialize(attributes_or_record = {})
|
14
14
|
case attributes_or_record
|
15
15
|
when Hash
|
16
|
-
attributes = attributes_or_record
|
16
|
+
attributes = attributes_or_record.clone
|
17
17
|
attributes.delete(:"@xmlns:platform_core")
|
18
18
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
19
19
|
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
@@ -39,7 +39,7 @@ module NetSuite
|
|
39
39
|
:consol_overdue_balance, :unbilled_orders, :consol_unbilled_orders
|
40
40
|
|
41
41
|
record_refs :access_role, :custom_form, :currency, :entity_status, :partner, :category, :lead_source,
|
42
|
-
:price_level
|
42
|
+
:price_level, :sales_rep, :subsidiary, :terms, :parent, :territory, :tax_item, :shipping_item, :receivables_account
|
43
43
|
|
44
44
|
attr_reader :internal_id
|
45
45
|
attr_accessor :external_id
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class InventoryAdjustment
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Support::Actions
|
8
|
+
include Namespaces::TranInvt
|
9
|
+
|
10
|
+
actions :get, :add, :delete, :search, :update, :upsert, :upsert_list
|
11
|
+
|
12
|
+
fields :created_date, :estimated_total_value, :last_modified_date, :tran_date, :tran_id, :memo
|
13
|
+
|
14
|
+
field :inventory_list, InventoryAdjustmentInventoryList
|
15
|
+
field :custom_field_list, CustomFieldList
|
16
|
+
|
17
|
+
record_refs :account, :adj_location, :customer, :posting_period, :location, :department,
|
18
|
+
:subsidiary, :custom_form
|
19
|
+
|
20
|
+
attr_reader :internal_id
|
21
|
+
attr_accessor :external_id
|
22
|
+
|
23
|
+
def initialize(attributes = {})
|
24
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
25
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
26
|
+
initialize_from_attributes_hash(attributes)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class InventoryAdjustmentInventory
|
4
|
+
include Support::Records
|
5
|
+
include Support::Fields
|
6
|
+
include Support::RecordRefs
|
7
|
+
include Namespaces::TranInvt
|
8
|
+
|
9
|
+
fields :adjust_qty_by, :description, :bin_numbers, :line,
|
10
|
+
:quantity_on_hand, :serial_numbers, :location
|
11
|
+
|
12
|
+
field :inventory_detail, InventoryDetail
|
13
|
+
|
14
|
+
record_refs :item, :units
|
15
|
+
|
16
|
+
def initialize(attributes = {})
|
17
|
+
initialize_from_attributes_hash(attributes)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -13,7 +13,12 @@ module NetSuite
|
|
13
13
|
record_refs :tax_schedule, :item, :effective_revision,
|
14
14
|
:obsolete_revision
|
15
15
|
|
16
|
+
attr_reader :internal_id
|
17
|
+
attr_accessor :external_id
|
18
|
+
|
16
19
|
def initialize(attributes = {})
|
20
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
21
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
17
22
|
initialize_from_attributes_hash(attributes)
|
18
23
|
end
|
19
24
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class VendorReturnAuthorization
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Support::Actions
|
8
|
+
include Namespaces::TranPurch
|
9
|
+
|
10
|
+
actions :get, :get_list, :add, :initialize, :delete, :update, :upsert, :search
|
11
|
+
|
12
|
+
fields :billing_address, :created_date, :memo, :tran_date, :tran_id
|
13
|
+
|
14
|
+
record_refs :bill_address_list, :department, :entity, :location
|
15
|
+
|
16
|
+
field :custom_field_list, CustomFieldList
|
17
|
+
field :item_list, VendorReturnAuthorizationItemList
|
18
|
+
|
19
|
+
attr_reader :internal_id
|
20
|
+
attr_accessor :external_id
|
21
|
+
|
22
|
+
def initialize(attributes = {})
|
23
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
24
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
25
|
+
initialize_from_attributes_hash(attributes)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class VendorReturnAuthorizationItem
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Namespaces::TranPurch
|
8
|
+
|
9
|
+
fields :amortization_end_date, :amortization_residual, :amount, :bin_numbers, :description,
|
10
|
+
:gross_amt, :is_billable, :is_closed, :is_drop_shipment, :line, :order_line, :quantity,
|
11
|
+
:rate, :vendor_name
|
12
|
+
|
13
|
+
field :inventory_detail, InventoryDetail
|
14
|
+
|
15
|
+
record_refs :item, :location, :tax_code, :units, :customer
|
16
|
+
|
17
|
+
def initialize(attributes = {})
|
18
|
+
initialize_from_attributes_hash(attributes)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/netsuite/version.rb
CHANGED
@@ -107,51 +107,61 @@ describe NetSuite::Actions::Search do
|
|
107
107
|
}
|
108
108
|
}
|
109
109
|
}
|
110
|
-
}
|
110
|
+
},
|
111
|
+
"listRel:columns" => [
|
112
|
+
{"tranSales:basic"=>{"platformCommon:internalId/"=>{}}}
|
113
|
+
],
|
111
114
|
}
|
112
115
|
},
|
113
116
|
}).returns(File.read('spec/support/fixtures/search/saved_search_joined_custom_customer.xml'))
|
114
117
|
|
115
118
|
search = NetSuite::Records::Customer.search({
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
119
|
+
criteria: {
|
120
|
+
saved: 500,
|
121
|
+
basic: [
|
122
|
+
{
|
123
|
+
field: 'entityId',
|
124
|
+
value: 'New Keywords',
|
125
|
+
operator: 'hasKeywords'
|
126
|
+
},
|
127
|
+
{
|
128
|
+
field: 'stage',
|
129
|
+
operator: 'anyOf',
|
130
|
+
type: 'SearchMultiSelectCustomField',
|
131
|
+
value: [
|
132
|
+
'_lead',
|
133
|
+
'_customer'
|
134
|
+
]
|
135
|
+
},
|
136
|
+
{
|
137
|
+
field: 'customFieldList',
|
138
|
+
value: [
|
139
|
+
{
|
140
|
+
field: 'custentity_customerandcontacttypelist',
|
141
|
+
operator: 'anyOf',
|
142
|
+
# type is needed for multiselect fields
|
143
|
+
type: 'SearchMultiSelectCustomField',
|
144
|
+
value: [
|
145
|
+
NetSuite::Records::CustomRecordRef.new(:internal_id => 4),
|
146
|
+
NetSuite::Records::CustomRecordRef.new(:internal_id => 11),
|
147
|
+
]
|
148
|
+
},
|
149
|
+
{
|
150
|
+
field: 'custentity_relatedthing',
|
151
|
+
# is in the GUI is the equivilent of anyOf with a single element array
|
152
|
+
operator: 'anyOf',
|
153
|
+
type: 'SearchMultiSelectCustomField',
|
154
|
+
value: [
|
155
|
+
NetSuite::Records::Customer.new(:internal_id => 88825)
|
156
|
+
]
|
157
|
+
}
|
158
|
+
]
|
159
|
+
}
|
160
|
+
]
|
161
|
+
},
|
162
|
+
columns: [
|
163
|
+
'tranSales:basic' => {
|
164
|
+
'platformCommon:internalId/' => {},
|
155
165
|
}
|
156
166
|
]
|
157
167
|
})
|
@@ -47,7 +47,7 @@ describe NetSuite::Configuration do
|
|
47
47
|
conn = config.connection
|
48
48
|
|
49
49
|
expect(
|
50
|
-
config.wsdl_cache.fetch(
|
50
|
+
config.wsdl_cache.fetch(config.wsdl)
|
51
51
|
).to eq(conn)
|
52
52
|
end
|
53
53
|
|
@@ -99,13 +99,13 @@ describe NetSuite::Configuration do
|
|
99
99
|
expect(config.wsdl_cache).to be_empty
|
100
100
|
config.cache_wsdl("whatevs")
|
101
101
|
expect(config.wsdl_cache).to eq(
|
102
|
-
{
|
102
|
+
{config.wsdl => "whatevs"}
|
103
103
|
)
|
104
104
|
end
|
105
105
|
|
106
106
|
it 'doesnt write over old values' do
|
107
107
|
config.class_exec(config.api_version, config.wsdl) do |api, wsdl|
|
108
|
-
wsdl_cache[
|
108
|
+
wsdl_cache[wsdl] = "old value"
|
109
109
|
end
|
110
110
|
config.cache_wsdl("new value")
|
111
111
|
|
@@ -116,13 +116,13 @@ describe NetSuite::Configuration do
|
|
116
116
|
config.class_eval { @wsdl_cache = nil }
|
117
117
|
config.cache_wsdl("whatevs")
|
118
118
|
expect(config.wsdl_cache).to eq(
|
119
|
-
{
|
119
|
+
{config.wsdl => "whatevs"}
|
120
120
|
)
|
121
121
|
end
|
122
122
|
|
123
123
|
it 'can cache multiple values' do
|
124
124
|
config.class_exec("2020_2", "fake wsdl") do |api, wsdl|
|
125
|
-
wsdl_cache[
|
125
|
+
wsdl_cache[wsdl] = "old value"
|
126
126
|
end
|
127
127
|
expect(config.wsdl_cache.keys.count).to eq 1
|
128
128
|
config.cache_wsdl("new value")
|
@@ -134,7 +134,7 @@ describe NetSuite::Configuration do
|
|
134
134
|
context '#cached_wsdl' do
|
135
135
|
it 'returns wsdl (xml)' do
|
136
136
|
config.class_exec(config.api_version, config.wsdl) do |api, wsdl|
|
137
|
-
wsdl_cache[
|
137
|
+
wsdl_cache[wsdl] = "xml wsdl string"
|
138
138
|
end
|
139
139
|
expect( config.cached_wsdl ).to eq "xml wsdl string"
|
140
140
|
end
|
@@ -146,7 +146,7 @@ describe NetSuite::Configuration do
|
|
146
146
|
wsdl_dbl = double(:wsdl, xml: "xml wsdl")
|
147
147
|
client.instance_exec(wsdl_dbl) {|wsdl| @wsdl = wsdl }
|
148
148
|
config.class_exec(config.api_version, config.wsdl, client) do |api, wsdl, c|
|
149
|
-
wsdl_cache[
|
149
|
+
wsdl_cache[wsdl] = c
|
150
150
|
end
|
151
151
|
|
152
152
|
expect( config.wsdl_cache.values.first ).to eq client
|
@@ -314,8 +314,12 @@ describe NetSuite::Configuration do
|
|
314
314
|
describe '#api_version=' do
|
315
315
|
context 'when api version is defined' do
|
316
316
|
it 'sets the api_version of the application' do
|
317
|
-
|
318
|
-
|
317
|
+
# retrieve wsdl to ensure setting the api works when the wsdl is cached
|
318
|
+
config.wsdl
|
319
|
+
config.api_version = '1980_1'
|
320
|
+
|
321
|
+
expect(config.api_version).to eq('1980_1')
|
322
|
+
expect(config.wsdl).to include('1980_1')
|
319
323
|
end
|
320
324
|
end
|
321
325
|
end
|
@@ -343,13 +347,16 @@ describe NetSuite::Configuration do
|
|
343
347
|
end
|
344
348
|
|
345
349
|
it '#wsdl_domain' do
|
350
|
+
# NOTE wsdl is tested since it uses wsdl_domain
|
346
351
|
expect(config.wsdl_domain).to eq('webservices.netsuite.com')
|
347
352
|
|
348
|
-
config.wsdl_domain
|
353
|
+
config.wsdl_domain('custom.domain.com')
|
349
354
|
expect(config.wsdl_domain).to eq('custom.domain.com')
|
355
|
+
expect(config.wsdl).to include('custom.domain.com')
|
350
356
|
|
351
357
|
config.sandbox = true
|
352
358
|
expect(config.wsdl_domain).to eq('webservices.sandbox.netsuite.com')
|
359
|
+
expect(config.wsdl).to include('webservices.sandbox.netsuite.com')
|
353
360
|
end
|
354
361
|
|
355
362
|
describe '#logger=' do
|
@@ -45,6 +45,8 @@ describe 'basic records' do
|
|
45
45
|
NetSuite::Records::ReturnAuthorization,
|
46
46
|
NetSuite::Records::SerializedInventoryItem,
|
47
47
|
NetSuite::Records::DepositApplication,
|
48
|
+
NetSuite::Records::InventoryAdjustment,
|
49
|
+
NetSuite::Records::VendorReturnAuthorization
|
48
50
|
]
|
49
51
|
}
|
50
52
|
|
@@ -6,6 +6,42 @@ describe NetSuite::Records::CustomFieldList do
|
|
6
6
|
it 'has a custom_fields attribute' do
|
7
7
|
expect(list.custom_fields).to be_kind_of(Array)
|
8
8
|
end
|
9
|
+
|
10
|
+
it 'accepts a collection of CustomField records' do
|
11
|
+
field = NetSuite::Records::CustomField.new({:value=>{:internal_id=>"5", :type_id=>"103"},
|
12
|
+
:script_id=>"custitem_item_category", :"@xsi:type"=>"platformCore:SelectCustomFieldRef"})
|
13
|
+
list = described_class.new(custom_field: [field])
|
14
|
+
expect(list.custom_fields).to eq([field])
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'initializing with custom field attributes without a type' do
|
18
|
+
it 'does not mutate the attributes' do
|
19
|
+
field = {:value=>{:internal_id=>"5", :type_id=>"103"},
|
20
|
+
:script_id=>"custitem_item_category"}
|
21
|
+
described_class.new(custom_field: [field])
|
22
|
+
expect(field).to eq({:value=>{:internal_id=>"5", :type_id=>"103"},
|
23
|
+
:script_id=>"custitem_item_category"})
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'initializing with custom field attributes and a type' do
|
28
|
+
it 'does not mutate the attributes' do
|
29
|
+
field = {:value=>{:internal_id=>"5", :type_id=>"103"},
|
30
|
+
:script_id=>"custitem_item_category", :"@xsi:type"=>"platformCore:SelectCustomFieldRef"}
|
31
|
+
described_class.new(custom_field: [field])
|
32
|
+
expect(field).to eq({:value=>{:internal_id=>"5", :type_id=>"103"},
|
33
|
+
:script_id=>"custitem_item_category", :"@xsi:type"=>"platformCore:SelectCustomFieldRef"})
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'writing convience methods' do
|
38
|
+
it "should create a custom field entry when none exists" do
|
39
|
+
list.custrecord_somefield = 'a value'
|
40
|
+
list.custom_fields.size.should == 1
|
41
|
+
list.custom_fields.first.value.should == 'a value'
|
42
|
+
list.custom_fields.first.type.should == 'platformCore:StringCustomFieldRef'
|
43
|
+
end
|
44
|
+
end
|
9
45
|
|
10
46
|
context 'custom field internalId-to-scriptId transition at WSDL 2013_2:' do
|
11
47
|
before(:context) { @reset = NetSuite::Configuration.api_version }
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netsuite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
5
|
-
prerelease:
|
4
|
+
version: 0.7.9
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ryan Moran
|
@@ -10,38 +9,34 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2017-
|
12
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: savon
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - ">="
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: 2.3.0
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- -
|
25
|
+
- - ">="
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: 2.3.0
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: rspec
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- - ~>
|
32
|
+
- - "~>"
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: 3.1.0
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- - ~>
|
39
|
+
- - "~>"
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: 3.1.0
|
47
42
|
description: NetSuite SuiteTalk API Wrapper
|
@@ -52,9 +47,9 @@ executables: []
|
|
52
47
|
extensions: []
|
53
48
|
extra_rdoc_files: []
|
54
49
|
files:
|
55
|
-
- .gitignore
|
56
|
-
- .rspec
|
57
|
-
- .ruby-version
|
50
|
+
- ".gitignore"
|
51
|
+
- ".rspec"
|
52
|
+
- ".ruby-version"
|
58
53
|
- Gemfile
|
59
54
|
- LICENSE
|
60
55
|
- README.md
|
@@ -176,6 +171,9 @@ files:
|
|
176
171
|
- lib/netsuite/records/gift_cert_redemption_list.rb
|
177
172
|
- lib/netsuite/records/gift_certificate.rb
|
178
173
|
- lib/netsuite/records/gift_certificate_item.rb
|
174
|
+
- lib/netsuite/records/inventory_adjustment.rb
|
175
|
+
- lib/netsuite/records/inventory_adjustment_inventory.rb
|
176
|
+
- lib/netsuite/records/inventory_adjustment_inventory_list.rb
|
179
177
|
- lib/netsuite/records/inventory_assignment.rb
|
180
178
|
- lib/netsuite/records/inventory_assignment_list.rb
|
181
179
|
- lib/netsuite/records/inventory_detail.rb
|
@@ -277,6 +275,9 @@ files:
|
|
277
275
|
- lib/netsuite/records/vendor_payment.rb
|
278
276
|
- lib/netsuite/records/vendor_payment_apply.rb
|
279
277
|
- lib/netsuite/records/vendor_payment_apply_list.rb
|
278
|
+
- lib/netsuite/records/vendor_return_authorization.rb
|
279
|
+
- lib/netsuite/records/vendor_return_authorization_item.rb
|
280
|
+
- lib/netsuite/records/vendor_return_authorization_item_list.rb
|
280
281
|
- lib/netsuite/records/work_order.rb
|
281
282
|
- lib/netsuite/records/work_order_item.rb
|
282
283
|
- lib/netsuite/records/work_order_item_list.rb
|
@@ -466,27 +467,26 @@ files:
|
|
466
467
|
- spec/support/savon.rb
|
467
468
|
homepage: https://github.com/NetSweet/netsuite
|
468
469
|
licenses: []
|
470
|
+
metadata: {}
|
469
471
|
post_install_message:
|
470
472
|
rdoc_options: []
|
471
473
|
require_paths:
|
472
474
|
- lib
|
473
475
|
required_ruby_version: !ruby/object:Gem::Requirement
|
474
|
-
none: false
|
475
476
|
requirements:
|
476
|
-
- -
|
477
|
+
- - ">="
|
477
478
|
- !ruby/object:Gem::Version
|
478
479
|
version: '0'
|
479
480
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
480
|
-
none: false
|
481
481
|
requirements:
|
482
|
-
- -
|
482
|
+
- - ">="
|
483
483
|
- !ruby/object:Gem::Version
|
484
484
|
version: '0'
|
485
485
|
requirements: []
|
486
486
|
rubyforge_project:
|
487
|
-
rubygems_version:
|
487
|
+
rubygems_version: 2.5.1
|
488
488
|
signing_key:
|
489
|
-
specification_version:
|
489
|
+
specification_version: 4
|
490
490
|
summary: NetSuite SuiteTalk API (SOAP) Wrapper
|
491
491
|
test_files:
|
492
492
|
- spec/netsuite/actions/add_spec.rb
|