quickbooks-ruby 1.0.11 → 1.0.16

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
  SHA256:
3
- metadata.gz: 59f6b50352335b6f8142b4b2e6ab4f3057104998119ff634f436bbf64e5009d4
4
- data.tar.gz: c6b0639561b040957fcef550fc6e117d0f3327f522c3ec8fc87edb622ef23523
3
+ metadata.gz: 80fd943e9fb98498f7b52adde6510420661a52096e86332e019b03a51e4485e5
4
+ data.tar.gz: c259acc229c14cfd586d670ed58f273e1d4b0d6dd81f0e2eddff56b4cc93e6f0
5
5
  SHA512:
6
- metadata.gz: e27ca054b8ad9281542eebcfa83fdcc6ec7a3855b7afc54fe2bb62d0981de4b1ef840b6e77ba11c164f6092263d6aa3e752b7fe0e3fc79baa747cc559a0e07cc
7
- data.tar.gz: 0b354dd455d03cf7625f9ac0fd8cae75e928aa52bc3e5edaf2ca5a4bea5b148cef9ef0122430c360bc1e14b6130cc57e30b84caaac7c13dd2293bac8fa0ba23d
6
+ metadata.gz: '08b8913a1412ee319d017b833099c6ef88aab2aba9339849805915e7f090759f0a388d74e24b9b984db0f81016693310849ea1e0ef8b8e1ce3164ad68de7173d'
7
+ data.tar.gz: c05b69125cc0debc6364a0a9b82fa14703691e2e2dd5f5722ba34035c7b90c3da5a9b14dc164811f94ba35e63ac590daab1d923c0bf4bfa801818ff46799057a
@@ -124,6 +124,7 @@ require 'quickbooks/model/item_change'
124
124
  require 'quickbooks/model/report'
125
125
  require 'quickbooks/model/credit_memo_change'
126
126
  require 'quickbooks/model/payment_change'
127
+ require 'quickbooks/model/purchase_change'
127
128
  require 'quickbooks/model/transfer'
128
129
  require 'quickbooks/model/change_data_capture'
129
130
  require 'quickbooks/model/refund_receipt_change'
@@ -181,6 +182,7 @@ require 'quickbooks/service/item_change'
181
182
  require 'quickbooks/service/reports'
182
183
  require 'quickbooks/service/credit_memo_change'
183
184
  require 'quickbooks/service/payment_change'
185
+ require 'quickbooks/service/purchase_change'
184
186
  require 'quickbooks/service/transfer'
185
187
  require 'quickbooks/service/change_data_capture'
186
188
  require 'quickbooks/service/refund_receipt_change'
@@ -56,6 +56,7 @@ module Quickbooks
56
56
  xml_accessor :tax_exemption_reason_id, :from => 'TaxExemptionReasonId'
57
57
  xml_accessor :primary_tax_identifier, :from => 'PrimaryTaxIdentifier'
58
58
  xml_accessor :customer_type_ref, :from => 'CustomerTypeRef', :as => BaseReference
59
+ xml_accessor :isproject?, :from => 'IsProject'
59
60
 
60
61
  #== Validations
61
62
  validate :names_cannot_contain_invalid_characters
@@ -36,6 +36,7 @@ module Quickbooks
36
36
  xml_accessor :customer_memo, :from => 'CustomerMemo'
37
37
  xml_accessor :billing_address, :from => 'BillAddr', :as => PhysicalAddress
38
38
  xml_accessor :shipping_address, :from => 'ShipAddr', :as => PhysicalAddress
39
+ xml_accessor :ship_from_address, :from => 'ShipFromAddr', :as => PhysicalAddress
39
40
  xml_accessor :class_ref, :from => 'ClassRef', :as => BaseReference
40
41
  xml_accessor :sales_term_ref, :from => 'SalesTermRef', :as => BaseReference
41
42
  xml_accessor :due_date, :from => 'DueDate', :as => Date
@@ -59,6 +60,7 @@ module Quickbooks
59
60
  xml_accessor :allow_online_credit_card_payment?, :from => 'AllowOnlineCreditCardPayment'
