netsuite 0.7.7 → 0.7.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/netsuite.rb +1 -0
- data/lib/netsuite/records/credit_memo.rb +1 -1
- data/lib/netsuite/records/customer.rb +1 -1
- data/lib/netsuite/records/customer_deposit.rb +5 -1
- data/lib/netsuite/records/customer_payment_apply.rb +6 -6
- data/lib/netsuite/records/customer_refund.rb +1 -0
- data/lib/netsuite/records/deposit.rb +1 -0
- data/lib/netsuite/records/deposit_application.rb +65 -0
- data/lib/netsuite/records/invoice.rb +1 -1
- data/lib/netsuite/records/item_fulfillment.rb +1 -1
- data/lib/netsuite/records/sales_order.rb +1 -1
- data/lib/netsuite/support/search_result.rb +4 -0
- data/lib/netsuite/utilities.rb +6 -0
- data/lib/netsuite/version.rb +1 -1
- data/spec/netsuite/records/basic_record_spec.rb +1 -0
- metadata +3 -2
data/lib/netsuite.rb
CHANGED
@@ -124,6 +124,7 @@ module NetSuite
|
|
124
124
|
autoload :CurrencyRate, 'netsuite/records/currency_rate'
|
125
125
|
autoload :Department, 'netsuite/records/department'
|
126
126
|
autoload :Deposit, 'netsuite/records/deposit'
|
127
|
+
autoload :DepositApplication, 'netsuite/records/deposit_application'
|
127
128
|
autoload :DepositPayment, 'netsuite/records/deposit_payment'
|
128
129
|
autoload :DepositPaymentList, 'netsuite/records/deposit_payment_list'
|
129
130
|
autoload :DepositOther, 'netsuite/records/deposit_other'
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::TranCust
|
9
9
|
|
10
|
-
actions :get, :get_deleted, :get_list, :add, :initialize, :delete, :update, :upsert, :search
|
10
|
+
actions :get, :get_deleted, :get_list, :add, :initialize, :delete, :update, :upsert, :upsert_list, :search
|
11
11
|
|
12
12
|
fields :alt_handling_cost, :alt_shipping_cost, :amount_paid, :amount_remaining, :auto_apply, :balance,
|
13
13
|
:bill_address, :contrib_pct, :created_date, :currency_name, :deferred_revenue, :discount_rate, :email,
|
@@ -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,:sales_rep, :subsidiary, :terms, :parent, :territory, :tax_item, :shipping_item
|
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
|
@@ -18,10 +18,14 @@ module NetSuite
|
|
18
18
|
field :custom_field_list, CustomFieldList
|
19
19
|
|
20
20
|
record_refs :customer, :sales_order, :account, :department, :payment_method,
|
21
|
-
:custom_form, :currency, :posting_period, :subsidiary
|
21
|
+
:custom_form, :currency, :posting_period, :subsidiary,
|
22
|
+
|
23
|
+
# only available in an advanced search result
|
24
|
+
:deposit_transaction
|
22
25
|
|
23
26
|
attr_reader :internal_id
|
24
27
|
attr_accessor :external_id
|
28
|
+
attr_accessor :search_joins
|
25
29
|
|
26
30
|
def initialize(attributes = {})
|
27
31
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
@@ -2,15 +2,15 @@ module NetSuite
|
|
2
2
|
module Records
|
3
3
|
class CustomerPaymentApply
|
4
4
|
include Support::Fields
|
5
|
-
|
6
|
-
|
5
|
+
include Support::Records
|
6
|
+
include Namespaces::TranCust
|
7
7
|
|
8
|
-
fields :amount, :apply, :apply_date, :currency, :disc, :disc_amt, :disc_date,
|
8
|
+
fields :amount, :apply, :apply_date, :currency, :disc, :disc_amt, :disc_date,
|
9
9
|
:doc, :due, :job, :line, :ref_num, :total, :type
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
def initialize(attributes = {})
|
12
|
+
initialize_from_attributes_hash(attributes)
|
13
|
+
end
|
14
14
|
|
15
15
|
end
|
16
16
|
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class DepositApplication
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Support::Actions
|
8
|
+
include Namespaces::TranCust
|
9
|
+
|
10
|
+
actions :get, :get_list, :initialize, :add, :delete, :update, :upsert, :search
|
11
|
+
|
12
|
+
fields :applied,
|
13
|
+
:created_date,
|
14
|
+
:dep_date,
|
15
|
+
:exchange_rate,
|
16
|
+
:last_modified_date,
|
17
|
+
:memo,
|
18
|
+
:status,
|
19
|
+
:total,
|
20
|
+
:tran_date,
|
21
|
+
:tran_id,
|
22
|
+
:unapplied
|
23
|
+
|
24
|
+
record_refs :ar_acct,
|
25
|
+
:klass,
|
26
|
+
:currency,
|
27
|
+
:customer,
|
28
|
+
:department,
|
29
|
+
:deposit,
|
30
|
+
:location,
|
31
|
+
:posting_period,
|
32
|
+
:subsidiary
|
33
|
+
|
34
|
+
# :accounting_book_detail_list AccountingBookDetailList 0..1
|
35
|
+
field :apply_list, CustomerPaymentApplyList
|
36
|
+
field :custom_field_list, CustomFieldList
|
37
|
+
|
38
|
+
attr_reader :internal_id
|
39
|
+
attr_accessor :external_id
|
40
|
+
attr_accessor :search_joins
|
41
|
+
|
42
|
+
def initialize(attributes = {})
|
43
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
44
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
45
|
+
initialize_from_attributes_hash(attributes)
|
46
|
+
end
|
47
|
+
|
48
|
+
def to_record
|
49
|
+
rec = super
|
50
|
+
if rec["#{record_namespace}:customFieldList"]
|
51
|
+
rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList")
|
52
|
+
end
|
53
|
+
rec
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.search_class_name
|
57
|
+
"Transaction"
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.search_class_namespace
|
61
|
+
'tranSales'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -9,7 +9,7 @@ module NetSuite
|
|
9
9
|
|
10
10
|
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/record/invoice.html?mode=package
|
11
11
|
|
12
|
-
actions :get, :get_deleted, :get_list, :initialize, :add, :update, :delete, :upsert, :search
|
12
|
+
actions :get, :get_deleted, :get_list, :initialize, :add, :update, :delete, :upsert, :upsert_list, :search
|
13
13
|
|
14
14
|
fields :balance, :bill_address,
|
15
15
|
:billing_schedule, :contrib_pct, :created_date, :currency_name, :custom_field_list,
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::TranSales
|
9
9
|
|
10
|
-
actions :get, :get_list, :add, :initialize, :update, :delete, :search, :upsert
|
10
|
+
actions :get, :get_list, :add, :initialize, :update, :delete, :search, :upsert, :upsert_list
|
11
11
|
|
12
12
|
fields :tran_date, :tran_id, :shipping_cost, :memo, :ship_company, :ship_attention, :ship_addr1,
|
13
13
|
:ship_addr2, :ship_city, :ship_state, :ship_zip, :ship_phone, :ship_is_residential,
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::TranSales
|
9
9
|
|
10
|
-
actions :get, :get_list, :add, :initialize, :delete, :update, :upsert, :search
|
10
|
+
actions :get, :get_list, :add, :initialize, :delete, :update, :upsert, :upsert_list, :search
|
11
11
|
|
12
12
|
fields :alt_handling_cost, :alt_shipping_cost, :amount_paid, :amount_remaining, :auto_apply, :balance,
|
13
13
|
:bill_address, :cc_approved, :contrib_pct, :created_date, :currency_name, :deferred_revenue, :discount_rate, :email, :end_date,
|
@@ -73,6 +73,10 @@ module NetSuite
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
if record[:basic][:internal_id]
|
77
|
+
record[:basic][:internal_id] = record[:basic][:internal_id][:@internal_id]
|
78
|
+
end
|
79
|
+
|
76
80
|
result_wrapper = result_class.new(record.delete(:basic))
|
77
81
|
result_wrapper.search_joins = record
|
78
82
|
results << result_wrapper
|
data/lib/netsuite/utilities.rb
CHANGED
@@ -32,6 +32,11 @@ module NetSuite
|
|
32
32
|
ns_record
|
33
33
|
end
|
34
34
|
|
35
|
+
def netsuite_server_time
|
36
|
+
server_time_response = NetSuite::Utilities.backoff { NetSuite::Configuration.connection.call(:get_server_time) }
|
37
|
+
server_time_response.body[:get_server_time_response][:get_server_time_result][:server_time]
|
38
|
+
end
|
39
|
+
|
35
40
|
def backoff(options = {})
|
36
41
|
# TODO the default backoff attempts should be customizable the global config
|
37
42
|
options[:attempts] ||= 8
|
@@ -74,6 +79,7 @@ module NetSuite
|
|
74
79
|
if !e.message.include?("Only one request may be made against a session at a time") &&
|
75
80
|
!e.message.include?('java.util.ConcurrentModificationException') &&
|
76
81
|
!e.message.include?('com.netledger.common.exceptions.NLDatabaseOfflineException') &&
|
82
|
+
!e.message.include?('com.netledger.database.NLConnectionUtil$NoCompanyDbsOnlineException') &&
|
77
83
|
!e.message.include?('An unexpected error occurred.') &&
|
78
84
|
!e.message.include?('Session invalidation is in progress with different thread') &&
|
79
85
|
!e.message.include?('SuiteTalk concurrent request limit exceeded. Request blocked.') &&
|
data/lib/netsuite/version.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.7.
|
4
|
+
version: 0.7.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-02-
|
13
|
+
date: 2017-02-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: savon
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- lib/netsuite/records/customer_refund_deposit_list.rb
|
160
160
|
- lib/netsuite/records/department.rb
|
161
161
|
- lib/netsuite/records/deposit.rb
|
162
|
+
- lib/netsuite/records/deposit_application.rb
|
162
163
|
- lib/netsuite/records/deposit_cash_back.rb
|
163
164
|
- lib/netsuite/records/deposit_cash_back_list.rb
|
164
165
|
- lib/netsuite/records/deposit_other.rb
|