netsuite 0.2.6 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -10,14 +10,26 @@ module NetSuite
|
|
|
10
10
|
when Array
|
|
11
11
|
attributes[:addressbook].each { |addressbook| addressbooks << CustomerAddressbook.new(addressbook) }
|
|
12
12
|
end
|
|
13
|
+
|
|
14
|
+
@replace_all = true
|
|
13
15
|
end
|
|
14
16
|
|
|
15
17
|
def addressbooks
|
|
16
18
|
@addressbooks ||= []
|
|
17
19
|
end
|
|
18
20
|
|
|
21
|
+
def replace_all
|
|
22
|
+
@replace_all
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def replace_all= new_replace_all
|
|
26
|
+
@replace_all = !!new_replace_all
|
|
27
|
+
end
|
|
28
|
+
|
|
19
29
|
def to_record
|
|
20
|
-
{ "#{record_namespace}:addressbook" => addressbooks.map(&:to_record)
|
|
30
|
+
{ "#{record_namespace}:addressbook" => addressbooks.map(&:to_record),
|
|
31
|
+
"#{record_namespace}:replaceAll" => @replace_all
|
|
32
|
+
}
|
|
21
33
|
end
|
|
22
34
|
|
|
23
35
|
end
|
|
@@ -15,9 +15,10 @@ module NetSuite
|
|
|
15
15
|
include Support::Records
|
|
16
16
|
include Namespaces::TranCust
|
|
17
17
|
|
|
18
|
-
actions :add, :get
|
|
18
|
+
actions :add, :get, :upsert
|
|
19
19
|
|
|
20
|
-
fields :custom_form, :payment, :tran_date, :exchange_rate, :undep_funds, :memo
|
|
20
|
+
fields :custom_form, :payment, :tran_date, :exchange_rate, :undep_funds, :memo,
|
|
21
|
+
:check_num
|
|
21
22
|
|
|
22
23
|
record_refs :customer, :sales_order, :account
|
|
23
24
|
|
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
|
7
7
|
include Support::Actions
|
|
8
8
|
include Namespaces::TranCust
|
|
9
9
|
|
|
10
|
-
actions :get, :initialize, :add, :delete
|
|
10
|
+
actions :get, :initialize, :add, :delete, :upsert
|
|
11
11
|
|
|
12
12
|
fields :auth_code, :auto_apply, :cc_approved, :cc_avs_street_match, :cc_avs_zip_match,
|
|
13
13
|
:cc_expire_date, :cc_name, :cc_number, :cc_security_code, :cc_security_code_match, :cc_street, :cc_zip_code,
|
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
|
7
7
|
include Support::Actions
|
|
8
8
|
include Namespaces::TranCust
|
|
9
9
|
|
|
10
|
-
actions :get, :initialize, :add, :delete
|
|
10
|
+
actions :get, :initialize, :add, :delete, :upsert
|
|
11
11
|
|
|
12
12
|
fields :address, :cc_approved, :cc_expire_date, :cc_name, :cc_number, :cc_street, :cc_zip_code, :charge_it,
|
|
13
13
|
:created_date, :currency_name, :debit_card_issue_no, :exchange_rate, :last_modified_date, :memo, :pn_ref_num, :status,
|
|
@@ -4,11 +4,13 @@ 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, :add, :delete
|
|
9
|
+
actions :get, :get_list, :get_select_value, :add, :delete, :upsert,
|
|
10
|
+
:search, :update
|
|
9
11
|
|
|
10
12
|
fields :name, :is_inactive
|
|
11
|
-
|
|
13
|
+
|
|
12
14
|
record_refs :parent
|
|
13
15
|
|
|
14
16
|
attr_reader :internal_id
|
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
|
7
7
|
include Support::Actions
|
|
8
8
|
include Namespaces::TranBank
|
|
9
9
|
|
|
10
|
-
actions :get, :add, :delete
|
|
10
|
+
actions :get, :add, :delete, :upsert
|
|
11
11
|
|
|
12
12
|
fields :created_date, :last_modified_date, :currency_name, :tran_id, :total, :tran_date, :memo, :to_be_printed
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ module NetSuite
|
|
|
15
15
|
|
|
16
16
|
fields :amount, :memo
|
|
17
17
|
|
|
18
|
-
record_refs :account, :department, :
|
|
18
|
+
record_refs :account, :department, :klass, :location
|
|
19
19
|
|
|
20
20
|
def initialize(attributes_or_record = {})
|
|
21
21
|
case attributes_or_record
|
|
@@ -39,4 +39,4 @@ module NetSuite
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
|
-
end
|
|
42
|
+
end
|
|
@@ -18,7 +18,7 @@ module NetSuite
|
|
|
18
18
|
|
|
19
19
|
fields :amount, :ref_num, :memo
|
|
20
20
|
|
|
21
|
-
record_refs :entity, :account, :payment_method, :department, :
|
|
21
|
+
record_refs :entity, :account, :payment_method, :department, :klass, :location
|
|
22
22
|
|
|
23
23
|
def initialize(attributes_or_record = {})
|
|
24
24
|
case attributes_or_record
|
|
@@ -42,4 +42,4 @@ module NetSuite
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
|
-
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
module Records
|
|
3
|
+
class DiscountItem
|
|
4
|
+
include Support::Fields
|
|
5
|
+
include Support::RecordRefs
|
|
6
|
+
include Support::Records
|
|
7
|
+
include Support::Actions
|
|
8
|
+
include Namespaces::ListAcct
|
|
9
|
+
|
|
10
|
+
actions :get, :add, :delete, :upsert
|
|
11
|
+
|
|
12
|
+
fields :available_to_partners, :created_date, :description, :display_name, :include_children, :is_inactive, :is_pretax,
|
|
13
|
+
:item_id, :last_modified_date, :non_posting, :rate, :upc_code, :vendor_name
|
|
14
|
+
|
|
15
|
+
record_refs :account, :custom_form, :deferred_revenue_account, :department, :expense_account,
|
|
16
|
+
:income_account, :issue_product, :klass, :location, :parent, :rev_rec_schedule, :sales_tax_code,
|
|
17
|
+
:subsidiary_list, :tax_schedule
|
|
18
|
+
|
|
19
|
+
field :custom_field_list, CustomFieldList
|
|
20
|
+
|
|
21
|
+
attr_reader :internal_id
|
|
22
|
+
attr_accessor :external_id
|
|
23
|
+
|
|
24
|
+
def initialize(attributes = {})
|
|
25
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
|
26
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
|
27
|
+
initialize_from_attributes_hash(attributes)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
module Records
|
|
3
|
+
|
|
4
|
+
class Employee < Support::Base
|
|
5
|
+
include Support::Actions
|
|
6
|
+
include Namespaces::ListEmp
|
|
7
|
+
|
|
8
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/script/record/employee.html
|
|
9
|
+
|
|
10
|
+
actions :get, :get_list, :add, :update, :upsert, :upsert_list, :delete, :search
|
|
11
|
+
|
|
12
|
+
fields :phone, :first_name, :last_name, :is_inactive, :email
|
|
13
|
+
|
|
14
|
+
field :roles_list, RoleList
|
|
15
|
+
|
|
16
|
+
attr_reader :internal_id
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
module Records
|
|
3
|
+
class File
|
|
4
|
+
include Support::Fields
|
|
5
|
+
include Support::RecordRefs
|
|
6
|
+
include Support::Records
|
|
7
|
+
include Support::Actions
|
|
8
|
+
include Namespaces::FileCabinet
|
|
9
|
+
|
|
10
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/record/file.html
|
|
11
|
+
|
|
12
|
+
actions :get, :add, :delete, :search, :get_list
|
|
13
|
+
|
|
14
|
+
fields :content, :description, :name, :media_type_name, :file_type, :text_file_encoding
|
|
15
|
+
|
|
16
|
+
record_refs :klass
|
|
17
|
+
|
|
18
|
+
read_only_fields :url
|
|
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
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
module Records
|
|
3
|
+
class InventoryAssignment
|
|
4
|
+
include Support::Records
|
|
5
|
+
include Support::RecordRefs
|
|
6
|
+
include Support::Fields
|
|
7
|
+
include Namespaces::PlatformCommon
|
|
8
|
+
|
|
9
|
+
fields :date_time, :quantity, :quantity_available,
|
|
10
|
+
:receipt_inventory_number
|
|
11
|
+
|
|
12
|
+
record_refs :bin_number, :issue_inventory_number, :to_bin_number
|
|
13
|
+
|
|
14
|
+
attr_reader :internal_id
|
|
15
|
+
attr_accessor :external_id
|
|
16
|
+
|
|
17
|
+
def initialize(attributes = {})
|
|
18
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
|
19
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
|
20
|
+
initialize_from_attributes_hash(attributes)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
module Records
|
|
3
|
+
class InventoryAssignmentList
|
|
4
|
+
include Support::Records
|
|
5
|
+
include Support::Fields
|
|
6
|
+
include Namespaces::TranInvt
|
|
7
|
+
|
|
8
|
+
fields :replace_all, :inventory_assignment
|
|
9
|
+
|
|
10
|
+
def initialize(attrs = {})
|
|
11
|
+
initialize_from_attributes_hash(attrs)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def inventory_assignment=(items)
|
|
15
|
+
case items
|
|
16
|
+
when Hash
|
|
17
|
+
self.inventory_assignment << InventoryAssignment.new(items)
|
|
18
|
+
when Array
|
|
19
|
+
items.each { |ref| self.inventory_assignment << InventoryAssignment.new(ref) }
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def inventory_assignment
|
|
24
|
+
@inventory_assignment ||= []
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def to_record
|
|
28
|
+
{ "#{record_namespace}:inventoryAssignment" => inventory_assignment.map(&:to_record) }
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
module Records
|
|
3
|
+
class InventoryDetail
|
|
4
|
+
include Support::RecordRefs
|
|
5
|
+
include Support::Records
|
|
6
|
+
include Support::Fields
|
|
7
|
+
include Namespaces::PlatformCommon
|
|
8
|
+
|
|
9
|
+
record_ref :custom_form
|
|
10
|
+
|
|
11
|
+
field :inventory_assignment_list, InventoryAssignmentList
|
|
12
|
+
|
|
13
|
+
def initialize(attributes = {})
|
|
14
|
+
initialize_from_attributes_hash(attributes)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
module Records
|
|
3
|
+
class InventoryTransfer
|
|
4
|
+
include Support::Fields
|
|
5
|
+
include Support::RecordRefs
|
|
6
|
+
include Support::Records
|
|
7
|
+
include Support::Actions
|
|
8
|
+
include Namespaces::TranInvt
|
|
9
|
+
|
|
10
|
+
actions :get, :add, :delete, :search, :update, :upsert, :upsert_list
|
|
11
|
+
|
|
12
|
+
fields :created_date, :last_modified_date, :tran_date, :tran_id, :memo
|
|
13
|
+
|
|
14
|
+
field :inventory_list, InventoryTransferInventoryList
|
|
15
|
+
|
|
16
|
+
record_refs :posting_period, :location, :transfer_location, :department,
|
|
17
|
+
:subsidiary
|
|
18
|
+
|
|
19
|
+
attr_reader :internal_id
|
|
20
|
+
attr_accessor :external_id
|
|
21
|
+
|
|
22
|
+
def initialize(attributes = {})
|
|
23
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
|
24
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
|
25
|
+
initialize_from_attributes_hash(attributes)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
module Records
|
|
3
|
+
class InventoryTransferInventory
|
|
4
|
+
include Support::Records
|
|
5
|
+
include Support::Fields
|
|
6
|
+
include Support::RecordRefs
|
|
7
|
+
include Namespaces::TranInvt
|
|
8
|
+
|
|
9
|
+
fields :adjust_qty_by, :description, :from_bin_numbers, :line,
|
|
10
|
+
:quantity_on_hand, :serial_numbers, :to_bin_numbers
|
|
11
|
+
|
|
12
|
+
field :inventory_detail, InventoryDetail
|
|
13
|
+
|
|
14
|
+
record_refs :item, :units
|
|
15
|
+
|
|
16
|
+
def initialize(attributes = {})
|
|
17
|
+
initialize_from_attributes_hash(attributes)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
module Records
|
|
3
|
+
class InventoryTransferInventoryList
|
|
4
|
+
include Support::RecordRefs
|
|
5
|
+
include Support::Records
|
|
6
|
+
include Support::Fields
|
|
7
|
+
include Namespaces::TranInvt
|
|
8
|
+
|
|
9
|
+
fields :inventory
|
|
10
|
+
|
|
11
|
+
def initialize(attributes = {})
|
|
12
|
+
initialize_from_attributes_hash(attributes)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def inventory=(items)
|
|
16
|
+
case items
|
|
17
|
+
when Hash
|
|
18
|
+
self.inventory << InventoryTransferInventory.new(items)
|
|
19
|
+
when Array
|
|
20
|
+
items.each { |item| self.inventory << InventoryTransferInventory.new(item) }
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def inventory
|
|
25
|
+
@inventory ||= []
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def to_record
|
|
29
|
+
{ "#{record_namespace}:inventory" => inventory.map(&:to_record) }
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
|
7
7
|
include Support::Actions
|
|
8
8
|
include Namespaces::TranSales
|
|
9
9
|
|
|
10
|
-
actions :get, :add, :initialize, :delete, :search
|
|
10
|
+
actions :get, :add, :initialize, :update, :delete, :search, :upsert
|
|
11
11
|
|
|
12
12
|
fields :tran_date, :tran_id, :shipping_cost, :memo, :ship_company, :ship_attention, :ship_addr1,
|
|
13
13
|
:ship_addr2, :ship_city, :ship_state, :ship_zip, :ship_phone, :ship_is_residential,
|
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
module NetSuite
|
|
2
2
|
module Records
|
|
3
|
-
class ItemFulfillmentItemList
|
|
4
|
-
include Support::Fields
|
|
3
|
+
class ItemFulfillmentItemList < Support::Sublist
|
|
5
4
|
include Namespaces::TranSales
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def initialize(attributes = {})
|
|
10
|
-
initialize_from_attributes_hash(attributes)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def item=(items)
|
|
14
|
-
case items
|
|
15
|
-
when Hash
|
|
16
|
-
self.items << ItemFulfillmentItem.new(items)
|
|
17
|
-
when Array
|
|
18
|
-
items.each { |item| self.items << ItemFulfillmentItem.new(item) }
|
|
19
|
-
end
|
|
20
|
-
end
|
|
6
|
+
sublist :item, ItemFulfillmentItem
|
|
21
7
|
|
|
22
8
|
def items
|
|
23
|
-
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def to_record
|
|
27
|
-
{ "#{record_namespace}:item" => items.map(&:to_record) }
|
|
9
|
+
self.item
|
|
28
10
|
end
|
|
29
11
|
|
|
30
12
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
module Records
|
|
3
|
+
class ItemMember
|
|
4
|
+
include Support::Fields
|
|
5
|
+
include Support::RecordRefs
|
|
6
|
+
include Support::Records
|
|
7
|
+
include Namespaces::ListAcct
|
|
8
|
+
|
|
9
|
+
fields :member_descr, :component_yield, :bom_quantity, :quantity,
|
|
10
|
+
:member_unit, :vsoe_delivered, :tax_code, :tax_rate, :effective_date,
|
|
11
|
+
:obsolete_date, :line_number, :vsoe_deferral, :vsoe_permit_discount
|
|
12
|
+
|
|
13
|
+
record_refs :tax_schedule, :item, :effective_revision,
|
|
14
|
+
:obsolete_revision
|
|
15
|
+
|
|
16
|
+
def initialize(attributes = {})
|
|
17
|
+
initialize_from_attributes_hash(attributes)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
|
7
7
|
include Support::Actions
|
|
8
8
|
include Namespaces::TranGeneral
|
|
9
9
|
|
|
10
|
-
actions :get, :add, :delete
|
|
10
|
+
actions :get, :add, :delete, :upsert
|
|
11
11
|
|
|
12
12
|
fields :approved, :created_date, :exchange_rate, :last_modified_date, :reversal_date, :reversal_defer, :reversal_entry,
|
|
13
13
|
:tran_date, :tran_id
|