netsuite 0.2.6 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -0
- data/Gemfile +2 -0
- data/README.md +132 -54
- data/lib/netsuite.rb +123 -76
- data/lib/netsuite/actions/add.rb +1 -0
- data/lib/netsuite/actions/delete.rb +1 -0
- data/lib/netsuite/actions/get.rb +1 -0
- data/lib/netsuite/actions/get_all.rb +67 -0
- data/lib/netsuite/actions/get_list.rb +2 -1
- data/lib/netsuite/actions/get_select_value.rb +1 -0
- data/lib/netsuite/actions/initialize.rb +1 -0
- data/lib/netsuite/actions/login.rb +2 -0
- data/lib/netsuite/actions/search.rb +3 -2
- data/lib/netsuite/actions/update.rb +18 -0
- data/lib/netsuite/actions/upsert.rb +1 -0
- data/lib/netsuite/actions/upsert_list.rb +114 -0
- data/lib/netsuite/configuration.rb +5 -0
- data/lib/netsuite/namespaces/file_cabinet.rb +11 -0
- data/lib/netsuite/namespaces/list_emp.rb +12 -0
- data/lib/netsuite/namespaces/list_mkt.rb +12 -0
- data/lib/netsuite/namespaces/list_website.rb +11 -0
- data/lib/netsuite/namespaces/tran_invt.rb +11 -0
- data/lib/netsuite/records/accounting_period.rb +1 -1
- data/lib/netsuite/records/assembly_item.rb +10 -4
- data/lib/netsuite/records/billing_schedule.rb +33 -0
- data/lib/netsuite/records/billing_schedule_milestone.rb +28 -0
- data/lib/netsuite/records/billing_schedule_milestone_list.rb +33 -0
- data/lib/netsuite/records/billing_schedule_recurrence.rb +28 -0
- data/lib/netsuite/records/billing_schedule_recurrence_list.rb +33 -0
- data/lib/netsuite/records/bin.rb +22 -0
- data/lib/netsuite/records/campaign.rb +28 -0
- data/lib/netsuite/records/cash_refund.rb +1 -1
- data/lib/netsuite/records/classification.rb +1 -1
- data/lib/netsuite/records/contact.rb +1 -1
- data/lib/netsuite/records/contact_access_roles.rb +14 -0
- data/lib/netsuite/records/contact_access_roles_list.rb +9 -0
- data/lib/netsuite/records/custom_field.rb +2 -1
- data/lib/netsuite/records/custom_field_list.rb +23 -4
- data/lib/netsuite/records/custom_list.rb +27 -0
- data/lib/netsuite/records/custom_list_custom_value.rb +14 -0
- data/lib/netsuite/records/custom_list_custom_value_list.rb +13 -0
- data/lib/netsuite/records/custom_record.rb +1 -1
- data/lib/netsuite/records/custom_record_type.rb +1 -1
- data/lib/netsuite/records/customer.rb +4 -4
- data/lib/netsuite/records/customer_addressbook.rb +8 -5
- data/lib/netsuite/records/customer_addressbook_list.rb +13 -1
- data/lib/netsuite/records/customer_deposit.rb +3 -2
- data/lib/netsuite/records/customer_payment.rb +1 -1
- data/lib/netsuite/records/customer_refund.rb +1 -1
- data/lib/netsuite/records/department.rb +4 -2
- data/lib/netsuite/records/deposit.rb +1 -1
- data/lib/netsuite/records/deposit_cash_back.rb +2 -2
- data/lib/netsuite/records/deposit_other.rb +2 -2
- data/lib/netsuite/records/discount_item.rb +32 -0
- data/lib/netsuite/records/employee.rb +20 -0
- data/lib/netsuite/records/file.rb +28 -0
- data/lib/netsuite/records/inventory_assignment.rb +24 -0
- data/lib/netsuite/records/inventory_assignment_list.rb +32 -0
- data/lib/netsuite/records/inventory_detail.rb +18 -0
- data/lib/netsuite/records/inventory_transfer.rb +29 -0
- data/lib/netsuite/records/inventory_transfer_inventory.rb +21 -0
- data/lib/netsuite/records/inventory_transfer_inventory_list.rb +33 -0
- data/lib/netsuite/records/item_fulfillment.rb +1 -1
- data/lib/netsuite/records/item_fulfillment_item_list.rb +3 -21
- data/lib/netsuite/records/item_member.rb +21 -0
- data/lib/netsuite/records/journal_entry.rb +1 -1
- data/lib/netsuite/records/kit_item.rb +1 -1
- data/lib/netsuite/records/location.rb +3 -1
- data/lib/netsuite/records/member_list.rb +32 -0
- data/lib/netsuite/records/non_inventory_sale_item.rb +4 -1
- data/lib/netsuite/records/partner.rb +21 -0
- data/lib/netsuite/records/promotion_code.rb +38 -0
- data/lib/netsuite/records/record_ref_list.rb +40 -0
- data/lib/netsuite/records/role_list.rb +25 -0
- data/lib/netsuite/records/sales_order.rb +6 -2
- data/lib/netsuite/records/sales_tax_item.rb +32 -0
- data/lib/netsuite/records/site_category.rb +33 -0
- data/lib/netsuite/records/subsidiary.rb +38 -0
- data/lib/netsuite/records/tax_type.rb +22 -0
- data/lib/netsuite/records/term.rb +1 -1
- data/lib/netsuite/records/units_type.rb +25 -0
- data/lib/netsuite/records/units_type_uom.rb +20 -0
- data/lib/netsuite/records/units_type_uom_list.rb +33 -0
- data/lib/netsuite/records/work_order.rb +38 -0
- data/lib/netsuite/records/work_order_item.rb +31 -0
- data/lib/netsuite/records/work_order_item_list.rb +31 -0
- data/lib/netsuite/support/actions.rb +4 -0
- data/lib/netsuite/support/base.rb +21 -0
- data/lib/netsuite/support/country.rb +273 -0
- data/lib/netsuite/support/search_result.rb +4 -0
- data/lib/netsuite/support/sublist.rb +54 -0
- data/lib/netsuite/version.rb +1 -1
- data/spec/netsuite/actions/search_spec.rb +1 -1
- data/spec/netsuite/actions/update_spec.rb +62 -31
- data/spec/netsuite/actions/upsert_list_spec.rb +112 -0
- data/spec/netsuite/records/account_spec.rb +4 -4
- data/spec/netsuite/records/accounting_period_spec.rb +4 -4
- data/spec/netsuite/records/assembly_item_spec.rb +38 -0
- data/spec/netsuite/records/billing_schedule_milestone_list_spec.rb +24 -0
- data/spec/netsuite/records/billing_schedule_milestone_spec.rb +51 -0
- data/spec/netsuite/records/billing_schedule_recurrence_list_spec.rb +24 -0
- data/spec/netsuite/records/billing_schedule_recurrence_spec.rb +49 -0
- data/spec/netsuite/records/billing_schedule_spec.rb +164 -0
- data/spec/netsuite/records/campaign_spec.rb +43 -0
- data/spec/netsuite/records/cash_refund_spec.rb +1 -1
- data/spec/netsuite/records/classification_spec.rb +2 -2
- data/spec/netsuite/records/credit_memo_spec.rb +4 -4
- data/spec/netsuite/records/custom_field_list_spec.rb +10 -0
- data/spec/netsuite/records/custom_list_spec.rb +21 -0
- data/spec/netsuite/records/custom_record_spec.rb +5 -5
- data/spec/netsuite/records/custom_record_type_spec.rb +5 -5
- data/spec/netsuite/records/customer_addressbook_list_spec.rb +19 -1
- data/spec/netsuite/records/customer_addressbook_spec.rb +42 -13
- data/spec/netsuite/records/customer_payment_spec.rb +4 -4
- data/spec/netsuite/records/customer_refund_spec.rb +4 -4
- data/spec/netsuite/records/customer_spec.rb +80 -6
- data/spec/netsuite/records/department_spec.rb +4 -4
- data/spec/netsuite/records/deposit_spec.rb +22 -4
- data/spec/netsuite/records/discount_item_spec.rb +124 -0
- data/spec/netsuite/records/inventory_item_spec.rb +4 -4
- data/spec/netsuite/records/inventory_transfer_spec.rb +58 -0
- data/spec/netsuite/records/invoice_spec.rb +4 -4
- data/spec/netsuite/records/job_spec.rb +7 -7
- data/spec/netsuite/records/journal_entry_spec.rb +5 -5
- data/spec/netsuite/records/non_inventory_sale_item_spec.rb +4 -4
- data/spec/netsuite/records/payment_method_spec.rb +1 -1
- data/spec/netsuite/records/pomo_code_spec.rb +40 -0
- data/spec/netsuite/records/sales_order_spec.rb +18 -18
- data/spec/netsuite/records/sales_tax_item_spec.rb +30 -0
- data/spec/netsuite/records/service_sale_item_spec.rb +4 -4
- data/spec/netsuite/records/site_category_spec.rb +51 -0
- data/spec/netsuite/records/subsidiary_spec.rb +25 -0
- data/spec/netsuite/records/support_case_spec.rb +8 -8
- data/spec/netsuite/records/tax_type_spec.rb +11 -0
- data/spec/netsuite/records/term_spec.rb +4 -4
- data/spec/netsuite/records/units_type_spec.rb +33 -0
- data/spec/netsuite/records/units_type_uom_list_spec.rb +23 -0
- data/spec/netsuite/records/units_type_uom_spec.rb +14 -0
- data/spec/netsuite/records/work_order_item_list_spec.rb +26 -0
- data/spec/netsuite/records/work_order_item_spec.rb +45 -0
- data/spec/netsuite/records/work_order_spec.rb +92 -0
- data/spec/netsuite/support/record_refs_spec.rb +1 -1
- data/spec/netsuite/support/sublist_spec.rb +36 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/fixtures/update/update_customer_error.xml +21 -0
- data/spec/support/fixtures/update/update_customer_multiple_errors.xml +25 -0
- data/spec/support/fixtures/upsert_list/upsert_list_customers.xml +21 -0
- data/spec/support/fixtures/upsert_list/upsert_list_one_customer.xml +17 -0
- data/spec/support/fixtures/upsert_list/upsert_list_with_errors.xml +32 -0
- data/spec/support/read_only_field_matcher.rb +1 -1
- metadata +115 -5
- checksums.yaml +0 -15
@@ -4,8 +4,10 @@ module NetSuite
|
|
4
4
|
include Support::Fields
|
5
5
|
include Support::RecordRefs
|
6
6
|
include Support::Actions
|
7
|
+
include Namespaces::ListAcct
|
7
8
|
|
8
|
-
actions :get
|
9
|
+
actions :add, :delete, :get, :get_list, :get_select_value, :search,
|
10
|
+
:update, :upsert
|
9
11
|
|
10
12
|
fields :addr1, :addr2, :addr3, :addr_phone, :addr_text, :addressee, :attention, :city, :country, :include_children,
|
11
13
|
:is_inactive, :make_inventory_available, :make_inventory_available_store, :name, :override, :state, :tran_prefix, :zip
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class MemberList
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Records
|
6
|
+
include Namespaces::ListAcct
|
7
|
+
|
8
|
+
fields :replace_all, :item_member
|
9
|
+
|
10
|
+
def initialize(attrs = {})
|
11
|
+
initialize_from_attributes_hash(attrs)
|
12
|
+
end
|
13
|
+
|
14
|
+
def item_member=(items)
|
15
|
+
case items
|
16
|
+
when Hash
|
17
|
+
self.item_member << ItemMember.new(items)
|
18
|
+
when Array
|
19
|
+
items.each { |ref| self.item_member << ItemMember.new(ref) }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def item_member
|
24
|
+
@item_member ||= []
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_record
|
28
|
+
{ "#{record_namespace}:itemMember" => item_member.map(&:to_record) }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::ListAcct
|
9
9
|
|
10
|
-
actions :get, :add, :delete
|
10
|
+
actions :get, :add, :delete, :search, :upsert
|
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,
|
@@ -43,6 +43,9 @@ module NetSuite
|
|
43
43
|
initialize_from_attributes_hash(attributes)
|
44
44
|
end
|
45
45
|
|
46
|
+
def self.search_class_name
|
47
|
+
"Item"
|
48
|
+
end
|
46
49
|
end
|
47
50
|
end
|
48
51
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
|
4
|
+
class Partner < Support::Base
|
5
|
+
include Support::Actions
|
6
|
+
include Support::RecordRefs
|
7
|
+
include Namespaces::ListRel
|
8
|
+
|
9
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/record/partner.html
|
10
|
+
|
11
|
+
actions :get, :get_list, :add, :update, :upsert, :upsert_list, :delete, :search
|
12
|
+
|
13
|
+
fields :phone, :first_name, :last_name, :is_inactive, :email
|
14
|
+
|
15
|
+
record_refs :klass
|
16
|
+
|
17
|
+
attr_reader :internal_id
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/record/promotioncode.html
|
2
|
+
|
3
|
+
module NetSuite
|
4
|
+
module Records
|
5
|
+
class PromotionCode
|
6
|
+
include Support::Fields
|
7
|
+
include Support::RecordRefs
|
8
|
+
include Support::Records
|
9
|
+
include Support::Actions
|
10
|
+
include Namespaces::ListMkt
|
11
|
+
|
12
|
+
actions :get, :add, :search, :delete, :update
|
13
|
+
|
14
|
+
fields :code, :code_pattern, :description, :discount_type, :display_line_discounts, :end_date,
|
15
|
+
:exclude_items, :is_inactive, :is_public, :minimum_order_amount, :name, :number_to_generate,
|
16
|
+
:rate, :start_date
|
17
|
+
|
18
|
+
record_refs :free_ship_method, :implementation, :custom_form
|
19
|
+
|
20
|
+
# TODO custom records need to be implemented
|
21
|
+
# field :currency_list, PromotionCodeCurrencyList
|
22
|
+
# field :apply_discount_to, PromotionCodeApplyDiscountTo
|
23
|
+
# field :items_list, PromotionCodeItemsList
|
24
|
+
# field :partners_list, PromotionCodePartnersList
|
25
|
+
# field :use_type, PromotionCodeUseType
|
26
|
+
|
27
|
+
attr_reader :internal_id
|
28
|
+
attr_accessor :external_id
|
29
|
+
|
30
|
+
def initialize(attributes = {})
|
31
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
32
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
33
|
+
initialize_from_attributes_hash(attributes)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class RecordRefList
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Records
|
6
|
+
include Namespaces::PlatformCore
|
7
|
+
|
8
|
+
fields :record_ref
|
9
|
+
|
10
|
+
def initialize(attrs = {})
|
11
|
+
initialize_from_attributes_hash(attrs)
|
12
|
+
end
|
13
|
+
|
14
|
+
def record_ref=(items)
|
15
|
+
case items
|
16
|
+
when Hash
|
17
|
+
self.record_ref << RecordRef.new(items)
|
18
|
+
when Array
|
19
|
+
items.each { |ref| self.record_ref << RecordRef.new(ref) }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def record_ref
|
24
|
+
@record_ref ||= []
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_record
|
28
|
+
{
|
29
|
+
"#{record_namespace}:recordRef" => record_ref.map do |rr|
|
30
|
+
rec = rr.to_record
|
31
|
+
rec[:@internalId] = rr.internal_id if rr.internal_id
|
32
|
+
rec[:@externalId] = rr.external_id if rr.external_id
|
33
|
+
rec[:@type] = rr.type if rr.type
|
34
|
+
rec
|
35
|
+
end
|
36
|
+
}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class RoleList < Support::Sublist
|
4
|
+
include Namespaces::PlatformCommon
|
5
|
+
|
6
|
+
sublist :roles, RecordRef
|
7
|
+
|
8
|
+
# role list is undocumented and has pretty funky XML:
|
9
|
+
|
10
|
+
# <listEmp:rolesList>
|
11
|
+
# <listEmp:roles>
|
12
|
+
# <listEmp:selectedRole xmlns:platformCore="urn:core_2013_1.platform.webservices.netsuite.com" internalId="1001">
|
13
|
+
# <platformCore:name>Customer Service Rep</platformCore:name>
|
14
|
+
# </listEmp:selectedRole>
|
15
|
+
# </listEmp:roles>
|
16
|
+
# <listEmp:roles>
|
17
|
+
# <listEmp:selectedRole xmlns:platformCore="urn:core_2013_1.platform.webservices.netsuite.com" internalId="1002">
|
18
|
+
# <platformCore:name>Customer Service Rep Mgr</platformCore:name>
|
19
|
+
# </listEmp:selectedRole>
|
20
|
+
# </listEmp:roles>
|
21
|
+
# </listEmp:rolesList>
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -10,11 +10,11 @@ module NetSuite
|
|
10
10
|
actions :get, :add, :initialize, :delete, :update, :upsert, :search
|
11
11
|
|
12
12
|
fields :alt_handling_cost, :alt_shipping_cost, :amount_paid, :amount_remaining, :auto_apply, :balance,
|
13
|
-
:bill_address, :contrib_pct, :created_date, :currency_name, :deferred_revenue, :discount_rate, :email, :end_date,
|
13
|
+
:bill_address, :cc_approved, :contrib_pct, :created_date, :currency_name, :deferred_revenue, :discount_rate, :email, :end_date,
|
14
14
|
:est_gross_profit, :est_gross_profit_percent, :exchange_rate, :exclude_commission, :fax, :gift_cert_applied,
|
15
15
|
:gift_cert_available, :gift_cert_total, :handling_cost, :handling_tax1_rate, :handling_tax2_rate, :is_taxable,
|
16
16
|
:last_modified_date, :memo, :message, :on_credit_hold, :order_status, :other_ref_num, :recognized_revenue,
|
17
|
-
:rev_rec_on_rev_commitment, :sales_effective_date, :shipping_cost, :shipping_tax1_rate, :shipping_tax2_rate, :source,
|
17
|
+
:rev_rec_on_rev_commitment, :sales_effective_date, :ship_date, :shipping_cost, :shipping_tax1_rate, :shipping_tax2_rate, :source,
|
18
18
|
:start_date, :status, :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
20
|
:vsoe_auto_calc
|
@@ -40,6 +40,10 @@ module NetSuite
|
|
40
40
|
initialize_from_attributes_hash(attributes)
|
41
41
|
end
|
42
42
|
|
43
|
+
def self.search_class_name
|
44
|
+
"Transaction"
|
45
|
+
end
|
46
|
+
|
43
47
|
end
|
44
48
|
end
|
45
49
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class SalesTaxItem
|
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, :get_all, :get_select_value, :add, :delete,
|
11
|
+
:update, :upsert
|
12
|
+
|
13
|
+
fields :item_id, :display_name, :description, :rate, :is_inactive,
|
14
|
+
:effective_from, :valid_until, :include_children, :eccode,
|
15
|
+
:reverse_charge, :service, :exempt, :is_default,
|
16
|
+
:exclude_from_tax_reports, :available, :export, :county, :city, :state,
|
17
|
+
:zip
|
18
|
+
|
19
|
+
record_refs :tax_type, :tax_agency, :tax_account, :purchase_account,
|
20
|
+
:sale_account, :parent, :nexus_country
|
21
|
+
|
22
|
+
attr_reader :internal_id
|
23
|
+
attr_accessor :external_id
|
24
|
+
|
25
|
+
def initialize(attributes = {})
|
26
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
27
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
28
|
+
initialize_from_attributes_hash(attributes)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class SiteCategory
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Support::Actions
|
8
|
+
include Namespaces::ListWebsite
|
9
|
+
|
10
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/record/sitecategory.html
|
11
|
+
|
12
|
+
actions :get, :add, :delete, :update, :upsert, :search
|
13
|
+
|
14
|
+
fields :description, :exclude_from_site_map, :is_inactive, :is_online,
|
15
|
+
:item_id, :meta_tag_html, :page_title, :presentation_item_list,
|
16
|
+
:search_keywords, :sitemap_priority, :store_detailed_description,
|
17
|
+
:translations_list, :url_component
|
18
|
+
|
19
|
+
record_refs :category_list_layout, :correlated_items_list_layout, :item_list_layout, :parent_category,
|
20
|
+
:related_items_list_layout, :store_display_image, :store_display_thumbnail, :website
|
21
|
+
|
22
|
+
attr_reader :internal_id
|
23
|
+
attr_accessor :external_id
|
24
|
+
|
25
|
+
def initialize(attributes = {})
|
26
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
27
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
28
|
+
initialize_from_attributes_hash(attributes)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class Subsidiary
|
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, :get, :get_list, :get_select_value, :search,
|
11
|
+
:update, :upsert
|
12
|
+
|
13
|
+
fields :name, :is_inactive, :show_subsidiary_name, :url, :tran_prefix,
|
14
|
+
:attention, :addressee, :addr_phone, :addr1, :addr2, :addr3, :city,
|
15
|
+
:state, :zip, :country, :addr_text, :override, :ship_addr,
|
16
|
+
:return_addr, :return_address1, :return_address2, :return_city,
|
17
|
+
:return_state, :return_country, :return_zip, :legal_name,
|
18
|
+
:is_elimination, :allow_payroll, :email, :fax, :edition,
|
19
|
+
:federal_id_number, :addr_language, :non_consol, :consol,
|
20
|
+
:ship_address1, :ship_address2, :ship_city, :ship_state, :ship_country,
|
21
|
+
:ship_zip, :state1_tax_number, :ssn_or_tin, :inbound_email
|
22
|
+
|
23
|
+
field :custom_field_list, CustomFieldList
|
24
|
+
|
25
|
+
record_refs :check_layout, :inter_co_account, :parent, :logo,
|
26
|
+
:page_logo, :fiscal_calendar, :tax_fiscal_calendar, :currency
|
27
|
+
|
28
|
+
attr_reader :internal_id
|
29
|
+
attr_accessor :external_id
|
30
|
+
|
31
|
+
def initialize(attributes = {})
|
32
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
33
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
34
|
+
initialize_from_attributes_hash(attributes)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class TaxType
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Actions
|
6
|
+
include Namespaces::ListAcct
|
7
|
+
|
8
|
+
actions :get, :get_list, :add, :update, :upsert, :delete, :search
|
9
|
+
|
10
|
+
fields :description, :name
|
11
|
+
|
12
|
+
attr_reader :internal_id
|
13
|
+
attr_accessor :external_id
|
14
|
+
|
15
|
+
def initialize(attributes = {})
|
16
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
17
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
18
|
+
initialize_from_attributes_hash(attributes)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -5,7 +5,7 @@ module NetSuite
|
|
5
5
|
include Support::RecordRefs
|
6
6
|
include Support::Actions
|
7
7
|
|
8
|
-
actions :get, :add, :delete
|
8
|
+
actions :get, :add, :delete, :upsert
|
9
9
|
|
10
10
|
fields :due_next_month_if_within_days, :name, :date_driven, :days_until_expiry, :days_until_next_due,
|
11
11
|
:day_discount_expires, :day_of_month_net_due, :discount_percent, :discount_percent_date_driven, :is_inactive,
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class UnitsType
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Records
|
6
|
+
include Support::Actions
|
7
|
+
include Namespaces::ListAcct
|
8
|
+
|
9
|
+
actions :get, :get_list, :add, :update, :upsert, :delete, :search
|
10
|
+
|
11
|
+
fields :is_inactive, :name
|
12
|
+
|
13
|
+
field :uom_list, UnitsTypeUomList
|
14
|
+
|
15
|
+
attr_reader :internal_id
|
16
|
+
attr_accessor :external_id
|
17
|
+
|
18
|
+
def initialize(attributes = {})
|
19
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
20
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
21
|
+
initialize_from_attributes_hash(attributes)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class UnitsTypeUom
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Records
|
6
|
+
include Namespaces::ListAcct
|
7
|
+
|
8
|
+
fields :abbreviation, :base_unit, :conversion_rate, :plural_abbreviation,
|
9
|
+
:plural_name, :unit_name
|
10
|
+
|
11
|
+
attr_reader :internal_id
|
12
|
+
|
13
|
+
def initialize(attributes = {})
|
14
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
15
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
16
|
+
initialize_from_attributes_hash(attributes)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class UnitsTypeUomList
|
4
|
+
include Support::Fields
|
5
|
+
include Namespaces::ListAcct
|
6
|
+
|
7
|
+
fields :uom
|
8
|
+
|
9
|
+
def initialize(attributes = {})
|
10
|
+
initialize_from_attributes_hash(attributes)
|
11
|
+
end
|
12
|
+
|
13
|
+
def uom=(items)
|
14
|
+
case items
|
15
|
+
when Hash
|
16
|
+
self.uom << UnitsTypeUom.new(items)
|
17
|
+
when Array
|
18
|
+
items.each { |item| self.uom << UnitsTypeUom.new(item) }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def uom
|
23
|
+
@uom ||= []
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_record
|
27
|
+
{ "#{record_namespace}:uom" => uom.map(&:to_record) }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
|