quickbooks-ruby 0.0.8 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64f3c2b5013b644526665b18754ed8eb4e1f8170
4
- data.tar.gz: 249040dc9a78a4851f96b7b71e72b2a5e2d7410d
3
+ metadata.gz: c209381ed6c5ab416d8309663cc7b817d2293041
4
+ data.tar.gz: 55cfad062e91adc4ac310f5e973459b6e79b3411
5
5
  SHA512:
6
- metadata.gz: 966392ae5982f5eaf61fda8d30d57d66354f6d623bbfb9f792411a4250d31bb4fd69080c17883bf1fad987ab8ba37f930f89231b965846a0f9b14f9914796d4b
7
- data.tar.gz: 67e2316ca99a758b8b346a3bc633e49221c83e5bbd5fe8608ccc1cef27a493ba0cba39cfe2a40f1445b5d4f9004c81917964434aa891600814f5db8c9e778288
6
+ metadata.gz: 96188250ed19a769b847b852f23464db1dfc7f4705b8d2ffeb026f883f1e6ef895c24726173e13923a8c88a3661abf528e4cf3eea6bf31bcb18c7c8382beaa42
7
+ data.tar.gz: 5676acfca87d298abe8676bb1da1fde1783f8d318a7ce330e13504ce999f452019a9e9a013fbfb78f8311f327f2d292d6b291a3a1ac0ed9fc9ce11e132930c7e
@@ -22,6 +22,7 @@ require 'quickbooks/model/sub_total_line_detail'
22
22
  require 'quickbooks/model/discount_override'
23
23
  require 'quickbooks/model/payment_line_detail'
24
24
  require 'quickbooks/model/account_based_expense_line_detail'
25
+ require 'quickbooks/model/linked_transaction'
25
26
  require 'quickbooks/model/line'
26
27
  require 'quickbooks/model/item'
27
28
  require 'quickbooks/model/account'
@@ -32,7 +33,6 @@ require 'quickbooks/model/other_contact_info'
32
33
  require 'quickbooks/model/email_address'
33
34
  require 'quickbooks/model/web_site_address'
34
35
  require 'quickbooks/model/physical_address'
35
- require 'quickbooks/model/linked_transaction'
36
36
  require 'quickbooks/model/invoice_line_item'
37
37
  require 'quickbooks/model/company_info'
38
38
  require 'quickbooks/model/customer'
@@ -62,6 +62,10 @@ require 'quickbooks/model/purchase_order'
62
62
  require 'quickbooks/model/vendor_credit'
63
63
  require 'quickbooks/model/estimate'
64
64
  require 'quickbooks/model/invoice'
65
+ require 'quickbooks/model/tax_rate'
66
+ require 'quickbooks/model/tax_rate_detail'
67
+ require 'quickbooks/model/sales_tax_rate_list'
68
+ require 'quickbooks/model/tax_code'
65
69
 
66
70
  #== Services
67
71
  require 'quickbooks/service/service_crud'
@@ -86,6 +90,8 @@ require 'quickbooks/service/purchase'
86
90
  require 'quickbooks/service/purchase_order'
87
91
  require 'quickbooks/service/vendor_credit'
88
92
  require 'quickbooks/service/estimate'
93
+ require 'quickbooks/service/tax_rate'
94
+ require 'quickbooks/service/tax_code'
89
95
 
90
96
  module Quickbooks
91
97
  @@logger = nil
@@ -119,6 +125,8 @@ module Quickbooks
119
125
 
120
126
  class AuthorizationFailure < StandardError; end
121
127
 
128
+ class ServiceUnavailable < StandardError; end
129
+
122
130
  class IntuitRequestException < StandardError
123
131
  attr_accessor :message, :code, :detail, :type
124
132
  def initialize(msg)
@@ -18,14 +18,14 @@ module Quickbooks
18
18
  xml_accessor :id, :from => 'Id', :as => Integer
19
19
  xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
20
20
  xml_accessor :meta_data, :from => 'MetaData', :as => MetaData
21
- xml_accessor :has_attachment, :from => 'HasAttachment'
21
+ xml_accessor :has_attachment?, :from => 'HasAttachment'
22
22
  xml_accessor :name, :from => 'Name'
23
23
  xml_accessor :description, :from => 'Description'
24
24
 
