netsuite 0.7.9 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.ruby-version +1 -1
  4. data/Gemfile +7 -2
  5. data/README.md +164 -61
  6. data/circle.yml +33 -13
  7. data/lib/netsuite.rb +55 -19
  8. data/lib/netsuite/actions/login.rb +20 -1
  9. data/lib/netsuite/actions/search.rb +1 -6
  10. data/lib/netsuite/actions/update.rb +6 -2
  11. data/lib/netsuite/actions/update_list.rb +109 -0
  12. data/lib/netsuite/actions/upsert.rb +2 -0
  13. data/lib/netsuite/configuration.rb +21 -4
  14. data/lib/netsuite/errors.rb +3 -0
  15. data/lib/netsuite/records/assembly_build.rb +39 -0
  16. data/lib/netsuite/records/assembly_component.rb +28 -0
  17. data/lib/netsuite/records/assembly_component_list.rb +12 -0
  18. data/lib/netsuite/records/assembly_item.rb +1 -0
  19. data/lib/netsuite/records/assembly_unbuild.rb +40 -0
  20. data/lib/netsuite/records/bin_number.rb +18 -0
  21. data/lib/netsuite/records/bin_number_list.rb +1 -20
  22. data/lib/netsuite/records/bin_transfer.rb +38 -0
  23. data/lib/netsuite/records/bin_transfer_inventory.rb +20 -0
  24. data/lib/netsuite/records/bin_transfer_inventory_list.rb +10 -0
  25. data/lib/netsuite/records/cash_refund.rb +101 -3
  26. data/lib/netsuite/records/cash_refund_item.rb +1 -1
  27. data/lib/netsuite/records/cash_sale.rb +1 -0
  28. data/lib/netsuite/records/classification.rb +5 -2
  29. data/lib/netsuite/records/contact.rb +2 -1
  30. data/lib/netsuite/records/contact_addressbook.rb +64 -0
  31. data/lib/netsuite/records/contact_addressbook_list.rb +11 -0
  32. data/lib/netsuite/records/credit_memo.rb +1 -0
  33. data/lib/netsuite/records/currency_rate.rb +4 -3
  34. data/lib/netsuite/records/custom_field_list.rb +16 -3
  35. data/lib/netsuite/records/custom_record.rb +3 -3
  36. data/lib/netsuite/records/custom_record_ref.rb +1 -0
  37. data/lib/netsuite/records/customer.rb +5 -4
  38. data/lib/netsuite/records/customer_credit_cards.rb +36 -0
  39. data/lib/netsuite/records/customer_credit_cards_list.rb +10 -0
  40. data/lib/netsuite/records/customer_deposit.rb +6 -2
  41. data/lib/netsuite/records/customer_deposit_apply.rb +17 -0
  42. data/lib/netsuite/records/customer_deposit_apply_list.rb +12 -0
  43. data/lib/netsuite/records/customer_payment.rb +1 -0
  44. data/lib/netsuite/records/customer_sales_team.rb +24 -0
  45. data/lib/netsuite/records/customer_sales_team_list.rb +9 -0
  46. data/lib/netsuite/records/customer_status.rb +29 -0
  47. data/lib/netsuite/records/customer_subscription.rb +18 -0
  48. data/lib/netsuite/records/customer_subscriptions_list.rb +10 -0
  49. data/lib/netsuite/records/deposit_other.rb +0 -10
  50. data/lib/netsuite/records/employee.rb +3 -2
  51. data/lib/netsuite/records/entity_custom_field.rb +53 -0
  52. data/lib/netsuite/records/estimate.rb +42 -0
  53. data/lib/netsuite/records/estimate_item.rb +40 -0
  54. data/lib/netsuite/records/estimate_item_list.rb +11 -0
  55. data/lib/netsuite/records/inbound_shipment.rb +33 -0
  56. data/lib/netsuite/records/inbound_shipment_item.rb +39 -0
  57. data/lib/netsuite/records/inbound_shipment_item_list.rb +11 -0
  58. data/lib/netsuite/records/inter_company_journal_entry.rb +48 -0
  59. data/lib/netsuite/records/inter_company_journal_entry_line.rb +28 -0
  60. data/lib/netsuite/records/inter_company_journal_entry_line_list.rb +14 -0
  61. data/lib/netsuite/records/inventory_adjustment.rb +1 -1
  62. data/lib/netsuite/records/inventory_adjustment_inventory.rb +2 -2
  63. data/lib/netsuite/records/inventory_item.rb +2 -2
  64. data/lib/netsuite/records/inventory_number.rb +35 -0
  65. data/lib/netsuite/records/inventory_number_locations.rb +16 -0
  66. data/lib/netsuite/records/inventory_number_locations_list.rb +10 -0
  67. data/lib/netsuite/records/inventory_transfer.rb +2 -2
  68. data/lib/netsuite/records/inventory_transfer_inventory_list.rb +0 -2
  69. data/lib/netsuite/records/invoice.rb +4 -4
  70. data/lib/netsuite/records/item_fulfillment.rb +2 -1
  71. data/lib/netsuite/records/job.rb +2 -1
  72. data/lib/netsuite/records/lot_numbered_assembly_item.rb +64 -0
  73. data/lib/netsuite/records/lot_numbered_inventory_item.rb +116 -0
  74. data/lib/netsuite/records/matrix_option_list.rb +12 -4
  75. data/lib/netsuite/records/message.rb +30 -0
  76. data/lib/netsuite/records/non_inventory_resale_item.rb +3 -2
  77. data/lib/netsuite/records/non_inventory_sale_item.rb +2 -1
  78. data/lib/netsuite/records/other_charge_sale_item.rb +2 -2
  79. data/lib/netsuite/records/partner.rb +1 -1
  80. data/lib/netsuite/records/price.rb +17 -0
  81. data/lib/netsuite/records/price_level.rb +26 -0
  82. data/lib/netsuite/records/price_list.rb +9 -0
  83. data/lib/netsuite/records/pricing.rb +20 -0
  84. data/lib/netsuite/records/pricing_matrix.rb +2 -2
  85. data/lib/netsuite/records/promotions.rb +26 -0
  86. data/lib/netsuite/records/promotions_list.rb +9 -0
  87. data/lib/netsuite/records/return_authorization.rb +3 -2
  88. data/lib/netsuite/records/return_authorization_item.rb +43 -0
  89. data/lib/netsuite/records/return_authorization_item_list.rb +11 -0
  90. data/lib/netsuite/records/sales_order.rb +1 -0
  91. data/lib/netsuite/records/sales_order_item.rb +12 -5
  92. data/lib/netsuite/records/sales_role.rb +26 -0
  93. data/lib/netsuite/records/sales_tax_item.rb +3 -1
  94. data/lib/netsuite/records/serialized_assembly_item.rb +239 -0
  95. data/lib/netsuite/records/serialized_inventory_item.rb +2 -2
  96. data/lib/netsuite/records/serialized_inventory_item_location.rb +37 -0
  97. data/lib/netsuite/records/serialized_inventory_item_locations_list.rb +10 -0
  98. data/lib/netsuite/records/serialized_inventory_item_numbers.rb +15 -0
  99. data/lib/netsuite/records/serialized_inventory_item_numbers_list.rb +10 -0
  100. data/lib/netsuite/records/service_resale_item.rb +1 -1
  101. data/lib/netsuite/records/service_sale_item.rb +2 -1
  102. data/lib/netsuite/records/subsidiary.rb +1 -0
  103. data/lib/netsuite/records/support_case.rb +1 -1
  104. data/lib/netsuite/records/support_case_type.rb +26 -0
  105. data/lib/netsuite/records/task.rb +2 -1
  106. data/lib/netsuite/records/tax_group.rb +3 -1
  107. data/lib/netsuite/records/transaction_body_custom_field.rb +61 -0
  108. data/lib/netsuite/records/transaction_column_custom_field.rb +59 -0
  109. data/lib/netsuite/records/transfer_order_item.rb +2 -2
  110. data/lib/netsuite/records/vendor.rb +1 -0
  111. data/lib/netsuite/records/vendor_bill.rb +2 -1
  112. data/lib/netsuite/records/vendor_credit.rb +2 -0
  113. data/lib/netsuite/records/work_order.rb +8 -0
  114. data/lib/netsuite/support/actions.rb +2 -0
  115. data/lib/netsuite/support/country.rb +27 -14
  116. data/lib/netsuite/support/search_result.rb +20 -5
  117. data/lib/netsuite/utilities.rb +100 -43
  118. data/lib/netsuite/version.rb +2 -2
  119. data/netsuite.gemspec +5 -4
  120. data/spec/netsuite/actions/login_spec.rb +23 -0
  121. data/spec/netsuite/actions/update_list_spec.rb +107 -0
  122. data/spec/netsuite/actions/update_spec.rb +42 -0
  123. data/spec/netsuite/configuration_spec.rb +79 -6
  124. data/spec/netsuite/records/address_spec.rb +10 -0
  125. data/spec/netsuite/records/basic_record_spec.rb +18 -1
  126. data/spec/netsuite/records/bin_number_spec.rb +23 -0
  127. data/spec/netsuite/records/classification_spec.rb +10 -1
  128. data/spec/netsuite/records/custom_field_list_spec.rb +46 -5
  129. data/spec/netsuite/records/custom_record_spec.rb +1 -1
  130. data/spec/netsuite/records/customer_credit_cards_list_spec.rb +23 -0
  131. data/spec/netsuite/records/customer_sales_team_list_spec.rb +41 -0
  132. data/spec/netsuite/records/customer_spec.rb +44 -2
  133. data/spec/netsuite/records/customer_subscription_spec.rb +41 -0
  134. data/spec/netsuite/records/customer_subscriptions_list_spec.rb +19 -0
  135. data/spec/netsuite/records/employee_spec.rb +2 -2
  136. data/spec/netsuite/records/entity_custom_field_spec.rb +34 -0
  137. data/spec/netsuite/records/estimate_item_list_spec.rb +26 -0
  138. data/spec/netsuite/records/estimate_item_spec.rb +40 -0
  139. data/spec/netsuite/records/estimate_spec.rb +216 -0
  140. data/spec/netsuite/records/inter_company_journal_entry_line_list_spec.rb +26 -0
  141. data/spec/netsuite/records/inter_company_journal_entry_line_spec.rb +60 -0
  142. data/spec/netsuite/records/inter_company_journal_entry_spec.rb +156 -0
  143. data/spec/netsuite/records/inventory_item_spec.rb +57 -0
  144. data/spec/netsuite/records/inventory_transfer_spec.rb +21 -0
  145. data/spec/netsuite/records/invoice_spec.rb +4 -4
  146. data/spec/netsuite/records/matrix_option_list_spec.rb +15 -5
  147. data/spec/netsuite/records/message_spec.rb +49 -0
  148. data/spec/netsuite/records/non_inventory_resale_item_spec.rb +165 -0
  149. data/spec/netsuite/records/non_inventory_sale_item_spec.rb +1 -1
  150. data/spec/netsuite/records/partner_spec.rb +141 -0
  151. data/spec/netsuite/records/price_level_spec.rb +16 -0
  152. data/spec/netsuite/records/pricing_matrix_spec.rb +15 -13
  153. data/spec/netsuite/records/return_authorization_item_list_spec.rb +26 -0
  154. data/spec/netsuite/records/return_authorization_item_spec.rb +43 -0
  155. data/spec/netsuite/records/sales_order_item_spec.rb +11 -5
  156. data/spec/netsuite/records/service_resale_item_spec.rb +134 -0
  157. data/spec/netsuite/records/support_case_type_spec.rb +22 -0
  158. data/spec/netsuite/records/transaction_body_custom_field_spec.rb +32 -0
  159. data/spec/netsuite/records/transaction_column_custom_field_spec.rb +32 -0
  160. data/spec/netsuite/records/vendor_credit_spec.rb +29 -0
  161. data/spec/netsuite/support/search_result_spec.rb +24 -0
  162. data/spec/netsuite/utilities_spec.rb +50 -0
  163. data/spec/spec_helper.rb +5 -4
  164. data/spec/support/fixtures/update_list/update_list_items.xml +22 -0
  165. data/spec/support/fixtures/update_list/update_list_one_item.xml +18 -0
  166. data/spec/support/fixtures/update_list/update_list_with_errors.xml +32 -0
  167. metadata +123 -8
