netsuite 0.0.39 → 0.0.40

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/README.md CHANGED
@@ -85,6 +85,16 @@ Or install it yourself as:
85
85
  response.body # => { :internal_id => '979', :type => 'customer' }
86
86
  ```
87
87
 
88
+ ## Gotchas
89
+
90
+ * The Initialize Action duck-punches the .initialize method on any class that includes it.
91
+ This has not proven to be a issue yet, but should be taken into account when analyzing any
92
+ strange issues with the gem.
93
+ * Some records define a 'class' field. Defining a 'class' field on a record overrides the
94
+ #class and #class= methods for this class. This is very obviously a problem. You can,
95
+ instead, define a 'klass' field that will be turned into 'class' before being submitted
96
+ to the API. The Invoice record has an example of this.
97
+
88
98
  ## Contributing
89
99
 
90
100
  1. Fork it
@@ -37,42 +37,43 @@ module NetSuite
37
37
  end
38
38
 
39
39
  module Records
40
- autoload :Account, 'netsuite/records/account'
41
- autoload :BillAddress, 'netsuite/records/bill_address'
42
- autoload :Classification, 'netsuite/records/classification'
43
- autoload :CreditMemo, 'netsuite/records/credit_memo'
44
- autoload :CreditMemoApply, 'netsuite/records/credit_memo_apply'
45
- autoload :CreditMemoApplyList, 'netsuite/records/credit_memo_apply_list'
46
- autoload :CreditMemoItem, 'netsuite/records/credit_memo_item'
47
- autoload :CreditMemoItemList, 'netsuite/records/credit_memo_item_list'
48
- autoload :CustomField, 'netsuite/records/custom_field'
49
- autoload :CustomFieldList, 'netsuite/records/custom_field_list'
50
- autoload :CustomRecord, 'netsuite/records/custom_record'
51
- autoload :CustomRecordRef, 'netsuite/records/custom_record_ref'
52
- autoload :CustomRecordType, 'netsuite/records/custom_record_type'
53
- autoload :Customer, 'netsuite/records/customer'
54
- autoload :CustomerAddressbook, 'netsuite/records/customer_addressbook'
55
- autoload :CustomerAddressbookList, 'netsuite/records/customer_addressbook_list'
56
- autoload :CustomerPayment, 'netsuite/records/customer_payment'
57
- autoload :CustomerRefund, 'netsuite/records/customer_refund'
58
- autoload :CustomerRefundApply, 'netsuite/records/customer_refund_apply'
59
- autoload :CustomerRefundApplyList, 'netsuite/records/customer_refund_apply_list'
60
- autoload :CustomerRefundDeposit, 'netsuite/records/customer_refund_deposit'
61
- autoload :CustomerRefundDepositList, 'netsuite/records/customer_refund_deposit_list'
62
- autoload :Duration, 'netsuite/records/duration'
63
- autoload :InventoryItem, 'netsuite/records/inventory_item'
64
- autoload :Invoice, 'netsuite/records/invoice'
65
- autoload :InvoiceItem, 'netsuite/records/invoice_item'
66
- autoload :InvoiceItemList, 'netsuite/records/invoice_item_list'
67
- autoload :Job, 'netsuite/records/job'
68
- autoload :JournalEntry, 'netsuite/records/journal_entry'
69
- autoload :JournalEntryLine, 'netsuite/records/journal_entry_line'
70
- autoload :JournalEntryLineList, 'netsuite/records/journal_entry_line_list'
71
- autoload :Location, 'netsuite/records/location'
72
- autoload :NonInventorySaleItem, 'netsuite/records/non_inventory_sale_item'
73
- autoload :PaymentMethod, 'netsuite/records/payment_method'
74
- autoload :RecordRef, 'netsuite/records/record_ref'
75
- autoload :ShipAddress, 'netsuite/records/ship_address'
40
+ autoload :Account, 'netsuite/records/account'
41
+ autoload :BillAddress, 'netsuite/records/bill_address'
42
+ autoload :Classification, 'netsuite/records/classification'
43
+ autoload :CreditMemo, 'netsuite/records/credit_memo'
44
+ autoload :CreditMemoApply, 'netsuite/records/credit_memo_apply'
45
+ autoload :CreditMemoApplyList, 'netsuite/records/credit_memo_apply_list'
46
+ autoload :CreditMemoItem, 'netsuite/records/credit_memo_item'
47
+ autoload :CreditMemoItemList, 'netsuite/records/credit_memo_item_list'
48
+ autoload :CustomField, 'netsuite/records/custom_field'
49
+ autoload :CustomFieldList, 'netsuite/records/custom_field_list'
50
+ autoload :CustomRecord, 'netsuite/records/custom_record'
51
+ autoload :CustomRecordRef, 'netsuite/records/custom_record_ref'
52
+ autoload :CustomRecordType, 'netsuite/records/custom_record_type'
53
+ autoload :Customer, 'netsuite/records/customer'
54
+ autoload :CustomerAddressbook, 'netsuite/records/customer_addressbook'
55
+ autoload :CustomerAddressbookList, 'netsuite/records/customer_addressbook_list'
56
+ autoload :CustomerPayment, 'netsuite/records/customer_payment'
57
+ autoload :CustomerRefund, 'netsuite/records/customer_refund'
58
+ autoload :CustomerRefundApply, 'netsuite/records/customer_refund_apply'
59
+ autoload :CustomerRefundApplyList, 'netsuite/records/customer_refund_apply_list'
60
+ autoload :CustomerRefundDeposit, 'netsuite/records/customer_refund_deposit'
61
+ autoload :CustomerRefundDepositList, 'netsuite/records/customer_refund_deposit_list'
62
+ autoload :Duration, 'netsuite/records/duration'
63
+ autoload :InventoryItem, 'netsuite/records/inventory_item'
64
+ autoload :Invoice, 'netsuite/records/invoice'
65
+ autoload :InvoiceItem, 'netsuite/records/invoice_item'
66
+ autoload :InvoiceItemList, 'netsuite/records/invoice_item_list'
67
+ autoload :Job, 'netsuite/records/job'
68
+ autoload :JournalEntry, 'netsuite/records/journal_entry'
69
+ autoload :JournalEntryLine, 'netsuite/records/journal_entry_line'
70
+ autoload :JournalEntryLineList, 'netsuite/records/journal_entry_line_list'
71
+ autoload :Location, 'netsuite/records/location'
72
+ autoload :NonInventorySaleItem, 'netsuite/records/non_inventory_sale_item'
73
+ autoload :PaymentMethod, 'netsuite/records/payment_method'
74
+ autoload :RecordRef, 'netsuite/records/record_ref'
75
+ autoload :RevenueRecognitionTemplate, 'netsuite/records/revenue_recognition_template'
76
+ autoload :ShipAddress, 'netsuite/records/ship_address'
76
77
  end
77
78
 
78
79
  def self.configure(&block)
@@ -26,9 +26,9 @@ module NetSuite
26
26
  :vsoe_permit_discount, :vsoe_price, :weight, :weight_unit, :weight_units
27
27
 
28
28
  record_refs :billing_schedule, :cost_category, :custom_form, :deferred_revenue_account, :department, :income_amount,
29
- :issue_product, :item_options_list, :location, :parent, :pricing_group, :purchase_tax_code, :quantity_pricing_schedule,
30
- :rev_rec_schedule, :sale_unit, :sales_tax_code, :ship_package, :store_display_image, :store_display_thumbnail,
31
- :store_item_template, :subsidiary_list, :tax_schedule, :units_type
29
+ :issue_product, :item_options_list, :klass, :location, :parent, :pricing_group, :purchase_tax_code,
30
+ :quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :ship_package, :store_display_image,
31
+ :store_display_thumbnail, :store_item_template, :subsidiary_list, :tax_schedule, :units_type
32
32
 
33
33
  attr_reader :internal_id
34
34
  attr_accessor :external_id
@@ -0,0 +1,25 @@
1
+ module NetSuite
2
+ module Records
3
+ class RevenueRecognitionTemplate
4
+ include Support::Fields
5
+ include Support::RecordRefs
6
+ include Support::Records
7
+ include Support::Actions
8
+ include Namespaces::ListAcct
9
+
10
+ actions :get
11
+
12
+ fields :name, :is_inactive
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
+
23
+ end
24
+ end
25
+ end
@@ -1,3 +1,3 @@
1
1
  module Netsuite
2
- VERSION = '0.0.39'
2
+ VERSION = '0.0.40'
3
3
  end
@@ -3,9 +3,6 @@ require 'spec_helper'
3
3
  describe NetSuite::Records::Account do
4
4
  let(:account) { NetSuite::Records::Account.new }
5
5
 
6
- # <element name="subsidiaryList" type="platformCore:RecordRefList" minOccurs="0"/>
7
- # <element name="translationsList" type="listAcct:AccountTranslationList" minOccurs="0"/>
8
- # <element name="customFieldList" type="platformCore:CustomFieldList" minOccurs="0"/>
9
6
  it 'has all the right fields' do
10
7
  [
11
8
  :acct_name, :acct_number, :acct_type, :cash_flow_rate, :cur_doc_num, :description, :eliminate, :exchange_rate,
@@ -23,6 +20,21 @@ describe NetSuite::Records::Account do
23
20
  end
24
21
  end
25
22
 
23
+ describe '#subsidiary_list' do
24
+ it 'can be set from attributes'
25
+ it 'can be set from a RecordRefList object'
26
+ end
27
+
28
+ describe '#translations_list' do
29
+ it 'can be set from attributes'
30
+ it 'can be set from an AccountTranslationList object'
31
+ end
32
+
33
+ describe '#custom_field_list' do
34
+ it 'can be set from attributes'
35
+ it 'can be set from a CustomFieldList object'
36
+ end
37
+
26
38
  describe '.get' do
27
39
  context 'when the response is successful' do
28
40
  let(:response) { NetSuite::Response.new(:success => true, :body => { :acct_name => 'Account 1' }) }
@@ -3,10 +3,6 @@ require 'spec_helper'
3
3
  describe NetSuite::Records::CreditMemoItem do
4
4
  let(:item) { NetSuite::Records::CreditMemoItem.new }
5
5
 
6
- # <element name="options" type="platformCore:CustomFieldList" minOccurs="0"/>
7
- # <element name="inventoryDetail" type="platformCommon:InventoryDetail" minOccurs="0"/>
8
- # <element name="customFieldList" type="platformCore:CustomFieldList" minOccurs="0"/>
9
-
10
6
  it 'has all the right fields' do
11
7
  [
12
8
  :amount, :bin_numbers, :cost_estimate, :cost_estimate_type, :defer_rev_rec, :description, :gift_cert_from,
@@ -27,4 +23,19 @@ describe NetSuite::Records::CreditMemoItem do
27
23
  end
28
24
  end
29
25
 
26
+ describe '#options' do
27
+ it 'can be set from attributes'
28
+ it 'can be set from a CustomFieldList object'
29
+ end
30
+
31
+ describe '#inventory_detail' do
32
+ it 'can be set from attributes'
33
+ it 'can be set from an InventoryDetail object'
34
+ end
35
+
36
+ describe '#custom_field_list' do
37
+ it 'can be set from attributes'
38
+ it 'can be set from a CustomFieldList object'
39
+ end
40
+
30
41
  end
@@ -22,7 +22,9 @@ describe NetSuite::Records::CreditMemo do
22
22
 
23
23
  it 'has all the right record refs' do
24
24
  [
25
- :account, :bill_address_list, :created_from, :custom_form, :department, :discount_item, :entity, :gift_cert, :handling_tax_code, :job, :klass, :lead_source, :location, :message_sel, :partner, :posting_period, :promo_code, :sales_group, :sales_rep, :ship_method, :shipping_tax_code, :subsidiary, :tax_item
25
+ :account, :bill_address_list, :created_from, :custom_form, :department, :discount_item, :entity, :gift_cert,
26
+ :handling_tax_code, :job, :klass, :lead_source, :location, :message_sel, :partner, :posting_period, :promo_code,
27
+ :sales_group, :sales_rep, :ship_method, :shipping_tax_code, :subsidiary, :tax_item
26
28
  ].each do |record_ref|
27
29
  memo.should have_record_ref(record_ref)
28
30
  end
@@ -66,11 +68,30 @@ describe NetSuite::Records::CreditMemo do
66
68
  end
67
69
  end
68
70
 
69
- # <element name="transactionBillAddress" type="platformCommon:BillAddress" minOccurs="0"/>
70
- # <element name="revenueStatus" type="platformCommonTyp:RevenueStatus" minOccurs="0"/>
71
- # <element name="salesTeamList" type="tranCust:CreditMemoSalesTeamList" minOccurs="0"/>
72
- # <element name="partnersList" type="tranCust:CreditMemoPartnersList" minOccurs="0"/>
73
- # <element name="customFieldList" type="platformCore:CustomFieldList" minOccurs="0"/>
71
+ describe '#transaction_bill_address' do
72
+ it 'can be set from attributes'
73
+ it 'can be set from a BillAddress object'
74
+ end
75
+
76
+ describe '#revenue_status' do
77
+ it 'can be set from attributes'
78
+ it 'can be set from a RevenueStatus object'
79
+ end
80
+
81
+ describe '#sales_team_list' do
82
+ it 'can be set from attributes'
83
+ it 'can be set from a CreditMemoSalesTeamList object'
84
+ end
85
+
86
+ describe '#partners_list' do
87
+ it 'can be set from attributes'
88
+ it 'can be set from a CreditMemoPartnersList object'
89
+ end
90
+
91
+ describe '#custom_field_list' do
92
+ it 'can be set from attributes'
93
+ it 'can be set from a CustomFieldList object'
94
+ end
74
95
 
75
96
  describe '.get' do
76
97
  context 'when the response is successful' do
@@ -3,17 +3,6 @@ require 'spec_helper'
3
3
  describe NetSuite::Records::CustomRecordType do
4
4
  let(:record_type) { NetSuite::Records::CustomRecordType.new }
5
5
 
6
- # <element name="fieldList" type="setupCustom:CustomRecordTypeFieldList" minOccurs="0"/>
7
- # <element name="tabsList" type="setupCustom:CustomRecordTypeTabsList" minOccurs="0"/>
8
- # <element name="sublistsList" type="setupCustom:CustomRecordTypeSublistsList" minOccurs="0"/>
9
- # <element name="formsList" type="setupCustom:CustomRecordTypeFormsList" minOccurs="0"/>
10
- # <element name="onlineFormsList" type="setupCustom:CustomRecordTypeOnlineFormsList" minOccurs="0"/>
11
- # <element name="permissionsList" type="setupCustom:CustomRecordTypePermissionsList" minOccurs="0"/>
12
- # <element name="linksList" type="setupCustom:CustomRecordTypeLinksList" minOccurs="0"/>
13
- # <element name="managersList" type="setupCustom:CustomRecordTypeManagersList" minOccurs="0"/>
14
- # <element name="childrenList" type="setupCustom:CustomRecordTypeChildrenList" minOccurs="0"/>
15
- # <element name="parentsList" type="setupCustom:CustomRecordTypeParentsList" minOccurs="0"/>
16
- # <element name="translationsList" type="setupCustom:CustomRecordTypeTranslationsList" minOccurs="0"/>
17
6
  it 'has all the right fields' do
18
7
  [
19
8
  :allow_attachments, :allow_inline_editing, :allow_numbering_override, :allow_quick_search, :description, :disclaimer,
@@ -34,6 +23,61 @@ describe NetSuite::Records::CustomRecordType do
34
23
  end
35
24
  end
36
25
 
26
+ describe '#field_list' do
27
+ it 'can be set from attributes'
28
+ it 'can be set from a CustomRecordTypeFieldList object'
29
+ end
30
+
31
+ describe '#tabs_list' do
32
+ it 'can be set from attributes'
33
+ it 'can be set from a CustomRecordTypeTabsList object'
34
+ end
35
+
36
+ describe '#sublists_list' do
37
+ it 'can be set from attributes'
38
+ it 'can be set from a CustomRecordTypeSublistsList object'
39
+ end
40
+
41
+ describe '#forms_list' do
42
+ it 'can be set from attributes'
43
+ it 'can be set from a CustomRecordTypeFormsList object'
44
+ end
45
+
46
+ describe '#online_forms_list' do
47
+ it 'can be set from attributes'
48
+ it 'can be set from a CustomRecordTypeOnlineFormsList object'
49
+ end
50
+
51
+ describe '#permissions_list' do
52
+ it 'can be set from attributes'
53
+ it 'can be set from a CustomRecordTypePermissionsList object'
54
+ end
55
+
56
+ describe '#links_list' do
57
+ it 'can be set from attributes'
58
+ it 'can be set from a CustomRecordTypeLinksList object'
59
+ end
60
+
61
+ describe '#managers_list' do
62
+ it 'can be set from attributes'
63
+ it 'can be set from a CustomRecordTypeManagersList object'
64
+ end
65
+
66
+ describe '#children_list' do
67
+ it 'can be set from attributes'
68
+ it 'can be set from a CustomRecordTypeChildrenList object'
69
+ end
70
+
71
+ describe '#parents_list' do
72
+ it 'can be set from attributes'
73
+ it 'can be set from a CustomRecordTypeParentsList object'
74
+ end
75
+
76
+ describe '#translations_list' do
77
+ it 'can be set from attributes'
78
+ it 'can be set from a CustomRecordTypeTranslationsList object'
79
+ end
80
+
37
81
  describe '.get' do
38
82
  context 'when the response is successful' do
39
83
  let(:response) { NetSuite::Response.new(:success => true, :body => { :allow_attachments => true }) }
@@ -5,9 +5,6 @@ describe NetSuite::Records::CustomerPayment do
5
5
  let(:invoice) { NetSuite::Records::Invoice.new }
6
6
  let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
7
7
 
8
- # <element name="applyList" type="tranCust:CustomerPaymentApplyList" minOccurs="0"/>
9
- # <element name="creditList" type="tranCust:CustomerPaymentCreditList" minOccurs="0"/>
10
- # <element name="depositList" type="tranCust:CustomerPaymentDepositList" minOccurs="0"/>
11
8
  it 'has all the right fields' do
12
9
  [
13
10
  :applied, :auth_code, :auto_apply, :balance, :cc_approved, :cc_avs_street_match, :cc_avs_zip_match, :cc_expire_date,
@@ -46,6 +43,21 @@ describe NetSuite::Records::CustomerPayment do
46
43
  end
47
44
  end
48
45
 
46
+ describe '#apply_list' do
47
+ it 'can be set from attributes'
48
+ it 'can be set from a CustomerPaymentApplyList object'
49
+ end
50
+
51
+ describe '#credit_list' do
52
+ it 'can be set from attributes'
53
+ it 'can be set from a CustomerPaymentCreditList object'
54
+ end
55
+
56
+ describe '#deposit_list' do
57
+ it 'can be set from attributes'
58
+ it 'can be set from a CustomerPaymentDepositList object'
59
+ end
60
+
49
61
  describe '.get' do
50
62
  context 'when the response is successful' do
51
63
  let(:response) { NetSuite::Response.new(:success => true, :body => { :memo => 'This is a memo' }) }
@@ -5,8 +5,6 @@ describe NetSuite::Records::CustomerRefund do
5
5
  let(:memo) { NetSuite::Records::CreditMemo.new }
6
6
  let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
7
7
 
8
- # <element name="depositList" type="tranCust:CustomerRefundDepositList" minOccurs="0"/>
9
-
10
8
  it 'has all the right fields' do
11
9
  [
12
10
  :address, :balance, :cc_approved, :cc_expire_date, :cc_name, :cc_number, :cc_street, :cc_zip_code, :charge_it,
@@ -39,18 +39,65 @@ describe NetSuite::Records::InventoryItem do
39
39
  end
40
40
  end
41
41
 
42
- # <element name="pricingMatrix" type="listAcct:PricingMatrix" minOccurs="0"/>
43
- # <element name="productFeedList" type="listAcct:ProductFeedList" minOccurs="0"/>
44
- # <element name="subsidiaryList" type="platformCore:RecordRefList" minOccurs="0"/>
45
- # <element name="itemOptionsList" type="listAcct:ItemOptionsList" minOccurs="0"/>
46
- # <element name="itemVendorList" type="listAcct:ItemVendorList" minOccurs="0"/>
47
- # <element name="siteCategoryList" type="listAcct:SiteCategoryList" minOccurs="0"/>
48
- # <element name="translationsList" type="listAcct:TranslationList" minOccurs="0"/>
49
- # <element name="binNumberList" type="listAcct:InventoryItemBinNumberList" minOccurs="0"/>
50
- # <element name="locationsList" type="listAcct:InventoryItemLocationsList" minOccurs="0"/>
51
- # <element name="matrixOptionList" type="listAcct:MatrixOptionList" minOccurs="0"/>
52
- # <element name="presentationItemList" type="listAcct:PresentationItemList" minOccurs="0"/>
53
- # <element name="customFieldList" type="platformCore:CustomFieldList" minOccurs="0"/>
42
+ describe '#pricing_matrix' do
43
+ it 'can be set from attributes'
44
+ it 'can be set from a PricingMatrix object'
45
+ end
46
+
47
+ describe '#product_feed_list' do
48
+ it 'can be set from attributes'
49
+ it 'can be set from a ProductFeedList object'
50
+ end
51
+
52
+ describe '#subsidiary_list' do
53
+ it 'can be set from attributes'
54
+ it 'can be set from a RecordRefList object'
55
+ end
56
+
57
+ describe '#item_options_list' do
58
+ it 'can be set from attributes'
59
+ it 'can be set from a ItemOptionsList object'
60
+ end
61
+
62
+ describe '#item_vendor_list' do
63
+ it 'can be set from attributes'
64
+ it 'can be set from an ItemVendorList object'
65
+ end
66
+
67
+ describe '#site_category_list' do
68
+ it 'can be set from attributes'
69
+ it 'can be set from a SiteCategoryList object'
70
+ end
71
+
72
+ describe '#translations_list' do
73
+ it 'can be set from attributes'
74
+ it 'can be set from a TranslationList object'
75
+ end
76
+
77
+ describe '#bin_number_list' do
78
+ it 'can be set from attributes'
79
+ it 'can be set from an InventoryItemBinNumberList object'
80
+ end
81
+
82
+ describe '#locations_list' do
83
+ it 'can be set from attributes'
84
+ it 'can be set from an InventoryItemLocationsList object'
85
+ end
86
+
87
+ describe '#matrix_option_list' do
88
+ it 'can be set from attributes'
89
+ it 'can be set from a MatrixOptionList object'
90
+ end
91
+
92
+ describe '#presentation_item_list' do
93
+ it 'can be set from attributes'
94
+ it 'can be set from a PresentationItemList object'
95
+ end
96
+
97
+ describe '#custom_field_list' do
98
+ it 'can be set from attributes'
99
+ it 'can be set from a CustomFieldList object'
100
+ end
54
101
 
55
102
  describe '.get' do
56
103
  context 'when the response is successful' do
@@ -3,12 +3,6 @@ require 'spec_helper'
3
3
  describe NetSuite::Records::Job do
4
4
  let(:job) { NetSuite::Records::Job.new }
5
5
 
6
- #<element name="jobResourcesList" type="listRel:JobResourcesList" minOccurs="0"/>
7
- #<element name="addressbookList" type="listRel:JobAddressbookList" minOccurs="0"/>
8
- #<element name="milestonesList" type="listRel:JobMilestonesList" minOccurs="0"/>
9
- #<element name="creditCardsList" type="listRel:JobCreditCardsList" minOccurs="0"/>
10
- #<element name="customFieldList" type="platformCore:CustomFieldList" minOccurs="0"/>
11
-
12
6
  it 'has all the right fields' do
13
7
  [
14
8
  :account_number, :allocate_payroll_expenses, :allow_all_resources_for_tasks, :allow_expenses, :allow_time, :alt_name,
@@ -84,6 +78,31 @@ describe NetSuite::Records::Job do
84
78
  end
85
79
  end
86
80
 
81
+ describe '#job_resources_list' do
82
+ it 'can be set from attributes'
83
+ it 'can be set from a JobResourcesList object'
84
+ end
85
+
86
+ describe '#addressbook_list' do
87
+ it 'can be set from attributes'
88
+ it 'can be set from a JobAddressbookList object'
89
+ end
90
+
91
+ describe '#milestones_list' do
92
+ it 'can be set from attributes'
93
+ it 'can be set from a JobMilestonesList object'
94
+ end
95
+
96
+ describe '#credit_cards_list' do
97
+ it 'can be set from attributes'
98
+ it 'can be set from a JobCreditCardsList object'
99
+ end
100
+
101
+ describe '#custom_field_list' do
102
+ it 'can be set from attributes'
103
+ it 'can be set from a CustomFieldList object'
104
+ end
105
+
87
106
  describe '.get' do
88
107
  context 'when the response is successful' do
89
108
  let(:response) { NetSuite::Response.new(:success => true, :body => { :account_number => 7 }) }
@@ -3,9 +3,6 @@ require 'spec_helper'
3
3
  describe NetSuite::Records::Location do
4
4
  let(:location) { NetSuite::Records::Location.new }
5
5
 
6
- # <element name="classTranslationList" type="listAcct:ClassTranslationList" minOccurs="0"/>
7
- # <element name="subsidiaryList" type="platformCore:RecordRefList" minOccurs="0"/>
8
- # <element name="customFieldList" type="platformCore:CustomFieldList" minOccurs="0"/>
9
6
  it 'has all the right attributes' do
10
7
  [
11
8
  :addr1, :addr2, :addr3, :addr_phone, :addr_text, :addressee, :attention, :city, :country, :include_children, :is_inactive,
@@ -23,6 +20,21 @@ describe NetSuite::Records::Location do
23
20
  end
24
21
  end
25
22
 
23
+ describe '#class_translation_list' do
24
+ it 'can be set from attributes'
25
+ it 'can be set from a ClassTranslationList object'
26
+ end
27
+
28
+ describe '#subsidiary_list' do
29
+ it 'can be set from attributes'
30
+ it 'can be set from a RecordRefList object'
31
+ end
32
+
33
+ describe '#custom_field_list' do
34
+ it 'can be set from attributes'
35
+ it 'can be set from a CustomFieldList object'
36
+ end
37
+
26
38
  describe '.get' do
27
39
  context 'when the response is successful' do
28
40
  let(:response) { NetSuite::Response.new(:success => true, :body => { :city => 'Los Angeles' }) }
@@ -27,16 +27,14 @@ describe NetSuite::Records::NonInventorySaleItem do
27
27
  it 'has the right record_refs' do
28
28
  [
29
29
  :billing_schedule, :cost_category, :custom_form, :deferred_revenue_account, :department, :income_amount, :issue_product,
30
- :item_options_list, :location, :parent, :pricing_group, :purchase_tax_code, :quantity_pricing_schedule, :rev_rec_schedule,
31
- :sale_unit, :sales_tax_code, :ship_package, :store_display_image, :store_display_thumbnail, :store_item_template,
32
- :subsidiary_list, :tax_schedule, :units_type
30
+ :item_options_list, :klass, :location, :parent, :pricing_group, :purchase_tax_code, :quantity_pricing_schedule,
31
+ :rev_rec_schedule, :sale_unit, :sales_tax_code, :ship_package, :store_display_image, :store_display_thumbnail,
32
+ :store_item_template, :subsidiary_list, :tax_schedule, :units_type
33
33
  ].each do |record_ref|
34
34
  item.should have_record_ref(record_ref)
35
35
  end
36
36
  end
37
37
 
38
- # :class RecordRef
39
-
40
38
  describe '.get' do
41
39
  context 'when the response is successful' do
42
40
  let(:response) { NetSuite::Response.new(:success => true, :body => { :manufacturer_zip => '90401' }) }
@@ -3,8 +3,6 @@ require 'spec_helper'
3
3
  describe NetSuite::Records::PaymentMethod do
4
4
  let(:payment_method) { NetSuite::Records::PaymentMethod.new }
5
5
 
6
- # <element name="merchantAccountsList" type="platformCore:RecordRefList" minOccurs="0"/>
7
-
8
6
  it 'has all the right fields' do
9
7
  [
10
8
  :credit_card, :express_checkout_arrangement, :is_debit_card, :is_inactive, :is_online, :name, :pay_pal_email_address,
@@ -22,6 +20,11 @@ describe NetSuite::Records::PaymentMethod do
22
20
  end
23
21
  end
24
22
 
23
+ describe '#merchant_accounts_list' do
24
+ it 'can be set from attributes'
25
+ it 'can be set from a RecordRefList object'
26
+ end
27
+
25
28
  describe '.get' do
26
29
  context 'when the response is successful' do
27
30
  let(:response) { NetSuite::Response.new(:success => true, :body => { :is_debit_card => true }) }
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ describe NetSuite::Records::RevenueRecognitionTemplate do
4
+ let(:template) { NetSuite::Records::RevenueRecognitionTemplate.new }
5
+
6
+ it 'has all the right fields' do
7
+ [
8
+ :name, :is_inactive
9
+ ].each do |field|
10
+ template.should have_field(field)
11
+ end
12
+ end
13
+
14
+ describe '.get' do
15
+ context 'when the response is successful' do
16
+ let(:response) { NetSuite::Response.new(:success => true, :body => { :name => 'A template' }) }
17
+
18
+ it 'returns an RevenueRecognitionTemplate instance populated with the data from the response object' do
19
+ NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::RevenueRecognitionTemplate, :external_id => 10).and_return(response)
20
+ template = NetSuite::Records::RevenueRecognitionTemplate.get(:external_id => 10)
21
+ template.should be_kind_of(NetSuite::Records::RevenueRecognitionTemplate)
22
+ template.name.should eql('A template')
23
+ end
24
+ end
25
+
26
+ context 'when the response is unsuccessful' do
27
+ let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
28
+
29
+ it 'raises a RecordNotFound exception' do
30
+ NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::RevenueRecognitionTemplate, :external_id => 10).and_return(response)
31
+ lambda {
32
+ NetSuite::Records::RevenueRecognitionTemplate.get(:external_id => 10)
33
+ }.should raise_error(NetSuite::RecordNotFound,
34
+ /NetSuite::Records::RevenueRecognitionTemplate with OPTIONS=(.*) could not be found/)
35
+ end
36
+ end
37
+ end
38
+
39
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netsuite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 81
4
+ hash: 79
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 39
10
- version: 0.0.39
9
+ - 40
10
+ version: 0.0.40
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Moran
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-26 00:00:00 Z
18
+ date: 2012-01-31 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: savon
@@ -164,6 +164,7 @@ files:
164
164
  - lib/netsuite/records/non_inventory_sale_item.rb
165
165
  - lib/netsuite/records/payment_method.rb
166
166
  - lib/netsuite/records/record_ref.rb
167
+ - lib/netsuite/records/revenue_recognition_template.rb
167
168
  - lib/netsuite/records/ship_address.rb
168
169
  - lib/netsuite/response.rb
169
170
  - lib/netsuite/support/actions.rb
@@ -216,6 +217,7 @@ files:
216
217
  - spec/netsuite/records/non_inventory_sale_item_spec.rb
217
218
  - spec/netsuite/records/payment_method_spec.rb
218
219
  - spec/netsuite/records/record_ref_spec.rb
220
+ - spec/netsuite/records/revenue_recognition_template_spec.rb
219
221
  - spec/netsuite/records/ship_address_spec.rb
220
222
  - spec/netsuite/response_spec.rb
221
223
  - spec/netsuite/support/actions_spec.rb
@@ -315,6 +317,7 @@ test_files:
315
317
  - spec/netsuite/records/non_inventory_sale_item_spec.rb
316
318
  - spec/netsuite/records/payment_method_spec.rb
317
319
  - spec/netsuite/records/record_ref_spec.rb
320
+ - spec/netsuite/records/revenue_recognition_template_spec.rb
318
321
  - spec/netsuite/records/ship_address_spec.rb
319
322
  - spec/netsuite/response_spec.rb
320
323
  - spec/netsuite/support/actions_spec.rb