netsuite 0.7.9 → 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/Gemfile +7 -2
- data/README.md +164 -61
- data/circle.yml +33 -13
- data/lib/netsuite.rb +55 -19
- data/lib/netsuite/actions/login.rb +20 -1
- data/lib/netsuite/actions/search.rb +1 -6
- data/lib/netsuite/actions/update.rb +6 -2
- data/lib/netsuite/actions/update_list.rb +109 -0
- data/lib/netsuite/actions/upsert.rb +2 -0
- data/lib/netsuite/configuration.rb +21 -4
- data/lib/netsuite/errors.rb +3 -0
- data/lib/netsuite/records/assembly_build.rb +39 -0
- data/lib/netsuite/records/assembly_component.rb +28 -0
- data/lib/netsuite/records/assembly_component_list.rb +12 -0
- data/lib/netsuite/records/assembly_item.rb +1 -0
- data/lib/netsuite/records/assembly_unbuild.rb +40 -0
- data/lib/netsuite/records/bin_number.rb +18 -0
- data/lib/netsuite/records/bin_number_list.rb +1 -20
- data/lib/netsuite/records/bin_transfer.rb +38 -0
- data/lib/netsuite/records/bin_transfer_inventory.rb +20 -0
- data/lib/netsuite/records/bin_transfer_inventory_list.rb +10 -0
- data/lib/netsuite/records/cash_refund.rb +101 -3
- data/lib/netsuite/records/cash_refund_item.rb +1 -1
- data/lib/netsuite/records/cash_sale.rb +1 -0
- data/lib/netsuite/records/classification.rb +5 -2
- data/lib/netsuite/records/contact.rb +2 -1
- data/lib/netsuite/records/contact_addressbook.rb +64 -0
- data/lib/netsuite/records/contact_addressbook_list.rb +11 -0
- data/lib/netsuite/records/credit_memo.rb +1 -0
- data/lib/netsuite/records/currency_rate.rb +4 -3
- data/lib/netsuite/records/custom_field_list.rb +16 -3
- data/lib/netsuite/records/custom_record.rb +3 -3
- data/lib/netsuite/records/custom_record_ref.rb +1 -0
- data/lib/netsuite/records/customer.rb +5 -4
- data/lib/netsuite/records/customer_credit_cards.rb +36 -0
- data/lib/netsuite/records/customer_credit_cards_list.rb +10 -0
- data/lib/netsuite/records/customer_deposit.rb +6 -2
- data/lib/netsuite/records/customer_deposit_apply.rb +17 -0
- data/lib/netsuite/records/customer_deposit_apply_list.rb +12 -0
- data/lib/netsuite/records/customer_payment.rb +1 -0
- data/lib/netsuite/records/customer_sales_team.rb +24 -0
- data/lib/netsuite/records/customer_sales_team_list.rb +9 -0
- data/lib/netsuite/records/customer_status.rb +29 -0
- data/lib/netsuite/records/customer_subscription.rb +18 -0
- data/lib/netsuite/records/customer_subscriptions_list.rb +10 -0
- data/lib/netsuite/records/deposit_other.rb +0 -10
- data/lib/netsuite/records/employee.rb +3 -2
- data/lib/netsuite/records/entity_custom_field.rb +53 -0
- data/lib/netsuite/records/estimate.rb +42 -0
- data/lib/netsuite/records/estimate_item.rb +40 -0
- data/lib/netsuite/records/estimate_item_list.rb +11 -0
- data/lib/netsuite/records/inbound_shipment.rb +33 -0
- data/lib/netsuite/records/inbound_shipment_item.rb +39 -0
- data/lib/netsuite/records/inbound_shipment_item_list.rb +11 -0
- data/lib/netsuite/records/inter_company_journal_entry.rb +48 -0
- data/lib/netsuite/records/inter_company_journal_entry_line.rb +28 -0
- data/lib/netsuite/records/inter_company_journal_entry_line_list.rb +14 -0
- data/lib/netsuite/records/inventory_adjustment.rb +1 -1
- data/lib/netsuite/records/inventory_adjustment_inventory.rb +2 -2
- data/lib/netsuite/records/inventory_item.rb +2 -2
- data/lib/netsuite/records/inventory_number.rb +35 -0
- data/lib/netsuite/records/inventory_number_locations.rb +16 -0
- data/lib/netsuite/records/inventory_number_locations_list.rb +10 -0
- data/lib/netsuite/records/inventory_transfer.rb +2 -2
- data/lib/netsuite/records/inventory_transfer_inventory_list.rb +0 -2
- data/lib/netsuite/records/invoice.rb +4 -4
- data/lib/netsuite/records/item_fulfillment.rb +2 -1
- data/lib/netsuite/records/job.rb +2 -1
- data/lib/netsuite/records/lot_numbered_assembly_item.rb +64 -0
- data/lib/netsuite/records/lot_numbered_inventory_item.rb +116 -0
- data/lib/netsuite/records/matrix_option_list.rb +12 -4
- data/lib/netsuite/records/message.rb +30 -0
- data/lib/netsuite/records/non_inventory_resale_item.rb +3 -2
- data/lib/netsuite/records/non_inventory_sale_item.rb +2 -1
- data/lib/netsuite/records/other_charge_sale_item.rb +2 -2
- data/lib/netsuite/records/partner.rb +1 -1
- data/lib/netsuite/records/price.rb +17 -0
- data/lib/netsuite/records/price_level.rb +26 -0
- data/lib/netsuite/records/price_list.rb +9 -0
- data/lib/netsuite/records/pricing.rb +20 -0
- data/lib/netsuite/records/pricing_matrix.rb +2 -2
- data/lib/netsuite/records/promotions.rb +26 -0
- data/lib/netsuite/records/promotions_list.rb +9 -0
- data/lib/netsuite/records/return_authorization.rb +3 -2
- data/lib/netsuite/records/return_authorization_item.rb +43 -0
- data/lib/netsuite/records/return_authorization_item_list.rb +11 -0
- data/lib/netsuite/records/sales_order.rb +1 -0
- data/lib/netsuite/records/sales_order_item.rb +12 -5
- data/lib/netsuite/records/sales_role.rb +26 -0
- data/lib/netsuite/records/sales_tax_item.rb +3 -1
- data/lib/netsuite/records/serialized_assembly_item.rb +239 -0
- data/lib/netsuite/records/serialized_inventory_item.rb +2 -2
- data/lib/netsuite/records/serialized_inventory_item_location.rb +37 -0
- data/lib/netsuite/records/serialized_inventory_item_locations_list.rb +10 -0
- data/lib/netsuite/records/serialized_inventory_item_numbers.rb +15 -0
- data/lib/netsuite/records/serialized_inventory_item_numbers_list.rb +10 -0
- data/lib/netsuite/records/service_resale_item.rb +1 -1
- data/lib/netsuite/records/service_sale_item.rb +2 -1
- data/lib/netsuite/records/subsidiary.rb +1 -0
- data/lib/netsuite/records/support_case.rb +1 -1
- data/lib/netsuite/records/support_case_type.rb +26 -0
- data/lib/netsuite/records/task.rb +2 -1
- data/lib/netsuite/records/tax_group.rb +3 -1
- data/lib/netsuite/records/transaction_body_custom_field.rb +61 -0
- data/lib/netsuite/records/transaction_column_custom_field.rb +59 -0
- data/lib/netsuite/records/transfer_order_item.rb +2 -2
- data/lib/netsuite/records/vendor.rb +1 -0
- data/lib/netsuite/records/vendor_bill.rb +2 -1
- data/lib/netsuite/records/vendor_credit.rb +2 -0
- data/lib/netsuite/records/work_order.rb +8 -0
- data/lib/netsuite/support/actions.rb +2 -0
- data/lib/netsuite/support/country.rb +27 -14
- data/lib/netsuite/support/search_result.rb +20 -5
- data/lib/netsuite/utilities.rb +100 -43
- data/lib/netsuite/version.rb +2 -2
- data/netsuite.gemspec +5 -4
- data/spec/netsuite/actions/login_spec.rb +23 -0
- data/spec/netsuite/actions/update_list_spec.rb +107 -0
- data/spec/netsuite/actions/update_spec.rb +42 -0
- data/spec/netsuite/configuration_spec.rb +79 -6
- data/spec/netsuite/records/address_spec.rb +10 -0
- data/spec/netsuite/records/basic_record_spec.rb +18 -1
- data/spec/netsuite/records/bin_number_spec.rb +23 -0
- data/spec/netsuite/records/classification_spec.rb +10 -1
- data/spec/netsuite/records/custom_field_list_spec.rb +46 -5
- data/spec/netsuite/records/custom_record_spec.rb +1 -1
- data/spec/netsuite/records/customer_credit_cards_list_spec.rb +23 -0
- data/spec/netsuite/records/customer_sales_team_list_spec.rb +41 -0
- data/spec/netsuite/records/customer_spec.rb +44 -2
- data/spec/netsuite/records/customer_subscription_spec.rb +41 -0
- data/spec/netsuite/records/customer_subscriptions_list_spec.rb +19 -0
- data/spec/netsuite/records/employee_spec.rb +2 -2
- data/spec/netsuite/records/entity_custom_field_spec.rb +34 -0
- data/spec/netsuite/records/estimate_item_list_spec.rb +26 -0
- data/spec/netsuite/records/estimate_item_spec.rb +40 -0
- data/spec/netsuite/records/estimate_spec.rb +216 -0
- data/spec/netsuite/records/inter_company_journal_entry_line_list_spec.rb +26 -0
- data/spec/netsuite/records/inter_company_journal_entry_line_spec.rb +60 -0
- data/spec/netsuite/records/inter_company_journal_entry_spec.rb +156 -0
- data/spec/netsuite/records/inventory_item_spec.rb +57 -0
- data/spec/netsuite/records/inventory_transfer_spec.rb +21 -0
- data/spec/netsuite/records/invoice_spec.rb +4 -4
- data/spec/netsuite/records/matrix_option_list_spec.rb +15 -5
- data/spec/netsuite/records/message_spec.rb +49 -0
- data/spec/netsuite/records/non_inventory_resale_item_spec.rb +165 -0
- data/spec/netsuite/records/non_inventory_sale_item_spec.rb +1 -1
- data/spec/netsuite/records/partner_spec.rb +141 -0
- data/spec/netsuite/records/price_level_spec.rb +16 -0
- data/spec/netsuite/records/pricing_matrix_spec.rb +15 -13
- data/spec/netsuite/records/return_authorization_item_list_spec.rb +26 -0
- data/spec/netsuite/records/return_authorization_item_spec.rb +43 -0
- data/spec/netsuite/records/sales_order_item_spec.rb +11 -5
- data/spec/netsuite/records/service_resale_item_spec.rb +134 -0
- data/spec/netsuite/records/support_case_type_spec.rb +22 -0
- data/spec/netsuite/records/transaction_body_custom_field_spec.rb +32 -0
- data/spec/netsuite/records/transaction_column_custom_field_spec.rb +32 -0
- data/spec/netsuite/records/vendor_credit_spec.rb +29 -0
- data/spec/netsuite/support/search_result_spec.rb +24 -0
- data/spec/netsuite/utilities_spec.rb +50 -0
- data/spec/spec_helper.rb +5 -4
- data/spec/support/fixtures/update_list/update_list_items.xml +22 -0
- data/spec/support/fixtures/update_list/update_list_one_item.xml +18 -0
- data/spec/support/fixtures/update_list/update_list_with_errors.xml +32 -0
- metadata +123 -8
@@ -15,10 +15,14 @@ module NetSuite
|
|
15
15
|
#
|
16
16
|
# <listAcct:matrixOptionList>
|
17
17
|
# <listAcct:matrixOption internalId="45" scriptId="custitem13">
|
18
|
-
# <platformCore:value internalId="4" typeId="28"
|
18
|
+
# <platformCore:value internalId="4" typeId="28">
|
19
|
+
# <platformCore:name>foo</platformCore:name>
|
20
|
+
# </platformCore:value>
|
19
21
|
# </listAcct:matrixOption>
|
20
22
|
# <listAcct:matrixOption internalId="46" scriptId="custitem14">
|
21
|
-
# <platformCore:value internalId="1" typeId="29"
|
23
|
+
# <platformCore:value internalId="1" typeId="29">
|
24
|
+
# <platformCore:name>bar</platformCore:name>
|
25
|
+
# </platformCore:value>
|
22
26
|
# </listAcct:matrixOption>
|
23
27
|
# </listAcct:matrixOptionList>
|
24
28
|
#
|
@@ -27,13 +31,17 @@ module NetSuite
|
|
27
31
|
when Hash
|
28
32
|
options << OpenStruct.new(
|
29
33
|
type_id: attributes[:matrix_option][:value][:'@type_id'],
|
30
|
-
value_id: attributes[:matrix_option][:value][:'@internal_id']
|
34
|
+
value_id: attributes[:matrix_option][:value][:'@internal_id'],
|
35
|
+
script_id: attributes[:matrix_option][:@script_id],
|
36
|
+
name: attributes[:matrix_option][:value][:name]
|
31
37
|
)
|
32
38
|
when Array
|
33
39
|
attributes[:matrix_option].each do |option|
|
34
40
|
options << OpenStruct.new(
|
35
41
|
type_id: option[:value][:'@type_id'],
|
36
|
-
value_id: option[:value][:'@internal_id']
|
42
|
+
value_id: option[:value][:'@internal_id'],
|
43
|
+
script_id: option[:@script_id],
|
44
|
+
name: option[:value][:name]
|
37
45
|
)
|
38
46
|
end
|
39
47
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class Message
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Support::Actions
|
8
|
+
include Namespaces::CommGeneral
|
9
|
+
|
10
|
+
actions :get, :add, :delete, :search
|
11
|
+
|
12
|
+
fields :bcc, :cc, :compress_attachments, :date_time, :emailed, :incoming,
|
13
|
+
:message, :record_name, :record_type_name, :subject
|
14
|
+
|
15
|
+
read_only_fields :last_modified_date, :message_date
|
16
|
+
|
17
|
+
record_refs :activity, :author, :recipient, :transaction
|
18
|
+
|
19
|
+
attr_reader :internal_id
|
20
|
+
attr_accessor :external_id
|
21
|
+
|
22
|
+
def initialize(attributes_or_record = {})
|
23
|
+
@internal_id = attributes_or_record.delete(:internal_id) || attributes_or_record.delete(:@internal_id)
|
24
|
+
@external_id = attributes_or_record.delete(:external_id) || attributes_or_record.delete(:@external_id)
|
25
|
+
initialize_from_attributes_hash(attributes_or_record)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::ListAcct
|
9
9
|
|
10
|
-
actions :get, :get_list, :add, :delete, :search, :upsert
|
10
|
+
actions :get, :get_list, :add, :delete, :search, :upsert, :update
|
11
11
|
|
12
12
|
fields :available_to_partners, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :country_of_manufacture,
|
13
13
|
:created_date, :display_name, :dont_show_price, :enforce_min_qty_internally, :exclude_from_sitemap,
|
@@ -28,11 +28,12 @@ module NetSuite
|
|
28
28
|
record_refs :billing_schedule, :cost_category, :custom_form, :deferred_revenue_account, :department, :income_account,
|
29
29
|
:issue_product, :item_options_list, :klass, :location, :parent, :pricing_group, :purchase_tax_code,
|
30
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
|
31
|
+
:store_display_thumbnail, :store_item_template, :tax_schedule, :units_type, :expense_account
|
32
32
|
|
33
33
|
field :custom_field_list, CustomFieldList
|
34
34
|
field :pricing_matrix, PricingMatrix
|
35
35
|
field :subsidiary_list, RecordRefList
|
36
|
+
field :item_vendor_list, ItemVendorList
|
36
37
|
|
37
38
|
|
38
39
|
attr_reader :internal_id
|
@@ -10,7 +10,7 @@ module NetSuite
|
|
10
10
|
actions :get, :get_list, :add, :delete, :search, :update, :upsert
|
11
11
|
|
12
12
|
fields :available_to_partners, :cost_estimate, :cost_estimate_type, :cost_estimate_units, :country_of_manufacture,
|
13
|
-
:created_date, :display_name, :dont_show_price, :enforce_min_qty_internally, :exclude_from_sitemap,
|
13
|
+
:created_date, :direct_revenue_posting, :display_name, :dont_show_price, :enforce_min_qty_internally, :exclude_from_sitemap,
|
14
14
|
:featured_description, :handling_cost, :handling_cost_units, :include_children, :is_donation_item, :is_fulfillable,
|
15
15
|
:is_gco_compliant, :is_inactive, :is_online, :is_taxable, :item_id, :last_modified_date, :manufacturer,
|
16
16
|
:manufacturer_addr1, :manufacturer_city, :manufacturer_state, :manufacturer_tariff, :manufacturer_tax_id,
|
@@ -37,6 +37,7 @@ module NetSuite
|
|
37
37
|
|
38
38
|
attr_reader :internal_id
|
39
39
|
attr_accessor :external_id
|
40
|
+
attr_accessor :search_joins
|
40
41
|
|
41
42
|
def initialize(attributes = {})
|
42
43
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
@@ -52,11 +52,11 @@ module NetSuite
|
|
52
52
|
:units_type, :sales_tax_code, :sale_unit, :tax_schedule, :parent
|
53
53
|
|
54
54
|
field :custom_field_list, CustomFieldList
|
55
|
-
|
55
|
+
field :pricing_matrix, PricingMatrix
|
56
56
|
# :translations_list,
|
57
57
|
# :matrix_option_list,
|
58
58
|
# :item_options_list
|
59
|
-
|
59
|
+
field :subsidiary_list, RecordRefList
|
60
60
|
|
61
61
|
def initialize(attributes = {})
|
62
62
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
@@ -16,7 +16,7 @@ module NetSuite
|
|
16
16
|
:partner_code, :is_person, :company_name, :eligible_for_commission, :entity_id, :last_modified_date,
|
17
17
|
:date_created, :title, :mobile_phone, :comments, :middle_name, :send_email, :password, :password2
|
18
18
|
|
19
|
-
record_refs :klass, :access_role, :department
|
19
|
+
record_refs :klass, :access_role, :department, :subsidiary
|
20
20
|
|
21
21
|
attr_reader :internal_id
|
22
22
|
attr_accessor :external_id
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class Price
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Records
|
6
|
+
include Namespaces::ListAcct
|
7
|
+
|
8
|
+
fields :value, :quantity
|
9
|
+
|
10
|
+
def initialize(attributes = {})
|
11
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
12
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
13
|
+
initialize_from_attributes_hash(attributes)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class PriceLevel
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Records
|
6
|
+
include Support::Actions
|
7
|
+
include Support::RecordRefs
|
8
|
+
include Namespaces::ListAcct
|
9
|
+
|
10
|
+
actions :get, :update, :get_list, :add, :delete, :search, :upsert
|
11
|
+
|
12
|
+
# http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_1/schema/record/pricelevel.html
|
13
|
+
fields :discountpct, :name, :is_online, :update_existing_prices,
|
14
|
+
:is_inactive
|
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
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class Pricing
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Records
|
6
|
+
include Support::RecordRefs
|
7
|
+
include Namespaces::ListAcct
|
8
|
+
|
9
|
+
record_refs :currency, :price_level
|
10
|
+
|
11
|
+
fields :discount
|
12
|
+
|
13
|
+
field :price_list, PriceList
|
14
|
+
|
15
|
+
def initialize(attributes = {})
|
16
|
+
initialize_from_attributes_hash(attributes)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module NetSuite
|
2
2
|
module Records
|
3
3
|
class PricingMatrix < Support::Sublist
|
4
|
-
include Namespaces::
|
4
|
+
include NetSuite::Namespaces::ListAcct
|
5
5
|
|
6
|
-
sublist :pricing,
|
6
|
+
sublist :pricing, NetSuite::Records::Pricing
|
7
7
|
|
8
8
|
alias :prices :pricing
|
9
9
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class Promotions
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Namespaces::TranSales
|
8
|
+
|
9
|
+
record_refs :coupon_code, :promo_code
|
10
|
+
|
11
|
+
def initialize(attributes_or_record = {})
|
12
|
+
case attributes_or_record
|
13
|
+
when Hash
|
14
|
+
initialize_from_attributes_hash(attributes_or_record)
|
15
|
+
when self.class
|
16
|
+
initialize_from_record(attributes_or_record)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def initialize_from_record(record)
|
21
|
+
self.attributes = record.send(:attributes)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -5,7 +5,7 @@ module NetSuite
|
|
5
5
|
include Support::RecordRefs
|
6
6
|
include Support::Records
|
7
7
|
include Support::Actions
|
8
|
-
include Namespaces::
|
8
|
+
include Namespaces::TranCust
|
9
9
|
|
10
10
|
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2015_2/schema/record/returnauthorization.html
|
11
11
|
|
@@ -103,9 +103,10 @@ module NetSuite
|
|
103
103
|
# :partners_list,
|
104
104
|
# :sales_team_list,
|
105
105
|
# :ship_address_list,
|
106
|
-
|
106
|
+
|
107
107
|
field :billing_address, Address
|
108
108
|
field :custom_field_list, CustomFieldList
|
109
|
+
field :item_list, ReturnAuthorizationItemList
|
109
110
|
|
110
111
|
attr_reader :internal_id
|
111
112
|
attr_accessor :external_id
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class ReturnAuthorizationItem
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Namespaces::TranCust
|
8
|
+
|
9
|
+
fields :alt_sales_amt, :amortization_period, :amortization_type, :amount, :bill_variance_status, :catch_up_period,
|
10
|
+
:cost_estimate, :cost_estimate_rate, :cost_estimate_type, :days_before_expiration, :defer_rev_rec, :description,
|
11
|
+
:gift_cert_from, :gift_cert_message, :gift_cert_recipient_email, :gift_cert_recipient_name, :id, :inventory_detail,
|
12
|
+
:is_closed, :is_drop_shipment, :is_taxable, :is_vsoe_bundle, :item_subtype, :item_type, :line, :line_number,
|
13
|
+
:matrix_type, :options, :order_line, :print_items, :quantity, :quantity_billed, :quantity_received, :quantity_rev_committed,
|
14
|
+
:rate, :rate_schedule, :rev_rec_end_date, :rev_rec_start_date, :tax_rate1, :vsoe_allocation, :vsoe_amount,
|
15
|
+
:vsoe_deferral, :vsoe_delivered, :vsoe_is_estimate, :vsoe_permit_discount, :vsoe_price, :vsoe_sop_group
|
16
|
+
|
17
|
+
field :custom_field_list, CustomFieldList
|
18
|
+
|
19
|
+
record_refs :department, :item, :job, :klass, :location, :price, :rev_rec_schedule, :tax_code, :units
|
20
|
+
|
21
|
+
def initialize(attributes_or_record = {})
|
22
|
+
case attributes_or_record
|
23
|
+
when Hash
|
24
|
+
initialize_from_attributes_hash(attributes_or_record)
|
25
|
+
when self.class
|
26
|
+
initialize_from_record(attributes_or_record)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def initialize_from_record(record)
|
31
|
+
self.attributes = record.send(:attributes)
|
32
|
+
end
|
33
|
+
|
34
|
+
def to_record
|
35
|
+
rec = super
|
36
|
+
if rec["#{record_namespace}:customFieldList"]
|
37
|
+
rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList")
|
38
|
+
end
|
39
|
+
rec
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -32,6 +32,7 @@ module NetSuite
|
|
32
32
|
field :custom_field_list, CustomFieldList
|
33
33
|
field :gift_cert_redemption_list, GiftCertRedemptionList
|
34
34
|
field :ship_group_list, SalesOrderShipGroupList
|
35
|
+
field :promotions_list, PromotionsList
|
35
36
|
|
36
37
|
read_only_fields :applied, :discount_total, :sub_total, :tax_total, :total, :unapplied,
|
37
38
|
:est_gross_profit_percent
|
@@ -6,11 +6,18 @@ module NetSuite
|
|
6
6
|
include Support::Records
|
7
7
|
include Namespaces::TranSales
|
8
8
|
|
9
|
-
fields :amount, :bin_numbers, :cost_estimate,
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
13
|
-
:
|
9
|
+
fields :amount, :bin_numbers, :cost_estimate,
|
10
|
+
:cost_estimate_type, :defer_rev_rec, :description,
|
11
|
+
:expand_item_group, :gift_cert_from, :gift_cert_message,
|
12
|
+
:gift_cert_number, :gift_cert_recipient_email,
|
13
|
+
:gift_cert_recipient_name, :gross_amt, :is_closed,
|
14
|
+
:is_taxable, :line, :order_line, :po_currency, :quantity,
|
15
|
+
:quantity_back_ordered, :quantity_billed, :quantity_committed,
|
16
|
+
:quantity_fulfilled, :rate, :rev_rec_end_date,
|
17
|
+
:rev_rec_start_date, :rev_rec_term_in_months, :serial_numbers,
|
18
|
+
:shipping_cost, :tax1_amt, :tax_rate1, :tax_rate2,
|
19
|
+
:vsoe_allocation, :vsoe_amount, :vsoe_deferral,
|
20
|
+
:vsoe_delivered, :vsoe_permit_discount, :vsoe_price
|
14
21
|
|
15
22
|
field :custom_field_list, CustomFieldList
|
16
23
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class SalesRole
|
4
|
+
include Support::Records
|
5
|
+
include Support::Fields
|
6
|
+
include Support::Actions
|
7
|
+
include Support::RecordRefs
|
8
|
+
include Namespaces::ListEmp
|
9
|
+
|
10
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_1/script/record/sales_role.html
|
11
|
+
|
12
|
+
actions :get, :get_list, :add, :update, :upsert, :upsert_list, :delete, :search
|
13
|
+
|
14
|
+
fields :name
|
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
|
@@ -7,8 +7,10 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::ListAcct
|
9
9
|
|
10
|
+
# NOTE `get_all` is not available in recent API versions ~2017_2
|
11
|
+
# `search` is only available in recent API versions
|
10
12
|
actions :get, :get_list, :get_all, :get_select_value, :add, :delete,
|
11
|
-
:update, :upsert
|
13
|
+
:update, :upsert, :search
|
12
14
|
|
13
15
|
fields :item_id, :display_name, :description, :rate, :is_inactive,
|
14
16
|
:effective_from, :valid_until, :include_children, :eccode,
|
@@ -0,0 +1,239 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class SerializedAssemblyItem
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Support::Actions
|
8
|
+
include Namespaces::ListAcct
|
9
|
+
|
10
|
+
actions :get, :get_list, :add, :delete, :search, :update, :upsert
|
11
|
+
|
12
|
+
fields :alternate_demand_source_item,
|
13
|
+
:asset_account,
|
14
|
+
:auto_lead_time,
|
15
|
+
:auto_preferred_stock_level,
|
16
|
+
:auto_reorder_point,
|
17
|
+
:available_to_partners,
|
18
|
+
:average_cost,
|
19
|
+
:bill_exch_rate_variance_acct,
|
20
|
+
:billing_schedule,
|
21
|
+
:bill_price_variance_acct,
|
22
|
+
:bill_qty_variance_acct,
|
23
|
+
:build_entire_assembly,
|
24
|
+
:build_time,
|
25
|
+
:klass,
|
26
|
+
:cogs_account,
|
27
|
+
:cost,
|
28
|
+
:cost_category,
|
29
|
+
:cost_estimate,
|
30
|
+
:cost_estimate_type,
|
31
|
+
:costing_method,
|
32
|
+
:costing_method_display,
|
33
|
+
:country_of_manufacture,
|
34
|
+
:created_date,
|
35
|
+
:create_revenue_plans_on,
|
36
|
+
:custom_form,
|
37
|
+
:default_item_ship_method,
|
38
|
+
:default_return_cost,
|
39
|
+
:default_revision,
|
40
|
+
:deferred_revenue_account,
|
41
|
+
:demand_modifier,
|
42
|
+
:demand_source,
|
43
|
+
:demand_time_fence,
|
44
|
+
:department,
|
45
|
+
:description,
|
46
|
+
:display_name,
|
47
|
+
:dont_show_price,
|
48
|
+
:dropship_expense_account,
|
49
|
+
:effective_bom_control,
|
50
|
+
:enforce_min_qty_internally,
|
51
|
+
:exclude_from_sitemap,
|
52
|
+
:featured_description,
|
53
|
+
:fixed_lot_size,
|
54
|
+
:gain_loss_account,
|
55
|
+
:handling_cost,
|
56
|
+
:handling_cost_units,
|
57
|
+
:hazmat_hazard_class,
|
58
|
+
:hazmat_id,
|
59
|
+
:hazmat_item_units,
|
60
|
+
:hazmat_item_units_qty,
|
61
|
+
:hazmat_packing_group,
|
62
|
+
:hazmat_shipping_name,
|
63
|
+
:include_children,
|
64
|
+
:income_account,
|
65
|
+
:interco_cogs_account,
|
66
|
+
:interco_income_account,
|
67
|
+
:invt_classification,
|
68
|
+
:invt_count_interval,
|
69
|
+
:is_donation_item,
|
70
|
+
:is_gco_compliant,
|
71
|
+
:is_hazmat_item,
|
72
|
+
:is_inactive,
|
73
|
+
:is_online,
|
74
|
+
:is_phantom,
|
75
|
+
:is_special_work_order_item,
|
76
|
+
:issue_product,
|
77
|
+
:is_taxable,
|
78
|
+
:item_carrier,
|
79
|
+
:item_id,
|
80
|
+
:item_number_options_list,
|
81
|
+
:item_revenue_category,
|
82
|
+
:last_invt_count_date,
|
83
|
+
:last_modified_date,
|
84
|
+
:last_purchase_price,
|
85
|
+
:lead_time,
|
86
|
+
:location,
|
87
|
+
:locations_list,
|
88
|
+
:manufacturer,
|
89
|
+
:manufactureraddr1,
|
90
|
+
:manufacturer_city,
|
91
|
+
:manufacturer_state,
|
92
|
+
:manufacturer_tariff,
|
93
|
+
:manufacturer_tax_id,
|
94
|
+
:manufacturer_zip,
|
95
|
+
:match_bill_to_receipt,
|
96
|
+
:matrix_item_name_template,
|
97
|
+
:max_donation_amount,
|
98
|
+
:meta_tag_html,
|
99
|
+
:minimum_quantity,
|
100
|
+
:minimum_quantity_units,
|
101
|
+
:mpn,
|
102
|
+
:mult_manufacture_addr,
|
103
|
+
:nex_tag_category,
|
104
|
+
:next_invt_count_date,
|
105
|
+
:no_price_message,
|
106
|
+
:offer_support,
|
107
|
+
:on_special,
|
108
|
+
:out_of_stock_behavior,
|
109
|
+
:out_of_stock_message,
|
110
|
+
:overall_quantity_pricing_type,
|
111
|
+
:page_title,
|
112
|
+
:parent,
|
113
|
+
:preference_criterion,
|
114
|
+
:preferred_location,
|
115
|
+
:preferred_stock_level,
|
116
|
+
:preferred_stock_level_days,
|
117
|
+
:preferred_stock_level_units,
|
118
|
+
:prices_include_tax,
|
119
|
+
:pricing_group,
|
120
|
+
:pricing_matrix,
|
121
|
+
:print_items,
|
122
|
+
:prod_price_variance_acct,
|
123
|
+
:prod_qty_variance_acct,
|
124
|
+
:producer,
|
125
|
+
:product_feed_list,
|
126
|
+
:purchase_description,
|
127
|
+
:purchase_order_amount,
|
128
|
+
:purchase_order_quantity,
|
129
|
+
:purchase_order_quantity_diff,
|
130
|
+
:purchase_price_variance_acct,
|
131
|
+
:purchase_tax_code,
|
132
|
+
:purchase_unit,
|
133
|
+
:quantity_available,
|
134
|
+
:quantity_back_ordered,
|
135
|
+
:quantity_committed,
|
136
|
+
:quantity_on_hand,
|
137
|
+
:quantity_on_hand_units,
|
138
|
+
:quantity_on_order,
|
139
|
+
:quantity_pricing_schedule,
|
140
|
+
:rate,
|
141
|
+
:receipt_amount,
|
142
|
+
:receipt_quantity,
|
143
|
+
:receipt_quantity_diff,
|
144
|
+
:related_items_description,
|
145
|
+
:reorder_multiple,
|
146
|
+
:reorder_point,
|
147
|
+
:reorder_point_units,
|
148
|
+
:reschedule_in_days,
|
149
|
+
:reschedule_out_days,
|
150
|
+
:revenue_allocation_group,
|
151
|
+
:revenue_recognition_rule,
|
152
|
+
:rev_rec_schedule,
|
153
|
+
:round_up_as_component,
|
154
|
+
:safety_stock_level,
|
155
|
+
:safety_stock_level_days,
|
156
|
+
:safety_stock_level_units,
|
157
|
+
:sales_tax_code,
|
158
|
+
:sale_unit,
|
159
|
+
:schedule_b_code,
|
160
|
+
:schedule_b_number,
|
161
|
+
:schedule_b_quantity,
|
162
|
+
:scrap_acct,
|
163
|
+
:search_keywords,
|
164
|
+
:seasonal_demand,
|
165
|
+
:serial_numbers,
|
166
|
+
:ship_individually,
|
167
|
+
:ship_package,
|
168
|
+
:shipping_cost,
|
169
|
+
:shipping_cost_units,
|
170
|
+
:shopping_dot_com_category,
|
171
|
+
:shopzilla_category_id,
|
172
|
+
:show_default_donation_amount,
|
173
|
+
:sitemap_priority,
|
174
|
+
:soft_descriptor,
|
175
|
+
:specials_description,
|
176
|
+
:stock_description,
|
177
|
+
:stock_unit,
|
178
|
+
:store_description,
|
179
|
+
:store_detailed_description,
|
180
|
+
:store_display_image,
|
181
|
+
:store_display_name,
|
182
|
+
:store_display_thumbnail,
|
183
|
+
:store_item_template,
|
184
|
+
:subsidiary_list,
|
185
|
+
:supply_lot_sizing_method,
|
186
|
+
:supply_replenishment_method,
|
187
|
+
:supply_time_fence,
|
188
|
+
:supply_type,
|
189
|
+
:tax_schedule,
|
190
|
+
:total_value,
|
191
|
+
:track_landed_cost,
|
192
|
+
:transfer_price,
|
193
|
+
:unbuild_variance_account,
|
194
|
+
:units_type,
|
195
|
+
:upc_code,
|
196
|
+
:url_component,
|
197
|
+
:use_bins,
|
198
|
+
:use_component_yield,
|
199
|
+
:use_marginal_rates,
|
200
|
+
:vendor_name,
|
201
|
+
:vsoe_deferral,
|
202
|
+
:vsoe_delivered,
|
203
|
+
:vsoe_permit_discount,
|
204
|
+
:vsoe_price,
|
205
|
+
:vsoe_sop_group,
|
206
|
+
:weight,
|
207
|
+
:weight_unit,
|
208
|
+
:weight_units,
|
209
|
+
:wip_acct,
|
210
|
+
:wip_variance_acct
|
211
|
+
|
212
|
+
# accountingBookDetailList ItemAccountingBookDetailList
|
213
|
+
# binNumberList InventoryItemBinNumberList
|
214
|
+
# itemOptionsList ItemOptionsList
|
215
|
+
# itemShipMethodList RecordRefList
|
216
|
+
# itemVendorList ItemVendorList
|
217
|
+
# memberList ItemMemberList
|
218
|
+
# numbersList SerializedInventoryItemNumbersList
|
219
|
+
# presentationItemList PresentationItemList
|
220
|
+
# siteCategoryList SiteCategoryList
|
221
|
+
# translationsList TranslationList
|
222
|
+
|
223
|
+
field :custom_field_list, CustomFieldList
|
224
|
+
|
225
|
+
attr_reader :internal_id
|
226
|
+
attr_accessor :external_id
|
227
|
+
|
228
|
+
def initialize(attributes = {})
|
229
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
230
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
231
|
+
initialize_from_attributes_hash(attributes)
|
232
|
+
end
|
233
|
+
|
234
|
+
def self.search_class_name
|
235
|
+
"Item"
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|