netsuite 0.8.10 → 0.8.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.github/dependabot.yml +14 -0
  4. data/.github/workflows/codeql-analysis.yml +70 -0
  5. data/.github/workflows/main.yml +7 -4
  6. data/Gemfile +5 -3
  7. data/HISTORY.md +27 -2
  8. data/README.md +13 -18
  9. data/lib/netsuite/actions/add.rb +5 -1
  10. data/lib/netsuite/actions/attach_file.rb +87 -0
  11. data/lib/netsuite/actions/search.rb +19 -6
  12. data/lib/netsuite/records/account.rb +0 -1
  13. data/lib/netsuite/records/accounting_period.rb +1 -1
  14. data/lib/netsuite/records/assembly_component.rb +0 -2
  15. data/lib/netsuite/records/assembly_item.rb +0 -1
  16. data/lib/netsuite/records/assembly_unbuild.rb +0 -1
  17. data/lib/netsuite/records/cash_refund.rb +0 -1
  18. data/lib/netsuite/records/cash_sale.rb +1 -2
  19. data/lib/netsuite/records/contact.rb +0 -1
  20. data/lib/netsuite/records/credit_memo.rb +0 -1
  21. data/lib/netsuite/records/currency_rate.rb +0 -1
  22. data/lib/netsuite/records/custom_record.rb +1 -1
  23. data/lib/netsuite/records/customer.rb +0 -1
  24. data/lib/netsuite/records/customer_deposit.rb +0 -1
  25. data/lib/netsuite/records/customer_payment.rb +0 -1
  26. data/lib/netsuite/records/customer_refund.rb +0 -1
  27. data/lib/netsuite/records/deposit.rb +0 -1
  28. data/lib/netsuite/records/deposit_application.rb +0 -1
  29. data/lib/netsuite/records/description_item.rb +1 -1
  30. data/lib/netsuite/records/estimate.rb +0 -1
  31. data/lib/netsuite/records/inbound_shipment.rb +0 -1
  32. data/lib/netsuite/records/inventory_item.rb +236 -37
  33. data/lib/netsuite/records/inventory_number.rb +0 -1
  34. data/lib/netsuite/records/invoice.rb +1 -2
  35. data/lib/netsuite/records/item_fulfillment.rb +0 -1
  36. data/lib/netsuite/records/item_group.rb +1 -1
  37. data/lib/netsuite/records/item_option_custom_field.rb +52 -0
  38. data/lib/netsuite/records/item_receipt.rb +0 -1
  39. data/lib/netsuite/records/item_vendor.rb +10 -1
  40. data/lib/netsuite/records/job.rb +0 -1
  41. data/lib/netsuite/records/kit_item.rb +1 -1
  42. data/lib/netsuite/records/location.rb +0 -1
  43. data/lib/netsuite/records/lot_numbered_inventory_item.rb +225 -81
  44. data/lib/netsuite/records/matrix_option_list.rb +16 -0
  45. data/lib/netsuite/records/non_inventory_resale_item.rb +156 -20
  46. data/lib/netsuite/records/non_inventory_sale_item.rb +133 -21
  47. data/lib/netsuite/records/opportunity.rb +0 -1
  48. data/lib/netsuite/records/other_charge_sale_item.rb +1 -1
  49. data/lib/netsuite/records/payment_item.rb +1 -1
  50. data/lib/netsuite/records/payroll_item.rb +0 -1
  51. data/lib/netsuite/records/purchase_order.rb +0 -1
  52. data/lib/netsuite/records/return_authorization.rb +1 -0
  53. data/lib/netsuite/records/sales_order.rb +1 -2
  54. data/lib/netsuite/records/serialized_inventory_item.rb +1 -1
  55. data/lib/netsuite/records/serialized_inventory_item_location.rb +0 -1
  56. data/lib/netsuite/records/service_resale_item.rb +123 -19
  57. data/lib/netsuite/records/service_sale_item.rb +0 -1
  58. data/lib/netsuite/records/subsidiary.rb +0 -1
  59. data/lib/netsuite/records/subtotal_item.rb +1 -1
  60. data/lib/netsuite/records/transfer_order.rb +0 -1
  61. data/lib/netsuite/records/translation.rb +17 -0
  62. data/lib/netsuite/records/translation_list.rb +11 -0
  63. data/lib/netsuite/records/vendor.rb +0 -1
  64. data/lib/netsuite/records/vendor_bill.rb +0 -1
  65. data/lib/netsuite/records/work_order.rb +0 -1
  66. data/lib/netsuite/records/work_order_item.rb +0 -1
  67. data/lib/netsuite/support/actions.rb +2 -0
  68. data/lib/netsuite/support/fields.rb +2 -0
  69. data/lib/netsuite/support/records.rb +9 -1
  70. data/lib/netsuite/utilities.rb +5 -0
  71. data/lib/netsuite/version.rb +1 -1
  72. data/lib/netsuite.rb +4 -0
  73. data/netsuite.gemspec +2 -2
  74. data/spec/netsuite/actions/add_spec.rb +36 -0
  75. data/spec/netsuite/actions/attach_file_spec.rb +59 -0
  76. data/spec/netsuite/actions/search_spec.rb +205 -0
  77. data/spec/netsuite/records/inventory_item_spec.rb +239 -22
  78. data/spec/netsuite/records/invoice_spec.rb +29 -0
  79. data/spec/netsuite/records/item_option_custom_field_spec.rb +27 -0
  80. data/spec/netsuite/records/item_vendor_list_spec.rb +2 -5
  81. data/spec/netsuite/records/item_vendor_spec.rb +14 -2
  82. data/spec/netsuite/records/lot_numbered_inventory_item_spec.rb +247 -0
  83. data/spec/netsuite/records/matrix_option_list_spec.rb +26 -0
  84. data/spec/netsuite/records/non_inventory_resale_item_spec.rb +159 -24
  85. data/spec/netsuite/records/non_inventory_sale_item_spec.rb +135 -22
  86. data/spec/netsuite/records/return_authorization_spec.rb +62 -0
  87. data/spec/netsuite/records/sales_order_spec.rb +29 -0
  88. data/spec/netsuite/records/service_resale_item_spec.rb +122 -17
  89. data/spec/netsuite/records/translation_list_spec.rb +34 -0
  90. data/spec/netsuite/records/translation_spec.rb +28 -0
  91. data/spec/netsuite/support/fields_spec.rb +16 -4
  92. data/spec/netsuite/support/search_result_spec.rb +12 -0
  93. data/spec/netsuite/utilities_spec.rb +10 -2
  94. data/spec/support/fixtures/add/add_file.xml +20 -0
  95. data/spec/support/fixtures/attach/attach_file_to_sales_order.xml +16 -0
  96. data/spec/support/fixtures/attach/attach_file_to_sales_order_error.xml +20 -0
  97. data/spec/support/fixtures/search/basic_search_contact.xml +39 -0
  98. data/spec/support/fixtures/search/single_search_result.xml +46 -0
  99. metadata +37 -8
