quickeebooks 0.1.22 → 0.1.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +6 -14
  2. data/lib/quickeebooks/common/addressable.rb +4 -4
  3. data/lib/quickeebooks/common/date_time.rb +2 -2
  4. data/lib/quickeebooks/common/online_entity_model.rb +1 -1
  5. data/lib/quickeebooks/online/model/account.rb +1 -1
  6. data/lib/quickeebooks/online/model/account_reference.rb +1 -1
  7. data/lib/quickeebooks/online/model/address.rb +2 -2
  8. data/lib/quickeebooks/online/model/bill_line_item.rb +2 -2
  9. data/lib/quickeebooks/online/model/clazz.rb +6 -6
  10. data/lib/quickeebooks/online/model/company_meta_data.rb +1 -1
  11. data/lib/quickeebooks/online/model/credit_card.rb +1 -1
  12. data/lib/quickeebooks/online/model/credit_charge_info.rb +1 -1
  13. data/lib/quickeebooks/online/model/credit_charge_response.rb +1 -1
  14. data/lib/quickeebooks/online/model/customer_custom_field.rb +2 -2
  15. data/lib/quickeebooks/online/model/email.rb +2 -2
  16. data/lib/quickeebooks/online/model/id.rb +8 -8
  17. data/lib/quickeebooks/online/model/intuit_type.rb +5 -5
  18. data/lib/quickeebooks/online/model/invoice.rb +2 -2
  19. data/lib/quickeebooks/online/model/invoice_header.rb +1 -1
  20. data/lib/quickeebooks/online/model/invoice_line_item.rb +1 -1
  21. data/lib/quickeebooks/online/model/item.rb +12 -4
  22. data/lib/quickeebooks/online/model/job.rb +2 -2
  23. data/lib/quickeebooks/online/model/journal_entry.rb +1 -1
  24. data/lib/quickeebooks/online/model/journal_entry_line_item.rb +2 -2
  25. data/lib/quickeebooks/online/model/meta_data.rb +2 -2
  26. data/lib/quickeebooks/online/model/open_balance.rb +1 -1
  27. data/lib/quickeebooks/online/model/payment_detail.rb +1 -1
  28. data/lib/quickeebooks/online/model/payment_header.rb +1 -1
  29. data/lib/quickeebooks/online/model/payment_line_item.rb +3 -3
  30. data/lib/quickeebooks/online/model/phone.rb +1 -1
  31. data/lib/quickeebooks/online/model/price.rb +1 -1
  32. data/lib/quickeebooks/online/model/purchase_cost.rb +1 -1
  33. data/lib/quickeebooks/online/model/sales_receipt.rb +1 -1
  34. data/lib/quickeebooks/online/model/sales_receipt_line_item.rb +2 -2
  35. data/lib/quickeebooks/online/model/time_activity.rb +13 -0
  36. data/lib/quickeebooks/online/model/time_activity_employee.rb +1 -1
  37. data/lib/quickeebooks/online/model/time_activity_vendor.rb +1 -1
  38. data/lib/quickeebooks/online/model/tracking_class.rb +1 -1
  39. data/lib/quickeebooks/online/model/unit_price.rb +1 -1
  40. data/lib/quickeebooks/online/model/web_site.rb +2 -2
  41. data/lib/quickeebooks/online/service/account.rb +1 -1
  42. data/lib/quickeebooks/online/service/clazz.rb +1 -1
  43. data/lib/quickeebooks/online/service/employee.rb +1 -1
  44. data/lib/quickeebooks/online/service/entitlement.rb +1 -1
  45. data/lib/quickeebooks/online/service/item.rb +1 -1
  46. data/lib/quickeebooks/online/service/pagination.rb +1 -1
  47. data/lib/quickeebooks/online/service/payment_method.rb +1 -1
  48. data/lib/quickeebooks/online/service/sort.rb +1 -1
  49. data/lib/quickeebooks/online/service/tracking_class.rb +1 -1
  50. data/lib/quickeebooks/shared/service/filter.rb +4 -4
  51. data/lib/quickeebooks/shared/service/operation_node.rb +8 -8
  52. data/lib/quickeebooks/shared/service/sort.rb +1 -1
  53. data/lib/quickeebooks/version.rb +1 -1
  54. data/lib/quickeebooks/windows/model/account.rb +7 -7
  55. data/lib/quickeebooks/windows/model/account_reference.rb +2 -2
  56. data/lib/quickeebooks/windows/model/address.rb +4 -4
  57. data/lib/quickeebooks/windows/model/clazz.rb +6 -6
  58. data/lib/quickeebooks/windows/model/company_meta_data.rb +1 -1
  59. data/lib/quickeebooks/windows/model/custom_field.rb +1 -1
  60. data/lib/quickeebooks/windows/model/customer.rb +9 -9
  61. data/lib/quickeebooks/windows/model/customer_msg.rb +3 -3
  62. data/lib/quickeebooks/windows/model/email.rb +6 -6
  63. data/lib/quickeebooks/windows/model/error.rb +4 -4
  64. data/lib/quickeebooks/windows/model/external_key.rb +4 -4
  65. data/lib/quickeebooks/windows/model/id.rb +7 -7
  66. data/lib/quickeebooks/windows/model/id_set.rb +6 -6
  67. data/lib/quickeebooks/windows/model/intuit_type.rb +1 -1
  68. data/lib/quickeebooks/windows/model/invoice.rb +5 -5
  69. data/lib/quickeebooks/windows/model/invoice_header.rb +1 -1
  70. data/lib/quickeebooks/windows/model/invoice_line_item.rb +4 -4
  71. data/lib/quickeebooks/windows/model/item.rb +2 -2
  72. data/lib/quickeebooks/windows/model/job.rb +8 -7
  73. data/lib/quickeebooks/windows/model/job_job_info.rb +1 -1
  74. data/lib/quickeebooks/windows/model/meta_data.rb +1 -1
  75. data/lib/quickeebooks/windows/model/ng_id.rb +6 -6
  76. data/lib/quickeebooks/windows/model/ng_id_set.rb +5 -5
  77. data/lib/quickeebooks/windows/model/object_ref.rb +3 -3
  78. data/lib/quickeebooks/windows/model/open_balance.rb +1 -1
  79. data/lib/quickeebooks/windows/model/other_name.rb +2 -2
  80. data/lib/quickeebooks/windows/model/other_name_id.rb +4 -4
  81. data/lib/quickeebooks/windows/model/party_role_ref.rb +1 -1
  82. data/lib/quickeebooks/windows/model/payment_header.rb +4 -4
  83. data/lib/quickeebooks/windows/model/payment_line_item.rb +2 -2
  84. data/lib/quickeebooks/windows/model/payment_method.rb +2 -2
  85. data/lib/quickeebooks/windows/model/phone.rb +3 -3
  86. data/lib/quickeebooks/windows/model/price.rb +2 -2
  87. data/lib/quickeebooks/windows/model/purchase_cost.rb +1 -1
  88. data/lib/quickeebooks/windows/model/rest_response.rb +6 -6
  89. data/lib/quickeebooks/windows/model/sales_receipt.rb +2 -2
  90. data/lib/quickeebooks/windows/model/sales_receipt_header.rb +1 -1
  91. data/lib/quickeebooks/windows/model/sales_receipt_line_item.rb +4 -4
  92. data/lib/quickeebooks/windows/model/sales_rep.rb +5 -5
  93. data/lib/quickeebooks/windows/model/sales_tax.rb +4 -4
  94. data/lib/quickeebooks/windows/model/ship_method.rb +3 -3
  95. data/lib/quickeebooks/windows/model/success.rb +4 -4
  96. data/lib/quickeebooks/windows/model/sync_status_param.rb +5 -5
  97. data/lib/quickeebooks/windows/model/sync_status_request.rb +6 -6
  98. data/lib/quickeebooks/windows/model/sync_status_response.rb +6 -6
  99. data/lib/quickeebooks/windows/model/tax_line.rb +1 -1
  100. data/lib/quickeebooks/windows/model/time_activity_employee.rb +1 -1
  101. data/lib/quickeebooks/windows/model/time_activity_vendor.rb +1 -1
  102. data/lib/quickeebooks/windows/model/unit_price.rb +1 -1
  103. data/lib/quickeebooks/windows/model/vendor.rb +2 -2
  104. data/lib/quickeebooks/windows/model/vendor_id.rb +4 -4
  105. data/lib/quickeebooks/windows/model/vendor_reference.rb +2 -2
  106. data/lib/quickeebooks/windows/model/web_site.rb +2 -2
  107. data/lib/quickeebooks/windows/service/access_token.rb +1 -1
  108. data/lib/quickeebooks/windows/service/account.rb +7 -2
  109. data/lib/quickeebooks/windows/service/clazz.rb +1 -1
  110. data/lib/quickeebooks/windows/service/customer.rb +1 -1
  111. data/lib/quickeebooks/windows/service/customer_msg.rb +2 -2
  112. data/lib/quickeebooks/windows/service/invoice.rb +6 -6
  113. data/lib/quickeebooks/windows/service/item.rb +7 -2
  114. data/lib/quickeebooks/windows/service/job.rb +5 -5
  115. data/lib/quickeebooks/windows/service/payment.rb +2 -2
  116. data/lib/quickeebooks/windows/service/payment_method.rb +2 -2
  117. data/lib/quickeebooks/windows/service/sales_rep.rb +1 -1
  118. data/lib/quickeebooks/windows/service/sales_tax.rb +2 -2
  119. data/lib/quickeebooks/windows/service/service_base.rb +1 -1
  120. data/lib/quickeebooks/windows/service/ship_method.rb +3 -3
  121. data/lib/quickeebooks/windows/service/sort.rb +1 -1
  122. data/lib/quickeebooks/windows/service/sync_status.rb +4 -4
  123. metadata +27 -27
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- OGY2YmJmMjg3MmU2OWQwNzNlMTk5NzM3YmFkYTVlODdlN2I2Njc5Zg==
5
- data.tar.gz: !binary |-
6
- MzllNzE0OTI3ZjUwYzQ1MWQ4NzczYzE0NmRmZGQyMDNlYzkxYjhiNQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- Y2VhOTU0ZTJiZGNiNmFlMTFiODg1MjA3N2E5ZmVhNTliYTFhYTBmOGVkOGQw
10
- YjFiZDdjZDY1ODRjMTBiNGJjNTdkODMxMmRiYzBmZTRhZWQyZjljMzIxOWIw
11
- YjJkZjkxNWFkNTA5MDk1MjhiNjE3ZTU2MmZjYmFhZWViYWJmMzA=
12
- data.tar.gz: !binary |-
13
- NDUyMzcwMzNlYWZkYmM3OTkxMGMwMjVmMjlhMzI4ZTVjNTY2MTI3YWUwNzVj
14
- Y2Q0YzFlYWRkOTNkMDE5MmQyZjg1NmFkYmUxNTA4YjQ3NGJiMjRlYjZlMDEy
15
- OGE5OWViMzNjMjliZGFmMGZiMTNkN2M3ZjY3N2MwNjRiNDI5ODE=
2
+ SHA1:
3
+ metadata.gz: 957d18c455b65bad21cb02301a81bed85e831c9f
4
+ data.tar.gz: dfe17e2f5a4a35260e72b445ec0c31872f7c566b
5
+ SHA512:
6
+ metadata.gz: 7215ec5084cbadd40ebb2cf27d6f0bd8e255d0194018e3220d556f385c2d642a055d21a7169ee411158b89ea11cf7044355ae309b60b15135f016a6565e518c1
7
+ data.tar.gz: c7caa643706f746f82b150942ccd2108d6efd786bafe29f3a43acab5f86810e84688a83602a9cdc1edd2905df90096f08bf58309a0c0d17cf18cb3ac8f11f56e
@@ -6,10 +6,10 @@ module Quickeebooks
6
6
  base.send :include, InstanceMethods
7
7
  base.extend ClassMethods
8
8
  end
9
-
9
+
10
10
  module ClassMethods
11
11
  end
12
-
12
+
13
13
  module InstanceMethods
14
14
  def phone=(phone)
15
15
  self.phones ||= []
@@ -58,9 +58,9 @@ module Quickeebooks
58
58
  def select_address(tag)
59
59
  addresses.detect { |address| address.tag == tag }
60
60
  end
61
-
61
+
62
62
  end # InstanceMethods
63
63
 
64
64
  end
65
65
  end
66
- end
66
+ end
@@ -16,6 +16,6 @@ module Quickeebooks
16
16
  ::DateTime.parse(datetime).strftime('%Y-%m-%dT%H:%M:%S%z')
17
17
  end
18
18
 
19
- end
19
+ end
20
20
  end
21
- end
21
+ end
@@ -24,7 +24,7 @@ module OnlineEntityModel
24
24
  xml_accessor :sales_term_id, :from => 'SalesTermId', :as => Quickeebooks::Online::Model::Id
25
25
  xml_accessor :open_balance, :from => 'OpenBalance', :as => Quickeebooks::Online::Model::OpenBalance
26
26
  xml_accessor :external_id, :from => 'ExternalId'
27
- end
27
+ end
28
28
  end
29
29
 
30
30
 
@@ -50,4 +50,4 @@ module Quickeebooks
50
50
  end
51
51
 
52
52
  end
53
- end
53
+ end
@@ -14,4 +14,4 @@ module Quickeebooks
14
14
  end
15
15
  end
16
16
  end
17
- end
17
+ end
@@ -26,7 +26,7 @@ module Quickeebooks
26
26
 
27
27
  end
28
28
  end
29
-
29
+
30
30
  end
31
31
  end
32
32
 
@@ -40,4 +40,4 @@ end
40
40
  <PostalCode>96009</PostalCode>
41
41
  <Tag>Billing</Tag>
42
42
  </Address>
43
- =end
43
+ =end
@@ -1,7 +1,7 @@
1
1
  require 'quickeebooks/online/model/bill_reimbursable'
2
2
 
3
- module Quickeebooks
4
- module Online
3
+ module Quickeebooks
4
+ module Online
5
5
  module Model
6
6
  class BillLineItem < Quickeebooks::Online::Model::IntuitType
7
7
  xml_name 'Line'
@@ -11,26 +11,26 @@ module Quickeebooks
11
11
 
12
12
  XML_COLLECTION_NODE = 'Classes'
13
13
  XML_NODE = 'Class'
14
-
14
+
15
15
  # https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0400_quickbooks_online/class
16
16
  REST_RESOURCE = "class"
17
-
17
+
18
18
  xml_convention :camelcase
19
19
  xml_accessor :id, :from => 'Id', :as => Quickeebooks::Online::Model::Id
20
20
  xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
21
21
  xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Online::Model::MetaData
22
22
  xml_accessor :name
23
23
  xml_accessor :class_parent_id, :from => 'ClassParentId', :as => Quickeebooks::Online::Model::Id
24
-
24
+
25
25
  validates_length_of :name, :minimum => 1, :maximum => 256
26
-
26
+
27
27
  def valid_for_update?
28
28
  if sync_token.nil?
29
29
  errors.add(:sync_token, "Missing required attribute SyncToken for update")
30
30
  end
31
31
  errors.empty?
32
32
  end
33
-
33
+
34
34
  def valid_for_create?
35
35
  valid?
36
36
  if type_of.nil?
@@ -49,7 +49,7 @@ module Quickeebooks
49
49
  return false if(id.nil? || sync_token.nil?)
50
50
  id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
51
51
  end
52
-
52
+
53
53
  def self.resource_for_collection
54
54
  "classes"
55
55
  end
@@ -9,7 +9,7 @@ module Quickeebooks
9
9
  module Model
10
10
  class CompanyMetaData < Quickeebooks::Online::Model::IntuitType
11
11
  include ActiveModel::Validations
12
-
12
+
13
13
  REST_RESOURCE = "companymetadata"
14
14
 
15
15
  xml_convention :camelcase
@@ -11,4 +11,4 @@ module Quickeebooks
11
11
  end
12
12
  end
13
13
  end
14
- end
14
+ end
@@ -14,4 +14,4 @@ module Quickeebooks
14
14
  end
15
15
  end
16
16
  end
17
- end
17
+ end
@@ -10,4 +10,4 @@ module Quickeebooks
10
10
  end
11
11
  end
12
12
  end
13
- end
13
+ end
@@ -13,7 +13,7 @@ module Quickeebooks
13
13
  xml_accessor :value, :from => 'Value'
14
14
 
15
15
  def to_xml(options = {})
16
- # Intuit v3 doesnt support custom field updating...
16
+ # Intuit v3 doesnt support custom field updating...
17
17
  return ""
18
18
 
19
19
  # return "" if value.to_s.empty?
@@ -48,4 +48,4 @@ module Quickeebooks
48
48
  end
49
49
 
50
50
  end
51
- end
51
+ end
@@ -1,7 +1,7 @@
1
1
  require "quickeebooks"
2
2
 
3
3
  module Quickeebooks
4
-
4
+
5
5
  module Online
6
6
  module Model
7
7
  class Email < Quickeebooks::Online::Model::IntuitType
@@ -21,4 +21,4 @@ module Quickeebooks
21
21
  end
22
22
  end
23
23
  end
24
- end
24
+ end
@@ -4,27 +4,27 @@ module Quickeebooks
4
4
  module Online
5
5
  module Model
6
6
  class Id < Quickeebooks::Online::Model::IntuitType
7
-
8
-
7
+
8
+
9
9
  DOMAIN = "QBO"
10
-
10
+
11
11
  xml_convention :camelcase
12
12
  xml_accessor :idDomain, :from => '@idDomain' # Attribute with name 'idDomain'
13
13
  xml_accessor :value, :from => :content
14
-
14
+
15
15
  def initialize(value = nil)
16
16
  self.value = value
17
17
  end
18
-
18
+
19
19
  def to_i
20
20
  self.value.to_i
21
21
  end
22
-
22
+
23
23
  def to_s
24
24
  self.value.to_s
25
25
  end
26
-
26
+
27
27
  end
28
28
  end
29
29
  end
30
- end
30
+ end
@@ -5,13 +5,13 @@ module Quickeebooks
5
5
  class IntuitType
6
6
  include ROXML
7
7
  include Logging
8
-
8
+
9
9
  # These can be over-ridden in each model object as needed
10
10
  # For the most part a model object has a single resource for all operations
11
11
  # E.g. <baseURL>/resource/invoice/v2/<realmID>
12
12
  # But for the Account object its collection is plural while all other operations are singular
13
- # E.g.
14
- # Fetch all accounts: <baseURL>/resource/accounts/v2/<realmID>
13
+ # E.g.
14
+ # Fetch all accounts: <baseURL>/resource/accounts/v2/<realmID>
15
15
  # vs
16
16
  # Create an account, fetch an account, etc: <baseURL>/resource/account/v2/<realmID>
17
17
  def self.resource_for_collection
@@ -22,7 +22,7 @@ module Quickeebooks
22
22
  self::REST_RESOURCE
23
23
  end
24
24
 
25
-
25
+
26
26
  private
27
27
 
28
28
  # ROXML doesnt insert the namespaces into generated XML so we need to do it ourselves
@@ -32,7 +32,7 @@ module Quickeebooks
32
32
  xml = to_xml(options).write_to(s, :indent => 0, :indent_text => '')
33
33
  destination_name = options.fetch(:destination_name, nil)
34
34
  destination_name ||= model_name
35
-
35
+
36
36
  step1 = s.string.sub("<#{model_name}>", "<#{destination_name} #{Quickeebooks::Online::Service::ServiceBase::XML_NS}>")
37
37
  step2 = step1.sub("</#{model_name}>", "</#{destination_name}>")
38
38
  step2
@@ -14,10 +14,10 @@ module Quickeebooks
14
14
  class Invoice < Quickeebooks::Online::Model::IntuitType
15
15
  include ActiveModel::Validations
16
16
  include OnlineLineItemModelMethods
17
-
17
+
18
18
  XML_NODE = "Invoice"
19
19
  REST_RESOURCE = "invoice"
20
-
20
+
21
21
  xml_convention :camelcase
22
22
  xml_accessor :id, :from => 'Id', :as => Quickeebooks::Online::Model::Id