@@ -67,7 +67,6 @@ module NetSuite
67
67
  # locations_list SerializedInventoryItemLocationsList
68
68
  # matrix_option_list MatrixOptionList
69
69
  # matrix_type ItemMatrixType
70
- # numbers_list SerializedInventoryItemNumbersList
71
70
  # out_of_stock_behavior ItemOutOfStockBehavior
72
71
  # overall_quantity_pricing_type ItemOverallQuantityPricingType
73
72
  # periodic_lot_size_type PeriodicLotSizeType
@@ -222,8 +221,9 @@ module NetSuite
222
221
  # weight_unit ItemWeightUnit
223
222
 
224
223
  field :custom_field_list, CustomFieldList
225
- field :locations_list, LocationsList
224
+ field :locations_list, SerializedInventoryItemLocationsList
226
225
  field :subsidiary_list, RecordRefList
226
+ field :numbers_list, SerializedInventoryItemNumbersList
227
227
 
228
228
  # TODO from standard copied item record; may need to be deleted
229
229
  # field :pricing_matrix, PricingMatrix
@@ -0,0 +1,37 @@
1
+ module NetSuite
2
+ module Records
3
+ class SerializedInventoryItemLocation
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Namespaces::ListAcct
8
+
9
+ fields :average_cost_mil, :backward_consumption_days, :build_time,
10
+ :cost, :costing_lot_size, :default_return_cost, :demand_time_force,
11
+ :fixed_lot_size, :forward_consumption_days, :invt_count_interval,
12
+ :is_wip, :last_invt_count_date, :last_purchase_price_mli, :lead_time,
13
+ :location, :next_invt_count_date, :on_hand_value_mli,
14
+ :periodic_lot_size_days, :preferred_stock_level, :quantity_available,
15
+ :quantity_back_ordered, :quantity_committed, :quantity_on_hand,
16
+ :quantity_on_order, :reorder_point, :reschedule_in_days,
17
+ :reschedule_out_days, :safety_stock_level, :serial_numbers
18
+
19
+ # field :invt_classification, ItemInvtClassification
20
+ # field :periodic_lot_size_type, PeriodicLotSizeType
21
+
22
+ record_refs :alternate_demand_source_item, :demand_source, :inventory_cost_template,
23
+ :location_id, :supply_lot_sizing_method, :supply_replenishment_method, :supply_type
24
+
25
+ attr_reader :internal_id
26
+ attr_accessor :external_id
27
+ attr_accessor :search_joins
28
+
29
+ def initialize(attributes = {})
30
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
31
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
32
+ initialize_from_attributes_hash(attributes)
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,10 @@
1
+ module NetSuite
2
+ module Records
3
+ class SerializedInventoryItemLocationsList < Support::Sublist
4
+ include Namespaces::ListAcct
5
+
6
+ sublist :locations, SerializedInventoryItemLocation
7
+
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ module NetSuite
2
+ module Records
3
+ class SerializedInventoryItemNumbers
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Namespaces::ListAcct
7
+
8
+ fields :serial_number
9
+
10
+ def initialize(attributes = {})
11
+ initialize_from_attributes_hash(attributes)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,10 @@
1
+ module NetSuite
2
+ module Records
3
+ class SerializedInventoryItemNumbersList < Support::Sublist
4
+ include Namespaces::ListAcct
5
+
6
+ sublist :numbers, SerializedInventoryItemNumbers
7
+
8
+ end
9
+ end
10
+ end
@@ -9,7 +9,7 @@ module NetSuite
9
9
 