@@ -9,35 +9,147 @@ module NetSuite
9
9
 
10
10
  actions :get, :get_list, :add, :delete, :search, :update, :upsert
11
11
 
12
- fields :available_to_partners, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :country_of_manufacture,
13
- :created_date, :direct_revenue_posting, :display_name, :dont_show_price, :enforce_min_qty_internally, :exclude_from_sitemap,
14
- :featured_description, :handling_cost, :handling_cost_units, :include_children, :is_donation_item, :is_fulfillable,
15
- :is_gco_compliant, :is_inactive, :is_online, :is_taxable, :item_id, :last_modified_date, :manufacturer,
16
- :manufacturer_addr1, :manufacturer_city, :manufacturer_state, :manufacturer_tariff, :manufacturer_tax_id,
17
- :manufacturer_zip, :matrix_option_list, :matrix_type, :max_donation_amount, :meta_tag_html, :minimum_quantity,
18
- :minimum_quantity_units, :mpn, :mult_manufacture_addr, :nex_tag_category, :no_price_message, :offer_support,
19
- :on_special, :out_of_stock_behavior, :out_of_stock_message, :overall_quantity_pricing_type, :page_title,
20
- :preference_criterion, :presentation_item_list, :prices_include_tax, :producer, :product_feed_list,
21
- :rate, :related_items_description, :sales_description, :schedule_b_code, :schedule_b_number, :schedule_b_quantity,
22
- :search_keywords, :ship_individually, :shipping_cost, :shipping_cost_units, :shopping_dot_com_category,
23
- :shopzilla_category_id, :show_default_donation_amount, :site_category_list, :sitemap_priority, :soft_descriptor,
24
- :specials_description, :stock_description, :store_description, :store_detailed_description, :store_display_name,
25
- :translations_list, :upc_code, :url_component, :use_marginal_rates, :vsoe_deferral, :vsoe_delivered,
26
- :vsoe_permit_discount, :vsoe_price, :weight, :weight_unit, :weight_units
12
+ fields :available_to_partners,
13
+ :contingent_revenue_handling,
14
+ :cost_estimate,
15
+ :cost_estimate_type,
16
+ :cost_estimate_units,
17
+ :country_of_manufacture,
18
+ :created_date,
19
+ :defer_rev_rec,
20
+ :direct_revenue_posting,
21
+ :display_name,
22
+ :dont_show_price,
23
+ :enforce_min_qty_internally,
24
+ :exclude_from_sitemap,
25
+ :featured_description,
26
+ :handling_cost,
27
+ :handling_cost_units,
28
+ :hazmat_hazard_class,
29
+ :hazmat_id,
30
+ :hazmat_item_units,
31
+ :hazmat_item_units_qty,
32
+ :hazmat_packing_group,
33
+ :hazmat_shipping_name,
34
+ :include_children,
35
+ :is_donation_item,
36
+ :is_fulfillable,
37
+ :is_gco_compliant,
38
+ :is_hazmat_item,
39
+ :is_inactive,
40
+ :is_online,
41
+ :is_taxable,
42
+ :item_carrier,
43
+ :item_id,
44
+ :last_modified_date,
45
+ :manufacturer,
46
+ :manufacturer_addr1,
47
+ :manufacturer_city,
48
+ :manufacturer_state,
49
+ :manufacturer_tariff,
50
+ :manufacturer_tax_id,
51
+ :manufacturer_zip,
52
+ :matrix_item_name_template,
53
+ :matrix_type,
54
+ :max_donation_amount,
55
+ :maximum_quantity,
56
+ :meta_tag_html,
57
+ :minimum_quantity,
58
+ :minimum_quantity_units,
59
+ :mpn,
60
+ :mult_manufacture_addr,
61
+ :nex_tag_category,
62
+ :no_price_message,
63
+ :offer_support,
64
+ :on_special,
65
+ :out_of_stock_behavior,
66
+ :out_of_stock_message,
67
+ :overall_quantity_pricing_type,
68
+ :page_title,
69
+ :preference_criterion,
70
+ :prices_include_tax,
71
+ :producer,
72
+ :rate,
73
+ :related_items_description,
74
+ :sales_description,
75
+ :schedule_b_code,
76
+ :schedule_b_number,
77
+ :schedule_b_quantity,
78
+ :search_keywords,
79
+ :ship_individually,
80
+ :shipping_cost,
81
+ :shipping_cost_units,
82
+ :shopping_dot_com_category,
83
+ :shopzilla_category_id,
84
+ :show_default_donation_amount,
85
+ :sitemap_priority,
86
+ :soft_descriptor,
87
+ :specials_description,
88
+ :stock_description,
89
+ :store_description,
90
+ :store_detailed_description,
91
+ :store_display_name,
92
+ :upc_code,
93
+ :url_component,
94
+ :use_marginal_rates,
95
+ :vsoe_deferral,
96
+ :vsoe_delivered,
97
+ :vsoe_permit_discount,
98
+ :vsoe_price,
99
+ :vsoe_sop_group,
100
+ :weight,
101
+ :weight_unit,
102
+ :weight_units
27
103
 