25
- xml_accessor :sub_account, :from => 'SubAccount'
25
+ xml_accessor :sub_account?, :from => 'SubAccount'
26
26
  xml_accessor :parent_ref, :from => 'ParentRef', :as => BaseReference
27
27
 
28
- xml_accessor :active, :from => 'Active'
28
+ xml_accessor :active?, :from => 'Active'
29
29
 
30
30
  xml_accessor :classification, :from => 'Classification'
31
31
  xml_accessor :account_type, :from => 'AccountType'
@@ -39,7 +39,7 @@ module Quickbooks
39
39
  xml_accessor :opening_balance, :from => 'OpeningBalance', :as => BigDecimal, :to_xml => Proc.new { |val| val.to_f }
40
40
  xml_accessor :opening_balance_date, :from => 'OpeningBalanceDate', :as => DateTime
41
41
  xml_accessor :currency_ref, :from => 'CurrencyRef', :as => BaseReference
42
- xml_accessor :tax_account, :from => 'TaxAccount'
42
+ xml_accessor :tax_account?, :from => 'TaxAccount'
43
43
  xml_accessor :tax_code_ref, :from => 'TaxCodeRef', :as => BaseReference
44
44
 
45
45
  reference_setters :parent_ref, :currency_ref, :tax_code_ref
@@ -72,21 +72,6 @@ module Quickbooks
72
72
  id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
73
73
  end
74
74
 
75
- def has_attachment?
76
- has_attachment.to_s == 'true'
77
- end
78
-
79
- def sub_account?
80
- sub_account.to_s == 'true'
81
- end
82
-
83
- def active?
84
- active.to_s == 'true'
85
- end
86
-
87
- def tax_account?
88
- tax_account.to_s == 'true'
89
- end
90
75
  end
91
76
  end
92
77
  end
@@ -3,7 +3,7 @@ module Quickbooks
3
3
  class BillPayment < BaseModel
4
4
  XML_COLLECTION_NODE = "BillPayment"
5
5
  XML_NODE = "BillPayment"
6
- REST_RESOURCE = 'bill_payment'
6
+ REST_RESOURCE = 'billpayment'
7
7
 
8
8
  xml_accessor :id, :from => 'Id', :as => Integer
9
9
  xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
@@ -27,7 +27,7 @@ module Quickbooks
27
27
  xml_accessor :company_name, :from => 'CompanyName'
28
28
  xml_accessor :display_name, :from => 'DisplayName'
29
29
  xml_accessor :print_on_check_name, :from => 'PrintOnCheckName'
30
- xml_accessor :active, :from => 'Active'
30
+ xml_accessor :active?, :from => 'Active'
31
31
  xml_accessor :primary_phone, :from => 'PrimaryPhone', :as => TelephoneNumber
32
32
  xml_accessor :alternate_phone, :from => 'AlternatePhone', :as => TelephoneNumber
33
33
  xml_accessor :mobile_phone, :from => 'Mobile', :as => TelephoneNumber
@@ -2,16 +2,12 @@ module Quickbooks
2
2
  module Model
3
3
  class DiscountOverride < BaseModel
4
4
  xml_accessor :discount_ref, :from => 'DiscountRef', :as => BaseReference
5
- xml_accessor :percent_based, :from => 'PercentBased'
5
+ xml_accessor :percent_based?, :from => 'PercentBased'
6
6
  xml_accessor :discount_percent, :from => 'DiscountPercent', :as => BigDecimal, :to_xml => Proc.new { |val| val.to_f }
7
7
  xml_accessor :discount_account_ref, :from => 'DiscountAccountRef', :as => BaseReference
8
8
 
9
9
  reference_setters :discount_ref, :discount_account_ref
10
10
 
11
- def percent_based?
12
- percent_based.to_s == 'true'
13
- end
14
-
15
11
  end
16
12
  end
17
- end
13
+ end
@@ -23,7 +23,7 @@ module Quickbooks
23
23
  xml_accessor :suffix, :from => 'Suffix'
24
24
  xml_accessor :display_name, :from => 'DisplayName'
25
25
  xml_accessor :print_on_check_name, :from => 'PrintOnCheckName'
26
- xml_accessor :active, :from => 'Active'
26
+ xml_accessor :active?, :from => 'Active'
27
27
  xml_accessor :primary_phone, :from => 'PrimaryPhone', :as => TelephoneNumber
