netsuite 0.8.4 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/main.yml +20 -0
  3. data/.gitignore +1 -0
  4. data/.ruby-version +1 -1
  5. data/.tool-versions +1 -0
  6. data/Gemfile +2 -5
  7. data/HISTORY.md +26 -0
  8. data/README.md +72 -29
  9. data/Rakefile +1 -1
  10. data/lib/netsuite.rb +13 -19
  11. data/lib/netsuite/actions/login.rb +10 -2
  12. data/lib/netsuite/actions/upsert.rb +2 -0
  13. data/lib/netsuite/configuration.rb +34 -4
  14. data/lib/netsuite/records/accounting_period.rb +2 -2
  15. data/lib/netsuite/records/classification.rb +4 -1
  16. data/lib/netsuite/records/contact.rb +1 -1
  17. data/lib/netsuite/records/cost_category.rb +28 -0
  18. data/lib/netsuite/records/credit_memo.rb +1 -1
  19. data/lib/netsuite/records/custom_field_list.rb +9 -3
  20. data/lib/netsuite/records/custom_record.rb +1 -1
  21. data/lib/netsuite/records/customer.rb +2 -1
  22. data/lib/netsuite/records/customer_credit_cards.rb +36 -0
  23. data/lib/netsuite/records/customer_credit_cards_list.rb +10 -0
  24. data/lib/netsuite/records/customer_deposit.rb +5 -5
  25. data/lib/netsuite/records/customer_payment.rb +6 -2
  26. data/lib/netsuite/records/customer_payment_credit.rb +17 -0
  27. data/lib/netsuite/records/customer_payment_credit_list.rb +12 -0
  28. data/lib/netsuite/records/employee.rb +1 -1
  29. data/lib/netsuite/records/estimate.rb +42 -0
  30. data/lib/netsuite/records/estimate_item.rb +40 -0
  31. data/lib/netsuite/records/estimate_item_list.rb +11 -0
  32. data/lib/netsuite/records/inventory_item.rb +62 -1
  33. data/lib/netsuite/records/invoice.rb +94 -1
  34. data/lib/netsuite/records/item_fulfillment.rb +1 -1
  35. data/lib/netsuite/records/lot_numbered_inventory_item.rb +116 -0
  36. data/lib/netsuite/records/matrix_option_list.rb +12 -4
  37. data/lib/netsuite/records/message.rb +30 -0
  38. data/lib/netsuite/records/non_inventory_resale_item.rb +1 -0
  39. data/lib/netsuite/records/non_inventory_sale_item.rb +1 -1
  40. data/lib/netsuite/records/other_charge_sale_item.rb +2 -2
  41. data/lib/netsuite/records/partner.rb +7 -5
  42. data/lib/netsuite/records/serialized_assembly_item.rb +3 -1
  43. data/lib/netsuite/records/service_resale_item.rb +1 -1
  44. data/lib/netsuite/records/support_case_type.rb +26 -0
  45. data/lib/netsuite/records/tax_group.rb +2 -2
  46. data/lib/netsuite/records/vendor.rb +2 -1
  47. data/lib/netsuite/records/vendor_currency.rb +26 -0
  48. data/lib/netsuite/records/vendor_currency_list.rb +9 -0
  49. data/lib/netsuite/support/fields.rb +16 -0
  50. data/lib/netsuite/support/records.rb +1 -1
  51. data/lib/netsuite/support/search_result.rb +36 -6
  52. data/lib/netsuite/utilities.rb +18 -6
  53. data/lib/netsuite/version.rb +1 -1
  54. data/netsuite.gemspec +5 -3
  55. data/spec/netsuite/actions/search_spec.rb +22 -0
  56. data/spec/netsuite/configuration_spec.rb +111 -6
  57. data/spec/netsuite/records/basic_record_spec.rb +9 -1
  58. data/spec/netsuite/records/classification_spec.rb +10 -1
  59. data/spec/netsuite/records/cost_category_spec.rb +105 -0
  60. data/spec/netsuite/records/custom_field_list_spec.rb +46 -6
  61. data/spec/netsuite/records/custom_record_spec.rb +1 -1
  62. data/spec/netsuite/records/customer_credit_cards_list_spec.rb +23 -0
  63. data/spec/netsuite/records/customer_payment_credit_list_spec.rb +26 -0
  64. data/spec/netsuite/records/customer_payment_spec.rb +1 -6
  65. data/spec/netsuite/records/customer_spec.rb +22 -1
  66. data/spec/netsuite/records/employee_spec.rb +2 -2
  67. data/spec/netsuite/records/estimate_item_list_spec.rb +26 -0
  68. data/spec/netsuite/records/estimate_item_spec.rb +40 -0
  69. data/spec/netsuite/records/estimate_spec.rb +216 -0
  70. data/spec/netsuite/records/inventory_item_spec.rb +65 -0
  71. data/spec/netsuite/records/invoice_spec.rb +94 -0
  72. data/spec/netsuite/records/matrix_option_list_spec.rb +15 -5
  73. data/spec/netsuite/records/message_spec.rb +49 -0
  74. data/spec/netsuite/records/non_inventory_resale_item_spec.rb +165 -0
  75. data/spec/netsuite/records/non_inventory_sale_item_spec.rb +1 -1
  76. data/spec/netsuite/records/partner_spec.rb +143 -0
  77. data/spec/netsuite/records/service_resale_item_spec.rb +134 -0
  78. data/spec/netsuite/records/support_case_type_spec.rb +22 -0
  79. data/spec/netsuite/records/vendor_spec.rb +1 -1
  80. data/spec/netsuite/support/search_result_spec.rb +24 -0
  81. data/spec/netsuite/utilities_spec.rb +20 -15
  82. data/spec/support/fixtures/custom_fields/multi_select.xml +47 -0
  83. data/spec/support/fixtures/search/saved_search_item.xml +55 -0
  84. data/spec/support/fixtures/search/saved_search_joined_custom_customer.xml +15 -1
  85. data/spec/support/search_only_field_matcher.rb +7 -0
  86. metadata +77 -12
  87. data/circle.yml +0 -17