28
- record_refs :billing_schedule, :cost_category, :custom_form, :deferred_revenue_account, :department, :income_account,
29
- :issue_product, :item_options_list, :klass, :location, :parent, :pricing_group, :purchase_tax_code,
30
- :quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :ship_package, :store_display_image,
31
- :store_display_thumbnail, :store_item_template, :tax_schedule, :units_type
104
+ record_refs :bill_exch_rate_variance_acct,
105
+ :billing_schedule,
106
+ :bill_price_variance_acct,
107
+ :bill_qty_variance_acct,
108
+ :klass,
109
+ :consumption_unit,
110
+ :cost_category,
111
+ :create_revenue_plans_on,
112
+ :custom_form,
113
+ :default_item_ship_method,
114
+ :deferred_revenue_account,
115
+ :department,
116
+ :income_account,
117
+ :issue_product,
118
+ :item_revenue_category,
119
+ :location,
120
+ :parent,
121
+ :pricing_group,
122
+ :purchase_tax_code,
123
+ :quantity_pricing_schedule,
124
+ :revenue_allocation_group,
125
+ :revenue_recognition_rule,
126
+ :rev_rec_forecast_rule,
127
+ :rev_reclass_f_x_account,
128
+ :rev_rec_schedule,
129
+ :sales_tax_code,
130
+ :sale_unit,
131
+ :ship_package,
132
+ :store_display_image,
133
+ :store_display_thumbnail,
134
+ :store_item_template,
135
+ :tax_schedule,
136
+ :units_type
32
137
 