28
28
  xml_accessor :mobile_phone, :from => 'Mobile', :as => TelephoneNumber
29
29
  xml_accessor :primary_email_address, :from => 'PrimaryEmailAddr', :as => EmailAddress
@@ -38,7 +38,7 @@ module Quickbooks
38
38
  xml_accessor :ship_method_ref, :from => 'ShipMethodRef', :as => BaseReference
39
39
  xml_accessor :ship_date, :from => 'ShipDate', :as => Date
40
40
 
41
- xml_accessor :apply_tax_after_discount, :from => 'ApplyTaxAfterDiscount'
41
+ xml_accessor :apply_tax_after_discount?, :from => 'ApplyTaxAfterDiscount'
42
42
  xml_accessor :print_status, :from => 'PrintStatus'
43
43
  xml_accessor :email_status, :from => 'EmailStatus'
44
44
  xml_accessor :bill_email, :from => 'BillEmail', :as => EmailAddress
@@ -52,15 +52,11 @@ module Quickbooks
52
52
  validates_length_of :line_items, :minimum => 1
53
53
  validate :existence_of_customer_ref
54
54
 
55
- def initialize
55
+ def initialize(*args)
56
56
  ensure_line_items_initialization
57
57
  super
58
58
  end
59
59
 
60
- def apply_tax_after_discount?
61
- apply_tax_after_discount.to_s == 'true'
62
- end
63
-
64
60
  private
65
61
 
66
62
  def existence_of_customer_ref
@@ -37,17 +37,17 @@ module Quickbooks
37
37
  xml_accessor :tracking_num, :from => 'TrackingNum'
38
38
  xml_accessor :ar_account_ref, :from => 'ARAccountRef', :as => BaseReference
39
39
  xml_accessor :total_amount, :from => 'TotalAmt', :as => BigDecimal, :to_xml => Proc.new { |val| val.to_f }
40
- xml_accessor :apply_tax_after_discount, :from => 'ApplyTaxAfterDiscount'
40
+ xml_accessor :apply_tax_after_discount?, :from => 'ApplyTaxAfterDiscount'
41
41
  xml_accessor :print_status, :from => 'PrintStatus'
42
42
  xml_accessor :email_status, :from => 'EmailStatus'
43
43
  xml_accessor :balance, :from => 'Balance', :as => BigDecimal, :to_xml => Proc.new { |val| val.to_f }
44
44
  xml_accessor :deposit, :from => 'Deposit', :as => BigDecimal, :to_xml => Proc.new { |val| val.to_f }
45
45
  xml_accessor :department_ref, :from => 'DepartmentRef', :as => BaseReference
46
- xml_accessor :allow_ipn_payment, :from => 'AllowIPNPayment'
46
+ xml_accessor :allow_ipn_payment?, :from => 'AllowIPNPayment'
47
47
  xml_accessor :bill_email, :from => 'BillEmail', :as => EmailAddress
48
- xml_accessor :allow_online_payment, :from => 'AllowOnlinePayment'
49
- xml_accessor :allow_online_credit_card_payment, :from => 'AllowOnlineCreditCardPayment'
50
- xml_accessor :allow_online_ach_payment, :from => 'AllowOnlineACHPayment'
48
+ xml_accessor :allow_online_payment?, :from => 'AllowOnlinePayment'
49
+ xml_accessor :allow_online_credit_card_payment?, :from => 'AllowOnlineCreditCardPayment'
50
+ xml_accessor :allow_online_ach_payment?, :from => 'AllowOnlineACHPayment'
51
51
 
52
52
  reference_setters :customer_ref, :class_ref, :sales_term_ref, :ship_method_ref
53
53
  reference_setters :ar_account_ref, :department_ref
@@ -57,7 +57,7 @@ module Quickbooks
57
57
  validate :existence_of_customer_ref
58
58
  validate :required_bill_email_if_email_delivery
59
59
 
60
- def initialize
60
+ def initialize(*args)
61
61
  ensure_line_items_initialization
62
62
  super
63
63
  end
@@ -82,26 +82,6 @@ module Quickbooks
82
82
  email_status == EMAIL_STATUS_NEED_TO_SEND
83
83
  end
84
84
 