60
61
  xml_accessor :allow_online_ach_payment?, :from => 'AllowOnlineACHPayment'
61
62
  xml_accessor :deposit_to_account_ref, :from => 'DepositToAccountRef', :as => BaseReference
63
+ xml_accessor :bill_email_cc, :from => 'BillEmailCc', :as => EmailAddress
62
64
 
63
65
 
64
66
  reference_setters
@@ -87,6 +89,9 @@ module Quickbooks
87
89
  self.bill_email = EmailAddress.new(email_address_string)
88
90
  end
89
91
 
92
+ def billing_email_cc_address=(email_address_string)
93
+ self.bill_email_cc = EmailAddress.new(email_address_string)
94
+ end
90
95
 
91
96
  def wants_billing_email_sent!
92
97
  self.email_status = EMAIL_STATUS_NEED_TO_SEND
@@ -96,7 +101,6 @@ module Quickbooks
96
101
  email_status == EMAIL_STATUS_NEED_TO_SEND
97
102
  end
98
103
 
99
-
100
104
  def existence_of_customer_ref
101
105
  if customer_ref.nil? || (customer_ref && customer_ref.value == 0)
102
106
  errors.add(:customer_ref, "CustomerRef is required and must be a non-zero value.")
@@ -0,0 +1,7 @@
1
+ module Quickbooks
2
+ module Model
3
+ class PurchaseChange < ChangeModel
4
+ XML_NODE = "Purchase"
5
+ end
6
+ end
7
+ end
@@ -24,10 +24,11 @@ module Quickbooks
24
24
  xml_accessor :attachable_ref, :from => 'AttachableRef', :as => BaseReference
25
25
  xml_accessor :vendor_ref, :from => 'VendorRef', :as => BaseReference
26
26
  xml_accessor :ap_account_ref, :from => 'APAccountRef', :as => BaseReference
27
+ xml_accessor :po_email, from: "POEmail", as: EmailAddress
27
28
  xml_accessor :class_ref, :from => 'ClassRef', :as => BaseReference
28
29
  xml_accessor :sales_term_ref, :from => 'SalesTermRef', :as => BaseReference
29
30
 
30
- xml_accessor :total, :from => 'TotalAmt', :as => BigDecimal, :to_xml => Proc.new { |val| val.to_f }
31
+ xml_accessor :total, :from => 'TotalAmt', :as => BigDecimal, :to_xml => to_xml_big_decimal
31
32
  xml_accessor :due_date, :from => 'DueDate', :as => Date
32
33
  xml_accessor :vendor_address, :from => 'VendorAddr', :as => PhysicalAddress
33
34
  xml_accessor :ship_address, :from => 'ShipAddr', :as => PhysicalAddress
@@ -38,11 +38,17 @@ module Quickbooks
38
38
  value = el.attr('value')
39
39
 
40
40
  next nil if value.blank?
41
- next value if value.to_s.match(/^\d+$|^\d+\.\d+$|^-\d+|^-\d+\.\d+$|^\.\d+$/).nil?
42
- BigDecimal(value)
41
+
42
+ parse_row_value(value)
43
43
  end
44
44
  end
45
45
 
46
+ def parse_row_value(value)
47
+ BigDecimal(value)
48
+ rescue ArgumentError
49
+ value
50
+ end
51
+
46
52
  end
47
53
  end
48
54
  end
@@ -41,6 +41,7 @@ module Quickbooks
41
41
  xml_accessor :account_number, :from => 'AcctNum'
42
42
  xml_accessor :is_1099?, :from => 'Vendor1099'
43
43
  xml_accessor :currency_ref, :from => 'CurrencyRef', :as => BaseReference
44
+ xml_accessor :bill_rate, from: "BillRate", as: BigDecimal, to_xml: to_xml_big_decimal
44
45
 
45
46
  #== Validations
46
47
  validate :names_cannot_contain_invalid_characters