33
138
  field :custom_field_list, CustomFieldList
139
+ field :item_ship_method_list, RecordRefList
140
+ field :matrix_option_list, MatrixOptionList
34
141
  field :pricing_matrix, PricingMatrix
35
142
  field :subsidiary_list, RecordRefList
36
-
143
+ # TODO: field :accounting_book_detail_list, ItemAccountingBookDetailList
144
+ # TODO: field :hierarchy_versions_list, NonInventorySaleItemHierarchyVersionsList
145
+ # TODO: field :item_options_list, ItemOptionsList
146
+ # TODO: field :presentation_item_list, PresentationItemList
147
+ # TODO: field :product_feed_list, ProductFeedList
148
+ # TODO: field :site_category_list, SiteCategoryList
149
+ field :translations_list, TranslationList
37
150
 
38
151
  attr_reader :internal_id
39
152
  attr_accessor :external_id
40
- attr_accessor :search_joins
41
153
 
42
154
  def initialize(attributes = {})
43
155
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -33,7 +33,6 @@ module NetSuite
33
33
 
34
34
  attr_reader :internal_id
35
35
  attr_accessor :external_id
36
- attr_accessor :search_joins
37
36
 
38
37
  def initialize(attributes = {})
39
38
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -53,7 +53,7 @@ module NetSuite
53
53
 
54
54
  field :custom_field_list, CustomFieldList
55
55
  field :pricing_matrix, PricingMatrix
56
- # :translations_list,
56
+ field :translations_list, TranslationList
57
57
  # :matrix_option_list,
58
58
  # :item_options_list
59
59
  field :subsidiary_list, RecordRefList
@@ -17,7 +17,7 @@ module NetSuite
17
17
  field :subsidiary_list, RecordRefList
18
18
 
19
19
  # TODO custom records need to be implemented
20
- # field :translations_list, TranslationList
20
+ field :translations_list, TranslationList
21
21
 
22
22
  attr_reader :internal_id
23
23
  attr_accessor :external_id
@@ -17,7 +17,6 @@ module NetSuite
17
17
 
18
18
  attr_reader :internal_id
19
19
  attr_accessor :external_id
20
- attr_accessor :search_joins
21
20
 
22
21
  def initialize(attributes = {})
23
22
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -31,7 +31,6 @@ module NetSuite
31
31
 
32
32
  attr_reader :internal_id
33
33
  attr_accessor :external_id
34
- attr_accessor :search_joins
35
34
 
36
35
  def initialize(attributes = {})
37
36
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -105,6 +105,7 @@ module NetSuite
105
105
  # :ship_address_list,
106
106
 
107
107
  field :billing_address, Address
108
+ field :shipping_address, Address
108
109
  field :custom_field_list, CustomFieldList
109
110
  field :item_list, ReturnAuthorizationItemList
110
111
 