85
- def apply_tax_after_discount?
86
- apply_tax_after_discount.to_s == 'true'
87
- end
88
-
89
- def allow_ipn_payment?
90
- allow_ipn_payment.to_s == 'true'
91
- end
92
-
93
- def allow_online_payment?
94
- allow_online_payment.to_s == 'true'
95
- end
96
-
97
- def allow_online_credit_card_payment?
98
- allow_online_credit_card_payment.to_s == 'true'
99
- end
100
-
101
- def allow_online_ach_payment?
102
- allow_online_ach_payment.to_s == 'true'
103
- end
104
-
105
85
  private
106
86
 
107
87
  def existence_of_customer_ref
@@ -22,26 +22,26 @@ module Quickbooks
22
22
  xml_accessor :meta_data, :from => 'MetaData', :as => MetaData
23
23
  xml_accessor :name, :from => 'Name'
24
24
  xml_accessor :description, :from => 'Description'
25
- xml_accessor :active, :from => 'Active'
26
- xml_accessor :sub_item, :from => 'SubItem'
25
+ xml_accessor :active?, :from => 'Active'
26
+ xml_accessor :sub_item?, :from => 'SubItem'
27
27
  xml_accessor :parent_ref, :from => 'ParentRef', :as => Integer
28
28
  xml_accessor :level, :from => 'Level', :as => Integer
29
29
 
30
30
  # read-only
31
31
  xml_accessor :fully_qualified_name, :from => 'FullyQualifiedName'
32
32
 
33
- xml_accessor :taxable, :from => 'Taxable'
34
- xml_accessor :sales_tax_included, :from => 'SalesTaxIncluded'
33
+ xml_accessor :taxable?, :from => 'Taxable'
34
+ xml_accessor :sales_tax_included?, :from => 'SalesTaxIncluded'
35
35
  xml_accessor :unit_price, :from => 'UnitPrice', :as => BigDecimal, :to_xml => to_xml_big_decimal
36
36
  xml_accessor :rate_percent, :from => 'RatePercent', :as => BigDecimal, :to_xml => to_xml_big_decimal
37
37
  xml_accessor :type, :from => 'Type'
38
38
  xml_accessor :income_account_ref, :from => 'IncomeAccountRef', :as => BaseReference
39
39
  xml_accessor :purchase_desc, :from => 'PurchaseDesc'
40
- xml_accessor :purchase_tax_included, :from => 'PurchaseTaxIncluded'
40
+ xml_accessor :purchase_tax_included?, :from => 'PurchaseTaxIncluded'
41
41
  xml_accessor :purchase_cost, :from => 'PurchaseCost', :as => BigDecimal, :to_xml => to_xml_big_decimal
42
42
  xml_accessor :expense_account_ref, :from => 'ExpenseAccountRef', :as => BaseReference
43
43
  xml_accessor :asset_account_ref, :from => 'AssetAccountRef', :as => BaseReference
44
- xml_accessor :track_quantity_on_hand, :from => 'TrackQtyOnHand'
44
+ xml_accessor :track_quantity_on_hand?, :from => 'TrackQtyOnHand'
45
45
  xml_accessor :quantity_on_hand, :from => 'QtyOnHand', :as => BigDecimal, :to_xml => to_xml_big_decimal
46
46
  xml_accessor :sales_tax_code_ref, :from => 'SalesTaxCodeRef', :as => BaseReference
47
47
  xml_accessor :purchase_tax_code_ref, :from => 'PurchaseTaxCodeRef', :as => BaseReference
@@ -54,35 +54,11 @@ module Quickbooks
54
54
  validates_length_of :name, :minimum => 1
55
55
  validates_inclusion_of :type, :in => ITEM_TYPES
56
56
 
57
- def initialize
57
+ def initialize(*args)
58
58
  self.type = INVENTORY_TYPE
59
59
  super
60
60
  end
61
61
 
62
- def active?
63
- active.to_s == 'true'
64
- end
65
-
66
- def sub_item?
67
- sub_item.to_s == 'true'
68
- end
69
-
70
- def taxable?
71
- taxable.to_s == 'true'
72
- end
73
-
74
- def track_quantity_on_hand?
75
- track_quantity_on_hand.to_s == 'true'
76
- end
77
-
78
- def sales_tax_included?
79
- sales_tax_included.to_s == 'true'
80
- end
81
-
82
- def purchase_tax_included?
83
- purchase_tax_included.to_s == 'true'
84
- end
85
-
86
62
  def valid_for_create?
