quickbooks-ruby 0.6.6 → 0.6.7

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: 6bd985e3f514d7c7dd61251a595403b0ce08b704aa36e0e46a22c9ff413dbd88
4
- data.tar.gz: 5dd26b9373a30bc69446fa501ece61b626c7d2370b09981a44e28966e575dafe
3
+ metadata.gz: 4f0f3695093279eed43fc6d76197a6b5cf69142ef0edc91f680981c1c9b30300
4
+ data.tar.gz: 04321daa044502c5bea12a6530323e50fc61e6838b6290598ad535ab11cfa885
5
5
  SHA512:
6
- metadata.gz: 65956021117c97495fa06dfe2679ab7d7c6fbff875fa1a4f7beb03077aeaebad151fb9a747c96a559ba82059859d32716cea69ee9cca11c4a47bcc6e1c7486dc
7
- data.tar.gz: 52fd82791663dcddaf5ad1671f2f7397bc2bf750696c8404d5f28e75b8b01c91674e0fcf785e5bfafcc404971dc8c74f8e3a930a9f0472b66323428115e4c745
6
+ metadata.gz: 2a0c35ff4ccbaf55a1846b00118c6e20de33f0780f477e459c68d6b6a12804c6e97de05c6e00a2a0a8da9c7faaa9ea0d330cf623a8d1036d985b7c2c18a542da
7
+ data.tar.gz: 283064cdffe11bbddb36b52d237a25635da700b6cb850391570c803a63d053adc473b458df57c66cdc0e7058ed2b997ad5e2a033d7aa64b609cb2ee4fb25306b
@@ -19,6 +19,14 @@ module Quickbooks
19
19
  data
20
20
  end
21
21
 
22
+ # time when refresh was requests from cdc/ endpoiint
23
+ # more information @here - https://developer.intuit.com/app/developer/qbo/docs/develop/explore-the-quickbooks-online-api/change-data-capture#using-change-data-capture
24
+ #
25
+ def time
26
+ attribute = xml.root.attribute('time')
27
+ attribute.value if attribute
28
+ end
29
+
22
30
  private
23
31
 
24
32
  def all_of_type(entity)
@@ -8,6 +8,24 @@ module Quickbooks
8
8
  xml_accessor :boolean_value, :from => 'BooleanValue'
9
9
  xml_accessor :date_value, :from => 'DateValue', :as => Date
10
10
  xml_accessor :number_value, :from => 'NumberValue', :as => Integer
11
+
12
+ def value
13
+ case type
14
+ when 'BooleanType' then boolean_value == 'true'
15
+ when 'StringType' then string_value
16
+ when 'DateType' then date_value
17
+ when 'NumberType' then number_value
18
+ end
19
+ end
20
+
21
+ def value=(value)
22
+ case type
23
+ when 'BooleanType' then self.boolean_value = value ? 'true' : 'false'
24
+ when 'StringType' then self.string_value = value
25
+ when 'DateType' then self.date_value = value
26
+ when 'NumberType' then self.number_value = value
27
+ end
28
+ end
11
29
  end
12
30
  end
13
31
  end
@@ -50,9 +50,10 @@ module Quickbooks
50
50
  xml_accessor :sales_tax_code_ref, :from => 'SalesTaxCodeRef', :as => BaseReference
51
51
  xml_accessor :purchase_tax_code_ref, :from => 'PurchaseTaxCodeRef', :as => BaseReference
52
52
  xml_accessor :inv_start_date, :from => 'InvStartDate', :as => Date
53
-
53
+ xml_accessor :custom_fields, :from => "CustomField", as: [CustomField]
54
54
  xml_accessor :print_grouped_items?, :from => 'PrintGroupedItems'
55
55
 
56
+
56
57
  xml_accessor :item_group_details, :from => 'ItemGroupDetail', :as => ItemGroupDetail
57
58
 
58
59
  reference_setters :parent_ref, :income_account_ref, :expense_account_ref