@@ -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, :upsert_list, :search
10
+ actions :attach_file, :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,
@@ -43,7 +43,6 @@ module NetSuite
43
43
 
44
44
  attr_reader :internal_id
45
45
  attr_accessor :external_id
46
- attr_accessor :search_joins
47
46
 
48
47
  def initialize(attributes = {})
49
48
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -214,7 +214,7 @@ module NetSuite
214
214
  # site_category_list SiteCategoryList
215
215
  # sitemap_priority SitemapPriority
216
216
  # subsidiary_list RecordRefList
217
- # translations_list TranslationList
217
+ field :translations_list, TranslationList
218
218
  # vsoe_deferral VsoeDeferral
219
219
  # vsoe_permit_discount VsoePermitDiscount
220
220
  # vsoe_sop_group VsoeSopGroup
@@ -24,7 +24,6 @@ module NetSuite
24
24
 
25
25
  attr_reader :internal_id
26
26
  attr_accessor :external_id
27
- attr_accessor :search_joins
28
27
 
29
28
  def initialize(attributes = {})
30
29
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -9,28 +9,132 @@ module NetSuite
9
9
 
10
10
  actions :get, :get_list, :add, :update, :delete, :upsert, :search
11
11
 
12
- fields :available_to_partners, :cost, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :create_job, :created_date,
13
- :display_name, :dont_show_price, :enforce_min_qty_internally, :exclude_from_sitemap, :featured_description,
14
- :include_children, :is_donation_item, :is_fulfillable, :is_gco_compliant, :is_inactive, :is_online, :is_taxable,
15
- :item_id, :last_modified_date, :matrix_option_list, :matrix_type, :max_donation_amount, :meta_tag_html,
16
- :minimum_quantity, :minimum_quantity_units, :no_price_message, :offer_support, :on_special, :out_of_stock_behavior,
17
- :out_of_stock_message, :overall_quantity_pricing_type, :page_title, :presentation_item_list, :prices_include_tax,
18
- :rate, :related_items_description, :sales_description, :search_keywords,
19
- :show_default_donation_amount, :site_category_list, :sitemap_priority, :soft_descriptor, :specials_description,
20
- :store_description, :store_detailed_description, :store_display_name, :translations_list, :upc_code, :url_component,
21
- :use_marginal_rates, :vsoe_deferral, :vsoe_delivered, :vsoe_permit_discount, :vsoe_price, :vsoe_sop_group
22
-
23
- # item_task_templates_list
24
- # billing_rates_matrix -- RecordRef, via listAcct::ItemOptionsList
25
-
26
- record_refs :billing_schedule, :cost_category, :custom_form, :deferred_revenue_account, :department, :income_account,
27
- :issue_product, :item_options_list, :klass, :location, :parent, :pricing_group, :purchase_tax_code,
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
12
+ fields :amortization_period,
13
+ :available_to_partners,
14
+ :contingent_revenue_handling,
15
+ :cost,
16
+ :cost_estimate,
17
+ :cost_estimate_type,
18
+ :cost_estimate_units,
19
+ :cost_units,
20
+ :created_date,
21
+ :create_job,
22
+ :currency,
23
+ :defer_rev_rec,
24
+ :direct_revenue_posting,
25
+ :display_name,
26
+ :dont_show_price,
27
+ :enforce_min_qty_internally,
28
+ :exclude_from_sitemap,
29
+ :featured_description,
30
+ :generate_accruals,
31
+ :include_children,
32
+ :is_donation_item,
33
+ :is_fulfillable,
34
+ :is_gco_compliant,
35
+ :is_inactive,
36
+ :is_online,
37
+ :is_taxable,
38
+ :item_id,
39
+ :last_modified_date,
40
+ :manufacturing_charge_item,
41
+ :matrix_item_name_template,
42
+ :matrix_type,
43
+ :max_donation_amount,
44
+ :maximum_quantity,
45
+ :meta_tag_html,
46
+ :minimum_quantity,
47
+ :minimum_quantity_units,
48
+ :no_price_message,
49
+ :offer_support,
50
+ :on_special,
51
+ :out_of_stock_behavior,
52
+ :out_of_stock_message,
53
+ :overall_quantity_pricing_type,
54
+ :page_title,
55
+ :prices_include_tax,
56
+ :purchase_description,
57
+ :purchase_order_amount,
58
+ :purchase_order_quantity,
59
+ :purchase_order_quantity_diff,
60
+ :rate,
61
+ :receipt_amount,
62
+ :receipt_quantity,
63
+ :receipt_quantity_diff,
64
+ :related_items_description,
65
+ :residual,
66
+ :sales_description,
67
+ :search_keywords,
68
+ :show_default_donation_amount,
69
+ :sitemap_priority,
70
+ :soft_descriptor,
71
+ :specials_description,
72
+ :store_description,
73
+ :store_detailed_description,
74
+ :store_display_name,
75
+ :upc_code,
76
+ :url_component,
77
+ :use_marginal_rates,
78
+ :vendor_name,
79
+ :vsoe_deferral,
80
+ :vsoe_delivered,
81
+ :vsoe_permit_discount,
82
+ :vsoe_price,
83
+ :vsoe_sop_group
84
+
85
+ record_refs :amortization_template,
86
+ :bill_exch_rate_variance_acct,
87
+ :billing_schedule,
88
+ :bill_price_variance_acct,
89
+ :bill_qty_variance_acct,
90
+ :klass,
91
+ :consumption_unit,
92
+ :cost_category,
93
+ :create_revenue_plans_on,
94
+ :custom_form,
95
+ :deferral_account,
96
+ :deferred_revenue_account,
97
+ :department,
98
+ :expense_account,
99
+ :income_account,
100
+ :interco_def_rev_account,
101
+ :interco_expense_account,
102
+ :interco_income_account,
103
+ :issue_product,
104
+ :item_revenue_category,
105
+ :location,
106
+ :parent,
107
+ :pricing_group,
108
+ :purchase_tax_code,
109
+ :purchase_unit,
110
+ :quantity_pricing_schedule,
111
+ :revenue_allocation_group,
112
+ :revenue_recognition_rule,
113
+ :rev_rec_forecast_rule,
114
+ :rev_reclass_f_x_account,
115
+ :rev_rec_schedule,
116
+ :sales_tax_code,
117
+ :sale_unit,
118
+ :store_display_image,
119
+ :store_display_thumbnail,
120
+ :store_item_template,
121
+ :tax_schedule,
122
+ :units_type,
123
+ :vendor
30
124
 