87
63
  valid?
88
64
  errors.empty?
@@ -5,6 +5,7 @@ module Quickbooks
5
5
  SALES_LINE_ITEM_DETAIL = 'SalesItemLineDetail'
6
6
  SUB_TOTAL_LINE_DETAIL = 'SubTotalLineDetail'
7
7
  PAYMENT_LINE_DETAIL = 'PaymentLineDetail'
8
+ DISCOUNT_LINE_DETAIL = 'DiscountLineDetail'
8
9
 
9
10
  xml_accessor :id, :from => 'Id', :as => Integer
10
11
  xml_accessor :line_num, :from => 'LineNum', :as => Integer
@@ -16,6 +17,13 @@ module Quickbooks
16
17
  xml_accessor :sales_item_line_detail, :from => 'SalesItemLineDetail', :as => SalesItemLineDetail
17
18
  xml_accessor :sub_total_line_detail, :from => 'SubTotalLineDetail', :as => SubTotalLineDetail
18
19
  xml_accessor :payment_line_detail, :from => 'PaymentLineDetail', :as => PaymentLineDetail
20
+ xml_accessor :discount_line_detail, :from => 'DiscountLineDetail', :as => DiscountOverride
21
+ xml_accessor :linked_transaction, :from => 'LinkedTxn', :as => LinkedTransaction
22
+
23
+ def invoice_id=(invoice_id)
24
+ self.linked_transaction = LinkedTransaction.new(txn_id: invoice_id,
25
+ txn_type: "Invoice")
26
+ end
19
27
 
20
28
  def sales_item!
21
29
  self.detail_type = SALES_LINE_ITEM_DETAIL
@@ -11,7 +11,7 @@ module Quickbooks
11
11
  xml_accessor :txn_date, :from => 'TxnDate', :as => Date
12
12
  xml_accessor :private_note, :from => 'PrivateNote'
13
13
  xml_accessor :txn_status, :from => 'TxnStatus'
14
- xml_accessor :line, :from => 'Line', :as => Line
14
+ xml_accessor :line_items, :from => 'Line', :as => [Line]
15
15
  xml_accessor :customer_ref, :from => 'CustomerRef', :as => BaseReference
16
16
  xml_accessor :ar_account_ref, :from => 'ARAccountRef', :as => BaseReference
17
17
  xml_accessor :deposit_to_account_ref, :from => 'DepositToAccountRef', :as => BaseReference
@@ -1,13 +1,13 @@
1
1
  module Quickbooks
2
2
  module Model
3
3
  class PaymentMethod < BaseModel
4
- REST_RESOURCE = 'payment_method'
4
+ REST_RESOURCE = 'paymentmethod'
5
5
  XML_COLLECTION_NODE = "PaymentMethod"
6
6
  XML_NODE = "PaymentMethod"
7
7
 
8
8
  xml_accessor :id, :from => 'Id', :as => Integer
9
9
  xml_accessor :name, :from => 'Name'
10
- xml_accessor :active, :from => 'Active'
10
+ xml_accessor :active?, :from => 'Active'
11
11
  xml_accessor :amount, :from => 'Amount', :as => BigDecimal, :to_xml => Proc.new { |val| val.to_f }
12
12
  end
13
13
  end