10
10
  actions :get, :get_list, :add, :update, :delete, :upsert, :search
11
11
 
12
- fields :available_to_partners, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :create_job, :created_date,
12
+ fields :available_to_partners, :cost, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :create_job, :created_date,
13
13
  :display_name, :dont_show_price, :enforce_min_qty_internally, :exclude_from_sitemap, :featured_description,
14
14
  :include_children, :is_donation_item, :is_fulfillable, :is_gco_compliant, :is_inactive, :is_online, :is_taxable,
15
15
  :item_id, :last_modified_date, :matrix_option_list, :matrix_type, :max_donation_amount, :meta_tag_html,
@@ -26,7 +26,7 @@ module NetSuite
26
26
  record_refs :billing_schedule, :cost_category, :custom_form, :deferred_revenue_account, :department, :income_account,
27
27
  :issue_product, :item_options_list, :klass, :location, :parent, :pricing_group, :purchase_tax_code,
28
28
  :quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :store_display_image,
29
- :store_display_thumbnail, :store_item_template, :tax_schedule, :units_type
29
+ :store_display_thumbnail, :store_item_template, :tax_schedule, :units_type, :revenue_recognition_rule
30
30
 
31
31
  field :pricing_matrix, PricingMatrix
32
32
  field :custom_field_list, CustomFieldList
