netsuite 0.7.7 → 0.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
- include Support::Records
6
- include Namespaces::TranCust
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
- def initialize(attributes = {})
12
- initialize_from_attributes_hash(attributes)
13
- end
11
+ def initialize(attributes = {})
12
+ initialize_from_attributes_hash(attributes)
13
+ end
14
14
 
15
15
  end
16
16
  end
@@ -24,6 +24,7 @@ module NetSuite
24
24
 
25
25
  attr_reader :internal_id
26
26
  attr_accessor :external_id
27
+ attr_accessor :search_joins
27
28
 
28
29
  def initialize(attributes = {})
29
30
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -20,6 +20,7 @@ module NetSuite
20
20
 
21
21
  attr_reader :internal_id
22
22
  attr_accessor :external_id
23
+ attr_accessor :search_joins
23
24
 
24
25
  def initialize(attributes = {})
25
26
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -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
@@ -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.') &&
@@ -1,3 +1,3 @@
1
1
  module Netsuite
2
- VERSION = '0.7.7'
2
+ VERSION = '0.7.8'
3
3
  end
@@ -44,6 +44,7 @@ describe 'basic records' do
44
44
  NetSuite::Records::GiftCertificateItem,
45
45
  NetSuite::Records::ReturnAuthorization,
46
46
  NetSuite::Records::SerializedInventoryItem,
47
+ NetSuite::Records::DepositApplication,
47
48
  ]
48
49
  }
49
50
 
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.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-02 00:00:00.000000000 Z
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