@@ -8,12 +8,12 @@ module NetSuite
8
8
 
9
9
  actions :get, :get_list, :add, :delete, :upsert, :search
10
10
 
11
- fields :allow_non_gl_changes, :end_date, :is_adjust, :is_quarter, :is_year, :period_name, :start_date
11
+ fields :allow_non_gl_changes, :end_date, :is_adjust, :is_quarter, :is_year, :period_name, :start_date, :closed
12
12
 
13
13
  record_refs :parent
14
14
 
15
15
  attr_reader :internal_id
16
- attr_accessor :external_id
16
+ attr_accessor :external_id, :search_joins
17
17
 
18
18
  def initialize(attributes = {})
19
19
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -9,9 +9,12 @@ module NetSuite
9
9
 
10
10
  actions :add, :get, :get_list, :delete, :upsert, :search
11
11
 
12
- fields :name, :include_children, :is_inactive, :class_translation_list, :custom_field_list, :parent
12
+ fields :name, :include_children, :is_inactive, :class_translation_list
13
13
 
14
14
  field :subsidiary_list, RecordRefList
15
+ field :custom_field_list, CustomFieldList
16
+
17
+ record_refs :parent
15
18
 
16
19
  attr_reader :internal_id
17
20
  attr_accessor :external_id
@@ -7,7 +7,7 @@ module NetSuite
7
7
  include Support::Actions
8
8
  include Namespaces::ListRel
9
9
 
10
- actions :get, :get_list, :add, :delete, :delete_list, :search, :update, :upsert
10
+ actions :get, :get_deleted, :get_list, :add, :delete, :delete_list, :search, :update, :upsert, :upsert_list
11
11
 
12
12
  fields :salutation, :first_name, :middle_name, :last_name, :title, :phone, :fax, :email, :default_address,
13
13
  :entity_id, :phonetic_name, :alt_email, :office_phone, :home_phone, :mobile_phone, :supervisor_phone,
@@ -0,0 +1,28 @@
1
+ module NetSuite
2
+ module Records
3
+ class CostCategory
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Support::Actions
8
+ include Namespaces::ListAcct
9
+
10
+ actions :add, :delete, :delete_list, :get, :get_all, :get_list, :get_select_value, :search, :update, :update_list, :upsert, :upsert_list
11
+ # TODO: Add add_list when supported by gem
12
+
13
+ fields :is_inactive, :item_cost_type, :name
14
+
15
+ record_refs :account
16
+
17
+ attr_reader :internal_id
18
+ attr_accessor :external_id
19
+
20
+ def initialize(attributes = {})
21
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
22
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
23
+ initialize_from_attributes_hash(attributes)
24
+ end
25
+
26
+ end
27
+ end
28
+ end
@@ -17,7 +17,7 @@ module NetSuite
17
17
  :sales_effective_date, :shipping_cost, :shipping_tax1_rate, :shipping_tax2_rate, :source, :status,