31
- field :pricing_matrix, PricingMatrix
32
125
  field :custom_field_list, CustomFieldList
126
+ field :item_vendor_list, ItemVendorList
127
+ field :matrix_option_list, MatrixOptionList
128
+ field :pricing_matrix, PricingMatrix
33
129
  field :subsidiary_list, RecordRefList
130
+ # TODO: field :accounting_book_detail_list, ItemAccountingBookDetailList
131
+ # TODO: field :billing_rates_matrix, BillingRatesMatrix
132
+ # TODO: field :item_options_list, ItemOptionsList
133
+ # TODO: field :item_task_templates_list, ServiceItemTaskTemplatesList
134
+ # TODO: field :hierarchy_versions_list, ServiceResaleItemHierarchyVersionsList
135
+ # TODO: field :presentation_item_list, PresentationItemList
136
+ # TODO: field :site_category_list, SiteCategoryList
137
+ field :translations_list, TranslationList
34
138
 
35
139
  attr_reader :internal_id
36
140
  attr_accessor :external_id
@@ -34,7 +34,6 @@ module NetSuite
34
34
 
35
35
  attr_reader :internal_id
36
36
  attr_accessor :external_id
37
- attr_accessor :search_joins
38
37
 
39
38
  def initialize(attributes = {})
40
39
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -27,7 +27,6 @@ module NetSuite
27
27
 
28
28
  attr_reader :internal_id
29
29
  attr_accessor :external_id
30
- attr_accessor :search_joins
31
30
 
32
31
  def initialize(attributes = {})
33
32
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -15,7 +15,7 @@ module NetSuite
15
15
 
16
16
  field :custom_field_list, CustomFieldList
17
17
  field :subsidiary_list, RecordRefList
