quickbooks-ruby 1.0.21 → 1.0.23

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fef9e529bfa1fb897b03273cad08ac6fe1fe45c30667f655a3a44dddaa36d10a
4
- data.tar.gz: 5dfe60a549caac7c0ecefd10b9ea3396916bccc440e3011ed804d1e02308cbdf
3
+ metadata.gz: 3b741bafa2526fd6ff2686ed3b57ad4dd6dcb5899dfe93b18847bb2b62088b7d
4
+ data.tar.gz: afac6ffcc890ecbbb89bfe80402b3ff1a32753692104c52b140bc90dab772f94
5
5
  SHA512:
6
- metadata.gz: 797e5336baeec1e26e813d9975f1721f187f72cff7abcfd87f01fef579d9669b686af0fd31a3812150365a99388fe69b074d0b6ed8fb5ed3437afc1d4ee49b2e
7
- data.tar.gz: 15c7ffea9da64f530709637aec045c3b2d235216a08cf197b86a9597820083810525674781e28e2299508a6b58758a487d7c8b42f0eb25f4ae50c0a3034ed373
6
+ metadata.gz: 7dc090c1fa9ec77d616276b1548c34f9412bbd2f6bfbf5cb59209357370d18ec19ebd13c2f44c52f86ed76bdfc23fcc7d0fdcba91baf51516e892bb2c3af634e
7
+ data.tar.gz: abbf29a2c505eeb9bee8aab89d62d3c46b5154def85bd5bc5e63f6a4abcaa195d49dd99011ab823bda1129b304c0299f2069d862cf9143f81deea70046728895
@@ -7,7 +7,7 @@ module Quickbooks
7
7
  xml_accessor :billable_status, :from => 'BillableStatus'
8
8
  xml_accessor :tax_amount, :from => 'UnitPrice', :as => BigDecimal, :to_xml => to_xml_big_decimal
9
9
  xml_accessor :tax_code_ref, :from => 'TaxCodeRef', :as => BaseReference
10
- xml_accessor :tax_inclusive_amount, from: 'TaxInclusiveAmt', to_xml: Proc.new { |val| val.to_f }
10
+ xml_accessor :tax_inclusive_amount, from: 'TaxInclusiveAmt', :as => BigDecimal, to_xml: Proc.new { |val| val.to_f }
11
11
 
12
12
  reference_setters :customer_ref, :class_ref, :account_ref, :tax_code_ref
13
13
 
@@ -13,7 +13,7 @@ module Quickbooks
13
13
  xml_accessor :tax_code_ref, :from => 'TaxCodeRef', :as => BaseReference
14
14
  xml_accessor :customer_ref, :from => 'CustomerRef', :as => BaseReference
15
15
  xml_accessor :billable_status, :from => 'BillableStatus'
16
- xml_accessor :tax_inclusive_amount, from: 'TaxInclusiveAmt', to_xml: Proc.new { |val| val.to_f }
16
+ xml_accessor :tax_inclusive_amount, from: 'TaxInclusiveAmt', :as => BigDecimal, to_xml: Proc.new { |val| val.to_f }
17
17
 
18
18
  reference_setters :item_ref, :class_ref, :price_level_ref, :customer_ref, :tax_code_ref
19
19
  end
@@ -32,6 +32,7 @@ module Quickbooks
32
32
  xml_accessor :txn_tax_detail, :from => 'TxnTaxDetail', :as => TransactionTaxDetail
33
33
 
34
34
  xml_accessor :payment_type, :from => 'PaymentType'
35
+ xml_accessor :payment_method_ref, :from => 'PaymentMethodRef', :as => BaseReference
35
36
  xml_accessor :entity_ref, :from => 'EntityRef', :as => BaseReference
36
37
  xml_accessor :remit_to_address, :from => 'RemitToAddr', :as => PhysicalAddress
37
38
  xml_accessor :total, :from => 'TotalAmt', :as => BigDecimal, :to_xml => to_xml_big_decimal