18
18
  :sync_partner_teams, :sync_sales_teams, :tax2_total, :tax_rate, :to_be_emailed, :to_be_faxed,
19
19
  :to_be_printed, :total_cost_estimate, :tran_date, :tran_id, :tran_is_vsoe_bundle, :vat_reg_num,
20
- :vsoe_auto_calc
20
+ :vsoe_auto_calc, :tax_details_override, :tax_reg_override
21
21
 
22
22
  field :custom_field_list, CustomFieldList
23
23
  field :item_list, CreditMemoItemList
@@ -110,10 +110,16 @@ module NetSuite
110
110
  attrs = custom_field_data.clone
111
111
  type = (custom_field_data[:"@xsi:type"] || custom_field_data[:type])
112
112
 
113
- if type == "platformCore:SelectCustomFieldRef"
113
+ case type
114
+ when "platformCore:SelectCustomFieldRef", "platformCore:SearchColumnSelectCustomField"
114
115
  attrs[:value] = CustomRecordRef.new(custom_field_data[:value])
115
- elsif type == 'platformCore:MultiSelectCustomFieldRef'
116
- attrs[:value] = custom_field_data[:value].map do |entry|
116
+ when 'platformCore:MultiSelectCustomFieldRef', 'platformCore:SearchColumnMultiSelectCustomField'
117
+ # if there is only a single selection, `:value` will be hash not an array
118
+ attrs[:value] = if custom_field_data[:value].is_a?(Array)
119
+ custom_field_data[:value]
120
+ else
121
+ [custom_field_data[:value]]
122
+ end.map do |entry|
117
123
  CustomRecordRef.new(entry)
118
124
  end
119
125
  end
@@ -18,7 +18,7 @@ module NetSuite
18
18
 
19
19
  field :custom_field_list, CustomFieldList
20
20
 
21
- record_refs :custom_form, :owner, :rec_type
21
+ record_refs :custom_form, :owner, :rec_type, :parent
22
22
 
23
23
  attr_reader :internal_id
24
24
  attr_accessor :external_id
@@ -13,7 +13,7 @@ module NetSuite
13
13
 
14
14
  fields :account_number, :aging, :alt_email, :alt_name, :alt_phone, :bill_pay,
15
15
  :buying_reason, :buying_time_frame, :campaign_category, :click_stream, :comments, :company_name,
16
- :consol_aging, :consol_days_overdue, :contrib_pct, :credit_cards_list, :credit_hold_override,
16
+ :consol_aging, :consol_days_overdue, :contrib_pct, :credit_hold_override,
17
17
  :credit_limit, :date_created, :days_overdue, :default_address,
18
18
  :download_list, :email, :email_preference, :email_transactions, :end_date, :entity_id,
19
19
  :estimated_budget, :fax, :fax_transactions, :first_name, :first_visit, :give_access, :global_subscription_status,
@@ -28,6 +28,7 @@ module NetSuite
28
28
  :vat_reg_number, :visits, :web_lead
29
29
 
30
30
  field :addressbook_list, CustomerAddressbookList
31
+ field :credit_cards_list, CustomerCreditCardsList
31
32
  field :custom_field_list, CustomFieldList
32
33
  field :contact_roles_list, ContactAccessRolesList
33
34
  field :currency_list, CustomerCurrencyList
@@ -0,0 +1,36 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerCreditCards
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+
8
+ # https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_1/schema/other/customercreditcards.html?mode=package
9
+
10
+ fields :cc_default, :cc_expire_date, :cc_memo, :cc_name, :cc_number, :debitcard_issue_no, :state_from, :validfrom
11
+ record_refs :card_state, :payment_method
12
+
13
+ attr_reader :internal_id
14
+
15
+ def initialize(attributes_or_record = {})
16
+ case attributes_or_record
17
+ when self.class
18
+ initialize_from_record(attributes_or_record)
19
+ when Hash
20
+ initialize_from_attributes_hash(attributes_or_record)
21
+ end
22
+ end
23
+
24
+ def initialize_from_record(obj)
25
+ self.cc_default = obj.cc_default
26
+ self.cc_expire_date = obj.cc_expire_date
27
+ self.cc_memo = obj.cc_memo
28
+ self.cc_name = obj.cc_name
29
+ self.cc_number = obj.cc_number
30
+ self.debitcard_issue_no = obj.debitcard_issue_no
31
+ self.state_from = obj.state_from
32
+ self.validfrom = obj.validfrom
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,10 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerCreditCardsList < Support::Sublist
4
+ include Namespaces::ListRel
5
+
6
+ sublist :credit_cards, CustomerCreditCards
7
+ alias :credit_card :credit_cards
8
+ end
9
+ end
10
+ end
@@ -21,11 +21,11 @@ module NetSuite
21
21
  field :apply_list, CustomerDepositApplyList