@@ -0,0 +1,16 @@
1
+ module Quickbooks
2
+ module Service
3
+ class PurchaseChange < ChangeService
4
+
5
+ private
6
+
7
+ def entity
8
+ "Purchase"
9
+ end
10
+
11
+ def model
12
+ Quickbooks::Model::PurchaseChange
13
+ end
14
+ end
15
+ end
16
+ end
@@ -7,13 +7,19 @@ module Quickbooks
7
7
  end
8
8
 
9
9
  def fetch_by_id(id, params = {})
10
- url = "#{url_for_base}/purchaseorder/#{id}?minorversion=#{Quickbooks::Model::PurchaseOrder::MINORVERSION}"
10
+ url = "#{url_for_base}/purchaseorder/#{id}?minorversion=#{Quickbooks.minorversion}"
11
11
  fetch_object(model, url, params)
12
12
  end
13
13
 
14
14
  def url_for_query(query = nil, start_position = 1, max_results = 20, options = {})
15
15
  url = super(query, start_position, max_results, options)
16
- "#{url}&minorversion=#{Quickbooks::Model::PurchaseOrder::MINORVERSION}"
16
+ "#{url}&minorversion=#{Quickbooks.minorversion}"
17
+ end
18
+
19
+ def pdf(purchase_order)
20
+ url = "#{url_for_resource(model::REST_RESOURCE)}/#{purchase_order.id}/pdf"
21
+ response = do_http_raw_get(url, {}, {'Accept' => 'application/pdf'})
22
+ response.plain_body
17
23
  end
18
24
 
19
25
  private
@@ -1,5 +1,5 @@
1
1
  module Quickbooks
2
2
 
3
- VERSION = "1.0.11"
3
+ VERSION = "1.0.16"
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: 1.0.11
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Caughlan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-16 00:00:00.000000000 Z
11
+ date: 2021-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2
@@ -98,44 +98,44 @@ dependencies:
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 0.7.1
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 0.7.1
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rr
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 1.0.2
117
+ version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 1.0.2
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: '3.9'
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: '3.9'
138
+ version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: webmock
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -154,16 +154,16 @@ dependencies:
154
154
  name: dotenv
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - '='
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 2.2.1
159
+ version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - '='
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: 2.2.1
166
+ version: '0'
167
167
  description: QBO V3 REST API to Quickbooks Online
168
168
  email: toolbag@gmail.com
169
169
  executables: []
@@ -249,6 +249,7 @@ files:
249
249
  - lib/quickbooks/model/physical_address.rb
250
250
  - lib/quickbooks/model/preferences.rb
251
251
  - lib/quickbooks/model/purchase.rb
252
+ - lib/quickbooks/model/purchase_change.rb
252
253
  - lib/quickbooks/model/purchase_line_item.rb
253
254
  - lib/quickbooks/model/purchase_order.rb
254
255
  - lib/quickbooks/model/purchase_tax_rate_list.rb
@@ -313,6 +314,7 @@ files:
313
314
  - lib/quickbooks/service/payment_method.rb
314
315
  - lib/quickbooks/service/preferences.rb
315
316
  - lib/quickbooks/service/purchase.rb
317
+ - lib/quickbooks/service/purchase_change.rb
316
318
  - lib/quickbooks/service/purchase_order.rb
317
319
  - lib/quickbooks/service/refund_receipt.rb
318
320
  - lib/quickbooks/service/refund_receipt_change.rb
@@ -345,7 +347,7 @@ homepage: http://github.com/ruckus/quickbooks-ruby
345
347
  licenses:
346
348
  - MIT
347
349
  metadata: {}
348
- post_install_message:
350
+ post_install_message:
349
351
  rdoc_options: []
350
352
  require_paths:
351
353
  - lib
@@ -360,9 +362,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
360
362
  - !ruby/object:Gem::Version
361
363
  version: '0'
362
364
  requirements: []
363
- rubyforge_project:
364
- rubygems_version: 2.7.8
365
- signing_key:
365
+ rubyforge_project:
366
+ rubygems_version: 2.7.6.2
367
+ signing_key:
366
368
  specification_version: 4
367
369
  summary: REST API to Quickbooks Online
368
370
  test_files: []