18
- # TODO field :translations_list, TranslationList
18
+ field :translations_list, TranslationList
19
19
 
20
20
  attr_reader :internal_id
21
21
  attr_accessor :external_id
@@ -24,7 +24,6 @@ module NetSuite
24
24
 
25
25
  attr_reader :internal_id
26
26
  attr_accessor :external_id
27
- attr_accessor :search_joins
28
27
 
29
28
  def initialize(attributes = {})
30
29
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -0,0 +1,17 @@
1
+ module NetSuite
2
+ module Records
3
+ class Translation
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Namespaces::ListAcct
7
+
8
+ fields :description, :display_name, :featured_description, :language, :locale, :locale_description, :name,
9
+ :no_price_message, :out_of_stock_message, :page_title, :replace_all, :sales_description,
10
+ :specials_description, :store_description, :store_detailed_description, :store_display_name
11
+
12
+ def initialize(attributes = {})
13
+ initialize_from_attributes_hash(attributes)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,11 @@
1
+ module NetSuite
2
+ module Records
3
+ class TranslationList < Support::Sublist
4
+ include NetSuite::Namespaces::ListAcct
5
+
6
+ sublist :translation, NetSuite::Records::Translation
7
+
8
+ alias translations translation
9
+ end
10
+ end
11
+ end
@@ -35,7 +35,6 @@ module NetSuite
35
35
 
36
36
  attr_reader :internal_id
37
37
  attr_accessor :external_id
38
- attr_accessor :search_joins
39
38
 
40
39
  def initialize(attributes = {})
41
40
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -25,7 +25,6 @@ module NetSuite
25
25
 
26
26
  attr_reader :internal_id
27
27
  attr_accessor :external_id
28
- attr_accessor :search_joins
29
28
 
30
29
  def initialize(attributes = {})
31
30
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -26,7 +26,6 @@ module NetSuite
26
26
 
27
27
  attr_reader :internal_id
28
28
  attr_accessor :external_id
29
- attr_accessor :search_joins
30
29
 
31
30
  def initialize(attributes = {})
32
31
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -19,7 +19,6 @@ module NetSuite
19
19
 
20
20
  attr_reader :internal_id
21
21
  attr_accessor :external_id
22
- attr_accessor :search_joins
23
22
 
24
23
  def initialize(attributes = {})
25
24
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -18,6 +18,8 @@ module NetSuite
18
18
 
19
19
  def action(name)
20
20
  case name
21
+ when :attach_file
22
+ self.send(:include, NetSuite::Actions::AttachFile::Support)
21
23
  when :get
22
24
  self.send(:include, NetSuite::Actions::Get::Support)
23
25
  when :get_all
@@ -22,6 +22,8 @@ module NetSuite
22
22
  def field(name, klass = nil)
23
23
  name_sym = name.to_sym
24
24
  raise "#{name} already defined on #{self.name}" if fields.include?(name_sym)
25
+ raise "#{name} conflicts with a method defined on #{self.name}" if method_defined?(name_sym)
26
+
25
27
  fields << name_sym
26
28
  if klass
27
29
  define_method(name_sym) do
@@ -49,7 +49,15 @@ module NetSuite
49
49
  end
50
50
 
51
51
  def record_type
52
- "#{record_namespace}:#{self.class.to_s.split('::').last}"
52
+ "#{record_namespace}:#{record_type_without_namespace}"
53
+ end
54
+
55
+ def netsuite_type
56
+ record_type_without_namespace.lower_camelcase
57
+ end
58
+
59
+ def record_type_without_namespace
60
+ "#{self.class.to_s.split('::').last}"
53
61
  end
54
62
 
55
63
  def refresh(credentials = {})
@@ -103,6 +103,10 @@ module NetSuite
103
103
  exceptions_to_retry << OpenSSL::SSL::SSLErrorWaitReadable if defined?(OpenSSL::SSL::SSLErrorWaitReadable)
104
104
 
105
105
  # depends on the http library chosen