22
22
  # accountingBookDetailList
23
23
 
24
- record_refs :customer, :sales_order, :account, :department, :payment_method,
25
- :custom_form, :currency, :posting_period, :subsidiary, :location,
26
-
27
- # only available in an advanced search result
28
- :deposit_transaction
24
+ record_refs :customer, :sales_order, :account, :department,
25
+ :payment_method, :payment_option, :custom_form, :currency,
26
+ :posting_period, :subsidiary, :location,
27
+ # only available in an advanced search result
28
+ :deposit_transaction
29
29
 
30
30
  attr_reader :internal_id
31
31
  attr_accessor :external_id
@@ -17,14 +17,18 @@ module NetSuite
17
17
 
18
18
  field :custom_field_list, CustomFieldList
19
19
  field :apply_list, CustomerPaymentApplyList
20
+ field :credit_list, CustomerPaymentCreditList
20
21
 
21
22
  read_only_fields :applied, :balance, :pending, :total, :unapplied
22
23
 
23
- record_refs :account, :ar_acct, :credit_card, :credit_card_processor, :custom_form, :customer, :department, :klass,
24
- :location, :payment_method, :posting_period, :subsidiary, :currency
24
+ record_refs :account, :ar_acct, :credit_card, :credit_card_processor,
25
+ :custom_form, :customer, :department, :klass, :location,
26
+ :payment_method, :payment_option, :posting_period, :subsidiary,
27
+ :currency
25
28
 
26
29
  attr_reader :internal_id
27
30
  attr_accessor :external_id
31
+ attr_accessor :search_joins
28
32
 
29
33
  def initialize(attributes = {})
30
34
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@@ -0,0 +1,17 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerPaymentCredit
4
+ include Support::Fields
5
+ include Support::Records
6
+ include Namespaces::TranCust
7
+
8
+ fields :amount, :applied_to, :apply, :credit_date, :currency, :doc, :due, :line,
9
+ :ref_num, :total, :type
10
+
11
+ def initialize(attributes = {})
12
+ initialize_from_attributes_hash(attributes)
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ module NetSuite
2
+ module Records
3
+ class CustomerPaymentCreditList < Support::Sublist
4
+ include Namespaces::TranCust
5
+
6
+ sublist :credit, CustomerPaymentCredit
7
+
8
+ alias :credits :credit
9
+
10
+ end
11
+ end
12
+ end
@@ -19,7 +19,7 @@ module NetSuite
19
19
  :phonetic_name, :purchase_order_approval_limit, :purchase_order_approver, :purchase_order_limit, :release_date,
20
20
  :resident_status, :salutation, :social_security_number, :visa_exp_date, :visa_type
21
21
 
22
- record_refs :currency, :department, :location, :subsidiary, :employee_type, :employee_status, :supervisor
22
+ record_refs :currency, :department, :location, :sales_role, :subsidiary, :employee_type, :employee_status, :supervisor
23
23
 
24
24
  field :custom_field_list, CustomFieldList
25
25
  field :roles_list, RoleList
