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
@@ -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
|
@@ -13,12 +13,16 @@ module NetSuite
|
|
13
13
|
actions :get, :get_list, :initialize, :add, :delete, :update, :upsert, :search
|
14
14
|
|
15
15
|
fields :created_date, :last_modified_date, :status, :payment, :tran_date, :exchange_rate, :undep_funds, :memo,
|
16
|
-
:check_num, :klass, :currency_name, :is_recurring_payment, :
|
16
|
+
:check_num, :klass, :currency_name, :is_recurring_payment, :tran_id, :auth_code,
|
17
|
+
:cc_approved, :cc_avs_street_match, :cc_avs_zip_match, :cc_expire_date, :cc_is_purchase_card_bin, :cc_name, :cc_number,
|
18
|
+
:cc_process_as_purchase_card, :cc_security_code, :cc_security_code_match, :cc_street, :cc_zip_code, :charge_it
|
17
19
|
|
18
20
|
field :custom_field_list, CustomFieldList
|
21
|
+
field :apply_list, CustomerDepositApplyList
|
22
|
+
# accountingBookDetailList
|
19
23
|
|
20
24
|
record_refs :customer, :sales_order, :account, :department, :payment_method,
|
21
|
-
:custom_form, :currency, :posting_period, :subsidiary,
|
25
|
+
:custom_form, :currency, :posting_period, :subsidiary, :location,
|
22
26
|
|
23
27
|
# only available in an advanced search result
|
24
28
|
:deposit_transaction
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class CustomerDepositApply
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Records
|
6
|
+
include Namespaces::TranCust
|
7
|
+
|
8
|
+
fields :amount, :apply, :apply_date, :currency, :disc, :disc_amt, :disc_date,
|
9
|
+
:doc, :due, :job, :line, :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,24 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class CustomerSalesTeam
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Namespaces::ListRel
|
8
|
+
|
9
|
+
fields :is_primary, :contribution
|
10
|
+
|
11
|
+
record_refs :sales_role, :employee
|
12
|
+
|
13
|
+
def initialize(attributes_or_record = {})
|
14
|
+
case attributes_or_record
|
15
|
+
when Hash
|
16
|
+
initialize_from_attributes_hash(attributes_or_record)
|
17
|
+
when self.class
|
18
|
+
initialize_from_record(attributes_or_record)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_2/schema/record/customerstatus.html
|
2
|
+
|
3
|
+
module NetSuite
|
4
|
+
module Records
|
5
|
+
|
6
|
+
class CustomerStatus
|
7
|
+
include Support::Records
|
8
|
+
include Support::Fields
|
9
|
+
include Support::RecordRefs
|
10
|
+
include Support::Actions
|
11
|
+
include Namespaces::ListRel
|
12
|
+
|
13
|
+
actions :get, :add, :delete, :search, :update, :upsert
|
14
|
+
|
15
|
+
fields :description, :include_in_lead_reports, :is_inactive, :name,
|
16
|
+
:probability, :stage
|
17
|
+
|
18
|
+
attr_reader :internal_id
|
19
|
+
attr_accessor :external_id
|
20
|
+
|
21
|
+
def initialize(attributes = {})
|
22
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
23
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
24
|
+
initialize_from_attributes_hash(attributes)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class CustomerSubscription
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Records
|
6
|
+
include Support::RecordRefs
|
7
|
+
include Namespaces::ListRel
|
8
|
+
|
9
|
+
fields :subscribed, :last_modified_date
|
10
|
+
record_refs :subscription
|
11
|
+
|
12
|
+
def initialize(attributes_or_record = {})
|
13
|
+
initialize_from_attributes_hash(attributes_or_record)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -6,16 +6,6 @@ module NetSuite
|
|
6
6
|
include Support::Records
|
7
7
|
include Namespaces::TranBank
|
8
8
|
|
9
|
-
# <element name="entity" type="platformCore:RecordRef" minOccurs="0"/>
|
10
|
-
# <element name="amount" type="xsd:double" minOccurs="0"/>
|
11
|
-
# <element name="account" type="platformCore:RecordRef" minOccurs="0"/>
|
12
|
-
# <element name="paymentMethod" type="platformCore:RecordRef" minOccurs="0"/>
|
13
|
-
# <element name="refNum" type="xsd:string" minOccurs="0"/>
|
14
|
-
# <element name="department" type="platformCore:RecordRef" minOccurs="0"/>
|
15
|
-
# <element name="class" type="platformCore:RecordRef" minOccurs="0"/>
|
16
|
-
# <element name="location" type="platformCore:RecordRef" minOccurs="0"/>
|
17
|
-
# <element name="memo" type="xsd:string" minOccurs="0"/>
|
18
|
-
|
19
9
|
fields :amount, :ref_num, :memo
|
20
10
|
|
21
11
|
record_refs :entity, :account, :payment_method, :department, :klass, :location
|
@@ -11,7 +11,7 @@ module NetSuite
|
|
11
11
|
|
12
12
|
actions :get, :get_list, :add, :update, :upsert, :upsert_list, :delete, :search
|
13
13
|
|
14
|
-
fields :phone, :first_name, :last_name, :is_inactive, :email, :give_access, :send_email, :is_support_rep,
|
14
|
+
fields :alt_name, :phone, :first_name, :last_name, :is_inactive, :email, :give_access, :send_email, :is_support_rep,
|
15
15
|
:birth_date, :hire_date, :last_review_date, :next_review_date, :title, :home_phone, :office_phone,
|
16
16
|
:eligible_for_commission, :is_sales_rep, :klass, :middle_name, :account_number, :alien_number, :approval_limit,
|
17
17
|
:bill_pay, :comments, :date_created, :direct_deposit, :entity_id, :password, :password2,
|
@@ -19,8 +19,9 @@ 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
|
+
field :custom_field_list, CustomFieldList
|
24
25
|
field :roles_list, RoleList
|
25
26
|
|
26
27
|
attr_reader :internal_id
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class EntityCustomField
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Support::Actions
|
8
|
+
include Namespaces::SetupCustom
|
9
|
+
|
10
|
+
actions :get, :get_list, :add, :delete, :update, :upsert, :upsert_list
|
11
|
+
|
12
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_1/schema/record/entitycustomfield.html
|
13
|
+
fields(
|
14
|
+
:access_level,
|
15
|
+
:applies_to_contact,
|
16
|
+
:applies_to_customer,
|
17
|
+
:applies_to_employee,
|
18
|
+
:applies_to_group,
|
19
|
+
:applies_to_other_name,
|
20
|
+
:applies_to_partner,
|
21
|
+
:applies_to_price_list,
|
22
|
+
:applies_to_statement,
|
23
|
+
:applies_to_vendor,
|
24
|
+
:applies_to_web_site,
|
25
|
+
:available_externally,
|
26
|
+
:check_spelling,
|
27
|
+
:default_checked,
|
28
|
+
:display_type,
|
29
|
+
:field_type,
|
30
|
+
:global_search,
|
31
|
+
:is_formula,
|
32
|
+
:is_mandatory,
|
33
|
+
:is_parent,
|
34
|
+
:label,
|
35
|
+
:script_id,
|
36
|
+
:search_level,
|
37
|
+
:show_in_list,
|
38
|
+
:store_value,
|
39
|
+
)
|
40
|
+
|
41
|
+
record_refs :owner
|
42
|
+
|
43
|
+
attr_reader :internal_id
|
44
|
+
attr_accessor :external_id
|
45
|
+
|
46
|
+
def initialize(attributes = {})
|
47
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
48
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
49
|
+
initialize_from_attributes_hash(attributes)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -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,33 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class InboundShipment
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Support::Actions
|
8
|
+
include Namespaces::TranPurch
|
9
|
+
|
10
|
+
actions :get, :get_list, :add, :initialize, :delete, :update, :upsert, :upsert_list, :search, :update_list
|
11
|
+
|
12
|
+
fields :shipment_number, :external_document_number, :shipment_status, :expected_shipping_date,
|
13
|
+
:actual_shipping_date, :expected_delivery_date, :actual_delivery_date, :shipment_memo,
|
14
|
+
:vessel_number, :bill_of_lading
|
15
|
+
|
16
|
+
field :items_list, InboundShipmentItemList
|
17
|
+
field :custom_field_list, CustomFieldList
|
18
|
+
|
19
|
+
record_refs :custom_form
|
20
|
+
|
21
|
+
attr_reader :internal_id
|
22
|
+
attr_accessor :external_id
|
23
|
+
attr_accessor :search_joins
|
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,39 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class InboundShipmentItem
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Namespaces::TranPurch
|
8
|
+
|
9
|
+
fields :id, :shipment_item_description, :po_vendor, :quantity_received, :quantity_expected,
|
10
|
+
:quantity_remaining, :po_rate, :expected_rate, :shipment_item_amount
|
11
|
+
|
12
|
+
field :custom_field_list, CustomFieldList
|
13
|
+
|
14
|
+
record_refs :purchase_order, :shipment_item, :receiving_location, :po_currency, :incoterm
|
15
|
+
|
16
|
+
def initialize(attributes_or_record = {})
|
17
|
+
case attributes_or_record
|
18
|
+
when Hash
|
19
|
+
initialize_from_attributes_hash(attributes_or_record)
|
20
|
+
when self.class
|
21
|
+
initialize_from_record(attributes_or_record)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def initialize_from_record(record)
|
26
|
+
self.attributes = record.send(:attributes)
|
27
|
+
end
|
28
|
+
|
29
|
+
def to_record
|
30
|
+
rec = super
|
31
|
+
if rec["#{record_namespace}:customFieldList"]
|
32
|
+
rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList")
|
33
|
+
end
|
34
|
+
rec
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|