netsuite 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -30,7 +30,6 @@ Before contributing a patch make sure all existing tests pass.
30
30
  ```
31
31
  git clone git://github.com/NetSweet/netsuite.git
32
32
  cd netsuite
33
-
34
33
  bundle
35
34
  bundle exec rspec
36
35
  ```
@@ -391,9 +390,6 @@ search.results_in_batches do |batch|
391
390
  puts batch.map(&:internal_id)
392
391
  end
393
392
 
394
- # search on transaction status
395
- NetSuite::Records::InventoryItem
396
-
397
393
  # item search
398
394
  NetSuite::Records::InventoryItem.search({
399
395
  criteria: {
@@ -128,6 +128,7 @@ module NetSuite
128
128
  autoload :Duration, 'netsuite/records/duration'
129
129
  autoload :Employee, 'netsuite/records/employee'
130
130
  autoload :File, 'netsuite/records/file'
131
+ autoload :GiftCertificate, 'netsuite/records/gift_certificate'
131
132
  autoload :Folder, 'netsuite/records/folder'
132
133
  autoload :InventoryAssignment, 'netsuite/records/inventory_assignment'
133
134
  autoload :InventoryAssignmentList, 'netsuite/records/inventory_assignment_list'
@@ -145,6 +146,9 @@ module NetSuite
145
146
  autoload :ItemFulfillmentPackage, 'netsuite/records/item_fulfillment_package'
146
147
  autoload :ItemFulfillmentPackageList, 'netsuite/records/item_fulfillment_package_list'
147
148
  autoload :ItemMember, 'netsuite/records/item_member'
149
+ autoload :ItemReceipt, 'netsuite/records/item_receipt'
150
+ autoload :ItemReceiptItemList, 'netsuite/records/item_receipt_item_list'
151
+ autoload :ItemReceiptItem, 'netsuite/records/item_receipt_item'
148
152
  autoload :Job, 'netsuite/records/job'
149
153
  autoload :JobStatus, 'netsuite/records/job_status'
150
154
  autoload :JournalEntry, 'netsuite/records/journal_entry'
@@ -28,7 +28,12 @@ module NetSuite
28
28
  if list
29
29
  self.filters = list
30
30
  else
31
- attributes[:filters] ||= [:password, :email]
31
+ attributes[:filters] ||= [
32
+ :password,
33
+ :email,
34
+ :consumerKey,
35
+ :token
36
+ ]
32
37
  end
33
38
  end
34
39
 
@@ -42,6 +42,7 @@ module NetSuite
42
42
 
43
43
  field :custom_field_list, CustomFieldList
44
44
  field :bin_number_list, BinNumberList
45
+ field :locations_list, LocationsList
45
46
  field :pricing_matrix, PricingMatrix
46
47
  field :member_list, MemberList
47
48
  field :subsidiary_list, RecordRefList
@@ -109,8 +109,8 @@ module NetSuite
109
109
  field_type = case
110
110
  when field_value.is_a?(Array)
111
111
  'MultiSelectCustomFieldRef'
112
- when field_value.is_a?(Hash)
113
- when field_value.is_a?(NetSuite::Records::CustomRecordRef)
112
+ when field_value.is_a?(Hash),
113
+ field_value.is_a?(NetSuite::Records::CustomRecordRef)
114
114
  'SelectCustomFieldRef'
115
115
  when field_value.is_a?(DateTime),
116
116
  field_value.is_a?(Time),
@@ -0,0 +1,26 @@
1
+ module NetSuite
2
+ module Records
3
+ class GiftCertificate
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Support::Actions
8
+ include Namespaces::ListAcct
9
+
10
+ actions :get, :get_list, :add, :initialize, :delete, :update, :upsert, :search
11
+
12
+ fields :amount_remaining, :created_date, :email, :expiration_date, :gift_cert_code,
13
+ :last_modified_date, :message, :name, :original_amount, :sender
14
+
15
+ attr_reader :internal_id
16
+ # NOTE as of 2016_1 there is no external ID available for this record
17
+
18
+ def initialize(attributes = {})
19
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
20
+
21
+ initialize_from_attributes_hash(attributes)
22
+ end
23
+
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,47 @@
1
+ module NetSuite
2
+ module Records
3
+ class ItemReceipt
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 :created_date, :currency_name, :exchange_rate, :landed_cost_per_line,
13
+ :last_modified_date, :memo, :tran_date, :tran_id
14
+
15
+
16
+ record_refs :created_from, :currency, :custom_form, :entity, :landed_cost_method,
17
+ :partner, :posting_period, :subsidiary
18
+
19
+
20
+ # TODO
21
+ # :expense_list
22
+ # :landed_costs_list
23
+
24
+ field :item_list, ItemReceiptItemList
25
+ field :custom_field_list, CustomFieldList
26
+
27
+ attr_reader :internal_id
28
+ attr_accessor :external_id
29
+ attr_accessor :search_joins
30
+
31
+ def initialize(attributes = {})
32
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
33
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
34
+ initialize_from_attributes_hash(attributes)
35
+ end
36
+
37
+ def self.search_class_name
38
+ "Transaction"
39
+ end
40
+
41
+ def self.search_class_namespace
42
+ 'tranSales'
43
+ end
44
+
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,42 @@
1
+ module NetSuite
2
+ module Records
3
+ class ItemReceiptItem
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Namespaces::TranPurch
8
+
9
+ fields :bin_numbers, :currency, :description, :expiration_date, :is_drop_shipment,
10
+ :item_name, :item_receive, :job_name, :line, :on_hand, :options, :order_line,
11
+ :quantity, :quantity_remaining, :rate, :restock, :serial_numbers,
12
+ :unit_cost_override, :units_display
13
+
14
+ record_refs :bill_variance_status, :inventory_detail, :item, :landed_cost,
15
+ :location
16
+
17
+ field :options, CustomFieldList
18
+ field :custom_field_list, CustomFieldList
19
+
20
+ def initialize(attributes_or_record = {})
21
+ case attributes_or_record
22
+ when Hash
23
+ initialize_from_attributes_hash(attributes_or_record)
24
+ when self.class
25
+ initialize_from_record(attributes_or_record)
26
+ end
27
+ end
28
+
29
+ def initialize_from_record(record)
30
+ self.attributes = record.send(:attributes)
31
+ end
32
+
33
+ def to_record
34
+ rec = super
35
+ if rec["#{record_namespace}:customFieldList"]
36
+ rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList")
37
+ end
38
+ rec
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,11 @@
1
+ module NetSuite
2
+ module Records
3
+ class ItemReceiptItemList < Support::Sublist
4
+ include Namespaces::TranPurch
5
+
6
+ sublist :item, ItemReceiptItem
7
+
8
+ alias :items :item
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Netsuite
2
- VERSION = '0.6.4'
2
+ VERSION = '0.6.5'
3
3
  end
@@ -18,7 +18,7 @@ describe NetSuite::Configuration do
18
18
 
19
19
  describe '#filters' do
20
20
  it 'filters out email and password by default' do
21
- expect(config.filters).to eq([:password, :email])
21
+ expect(config.filters).to eq([:password, :email, :consumerKey, :token])
22
22
  end
23
23
 
24
24
  it 'allows the user to set custom filters' do
@@ -28,6 +28,8 @@ describe 'basic records' do
28
28
  NetSuite::Records::TransferOrder,
29
29
  NetSuite::Records::Partner,
30
30
  NetSuite::Records::PurchaseOrder,
31
+ NetSuite::Records::ItemReceipt,
32
+ NetSuite::Records::GiftCertificate,
31
33
  ]
32
34
  }
33
35
 
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.6.4
4
+ version: 0.6.5
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: 2016-05-26 00:00:00.000000000 Z
13
+ date: 2016-06-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: savon
@@ -167,6 +167,7 @@ files:
167
167
  - lib/netsuite/records/employee.rb
168
168
  - lib/netsuite/records/file.rb
169
169
  - lib/netsuite/records/folder.rb
170
+ - lib/netsuite/records/gift_certificate.rb
170
171
  - lib/netsuite/records/inventory_assignment.rb
171
172
  - lib/netsuite/records/inventory_assignment_list.rb
172
173
  - lib/netsuite/records/inventory_detail.rb
@@ -183,6 +184,9 @@ files:
183
184
  - lib/netsuite/records/item_fulfillment_package.rb
184
185
  - lib/netsuite/records/item_fulfillment_package_list.rb
185
186
  - lib/netsuite/records/item_member.rb
187
+ - lib/netsuite/records/item_receipt.rb
188
+ - lib/netsuite/records/item_receipt_item.rb
189
+ - lib/netsuite/records/item_receipt_item_list.rb
186
190
  - lib/netsuite/records/job.rb
187
191
  - lib/netsuite/records/job_status.rb
188
192
  - lib/netsuite/records/journal_entry.rb