@@ -20,11 +20,11 @@ module Quickbooks
20
20
  end
21
21
 
22
22
  def lat_to_f
23
- BigDecimal.new(lat)
23
+ BigDecimal(lat)
24
24
  end
25
25
 
26
26
  def lon_to_f
27
- BigDecimal.new(lon)
27
+ BigDecimal(lon)
28
28
  end
29
29
 
30
30
  def have_lat?
@@ -20,9 +20,6 @@ module Quickbooks
20
20
  PREFERENCE_SECTIONS = {
21
21
  :accounting_info => %w(TrackDepartments DepartmentTerminology ClassTrackingPerTxnLine? ClassTrackingPerTxn? CustomerTerminology),
22
22
  :product_and_services => %w(ForSales? ForPurchase? QuantityWithPriceAndRate? QuantityOnHand?),
23
- :sales_forms => %w(CustomTxnNumbers? AllowDeposit? AllowDiscount? DefaultDiscountAccount? AllowEstimates? EstimateMessage?
24
- ETransactionEnabledStatus? ETransactionAttachPDF? ETransactionPaymentEnabled? IPNSupportEnabled?
25
- AllowServiceDate? AllowShipping? DefaultShippingAccount? DefaultTerms DefaultCustomerMessage),
26
23
  :vendor_and_purchase => %w(TrackingByCustomer? BillableExpenseTracking? DefaultTerms? DefaultMarkup? POCustomField),
27
24
  :time_tracking => %w(UseServices? BillCustomers? ShowBillRateToAll WorkWeekStartDate MarkTimeEntiresBillable?),
28
25
  :tax => %w(UsingSalesTax? PartnerTaxEnabled?),
@@ -30,6 +27,14 @@ module Quickbooks
30
27
  :report => %w(ReportBasis)
31
28
  }
32
29
 
30
+ xml_reader :sales_forms, :from => "SalesFormsPrefs", :as => create_preference_class(*%w(
31
+ CustomTxnNumbers? AllowDeposit? AllowDiscount? DefaultDiscountAccount? AllowEstimates? EstimateMessage?
32
+ ETransactionEnabledStatus? ETransactionAttachPDF? ETransactionPaymentEnabled? IPNSupportEnabled?
33
+ AllowServiceDate? AllowShipping? DefaultShippingAccount? DefaultTerms DefaultCustomerMessage
34
+ )) {
35
+ xml_reader :custom_fields, :as => [CustomField], :from => 'CustomField', in: 'CustomField'
36
+ }
37
+
33
38
  PREFERENCE_SECTIONS.each do |section_name, fields|
34
39
  xml_reader section_name, :from => "#{section_name}_prefs".camelize, :as => create_preference_class(*fields)
35
40
  end
@@ -258,6 +258,10 @@ module Quickbooks
258
258
  end
259
259
 
260
260
  def check_response(response, options = {})
261
+ log "------ RESPONSE_HEADERS -----"
262
+ if log?
263
+ response.each_header {|h| log "#{h}: #{response[h]}"}
264
+ end
261
265
  log "------ QUICKBOOKS-RUBY RESPONSE ------"
262
266
  log "RESPONSE CODE = #{response.code}"
263
267
  log_response_body(response)
@@ -5,6 +5,10 @@ module Quickbooks
5
5
  ::Quickbooks.log(msg)
6
6
  end
7
7
 
8
+ def log?
9
+ ::Quickbooks.log?
10
+ end
11
+
8
12
  def log_xml(str)
9
13
  if ::Quickbooks.log_xml_pretty_print? && !(str and str.empty?)
10
14
  Nokogiri::XML(str).to_xml
@@ -1,5 +1,5 @@
1
1
  module Quickbooks
2
2
 
3
- VERSION = "0.6.6"
3
+ VERSION = "0.6.7"
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.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Caughlan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-31 00:00:00.000000000 Z
11
+ date: 2019-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth