effective_qb_online 0.6.2 → 0.6.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e972afaa191b14e8348a7efe55ed2f5b21ecb5d39c2fbf5de0a0766c3dec8179
|
4
|
+
data.tar.gz: 99b89c7dc278bce7f6478e0e386c5a0a726df3cf4574888255b875aca0491313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00dae06cea1f1c336310beba68b5224e8f8ec9f4c6a86fa06fe7d1ae65eaa5977ce69c7b87fa36663b9a13ec848b1b2d20a470c9328935373fe5b88efe1b5bd6
|
7
|
+
data.tar.gz: 81e48c7baa086d9a8b6f86f51df0880f5867ff40540eb95d7f5d2fa06a52093f4e6cbbaa8439f2cdcfee741bc8930987f1553a517325394a667c056cb8cdb5f6
|
@@ -160,18 +160,16 @@ module Effective
|
|
160
160
|
exempt = [['0.0', exempt]] if exempt.present?
|
161
161
|
|
162
162
|
# Find The rest
|
163
|
-
tax_codes = codes.map do |code|
|
163
|
+
tax_codes = codes.select(&:active?).map do |code|
|
164
164
|
rate_id = code.sales_tax_rate_list.tax_rate_detail.first&.tax_rate_ref&.value
|
165
165
|
rate = rates.find { |rate| rate.id == rate_id } if rate_id
|
166
166
|
|
167
167
|
[rate.rate_value.to_s, code] if rate && (exempt.blank? || rate.rate_value.to_f > 0.0)
|
168
168
|
end
|
169
169
|
|
170
|
-
(Array(exempt) + tax_codes.compact).to_h
|
170
|
+
(Array(exempt) + tax_codes.uniq { |key, _| key }.compact).to_h
|
171
171
|
end
|
172
172
|
|
173
|
-
private
|
174
|
-
|
175
173
|
def with_service(name, &block)
|
176
174
|
klass = "Quickbooks::Service::#{name}".constantize
|
177
175
|
|
@@ -181,6 +179,8 @@ module Effective
|
|
181
179
|
end
|
182
180
|
end
|
183
181
|
|
182
|
+
private
|
183
|
+
|
184
184
|
def with_authenticated_request(max_attempts: 3, &block)
|
185
185
|
attempts = 0
|
186
186
|
|
@@ -75,6 +75,7 @@ module Effective
|
|
75
75
|
customer_id: receipt.customer_id,
|
76
76
|
deposit_to_account_id: api.realm.deposit_to_account_id, # The ID of the Account Entity you want the SalesReceipt to be deposited to
|
77
77
|
payment_method_id: api.realm.payment_method_id, # The ID of the PaymentMethod Entity
|
78
|
+
doc_number: order.to_param, # This is the transaction # field
|
78
79
|
payment_ref_number: order.to_param, # Optional payment reference number/string
|
79
80
|
txn_date: order.purchased_at.to_date,
|
80
81
|
customer_memo: order.note_to_buyer,
|
@@ -83,9 +84,6 @@ module Effective
|
|
83
84
|
email_status: 'EmailSent'
|
84
85
|
)
|
85
86
|
|
86
|
-
# Allows QuickBooks to auto-generate the transaction number
|
87
|
-
sales_receipt.auto_doc_number!
|
88
|
-
|
89
87
|
# Addresses
|
90
88
|
sales_receipt.bill_address = api.build_address(order.billing_address) if order.billing_address.present?
|
91
89
|
sales_receipt.ship_address = api.build_address(order.shipping_address) if order.shipping_address.present?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_qb_online
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|