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
@@ -0,0 +1,28 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class BillingScheduleMilestone
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Namespaces::ListAcct
|
8
|
+
|
9
|
+
fields :comments, :milestone_actual_completion_date, :milestone_amount,
|
10
|
+
:milestone_completed, :milestone_date, :milestone_id
|
11
|
+
|
12
|
+
record_refs :milestone_term, :project_task
|
13
|
+
|
14
|
+
def initialize(attributes_or_record = {})
|
15
|
+
case attributes_or_record
|
16
|
+
when Hash
|
17
|
+
initialize_from_attributes_hash(attributes_or_record)
|
18
|
+
when self.class
|
19
|
+
initialize_from_record(attributes_or_record)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize_from_record(record)
|
24
|
+
self.attributes = record.send(:attributes)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class BillingScheduleMilestoneList
|
4
|
+
include Support::Fields
|
5
|
+
include Namespaces::ListAcct
|
6
|
+
|
7
|
+
fields :billing_schedule_milestone
|
8
|
+
|
9
|
+
def initialize(attributes = {})
|
10
|
+
initialize_from_attributes_hash(attributes)
|
11
|
+
end
|
12
|
+
|
13
|
+
def milestone=(milestones)
|
14
|
+
case milestones
|
15
|
+
when Hash
|
16
|
+
self.milestones << BillingScheduleMilestone.new(milestones)
|
17
|
+
when Array
|
18
|
+
milestones.each { |milestone| self.milestones << BillingScheduleMilestone.new(milestone) }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def milestones
|
23
|
+
@milestones ||= []
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_record
|
27
|
+
{ "#{record_namespace}:billingScheduleMilestone" => milestones.map(&:to_record) }
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class BillingScheduleRecurrence
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Records
|
7
|
+
include Namespaces::ListAcct
|
8
|
+
|
9
|
+
fields :amount, :count, :recurrence_date, :recurrence_id,
|
10
|
+
:relative_to_previous, :units
|
11
|
+
|
12
|
+
record_refs :payment_terms
|
13
|
+
|
14
|
+
def initialize(attributes_or_record = {})
|
15
|
+
case attributes_or_record
|
16
|
+
when Hash
|
17
|
+
initialize_from_attributes_hash(attributes_or_record)
|
18
|
+
when self.class
|
19
|
+
initialize_from_record(attributes_or_record)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize_from_record(record)
|
24
|
+
self.attributes = record.send(:attributes)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class BillingScheduleRecurrenceList
|
4
|
+
include Support::Fields
|
5
|
+
include Namespaces::ListAcct
|
6
|
+
|
7
|
+
fields :billing_schedule_recurrence
|
8
|
+
|
9
|
+
def initialize(attributes = {})
|
10
|
+
initialize_from_attributes_hash(attributes)
|
11
|
+
end
|
12
|
+
|
13
|
+
def recurrence=(recurrences)
|
14
|
+
case recurrences
|
15
|
+
when Hash
|
16
|
+
self.recurrences << BillingScheduleRecurrence.new(recurrences)
|
17
|
+
when Array
|
18
|
+
recurrences.each { |recurrence| self.recurrences << BillingScheduleRecurrence.new(recurrence) }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def recurrences
|
23
|
+
@recurrences ||= []
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_record
|
27
|
+
{ "#{record_namespace}:billingScheduleRecurrence" => recurrences.map(&:to_record) }
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
|
4
|
+
class Bin < NetSuite::Support::Base
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Actions
|
7
|
+
include Namespaces::ListAcct
|
8
|
+
|
9
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/record/bin.html?mode=package
|
10
|
+
|
11
|
+
attr_reader :internal_id
|
12
|
+
attr_accessor :external_id
|
13
|
+
|
14
|
+
actions :get, :add, :delete, :search, :update, :upsert
|
15
|
+
|
16
|
+
fields :bin_number, :is_inactive, :location, :memo
|
17
|
+
|
18
|
+
field :custom_field_list, NetSuite::Records::CustomFieldList
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class Campaign
|
4
|
+
include Support::Fields
|
5
|
+
include Support::RecordRefs
|
6
|
+
include Support::Actions
|
7
|
+
|
8
|
+
actions :get, :search
|
9
|
+
|
10
|
+
fields :audience, :base_cost, :campaign_direct_mail_list, :campaign_email_list,
|
11
|
+
:campaign_event_list, :campaign_id, :category, :conv_cost_per_customer, :conversions,
|
12
|
+
:cost, :cost_per_customer, :end_date, :event_response_list, :expected_revenue,
|
13
|
+
:family, :is_inactive, :item_list, :keyword, :leads_generated, :message,
|
14
|
+
:offer, :owner, :profit, :promotion_code, :roi, :search_engine, :start_date, :title,
|
15
|
+
:total_revenue, :unique_visitors, :url, :vertical
|
16
|
+
|
17
|
+
attr_reader :internal_id
|
18
|
+
attr_accessor :external_id
|
19
|
+
|
20
|
+
def initialize(attributes = {})
|
21
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
22
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
23
|
+
initialize_from_attributes_hash(attributes)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::ListRel
|
9
9
|
|
10
|
-
actions :get, :add, :delete, :search, :update
|
10
|
+
actions :get, :add, :delete, :search, :update, :upsert
|
11
11
|
|
12
12
|
fields :salutation, :first_name, :middle_name, :last_name, :title, :phone, :fax, :email, :default_address,
|
13
13
|
:entity_id, :phonetic_name, :alt_email, :office_phone, :home_phone, :mobile_phone, :supervisor_phone,
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class ContactAccessRoles < NetSuite::Support::Base
|
4
|
+
include Support::RecordRefs
|
5
|
+
include Namespaces::ListRel
|
6
|
+
|
7
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/other/contactaccessroles.html?mode=package
|
8
|
+
|
9
|
+
fields :email, :give_access, :password, :password2, :send_email
|
10
|
+
|
11
|
+
record_refs :contact, :role
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -4,10 +4,11 @@ module NetSuite
|
|
4
4
|
include Support::Fields
|
5
5
|
include Support::Records
|
6
6
|
|
7
|
-
attr_reader :internal_id
|
7
|
+
attr_reader :internal_id, :script_id
|
8
8
|
attr_accessor :type
|
9
9
|
|
10
10
|
def initialize(attributes = {})
|
11
|
+
@script_id = attributes.delete(:script_id) || attributes.delete(:@script_id)
|
11
12
|
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
12
13
|
@type = attributes.delete(:type) || attributes.delete(:"@xsi:type")
|
13
14
|
self.attributes = attributes
|
@@ -12,13 +12,21 @@ module NetSuite
|
|
12
12
|
end
|
13
13
|
|
14
14
|
@custom_fields_assoc = Hash.new
|
15
|
-
custom_fields.each
|
15
|
+
custom_fields.each do |custom_field|
|
16
|
+
reference_id = custom_field.script_id || custom_field.internal_id
|
17
|
+
@custom_fields_assoc[reference_id.to_sym] = custom_field
|
18
|
+
end
|
16
19
|
end
|
17
20
|
|
18
21
|
def custom_fields
|
19
22
|
@custom_fields ||= []
|
20
23
|
end
|
21
24
|
|
25
|
+
def delete_custom_field(field)
|
26
|
+
custom_fields.delete_if { |c| c.internal_id.to_sym == field }
|
27
|
+
@custom_fields_assoc.delete(field)
|
28
|
+
end
|
29
|
+
|
22
30
|
# In case you want to get only MultiSelectCustomFieldRef for example:
|
23
31
|
#
|
24
32
|
# list.custom_fields_by_type "MultiSelectCustomFieldRef"
|
@@ -35,7 +43,9 @@ module NetSuite
|
|
35
43
|
|
36
44
|
# write custom field
|
37
45
|
if sym.to_s.end_with?('=')
|
38
|
-
|
46
|
+
field_name = sym.to_s[0..-2]
|
47
|
+
delete_custom_field(field_name.to_sym)
|
48
|
+
return create_custom_field(field_name, args.first)
|
39
49
|
end
|
40
50
|
|
41
51
|
super(sym, *args, &block)
|
@@ -57,11 +67,20 @@ module NetSuite
|
|
57
67
|
custom_field_value = custom_field.value.to_s
|
58
68
|
end
|
59
69
|
|
60
|
-
{
|
70
|
+
base = {
|
61
71
|
"platformCore:value" => custom_field_value,
|
62
|
-
'@internalId' => custom_field.internal_id,
|
63
72
|
'@xsi:type' => custom_field.type
|
64
73
|
}
|
74
|
+
|
75
|
+
if custom_field.internal_id
|
76
|
+
base['@internalId'] = custom_field.internal_id
|
77
|
+
end
|
78
|
+
|
79
|
+
if custom_field.script_id
|
80
|
+
base['@scriptId'] = custom_field.script_id
|
81
|
+
end
|
82
|
+
|
83
|
+
base
|
65
84
|
end
|
66
85
|
}
|
67
86
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class CustomList
|
4
|
+
include Support::Fields
|
5
|
+
include Support::Records
|
6
|
+
include Support::Actions
|
7
|
+
include Namespaces::SetupCustom
|
8
|
+
|
9
|
+
actions :get, :update, :get_list, :add, :delete, :search, :upsert
|
10
|
+
|
11
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/record/customlist.html
|
12
|
+
fields :description, :name, :is_ordered, :script_id, :convert_to_custom_record,
|
13
|
+
:is_inactive
|
14
|
+
|
15
|
+
field :custom_value_list, NetSuite::Records::CustomListCustomValueList
|
16
|
+
|
17
|
+
attr_reader :internal_id
|
18
|
+
attr_accessor :external_id
|
19
|
+
|
20
|
+
def initialize(attributes = {})
|
21
|
+
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
|
22
|
+
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
|
23
|
+
initialize_from_attributes_hash(attributes)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
class CustomListCustomValue < Support::Base
|
4
|
+
include Namespaces::SetupCustom
|
5
|
+
|
6
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/other/customlistcustomvalue.html?mode=package
|
7
|
+
|
8
|
+
fields :abbreviation, :value, :value_id, :is_inactive
|
9
|
+
|
10
|
+
# field valueLanguageValueList
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module NetSuite
|
2
|
+
module Records
|
3
|
+
|
4
|
+
class CustomListCustomValueList < Support::Sublist
|
5
|
+
include Namespaces::SetupCustom
|
6
|
+
|
7
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/other/customlistcustomvaluelist.html?mode=package
|
8
|
+
|
9
|
+
sublist :custom_value, CustomListCustomValue
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -7,7 +7,7 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::SetupCustom
|
9
9
|
|
10
|
-
actions :get, :update, :get_list, :add, :delete, :search
|
10
|
+
actions :get, :update, :get_list, :add, :delete, :search, :upsert
|
11
11
|
|
12
12
|
fields :allow_attachments, :allow_inline_editing, :allow_numbering_override, :allow_quick_search, :created,
|
13
13
|
:custom_record_id, :description, :disclaimer, :enabl_email_merge, :enable_numbering, :include_name,
|
@@ -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 :allow_attachments, :allow_inline_editing, :allow_numbering_override, :allow_quick_search, :description,
|
11
11
|
:disclaimer, :enable_mail_merge, :enable_numbering, :include_name, :is_available_offline, :is_inactive,
|
@@ -7,14 +7,13 @@ module NetSuite
|
|
7
7
|
include Support::Actions
|
8
8
|
include Namespaces::ListRel
|
9
9
|
|
10
|
-
actions :get, :get_list, :add, :update, :upsert, :delete, :search
|
10
|
+
actions :get, :get_list, :add, :update, :upsert, :upsert_list, :delete, :search
|
11
11
|
|
12
|
-
#
|
13
|
-
# for the complete list of attributes their descriptions
|
12
|
+
# https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2014_1/schema/record/customer.html
|
14
13
|
|
15
14
|
fields :access_role, :account_number, :aging, :alt_email, :alt_name, :alt_phone, :bill_pay,
|
16
15
|
:buying_reason, :buying_time_frame, :campaign_category, :click_stream, :comments, :company_name,
|
17
|
-
:consol_aging, :consol_days_overdue, :
|
16
|
+
:consol_aging, :consol_days_overdue, :contrib_pct, :credit_cards_list, :credit_hold_override,
|
18
17
|
:credit_limit, :currency, :currency_list, :date_created, :days_overdue, :default_address,
|
19
18
|
:download_list, :email, :email_preference, :email_transactions, :end_date, :entity_id,
|
20
19
|
:estimated_budget, :fax, :fax_transactions, :first_name, :first_visit, :give_access, :global_subscription_status,
|
@@ -30,6 +29,7 @@ module NetSuite
|
|
30
29
|
|
31
30
|
field :addressbook_list, CustomerAddressbookList
|
32
31
|
field :custom_field_list, CustomFieldList
|
32
|
+
field :contact_roles_list, ContactAccessRolesList
|
33
33
|
|
34
34
|
read_only_fields :balance, :consol_balance, :deposit_balance, :consol_deposit_balance, :overdue_balance,
|
35
35
|
:consol_overdue_balance, :unbilled_orders, :consol_unbilled_orders
|
@@ -5,11 +5,15 @@ module NetSuite
|
|
5
5
|
include Support::Records
|
6
6
|
include Namespaces::ListRel
|
7
7
|
|
8
|
+
# internalId is a bit strange on this record
|
9
|
+
# https://github.com/NetSweet/netsuite/wiki/Miscellaneous-Web-Services-Quirks#customer
|
10
|
+
|
8
11
|
fields :default_shipping, :default_billing, :is_residential, :label, :attention, :addressee,
|
9
|
-
:phone, :addr1, :addr2, :addr3, :city, :zip, :
|
12
|
+
:phone, :addr1, :addr2, :addr3, :city, :zip, :override, :state, :internal_id
|
13
|
+
|
14
|
+
field :country, NetSuite::Support::Country
|
10
15
|
|
11
|
-
|
12
|
-
attr_accessor :external_id
|
16
|
+
read_only_fields :addr_text
|
13
17
|
|
14
18
|
def initialize(attributes_or_record = {})
|
15
19
|
case attributes_or_record
|
@@ -17,7 +21,6 @@ module NetSuite
|
|
17
21
|
initialize_from_record(attributes_or_record)
|
18
22
|
when Hash
|
19
23
|
attributes_or_record = attributes_or_record[:addressbook] if attributes_or_record[:addressbook]
|
20
|
-
@internal_id = attributes_or_record.delete(:internal_id)
|
21
24
|
initialize_from_attributes_hash(attributes_or_record)
|
22
25
|
end
|
23
26
|
end
|
@@ -39,7 +42,7 @@ module NetSuite
|
|
39
42
|
self.addr_text = obj.addr_text
|
40
43
|
self.override = obj.override
|
41
44
|
self.state = obj.state
|
42
|
-
|
45
|
+
self.internal_id = obj.internal_id
|
43
46
|
end
|
44
47
|
|
45
48
|
end
|