@@ -0,0 +1,11 @@
1
+ module Quickbooks
2
+ module Model
3
+ class SalesTaxRateList < BaseModel
4
+ XML_COLLECTION_NODE = "SalesTaxRateList"
5
+ XML_NODE = "SalesTaxRateList"
6
+ REST_RESOURCE = "salestaxratelist"
7
+
8
+ xml_accessor :tax_rate_detail, :from => "TaxRateDetail", :as => [TaxRateDetail]
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,31 @@
1
+ module Quickbooks
2
+ module Model
3
+ class TaxCode < BaseModel
4
+ XML_COLLECTION_NODE = "TaxCode"
5
+ XML_NODE = "TaxCode"
6
+ REST_RESOURCE = "taxcode"
7
+
8
+ xml_accessor :id, :from => "Id"
9
+ xml_accessor :sync_token, :from => "SyncToken", :as => Integer
10
+ xml_accessor :meta_data, :from => "MetaData", :as => MetaData
11
+ xml_accessor :name, :from => "Name"
12
+ xml_accessor :description, :from => "Description"
13
+ xml_accessor :active, :from => "Active"
14
+ xml_accessor :taxable, :from => "Taxable"
15
+ xml_accessor :tax_group, :from => "TaxGroup"
16
+ xml_accessor :sales_tax_rate_list, :from => "SalesTaxRateList", :as => SalesTaxRateList
17
+
18
+ def active?
19
+ active == "true"
20
+ end
21
+
22
+ def taxable?
23
+ taxable == "true"
24
+ end
25
+
26
+ def tax_group?
27
+ tax_group == "true"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ module Quickbooks
2
+ module Model
3
+ class TaxRate < BaseModel
4
+ XML_COLLECTION_NODE = "TaxRate"
5
+ XML_NODE = "TaxRate"
6
+ REST_RESOURCE = "taxrate"
7
+
8
+ xml_accessor :id, :from => "Id", :as => Integer
9
+ xml_accessor :sync_token, :from => "SyncToken", :as => Integer
10
+ xml_accessor :meta_data, :from => "MetaData", :as => MetaData
11
+ xml_accessor :name, :from => "Name"
12
+ xml_accessor :description, :from => "Description"
13
+ xml_accessor :active, :from => "Active"
14
+ xml_accessor :rate_value, :from => "RateValue", :as => BigDecimal, :to_xml => :to_f.to_proc
15
+ xml_accessor :agency_ref, :from => "AgencyRef", :as => BaseReference
16
+ xml_accessor :tax_return_line_ref, :from => "TaxReturnLineRef", :as => BaseReference
17
+ xml_accessor :special_tax_type, :from => "SpecialTaxType"
18
+ xml_accessor :display_type, :from => "DisplayType"
19
+ xml_accessor :effective_tax_rate, :from => "EffectiveTaxRate"
20
+
21
+ validates_presence_of :name, :rate_value
22
+
23
+ reference_setters :agency_ref
24
+ reference_setters :tax_return_line_ref
25
+
26
+ def active?
27
+ active == "true"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,15 @@
1
+ module Quickbooks
2
+ module Model
3
+ class TaxRateDetail < BaseModel
4
+ XML_COLLECTION_NODE = "TaxRateDetail"
5
+ XML_NODE = "TaxRateDetail"
6
+ REST_RESOURCE = "taxratedetail"
7
+
8
+ xml_accessor :tax_rate_ref, :from => "TaxRateRef", :as => BaseReference
9
+ xml_accessor :tax_type_applicable, :from => "TaxTypeApplicable"
10
+ xml_accessor :tax_order, :from => "TaxOrder"
11
+
12
+ reference_setters :tax_rate_ref
13
+ end
14
+ end
15
+ end
@@ -9,7 +9,7 @@ module Quickbooks
9
9
  xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
10
10
  xml_accessor :meta_data, :from => 'MetaData', :as => MetaData
11
11
  xml_accessor :name, :from => 'Name'
12
- xml_accessor :active, :from => 'Active'
12
+ xml_accessor :active?, :from => 'Active'
13
13
  xml_accessor :type, :from => 'Type'
14
14
  xml_accessor :discount_percent, :from => 'DiscountPercent', :as => BigDecimal
15
15
  xml_accessor :due_days, :from => 'DueDays', :as => Integer
@@ -20,9 +20,6 @@ module Quickbooks
20
20
 
21
21
  validates_presence_of :name
22
22
 
23
- def active?
24
- active == "true"
25
- end
26
23
  end
27
24
  end
28
25
  end
@@ -25,7 +25,7 @@ module Quickbooks
25
25
  xml_accessor :company_name, :from => 'CompanyName'
26
26
  xml_accessor :display_name, :from => 'DisplayName'
27
27
  xml_accessor :print_on_check_name, :from => 'PrintOnCheckName'
28
- xml_accessor :active, :from => 'Active'
28
+ xml_accessor :active?, :from => 'Active'
29
29
  xml_accessor :primary_phone, :from => 'PrimaryPhone', :as => TelephoneNumber
30
30
  xml_accessor :alternate_phone, :from => 'AlternatePhone', :as => TelephoneNumber