@@ -0,0 +1,42 @@
1
+ module NetSuite
2
+ module Records
3
+ class Estimate
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Support::Actions
8
+ include Namespaces::TranSales
9
+
10
+ actions :get, :get_list, :add, :initialize, :delete, :update, :upsert, :search
11
+
12
+ fields :alt_handling_cost, :alt_sales_total, :alt_shipping_cost, :balance,
13
+ :bill_address, :billing_address, :billing_schedule, :bill_is_residential,
14
+ :created_date, :currency_name, :discount_rate, :email, :end_date,
15
+ :est_gross_profit, :exchange_rate, :handling_cost, :handling_tax1_rate, :is_taxable,
16
+ :last_modified_date, :memo, :message, :other_ref_num, :ship_date, :shipping_cost,
17
+ :shipping_tax1_rate, :source, :start_date, :status, :sync_partner_teams, :sync_sales_teams,
18
+ :to_be_emailed, :to_be_faxed, :to_be_printed, :total_cost_estimate, :tran_date, :tran_id,
19
+ :linked_tracking_numbers, :is_multi_ship_to
20
+
21
+ field :shipping_address, Address
22
+ field :billing_address, Address
23
+
24
+ field :item_list, EstimateItemList
25
+ field :custom_field_list, CustomFieldList
26
+
27
+ record_refs :bill_address_list, :created_from, :currency, :custom_form, :department, :discount_item, :entity,
28
+ :handling_tax_code, :job, :klass, :lead_source, :location, :message_sel, :opportunity, :partner,
29
+ :promo_code, :sales_group, :sales_rep, :ship_method, :shipping_tax_code, :subsidiary, :terms
30
+
31
+ attr_reader :internal_id
32
+ attr_accessor :external_id
33
+ attr_accessor :search_joins
34
+
35
+ def initialize(attributes = {})
36
+ @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
37
+ @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
38
+ initialize_from_attributes_hash(attributes)
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,40 @@
1
+ module NetSuite
2
+ module Records
3
+ class EstimateItem
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Namespaces::TranSales
8
+
9
+ fields :amount, :cost_estimate,
10
+ :cost_estimate_type, :defer_rev_rec, :description,
11
+ :is_taxable, :line, :quantity,
12
+ :rate, :tax_rate1
13
+
14
+ field :custom_field_list, CustomFieldList
15
+
16
+ record_refs :item, :job, :price, :tax_code, :units
17
+
18
+ def initialize(attributes_or_record = {})
19
+ case attributes_or_record
20
+ when Hash
21
+ initialize_from_attributes_hash(attributes_or_record)
22
+ when self.class
23
+ initialize_from_record(attributes_or_record)
24
+ end
25
+ end
26
+
27
+ def initialize_from_record(record)
28
+ self.attributes = record.send(:attributes)
29
+ end
30
+
31
+ def to_record
32
+ rec = super
33
+ if rec["#{record_namespace}:customFieldList"]
34
+ rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList")
35
+ end
36
+ rec
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,11 @@
1
+ module NetSuite
2
+ module Records
3
+ class EstimateItemList < Support::Sublist
4
+ include Namespaces::TranSales
5
+
6
+ sublist :item, EstimateItem
7
+
8
+ alias :items :item
9
+ end
10
+ end
11
+ end
@@ -45,13 +45,74 @@ module NetSuite
45
45
  :total_value, :track_landed_cost, :transfer_price, :upc_code, :url_component, :use_bins, :use_marginal_rates,
46
46
  :vendor_name, :vsoe_deferral, :vsoe_delivered, :vsoe_permit_discount, :vsoe_price, :weight, :weight_unit, :weight_units
47
47
 