@@ -34,6 +34,7 @@ module NetSuite
34
34
 
35
35
  attr_reader :internal_id
36
36
  attr_accessor :external_id
37
+ attr_accessor :search_joins
37
38
 
38
39
  def initialize(attributes = {})
39
40
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -27,6 +27,7 @@ module NetSuite
27
27
 
28
28
  attr_reader :internal_id
29
29
  attr_accessor :external_id
30
+ attr_accessor :search_joins
30
31
 
31
32
  def initialize(attributes = {})
32
33
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -7,7 +7,7 @@ module NetSuite
7
7
  include Support::Actions
8
8
  include Namespaces::ListSupport
9
9
 
10
- actions :get, :get_list, :add, :delete, :update, :upsert
10
+ actions :get, :get_list, :add, :delete, :update, :upsert, :search
11
11
 
12
12
  fields :end_date, :incoming_message, :outgoing_message, :search_solution, :email_form,
13
13
  :internal_only, :title, :case_number, :start_date, :email, :phone, :inbound_email,
@@ -0,0 +1,26 @@
1
+ module NetSuite
2
+ module Records
3
+ class SupportCaseType
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Support::Actions
8
+ include Namespaces::ListSupport
9
+
10
+ actions :get
11
+
12
+ fields :description, :is_inactive, :name
13
+
14
+ record_refs :insert_before
15
+
16
+ attr_reader :internal_id
17
+ attr_accessor :external_id
18
+
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)
22
+ initialize_from_attributes_hash(attributes)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -11,9 +11,10 @@ module NetSuite
11
11
 