31
31
  xml_accessor :mobile_phone, :from => 'Mobile', :as => TelephoneNumber
@@ -7,7 +7,7 @@ module Quickbooks
7
7
  class VendorCredit < BaseModel
8
8
 
9
9
  #== Constants
10
- REST_RESOURCE = 'vendor_credit'
10
+ REST_RESOURCE = 'vendorcredit'
11
11
  XML_COLLECTION_NODE = "VendorCredit"
12
12
  XML_NODE = "VendorCredit"
13
13
 
@@ -17,7 +17,7 @@ module Quickbooks
17
17
  xml_accessor :doc_number, :from => 'DocNumber'
18
18
  xml_accessor :txn_date, :from => 'TxnDate', :as => Date
19
19
  xml_accessor :private_note, :from => 'PrivateNote'
20
-
20
+
21
21
  xml_accessor :line_items, :from => 'Line', :as => [PurchaseLineItem]
22
22
  xml_accessor :department_ref, :from => 'DepartmentRef', :as => BaseReference
23
23
  xml_accessor :ap_account_ref, :from => 'APAccountRef', :as => BaseReference
@@ -238,6 +238,8 @@ module Quickbooks
238
238
  raise Quickbooks::AuthorizationFailure
239
239
  when 400, 500
240
240
  parse_and_raise_exception
241
+ when 503
242
+ raise Quickbooks::ServiceUnavailable
241
243
  else
242
244
  raise "HTTP Error Code: #{status}, Msg: #{response.plain_body}"
243
245
  end
@@ -0,0 +1,16 @@
1
+ module Quickbooks
2
+ module Service
3
+ class TaxCode < BaseService
4
+
5
+ private
6
+
7
+ def default_model_query
8
+ "SELECT * FROM TaxCode"
9
+ end
10
+
11
+ def model
12
+ Quickbooks::Model::TaxCode
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module Quickbooks
2
+ module Service
3
+ class TaxRate < BaseService
4
+
5
+ private
6
+
7
+ def default_model_query
8
+ "SELECT * FROM TaxRate"
9
+ end
10
+
11
+ def model
12
+ Quickbooks::Model::TaxRate
13
+ end
14
+ end
15
+ end
16
+ end
@@ -29,9 +29,6 @@ module NameEntity
29
29
  end
30
30
 
31
31
  module PermitAlterations
32
- def active?
33
- active.to_s == 'true'
34
- end
35
32
 
36
33
  def valid_for_update?
37
34
  if sync_token.nil?
@@ -1,5 +1,5 @@
1
1
  module Quickbooks
2
2
 
3
- VERSION = "0.0.8"
3
+ VERSION = "0.1.0"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quickbooks-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Caughlan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-21 00:00:00.000000000 Z
11
+ date: 2014-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth
@@ -210,9 +210,13 @@ files:
210
210
  - lib/quickbooks/model/purchase_order.rb
211
211
  - lib/quickbooks/model/sales_item_line_detail.rb
212
212
  - lib/quickbooks/model/sales_receipt.rb
213
+ - lib/quickbooks/model/sales_tax_rate_list.rb
213
214
  - lib/quickbooks/model/sub_total_line_detail.rb
215
+ - lib/quickbooks/model/tax_code.rb
214
216
  - lib/quickbooks/model/tax_line.rb
215
217
  - lib/quickbooks/model/tax_line_detail.rb
218
+ - lib/quickbooks/model/tax_rate.rb
219
+ - lib/quickbooks/model/tax_rate_detail.rb
216
220
  - lib/quickbooks/model/telephone_number.rb
217
221
  - lib/quickbooks/model/term.rb
218
222
  - lib/quickbooks/model/time_activity.rb
@@ -238,6 +242,8 @@ files:
238
242
  - lib/quickbooks/service/purchase_order.rb
239
243
  - lib/quickbooks/service/sales_receipt.rb
240
244
  - lib/quickbooks/service/service_crud.rb
245
+ - lib/quickbooks/service/tax_code.rb
246
+ - lib/quickbooks/service/tax_rate.rb
241
247
  - lib/quickbooks/service/term.rb
242
248
  - lib/quickbooks/service/time_activity.rb
243
249
  - lib/quickbooks/service/vendor.rb