netsuite 0.4.0 → 0.4.1

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjYyYWE4ZTFiZjRkZjc2ZGM0MmEyY2YzZjA1NGVkYzM2NjMwNWZiZg==
4
+ MmRiYjFkYTU4MTJhODQ5M2NlZmVhNTlhYmNiOTgwZDAxYzBhNmEwMQ==
5
5
  data.tar.gz: !binary |-
6
- MGZiNTNiN2YwNmM3MmM3Yzc1Yzc4Mjg4ZGNkYmM1NDRkYjRjYzI2Mw==
6
+ MzE2Zjk5NmUzMjdjNjU3YmFjMTgyY2Y5ZDRkNTAwMmI5YmUzNWUwYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDE4NDFiN2UxODAzNzcxNTQzMDQ2MWU5NWZiZGIyY2VlY2I4NmY0MjhmNmI1
10
- NmU4NWI0ZGEwZmU4MGYzZmY5YzUzOTk1NDhkMDM2OWQ5MjdmNTQ2MjNmYmQ1
11
- YTY0MGE1YzQ4NmNkZjY0ZmZlMTM5MjZjZGRkOTBmMmVhODI4ZDc=
9
+ NDk0NzRlOTUxYjFiNmJlY2I2NmEzMTBkYTIxMWZkYjU0MjgxMTA2NjFjMTc5
10
+ ZWM3NGIxMzU4MGE3YzhjOWQ5MjU4NTEwZmJiOTU1MGExNDIwNDJlMjFlZjI3
11
+ OWZmZGEzNGJmMGE0ZTFhNGQzYjdhYmRmODAzNjAzZDE3MTJiYjg=
12
12
  data.tar.gz: !binary |-
13
- ZmJkY2ZlYTMxYTZiMGQwMGNjYzlkYjYwNWY4MzMwNTA3MTY0Njk2MWUyZDA3
14
- YTEyYmMyNmNmNWY4ZDkzNDdiZTM2MGY5NjkyNGJjY2ZhMzhhYjA3OWUwMzM3
15
- NDk2Y2VkMTNjM2I0NWU2NjJiZmY0MWE2NjE0ZGY1ZDdiM2JkMzE=
13
+ YjkzZjZlMzg1YTUzYmM0NGY3YWNhNGIxMWRlZWQ0ODVjODk4YmNlNGU3ZGI3
14
+ OThhOTY1NDExMTAzNWVjZGRjZjhiYWYxZTdkYjY1MDEzODhhNzY1OWU0ZjI1
15
+ YjlhOTVkYjM3OTgzZTY5ZWM3ZGZkNDg1MDhmYmRhZTY1ZDUwNGQ=
data/README.md CHANGED
@@ -335,6 +335,7 @@ NetSuite::Records::InventoryItem.search({
335
335
  '_inventoryItem',
336
336
 
337
337
  # note that the naming conventions aren't consistent: AssemblyItem != _assemblyItem
338
+ # https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/enum/itemtype.html
338
339
  '_assembly'
339
340
  ]
340
341
  },
@@ -14,7 +14,11 @@ module NetSuite
14
14
  @custom_fields_assoc = Hash.new
15
15
  custom_fields.each do |custom_field|
16
16
  reference_id = custom_field.script_id || custom_field.internal_id
17
- @custom_fields_assoc[reference_id.to_sym] = custom_field
17
+
18
+ # not all custom fields have an id; https://github.com/NetSweet/netsuite/issues/182
19
+ if reference_id
20
+ @custom_fields_assoc[reference_id.to_sym] = custom_field
21
+ end
18
22
  end
19
23
  end
20
24
 
@@ -7,9 +7,9 @@ module NetSuite
7
7
  include Support::Actions
8
8
  include Namespaces::ListAcct
9
9
 
10
- actions :get, :get_list, :add, :delete, :upsert
10
+ actions :get, :get_list, :add, :delete, :search, :upsert
11
11
 
12
- fields :available_to_partners, :created_date, :description, :display_name, :include_children, :is_inactive, :is_pretax,
12
+ fields :available_to_partners, :created_date, :description, :display_name, :include_children, :is_inactive, :is_pre_tax,
13
13
  :item_id, :last_modified_date, :non_posting, :rate, :upc_code, :vendor_name
14
14
 
15
15
  record_refs :account, :custom_form, :deferred_revenue_account, :department, :expense_account,
@@ -26,6 +26,10 @@ module NetSuite
26
26
  @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
27
27
  initialize_from_attributes_hash(attributes)
28
28
  end
29
+
30
+ def self.search_class_name
31
+ "Item"
32
+ end
29
33
 
30
34
  end
31
35
  end
@@ -13,16 +13,18 @@ module NetSuite
13
13
  fields :phone, :first_name, :last_name, :is_inactive, :email, :give_access, :send_email, :is_support_rep,
14
14
  :birth_date, :hire_date, :last_review_date, :next_review_date, :title, :home_phone, :office_phone,
15
15
  :eligible_for_commission, :is_sales_rep, :klass, :middle_name, :account_number, :alien_number, :approval_limit,