12
12
  fields :title, :send_email, :message, :status, :access_level, :reminder_type,
13
13
  :reminder_minutes, :start_date, :end_date, :due_date, :timed_event,
14
- :created_date, :last_modified_date
14
+ :created_date, :last_modified_date, :priority
15
15
 
16
16
  field :contact_list, ContactList
17
+ field :custom_field_list, CustomFieldList
17
18
 
18
19
  record_refs :assigned, :owner, :company, :contact, :transaction
19
20
 
@@ -7,7 +7,9 @@ module NetSuite
7
7
  include Support::Actions
8
8
  include Namespaces::ListAcct
9
9
 
10
- actions :get, :get_list, :add, :initialize, :delete, :update, :upsert, :search
10
+ # NOTE `get_all` is not available API > 2017_1
11
+ # `search` is available API > 2016_2
12
+ actions :get, :get_list, :add, :initialize, :delete, :update, :upsert, :search, :get_all
11
13
 
12
14
  fields :city, :county, :description, :include_children, :is_default, :is_inactive,
13
15
  :item_id, :piggyback, :rate, :state, :subsidiary_list, :unitprice1, :unitprice2,
@@ -0,0 +1,61 @@
1
+ module NetSuite
2
+ module Records
3
+ class TransactionBodyCustomField
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Support::Actions
8
+ include Namespaces::SetupCustom
9
+
10
+ actions :get, :get_list, :add, :delete, :update, :upsert, :upsert_list
11
+
12
+ # http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_1/schema/record/transactionbodycustomfield.html
13
+ fields(
14
+ :label,
15
+ :store_value,
16
+ :display_type,
17
+ :is_mandatory,
18
+ :default_checked,
19
+ :is_formula,
20
+ :body_assembly_build,
21
+ :body_bom,
22
+ :body_b_tegata,
23
+ :body_customer_payment,
24
+ :body_deposit,
25
+ :body_expense_report,
26
+ :body_inventory_adjustment,
27
+ :body_item_fulfillment,
28
+ :body_item_fulfillment_order,
29
+ :body_item__receipt,
30
+ :body_item__receipt_order,
31
+ :body_journal,
32
+ :body_opportunity,
33
+ :body_other_transaction,
34
+ :body_picking_ticket,
35
+ :body_print_flag,
36
+ :body_print_packing_slip,
37
+ :body_print_statement,
38
+ :body_purchase,
39
+ :body_sale,
40
+ :body_store,
41
+ :body_transfer_order,
42
+ :body_vendor_payment,
43
+ :access_level,
44
+ :search_level,
45
+ :field_type,
46
+ :script_id
47
+ )
48
+
49
+ record_refs :owner
50
+
51
+ attr_reader :internal_id
52
+ attr_accessor :external_id
53
+
54
+ def initialize(attributes = {})
55
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
56
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
57
+ initialize_from_attributes_hash(attributes)
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,59 @@
1
+ module NetSuite
2
+ module Records
3
+ class TransactionColumnCustomField
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Support::Actions
8
+ include Namespaces::SetupCustom
9
+
10
+ actions :get, :get_list, :add, :delete, :update, :upsert, :upsert_list
11
+
12
+ # http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_1/schema/record/transactioncolumncustomfield.html
13
+ fields(
14
+ :label,
15
+ :store_value,
16
+ :display_type,
17
+ :is_mandatory,
18
+ :default_checked,
19
+ :is_formula,
20
+ :col_expense,
21
+ :col_purchase,
22
+ :col_sale,
23
+ :col_opportunity,
24
+ :col_store,
25
+ :col_store_hidden,
26
+ :col_journal,
27
+ :col_expense_report,
28
+ :col_time,
29
+ :col_transfer_order,
30
+ :col_item_receipt,
31
+ :col_item_receipt_order,
32
+ :col_item_fulfillment,
33
+ :col_item_fulfillment_order,
34
+ :col_print_flag,
35
+ :col_picking_ticket,
36
+ :col_packing_slip,
37
+ :col_return_form,
38
+ :col_store_with_groups,
39
+ :col_group_on_invoices,
40
+ :col_kit_item,
41
+ :access_level,
42
+ :search_level,
43
+ :field_type,
44
+ :script_id
45
+ )
46
+
47
+ record_refs :owner
48
+
49
+ attr_reader :internal_id
50
+ attr_accessor :external_id
51
+
52
+ def initialize(attributes = {})
53
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
54
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
55
+ initialize_from_attributes_hash(attributes)
56
+ end
57
+ end
58
+ end
59
+ end
@@ -7,7 +7,7 @@ module NetSuite
7
7
  include Namespaces::TranInvt