48
+ # https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2020_2/schema/search/itemsearchrowbasic.html?mode=package
49
+ search_only_fields :acc_book_rev_rec_forecast_rule, :accounting_book,
50
+ :accounting_book_amortization, :accounting_book_create_plans_on,
51
+ :accounting_book_rev_rec_rule, :accounting_book_rev_rec_schedule,
52
+ :allowed_shipping_method, :atp_lead_time, :atp_method, :base_price,
53
+ :bin_number, :bin_on_hand_avail, :bin_on_hand_count, :bom_quantity,
54
+ :build_entire_assembly, :build_time, :buy_it_now_price, :category,
55
+ :category_preferred, :component_yield, :correlated_item,
56
+ :correlated_item_correlation, :correlated_item_count,
57
+ :correlated_item_lift, :correlated_item_purchase_rate,
58
+ :cost_accounting_status, :created, :create_job,
59
+ :cust_return_variance_account, :date_viewed, :days_before_expiration,
60
+ :default_shipping_method, :deferred_expense_account,
61
+ :departmentnohierarchy, :display_ine_bay_store, :e_bay_item_description,
62
+ :e_bay_item_subtitle, :e_bay_item_title, :ebay_relisting_option,
63
+ :effective_bom_control, :effective_date, :effective_revision,
64
+ :end_auctions_when_out_of_stock, :feed_description, :feed_name,
65
+ :froogle_product_feed, :fx_cost, :generate_accruals,
66
+ :gift_cert_auth_code, :gift_cert_email, :gift_cert_expiration_date,
67
+ :gift_cert_from, :gift_cert_message, :gift_cert_original_amount,
68
+ :gift_cert_recipient, :hierarchy_node, :hierarchy_version, :hits,
69
+ :image_url, :interco_expense_account, :inventory_location,
70
+ :is_available, :is_fulfillable, :is_lot_item, :is_serial_item,
71
+ :is_special_work_order_item, :is_vsoe_bundle, :is_wip, :item_url,
72
+ :last_quantity_available_change, :liability_account, :listing_duration,
73
+ :location_allow_store_pickup, :location_atp_lead_time,
74
+ :location_average_cost, :location_bin_quantity_available,
75
+ :location_build_time, :location_cost, :location_cost_accounting_status,
76
+ :location_default_return_cost, :location_demand_source,
77
+ :location_demand_time_fence, :location_fixed_lot_size,
78
+ :location_inventory_cost_template, :location_invt_classification,
79
+ :location_invt_count_interval, :location_last_invt_count_date,
80
+ :location_lead_time, :location_next_invt_count_date,
81
+ :location_periodic_lot_size_days, :location_periodic_lot_size_type,
82
+ :location_preferred_stock_level, :location_qty_avail_for_store_pickup,
83
+ :location_quantity_available, :location_quantity_back_ordered,
84
+ :location_quantity_committed, :location_quantity_in_transit,
85
+ :location_quantity_on_hand, :location_quantity_on_order,
86
+ :location_re_order_point, :location_reschedule_in_days,
87
+ :location_reschedule_out_days, :location_safety_stock_level,
88
+ :location_store_pickup_buffer_stock, :location_supply_lot_sizing_method,
89
+ :location_supply_time_fence, :location_supply_type,
90
+ :location_total_value, :loc_backward_consumption_days,
91
+ :loc_forward_consumption_days, :manufacturing_charge_item, :member_item,
92
+ :member_quantity, :modified, :moss_applies, :nextag_product_feed,
93
+ :num_active_listings, :number_allowed_downloads, :num_currently_listed,
94
+ :obsolete_date, :obsolete_revision, :online_customer_price,
95
+ :online_price, :other_prices, :other_vendor, :overhead_type,
96
+ :preferred_bin, :primary_category, :prod_price_variance_acct,
97
+ :prod_qty_variance_acct, :purchase_unit, :reserve_price,
98
+ :revenue_recognition_rule, :same_as_primary_book_amortization,
99
+ :same_as_primary_book_rev_rec, :scrap_acct, :sell_on_ebay,
100
+ :serial_number, :serial_number_location, :shipping_carrier,
101
+ :shipping_rate, :shopping_product_feed, :shopzilla_product_feed,
102
+ :soft_descriptor, :starting_price, :subsidiary, :sub_type,
103
+ :thumb_nail_url, :type, :unbuild_variance_account, :use_component_yield,
104
+ :vendor_code, :vendor_cost, :vendor_cost_entered,
105
+ :vendor_price_currency, :vendor_schedule, :vend_return_variance_account,
106
+ :web_site, :wip_acct, :wip_variance_acct, :yahoo_product_feed
107
+
48
108
  record_refs :alternate_demand_source_item, :asset_account, :bill_exch_rate_variance_acct, :bill_price_variance_acct,
49
109
  :bill_qty_variance_acct, :billing_schedule, :cogs_account, :cost_category, :custom_form, :deferred_revenue_account,
50
110
  :demand_source, :department, :expense_account, :gain_loss_account, :income_account, :issue_product, :klass, :location,
51
111
  :parent, :preferred_location, :pricing_group, :purchase_price_variance_acct, :purchase_tax_code, :purchase_unit,
52
112
  :quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :ship_package, :soft_descriptor,
53
113
  :stock_unit, :store_display_image, :store_display_thumbnail, :store_item_template, :supply_lot_sizing_method,
54
- :supply_replenishment_method, :supply_type, :tax_schedule, :units_type, :vendor
114
+ :supply_replenishment_method, :supply_type, :tax_schedule, :units_type, :vendor, :create_revenue_plans_on,
115
+ :revenue_recognition_rule, :rev_rec_forecast_rule
55
116
 