16
- :bill_pay, :comments, :date_created, :direct_deposit, :employee_status, :employee_type, :entity_id,
16
+ :bill_pay, :comments, :date_created, :direct_deposit, :entity_id, :password, :password2,
17
17
  :expense_limit, :fax, :is_job_resource, :job_description, :labor_cost, :last_modified_date, :mobile_phone, :pay_frequency,
18
18
  :phonetic_name, :purchase_order_approval_limit, :purchase_order_approver, :purchase_order_limit, :release_date,
19
19
  :resident_status, :salutation, :social_security_number, :visa_exp_date, :visa_type
20
20
 
21
- record_refs :currency, :department, :location, :subsidiary
21
+ record_refs :currency, :department, :location, :subsidiary, :employee_type, :employee_status, :supervisor
22
22
 
23
23
  field :roles_list, RoleList
24
24
 
25
25
  attr_reader :internal_id
26
+ attr_accessor :external_id
27
+
26
28
  end
27
29
  end
28
30
  end
@@ -14,7 +14,7 @@ module NetSuite
14
14
  :partner_code, :is_person, :company_name, :eligible_for_commission, :entity_id, :last_modified_date,
15
15
  :date_created, :title, :mobile_phone, :comments, :middle_name
16
16
 
17
- record_refs :klass, :access_role
17
+ record_refs :klass, :access_role, :department
18
18
 
19
19
  attr_reader :internal_id
20
20
  end
@@ -5,6 +5,7 @@ module NetSuite
5
5
 
6
6
  attr_reader :total_records
7
7
  attr_reader :total_pages
8
+ attr_reader :current_page
8
9
 
9
10
  # header from a basic customer search:
10
11
 
@@ -22,6 +23,7 @@ module NetSuite
22
23
 
23
24
  @total_records = response.body[:total_records].to_i
24
25
  @total_pages = response.body[:total_pages].to_i
26
+ @current_page = response.body[:page_index].to_i
25
27
 
26
28
  if @total_records > 0
27
29
  if response.body.has_key?(:record_list)
@@ -87,6 +89,7 @@ module NetSuite
87
89
 
88
90
  @results = next_search.results
89
91
  @response = next_search.response
92
+ @current_page = response.body[:page_index].to_i
90
93
  end
91
94
 
92
95
  yield results
@@ -1,3 +1,3 @@
1
1
  module Netsuite
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -157,6 +157,7 @@ describe NetSuite::Actions::Search do
157
157
  })
158
158
 
159
159
  expect(search.results.size).to eq(2)
160
+ expect(search.current_page).to eq(1)
160
161
  expect(search.results.first.alt_name).to eq('A Awesome Name')
161
162
  expect(search.results.last.email).to eq('alessawesome@gmail.com')
162
163
  end
@@ -78,6 +78,11 @@ describe NetSuite::Records::CustomFieldList do
78
78
  expect(list.to_record).to eql(record)
79
79
  expect(list.to_record.length).to eq(1)
80
80
  end
81
+
82
+ # https://github.com/NetSweet/netsuite/issues/182
83
+ it 'handles custom fields without an internalId or scriptId' do
84
+ custom_list = NetSuite::Records::CustomFieldList.new({custom_field: { '@xsi:type' => 'platformCore:StringCustomFieldRef' }})
85
+ end
81
86
  end
82
87
 
83
88
  end
@@ -5,7 +5,7 @@ describe NetSuite::Records::DiscountItem do
5
5
 
6
6
  it 'has the right fields' do
7
7
  [
8
- :available_to_partners, :created_date, :description, :display_name, :include_children, :is_inactive, :is_pretax,
8
+ :available_to_partners, :created_date, :description, :display_name, :include_children, :is_inactive, :is_pre_tax,
9
9
  :item_id, :last_modified_date, :non_posting, :rate, :upc_code, :vendor_name
10
10
  ].each do |field|
11
11
  expect(item).to have_field(field)
@@ -7,7 +7,7 @@ describe NetSuite::Records::Employee do
7
7
  [
8
8
  :account_number, :alien_number, :approval_limit, :bill_pay, :birth_date,
9
9
  :comments, :date_created, :direct_deposit, :eligible_for_commission,
10
- :email, :employee_status, :employee_type, :entity_id, :expense_limit,
10
+ :email, :entity_id, :expense_limit,
11
11
  :fax, :first_name, :hire_date, :home_phone, :is_inactive, :is_job_resource,
12
12
  :job_description, :labor_cost, :last_modified_date, :last_name, :middle_name,
13
13
  :mobile_phone, :next_review_date, :office_phone, :pay_frequency, :phone,
@@ -21,7 +21,7 @@ describe NetSuite::Records::Employee do
21
21
 
22
22
  it 'has all the right record refs' do
23
23
  [
24
- :location
24
+ :location, :employee_status, :employee_type
25
25
  ].each do |record_ref|
26
26
  expect(employee).to have_record_ref(record_ref)
27
27
  end
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.4.0
4
+ version: 0.4.1
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: 2015-04-23 00:00:00.000000000 Z
12
+ date: 2015-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: savon