8
8
 
9
9
  fields :amount, :average_cost, :klass, :commit_inventory, :description,
10
- :expected_receipt_date, :expected_ship_date, :is_closed, :last_purchase_price,
10
+ :expected_receipt_date, :expected_ship_date, :inventory_detail, :is_closed, :last_purchase_price,
11
11
  :line, :options, :order_priority, :quantity, :quantity_available,
12
12
  :quantity_back_ordered, :quantity_committed, :quantity_fulfilled,
13
13
  :quantity_on_hand, :quantity_packed, :quantity_picked, :quantity_received,
@@ -16,7 +16,7 @@ module NetSuite
16
16
  field :options, CustomFieldList
17
17
  field :custom_field_list, CustomFieldList
18
18
 
19
- record_refs :department, :inventory_detail, :item, :units
19
+ record_refs :department, :item, :units
20
20
 
21
21
  def initialize(attributes_or_record = {})
22
22
  case attributes_or_record
@@ -34,6 +34,7 @@ module NetSuite
34
34
 
35
35
  attr_reader :internal_id
36
36
  attr_accessor :external_id
37
+ attr_accessor :search_joins
37
38
 
38
39
  def initialize(attributes = {})
39
40
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -11,7 +11,7 @@ module NetSuite
11
11
 
12
12
  fields :created_date, :credit_limit, :currency_name, :discount_amount, :discount_date, :due_date, :exchange_rate,
13
13
  :landed_costs_list, :landed_cost_method, :landed_cost_per_line, :last_modified_date, :memo, :tax_total,
14
- :tax_2_total, :transaction_number, :tran_date, :tran_id, :user_total, :vat_reg_num
14
+ :tax_2_total, :transaction_number, :tran_date, :tran_id, :user_total, :vat_reg_num, :payment_hold, :amount_remaining
15
15
 
16
16
  field :custom_field_list, CustomFieldList
17
17
  field :expense_list, VendorBillExpenseList
@@ -25,6 +25,7 @@ module NetSuite
25
25
 
26
26
  attr_reader :internal_id
27
27
  attr_accessor :external_id
28
+ attr_accessor :search_joins
28
29
 
29
30
  def initialize(attributes = {})
30
31
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -33,9 +33,11 @@ module NetSuite
33
33
  field :custom_field_list, CustomFieldList
34
34
 
35
35
  attr_reader :internal_id
36
+ attr_accessor :external_id
36
37
 