56
117
  field :pricing_matrix, PricingMatrix
57
118
  field :custom_field_list, CustomFieldList
@@ -39,9 +39,102 @@ module NetSuite
39
39
  field :shipping_address, Address
40
40
  field :billing_address, Address
41
41
 
42
- read_only_fields :sub_total, :discount_total, :total, :recognized_revenue, :amount_remaining, :amount_paid,
42
+ read_only_fields :sub_total, :discount_total, :total, :recognized_revenue, :amount_remaining, :amount_paid, :amount,
43
43
  :alt_shipping_cost, :gift_cert_applied, :handling_cost, :alt_handling_cost
44
44
 
45
+ # https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2020_2/schema/search/transactionsearchrowbasic.html?mode=package
46
+ search_only_fields :abbrev, :account_type, :acct_corp_card_exp,
47
+ :actual_production_end_date, :actual_production_start_date,
48
+ :actual_ship_date, :alt_sales_amount, :alt_sales_net_amount, :amount,
49
+ :amount_unbilled, :applied_to_foreign_amount,
50
+ :applied_to_is_fx_variance, :applied_to_link_amount,
51
+ :applied_to_link_type, :applied_to_transaction,
52
+ :applying_foreign_amount, :applying_is_fx_variance,
53
+ :applying_link_amount, :applying_link_type, :applying_transaction,
54
+ :auth_code, :auto_calculate_lag, :avs_street_match, :avs_zip_match,
55
+ :billable, :bill_address, :bill_address1, :bill_address2,
56
+ :bill_address3, :bill_addressee, :bill_attention, :bill_city,
57
+ :bill_country, :bill_country_code, :billed_date, :billing_amount,
58
+ :billing_transaction, :bill_phone, :bill_state, :bill_variance_status,
59
+ :bill_zip, :bin_number, :bin_number_quantity, :bom_quantity,
60
+ :build_entire_assembly, :build_variance, :built,
61
+ :can_have_stackable_promotions, :catch_up_period, :cc_customer_code,
62
+ :cc_exp_date, :cc_holder_name, :cc_number, :cc_street, :cc_zip_code,
63
+ :cleared, :closed, :close_date, :cogs_amount,
64
+ :commission_effective_date, :commit, :component_yield,
65
+ :confirmation_number, :contribution, :contribution_primary,
66
+ :cost_component_amount, :cost_component_category, :cost_component_item,
67
+ :cost_component_quantity, :cost_component_standard_cost, :cost_estimate,
68
+ :cost_estimate_rate, :cost_estimate_type, :created_by, :credit_amount,
69
+ :csc_match, :custom_gl, :cust_type, :date_created, :days_open,
70
+ :days_overdue, :debit_amount, :defer_rev_rec, :deposit_date,
71
+ :deposit_transaction, :doc_unit, :dr_account, :effective_rate,
72
+ :entity_status, :est_gross_profit_pct, :exclude_from_rate_request,
73
+ :expected_close_date, :expected_receipt_date, :expense_category,
74
+ :expense_date, :firmed, :forecast_type, :fulfilling_transaction,
75
+ :fx_account, :fx_amount, :fx_cost_estimate, :fx_cost_estimate_rate,
76
+ :fx_est_gross_profit, :fx_tran_cost_estimate, :fx_vsoe_allocation,
77
+ :fx_vsoe_amount, :fx_vsoe_price, :gco_availabel_to_charge,
78
+ :gco_available_to_refund, :gco_avs_street_match, :gco_avs_zip_match,
79
+ :gco_buyer_account_age, :gco_buyer_ip, :gco_charge_amount,
80
+ :gco_chargeback_amount, :gco_confirmed_charged_total,
81
+ :gco_confirmed_refunded_total, :gco_creditcard_number, :gco_csc_match,
82
+ :gco_financial_state, :gco_fulfillment_state, :gco_order_id,
83
+ :gco_order_total, :gco_promotion_amount, :gco_promotion_name,
84
+ :gco_refund_amount, :gco_shipping_total, :gco_state_changed_detail,
85
+ :gift_cert, :gross_amount, :include_in_forecast, :incoterm,
86
+ :interco_status, :interco_transaction, :inventory_location,
87
+ :inventory_subsidiary, :in_vsoe_bundle, :is_allocation, :is_backflush,
88
+ :is_gco_chargeback, :is_gco_charge_confirmed,
89
+ :is_gco_payment_guaranteed, :is_gco_refund_confirmed,
90
+ :is_inside_delivery, :is_inside_pickup, :is_intercompany_adjustment,
91
+ :is_in_transit_payment, :is_multi_ship_to, :is_reversal,
92
+ :is_rev_rec_transaction, :is_scrap, :is_ship_address,
93
+ :is_transfer_price_costing, :is_wip, :item, :item_fulfillment_choice,
94
+ :item_revision, :landed_cost_per_line, :line, :line_sequence_number,
95
+ :line_unique_key, :location_auto_assigned, :main_line, :main_name,
96
+ :manufacturing_routing, :match_bill_to_receipt, :memo_main, :memorized,
97
+ :merchant_account, :multi_subsidiary, :net_amount, :net_amount_no_tax,
98
+ :next_bill_date, :no_auto_assign_location, :non_reimbursable,
99
+ :one_time_total, :options, :order_allocation_strategy, :order_priority,
100
+ :originator, :other_ref_num, :overhead_parent_item,
101
+ :override_installments, :package_count, :paid_amount, :paid_transaction,
102
+ :partner_contribution, :partner_role, :partner_team_member,
103
+ :paying_amount, :paying_transaction, :payment_approved,
104
+ :payment_event_date, :payment_event_hold_reason,
105
+ :payment_event_purchase_card_used, :payment_event_purchase_data_sent,
106
+ :payment_event_result, :payment_event_type, :payment_hold,
107
+ :payment_method, :payment_option, :pay_pal_pending, :pay_pal_status,
108
+ :pay_pal_tran_id, :payroll_batch, :pn_ref_num, :po_rate, :posting,
109
+ :price_level, :print, :probability, :projected_amount, :project_task,
110
+ :purchase_order, :quantity, :quantity_billed, :quantity_committed,
111
+ :quantity_packed, :quantity_picked, :quantity_rev_committed,
112
+ :quantity_ship_recv, :quantity_uom, :rate,
113
+ :realized_gain_posting_transaction, :recur_annually_total,
114
+ :recur_monthly_total, :recur_quarterly_total, :recur_weekly_total,
115
+ :ref_number, :requested_date, :rev_commit_status,
116
+ :rev_committing_transaction, :reversal_date, :reversal_number,
117
+ :rg_account, :rg_amount, :sales_order, :sales_team_member,
118
+ :sales_team_role, :scheduling_method, :serial_number,
119
+ :serial_number_cost, :serial_number_cost_adjustment,
120
+ :serial_number_quantity, :serial_numbers, :ship_address, :ship_address1,
121
+ :ship_address2, :ship_address3, :ship_addressee, :ship_attention,
122
+ :ship_carrier, :ship_city, :ship_complete, :ship_country,
123
+ :ship_country_code, :ship_group, :ship_phone, :shipping_amount,
124
+ :ship_recv_status_line, :ship_state, :ship_to, :ship_zip,
125
+ :signed_amount, :subscription, :subscription_line, :tax_amount,
126
+ :tax_code, :tax_line, :tax_period, :term_in_months, :terms_of_sale,
127
+ :title, :to_subsidiary, :tran_est_gross_profit,
128
+ :tran_fx_est_gross_profit, :transaction_discount,
129
+ :transaction_line_type, :transaction_number, :transfer_location,
130
+ :transfer_order_item_line, :transfer_order_quantity_committed,
131
+ :transfer_order_quantity_packed, :transfer_order_quantity_picked,
132
+ :transfer_order_quantity_received, :transfer_order_quantity_shipped,
133
+ :type, :unit, :unit_cost_override, :vend_type, :visible_to_customer,
134
+ :vsoe_allocation, :vsoe_amount, :vsoe_deferral, :vsoe_delivered,
135
+ :vsoe_permit_discount, :vsoe_price, :web_site
136
+ # TODO: Add record_type, conflicts with Support::Records#record_type, returns "invoice" versus "tranSales:Invoice"
137
+
45
138
  record_refs :account, :bill_address_list, :custom_form, :department, :entity, :klass, :partner,
46
139
  :posting_period, :ship_address_list, :terms, :location, :sales_rep, :tax_item, :created_from,
47
140
  :ship_method, :lead_source, :promo_code, :subsidiary, :currency, :approval_status, :job, :discount_item