@@ -9,7 +9,7 @@ module Quickbooks
9
9
  xml_accessor :quantity, :from => 'Qty', :as => BigDecimal, :to_xml => Proc.new { |val| val.to_f }
10
10
  xml_accessor :tax_code_ref, :from => 'TaxCodeRef', :as => BaseReference
11
11
  xml_accessor :service_date, :from => 'ServiceDate', :as => Date
12
- xml_accessor :tax_inclusive_amount, from: 'TaxInclusiveAmt', to_xml: Proc.new { |val| val.to_f }
12
+ xml_accessor :tax_inclusive_amount, from: 'TaxInclusiveAmt', :as => BigDecimal, to_xml: Proc.new { |val| val.to_f }
13
13
 
14
14
  reference_setters :item_ref, :class_ref, :price_level_ref, :tax_code_ref
15
15
  end
@@ -429,8 +429,6 @@ module Quickbooks
429
429
  begin
430
430
  @last_response_xml.xpath("//xmlns:IntuitResponse/xmlns:Fault")[0] != nil
431
431
  rescue Nokogiri::XML::XPath::SyntaxError => exception
432
- #puts @last_response_xml.to_xml.to_s
433
- #puts "WTF: #{exception.inspect}:#{exception.backtrace.join("\n")}"
434
432
  true
435
433
  end
436
434
  end
@@ -439,20 +437,20 @@ module Quickbooks
439
437
  error = {:message => "", :detail => "", :type => nil, :code => 0, :intuit_tid => @last_response_intuit_tid}
440
438
  fault = @last_response_xml.xpath("//xmlns:IntuitResponse/xmlns:Fault")[0]
441
439
  if fault
442
- error[:type] = fault.attributes['type'].value
440
+ error[:type] = fault.attributes['type'].try(:value)
443
441
 
444
442
  error_element = fault.xpath("//xmlns:Error")[0]
445
443
  if error_element
446
444
  code_attr = error_element.attributes['code']
447
445
  if code_attr
448
- error[:code] = code_attr.value
446
+ error[:code] = code_attr.try(:value)
449
447
  end
450
448
  element_attr = error_element.attributes['element']
451
449
  if element_attr
452
- error[:element] = code_attr.value
450
+ error[:element] = code_attr.try(:value)
453
451
  end
454
- error[:message] = error_element.xpath("//xmlns:Message").text
455
- error[:detail] = error_element.xpath("//xmlns:Detail").text
452
+ error[:message] = error_element.xpath("//xmlns:Message").try(:text)
453
+ error[:detail] = error_element.xpath("//xmlns:Detail").try(:text)
456
454
  end
457
455
  end
458
456
 
@@ -1,8 +1,10 @@
1
1
  module Quickbooks
2
2
  module Util
3
3
  module Logging
4
+ attr_writer :log
5
+
4
6
  def log(msg)
5
- ::Quickbooks.log(msg)
7
+ ::Quickbooks.log(msg) if log?
6
8
  end
7
9
 
8
10
  def log_multiple(messages)
@@ -14,7 +16,7 @@ module Quickbooks
14
16
  end
15
17
 
16
18
  def log?
17
- ::Quickbooks.log?
19
+ defined?(@log) ? @log : ::Quickbooks.log?
18
20
  end
19
21
 
20
22
  def condense_logs?
@@ -1,5 +1,5 @@
1
1
  module Quickbooks
2
2
 
3
- VERSION = "1.0.21"
3
+ VERSION = "1.0.23"
4
4
 
5
5
  end
@@ -248,10 +248,8 @@ module Quickbooks
248
248
  end
249
249
 
250
250
  def log(msg)
251
- if log?
252
- logger.info(msg)
253
- logger.flush if logger.respond_to?(:flush)
254
- end
251
+ logger.info(msg)
252
+ logger.flush if logger.respond_to?(:flush)
255
253
  end
256
254
  end # << self
257
255
 
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.21
4
+ version: 1.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Caughlan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-26 00:00:00.000000000 Z
11
+ date: 2024-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2