106
+ exceptions_to_retry << HTTPClient::TimeoutError if defined?(HTTPClient::TimeoutError)
107
+ exceptions_to_retry << HTTPClient::ConnectTimeoutError if defined?(HTTPClient::ConnectTimeoutError)
108
+ exceptions_to_retry << HTTPClient::ReceiveTimeoutError if defined?(HTTPClient::ReceiveTimeoutError)
109
+ exceptions_to_retry << HTTPClient::SendTimeoutError if defined?(HTTPClient::SendTimeoutError)
106
110
  exceptions_to_retry << Excon::Error::Timeout if defined?(Excon::Error::Timeout)
107
111
  exceptions_to_retry << Excon::Error::Socket if defined?(Excon::Error::Socket)
108
112
 
@@ -170,6 +174,7 @@ module NetSuite
170
174
  ns_item ||= NetSuite::Utilities.get_record(NetSuite::Records::DiscountItem, ns_item_internal_id, opts)
171
175
  ns_item ||= NetSuite::Utilities.get_record(NetSuite::Records::OtherChargeSaleItem, ns_item_internal_id, opts)
172
176
  ns_item ||= NetSuite::Utilities.get_record(NetSuite::Records::ServiceSaleItem, ns_item_internal_id, opts)
177
+ ns_item ||= NetSuite::Utilities.get_record(NetSuite::Records::ServiceResaleItem, ns_item_internal_id, opts)
173
178
  ns_item ||= NetSuite::Utilities.get_record(NetSuite::Records::GiftCertificateItem, ns_item_internal_id, opts)
174
179
  ns_item ||= NetSuite::Utilities.get_record(NetSuite::Records::KitItem, ns_item_internal_id, opts)
175
180
  ns_item ||= NetSuite::Utilities.get_record(NetSuite::Records::SerializedInventoryItem, ns_item_internal_id, opts)
@@ -1,3 +1,3 @@
1
1
  module NetSuite
2
- VERSION = '0.8.10'
2
+ VERSION = '0.8.11'
3
3
  end
data/lib/netsuite.rb CHANGED
@@ -49,6 +49,7 @@ module NetSuite
49
49
 
50
50
  module Actions
51
51
  autoload :Add, 'netsuite/actions/add'
52
+ autoload :AttachFile, 'netsuite/actions/attach_file'
52
53
  autoload :Delete, 'netsuite/actions/delete'
53
54
  autoload :DeleteList, 'netsuite/actions/delete_list'
54
55
  autoload :Get, 'netsuite/actions/get'
@@ -200,6 +201,7 @@ module NetSuite
200
201
  autoload :ItemGroup, 'netsuite/records/item_group'
201
202
  autoload :ItemMember, 'netsuite/records/item_member'
202
203
  autoload :ItemMemberList, 'netsuite/records/item_member_list'
204
+ autoload :ItemOptionCustomField, 'netsuite/records/item_option_custom_field'
203
205
  autoload :ItemReceipt, 'netsuite/records/item_receipt'
204
206
  autoload :ItemReceiptItemList, 'netsuite/records/item_receipt_item_list'
205
207
  autoload :ItemReceiptItem, 'netsuite/records/item_receipt_item'
@@ -283,6 +285,8 @@ module NetSuite
283
285
  autoload :TransferOrder, 'netsuite/records/transfer_order'
284
286
  autoload :TransferOrderItemList, 'netsuite/records/transfer_order_item_list'
285
287
  autoload :TransferOrderItem, 'netsuite/records/transfer_order_item'
288
+ autoload :Translation, 'netsuite/records/translation'
289
+ autoload :TranslationList, 'netsuite/records/translation_list'
286
290
  autoload :UnitsType, 'netsuite/records/units_type'
287
291
  autoload :UnitsTypeUomList, 'netsuite/records/units_type_uom_list'
288
292
  autoload :UnitsTypeUom, 'netsuite/records/units_type_uom'
data/netsuite.gemspec CHANGED
@@ -19,6 +19,6 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.add_dependency 'savon', '>= 2.3.0'
21
21
 
22
- gem.add_development_dependency 'rspec', '~> 3.10.0'
23
- gem.add_development_dependency 'rake'
22
+ gem.add_development_dependency 'rspec', '~> 3.11.0'
23
+ gem.add_development_dependency 'rake', '~> 13'
24
24
  end