37
38
  def initialize(attributes = {})
38
39
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
40
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
39
41
  initialize_from_attributes_hash(attributes)
40
42
  end
41
43
 
@@ -33,6 +33,14 @@ module NetSuite
33
33
  @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
34
34
  initialize_from_attributes_hash(attributes)
35
35
  end
36
+
37
+ def self.search_class_name
38
+ "Transaction"
39
+ end
40
+
41
+ def self.search_class_namespace
42
+ 'tranSales'
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -42,6 +42,8 @@ module NetSuite
42
42
  self.send(:include, NetSuite::Actions::DeleteList::Support)
43
43
  when :update
44
44
  self.send(:include, NetSuite::Actions::Update::Support)
45
+ when :update_list
46
+ self.send(:include, NetSuite::Actions::UpdateList::Support)
45
47
  when :initialize
46
48
  self.send(:include, NetSuite::Actions::Initialize::Support)
47
49
  else
@@ -4,6 +4,7 @@ module NetSuite
4
4
 
5
5
  ISO_TO_NETSUITE = {
6
6
  'AF' => '_afghanistan',
7
+ 'AX' => '_alandIslands',
7
8
  'AL' => '_albania',
8
9
  'DZ' => '_algeria',
9
10
  'AS' => '_americanSamoa',
@@ -29,6 +30,7 @@ module NetSuite
29
30
  'BM' => '_bermuda',
30
31
  'BT' => '_bhutan',
31
32
  'BO' => '_bolivia',
33
+ 'BQ' => '_bonaireSaintEustatiusAndSaba',
32
34
  'BA' => '_bosniaAndHerzegovina',
33
35
  'BW' => '_botswana',
34
36
  'BV' => '_bouvetIsland',
@@ -41,9 +43,11 @@ module NetSuite
41
43
  'KH' => '_cambodia',
42
44
  'CM' => '_cameroon',
43
45
  'CA' => '_canada',
44
- 'CV' => '_capVerde',
46
+ 'IC' => '_canaryIslands',
47
+ 'CV' => '_capeVerde',
45
48
  'KY' => '_caymanIslands',
46
49
  'CF' => '_centralAfricanRepublic',
50
+ 'EA' => '_ceutaAndMelilla',
47
51
  'TD' => '_chad',
48
52
  'CL' => '_chile',
49
53
  'CN' => '_china',
@@ -65,7 +69,7 @@ module NetSuite
65
69
  'DJ' => '_djibouti',
66
70
  'DM' => '_dominica',
67
71
  'DO' => '_dominicanRepublic',
68
- 'TP' => '_eastTimor',
72
+ 'TL' => '_eastTimor',
69
73
  'EC' => '_ecuador',
70
74
  'EG' => '_egypt',
71
75
  'SV' => '_elSalvador',
@@ -73,7 +77,7 @@ module NetSuite
73
77
  'ER' => '_eritrea',
74
78
  'EE' => '_estonia',
75
79
  'ET' => '_ethiopia',
76
- 'FK' => '_falklandIslandsMalvina',
80
+ 'FK' => '_falklandIslands',
77
81
  'FO' => '_faroeIslands',
78
82
  'FJ' => '_fiji',
79
83
  'FI' => '_finland',
@@ -121,6 +125,7 @@ module NetSuite
121
125
  'KI' => '_kiribati',
122
126
  'KP' => '_koreaDemocraticPeoplesRepublic',
123
127
  'KR' => '_koreaRepublicOf',
128
+ 'XK' => '_kosovo',
124
129
  'KW' => '_kuwait',
125
130
  'KG' => '_kyrgyzstan',
126
131
  'LA' => '_laoPeoplesDemocraticRepublic',
@@ -128,7 +133,7 @@ module NetSuite
128
133
  'LB' => '_lebanon',
129
134
  'LS' => '_lesotho',
130
135
  'LR' => '_liberia',
131
- 'LY' => '_libyanArabJamahiriya',
136
+ 'LY' => '_libya',
132
137
  'LI' => '_liechtenstein',
133
138
  'LT' => '_lithuania',
134
139
  'LU' => '_luxembourg',
@@ -159,7 +164,6 @@ module NetSuite
159
164
  'NR' => '_nauru',
160
165
  'NP' => '_nepal',
161
166
  'NL' => '_netherlands',
162
- 'AN' => '_netherlandsAntilles',
163
167
  'NC' => '_newCaledonia',
164
168
  'NZ' => '_newZealand',
165
169
  'NI' => '_nicaragua',
@@ -172,7 +176,7 @@ module NetSuite
172
176
  'OM' => '_oman',
173
177
  'PK' => '_pakistan',
174
178
  'PW' => '_palau',
175
- 'PS' => '_palestinianTerritories',
179
+ 'PS' => '_stateOfPalestine',
176
180
  'PA' => '_panama',
177
181
  'PG' => '_papuaNewGuinea',
178
182
  'PY' => '_paraguay',
@@ -185,18 +189,19 @@ module NetSuite
185
189
  'QA' => '_qatar',
186
190
  'RE' => '_reunionIsland',
187
191
  'RO' => '_romania',
188
- 'RS' => '_serbia',
189
192
  'RU' => '_russianFederation',
190
193
  'RW' => '_rwanda',
191
194
  'BL' => '_saintBarthelemy',
195
+ 'SH' => '_saintHelena',
192
196
  'KN' => '_saintKittsAndNevis',
193
197
  'LC' => '_saintLucia',
198
+ 'MF' => '_saintMartin',
194
199
  'VC' => '_saintVincentAndTheGrenadines',
195
200
  'SM' => '_sanMarino',
196
201
  'ST' => '_saoTomeAndPrincipe',
197
202
  'SA' => '_saudiArabia',
198
203
  'SN' => '_senegal',
199
- 'CS' => '_serbia',
204
+ 'RS' => '_serbia',
200
205
  'SC' => '_seychelles',
201
206
  'SL' => '_sierraLeone',
202
207
  'SG' => '_singapore',
@@ -207,9 +212,9 @@ module NetSuite
207
212
  'SO' => '_somalia',
208
213
  'ZA' => '_southAfrica',
209
214
  'GS' => '_southGeorgia',
215
+ 'SS' => '_southSudan',
210
216
  'ES' => '_spain',
211
217
  'LK' => '_sriLanka',
212
- 'SH' => '_stHelena',
213
218
  'PM' => '_stPierreAndMiquelon',
214
219
  'SD' => '_sudan',
215
220
  'SR' => '_suriname',
@@ -234,7 +239,7 @@ module NetSuite
234
239
  'UG' => '_uganda',
235
240
  'UA' => '_ukraine',
236
241
  'AE' => '_unitedArabEmirates',
237
- 'GB' => '_unitedKingdomGB',
242
+ 'GB' => '_unitedKingdom',
238
243
  'US' => '_unitedStates',
239
244
  'UY' => '_uruguay',
240
245
  'UM' => '_uSMinorOutlyingIslands',
@@ -246,16 +251,15 @@ module NetSuite
246
251
  'VI' => '_virginIslandsUSA',
247
252
  'WF' => '_wallisAndFutunaIslands',
248
253
  'EH' => '_westernSahara',
249
- 'WS' => '_westernSamoa',
254
+ 'WS' => '_samoa',
250
255
  'YE' => '_yemen',
251
- 'YU' => '_yugoslavia',
252
256
  'ZM' => '_zambia',
253
257
  'ZW' => '_zimbabwe'
254
258
  }
255
259
 
256
260
  def initialize(iso_or_name = '')
257
261
  if iso_or_name =~ /^[A-Z]{2}/
258
- @id = ISO_TO_NETSUITE.fetch(iso_or_name)
262
+ @id = iso_to_netsuite.fetch(iso_or_name)
259
263
  else
260
264
  @id = iso_or_name
261
265
  end
@@ -268,13 +272,22 @@ module NetSuite
268
272
  alias :eql? :==
269
273
 
270
274
  def to_iso
271
- ISO_TO_NETSUITE.key(@id)
275
+ iso_to_netsuite.key(@id)
272
276
  end
273
277
 
274
278
  def to_record
275
279
  @id
276
280
  end
277
281
 
282
+ def iso_to_netsuite
283
+ # NOTE GB country code changed on 2016_1
284
+ if NetSuite::Configuration.api_version <= "2015_2"
285
+ ISO_TO_NETSUITE.merge({ 'GB' => '_unitedKingdomGB' })
286
+ else
287
+ ISO_TO_NETSUITE
288
+ end
289
+ end
290
+
278
291
  end
279
292
  end
280
293
  end