23
23
  xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
@@ -37,7 +37,7 @@ module Quickeebooks
37
37
  xml_accessor :discount_rate, :from => 'DiscountRate', :as => Float
38
38
  xml_accessor :discount_taxable, :from => 'DiscountTaxable'
39
39
  xml_accessor :txn_id, :from => 'TxnId', :as => Quickeebooks::Online::Model::Id
40
-
40
+
41
41
  end
42
42
  end
43
43
  end
@@ -20,4 +20,4 @@ module Quickeebooks
20
20
  end
21
21
  end
22
22
  end
23
- end
23
+ end
@@ -10,9 +10,9 @@ module Quickeebooks
10
10
  module Model
11
11
  class Item < Quickeebooks::Online::Model::IntuitType
12
12
  include ActiveModel::Validations
13
-
13
+
14
14
  XML_NODE = "Item"
15
-
15
+
16
16
  # <baseURL>/resource/items/v2/<realmID>
17
17
  REST_RESOURCE = "item"
18
18
 
@@ -44,12 +44,20 @@ module Quickeebooks
44
44
  id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
45
45
  end
46
46
 
47
+ def valid_for_update?
48
+ if sync_token.nil?
49
+ errors.add(:sync_token, "Missing required attribute SyncToken for update")
50
+ end
51
+ valid?
52
+ errors.empty?
53
+ end
54
+
47
55
  def taxable?
48
56
  taxable == "true"
49
57
  end
50
-
58
+
51
59
  end
52
60
  end
53
61
  end
54
62
 
55
- end
63
+ end
@@ -32,9 +32,9 @@ module Quickeebooks
32
32
 
33
33
  validates_length_of :name, :minimum => 1
34
34
  validate :require_a_customer
35
-
35
+
36
36
  private
37
-
37
+
38
38
  def require_a_customer
39
39
  if customer_id.nil?
40
40
  errors.add(:customer_id, "Must provide a Customer ID.")
@@ -29,4 +29,4 @@ module Quickeebooks
29
29
  end
30
30
  end
31
31
  end
32
- end
32
+ end
@@ -1,5 +1,5 @@
1
- module Quickeebooks
2
- module Online
1
+ module Quickeebooks
2
+ module Online
3
3
  module Model
4
4
  class JournalEntryLineItem < Quickeebooks::Online::Model::IntuitType
5
5
  include ActiveModel::Validations
@@ -21,7 +21,7 @@ module Quickeebooks
21
21
  datetime.strftime('%Y-%m-%dT%H:%M:%S%z')
22
22
  end
23
23
 
24
- end
24
+ end
25
25
  end
26
26
  end
27
- end
27
+ end
@@ -8,4 +8,4 @@ module Quickeebooks
8
8
  end
9
9
  end
10
10
  end
11
- end
11
+ end
@@ -9,4 +9,4 @@ module Quickeebooks
9
9
  end
10
10
  end
11
11
  end
12
- end
12
+ end
@@ -21,4 +21,4 @@ module Quickeebooks
21
21
  end
22
22
  end
23
23
  end
24
- end
24
+ end
@@ -1,7 +1,7 @@
1
1
  require 'quickeebooks/online/model/id'
2
2
 
3
- module Quickeebooks
4
- module Online
3
+ module Quickeebooks
4
+ module Online
5
5
  module Model
6
6
  class PaymentLineItem < Quickeebooks::Online::Model::IntuitType
7
7
  xml_name 'Line'
@@ -12,4 +12,4 @@ module Quickeebooks
12
12
  end
13
13
  end
14
14
  end
15
- end
15
+ end
@@ -9,4 +9,4 @@ module Quickeebooks
9
9
  end
10
10
  end
11
11
  end
12
- end
12
+ end
@@ -15,4 +15,4 @@ module Quickeebooks
15
15
  end
16
16
  end
17
17
  end
18
- end
18
+ end
@@ -8,4 +8,4 @@ module Quickeebooks
8
8
  end
9
9
  end
10
10
  end
11
- end
11
+ end
@@ -25,4 +25,4 @@ module Quickeebooks
25
25
  end
26
26
  end
27
27
  end
28
- end
28
+ end