effective_qb_sync 1.3.8 → 1.4.0

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: d57feb13b269e62b4c7756a455c73cd20d9f5ae9dd7086d4ee24be3c9bcda817
4
- data.tar.gz: cd2daba55cd448f6b6c04c54f93bf17c5d143d1b30fbc3309825794ef48256f8
3
+ metadata.gz: 349c5cbc263f6553be07c308064427d01c9fd44f45e9e89b626852ff1daad271
4
+ data.tar.gz: 3d961d678553a5cea81250014b18256a10fee4334bd720a98b2ad3c2bcc85d1d
5
5
  SHA512:
6
- metadata.gz: f357b73b508db96cce4dfdd29a925add3d9240ec531624a3d321b858e3e7f0b931d355ea301e5bb9bf453747c3d3d09bcb89c4c6f7fc157f8962718d88475a39
7
- data.tar.gz: '03875a16f136ec46d7bbf469ebbbafae8c60107261a7c7881c79496b1550a049648af1133a87bc9e390b324622582022073bcb1c3336cd59bd20cac5bbec2541'
6
+ metadata.gz: ddc265acf4e19b8aeedc7fb6fe4a2d764e54c883818e5fc3e07ad08264bf874b387cd231a2e26c44533b38d3a1635a792964e6c90a6f33ec6c4c8d784772d0ed
7
+ data.tar.gz: 73a4419a4eea4ac12900d40e15869cad50ef8d5279d81a79dac1ffcb0958733804f02fec5773bc9a0889d60afe836deade1630e78ce8ef4dd9a0f7b7e9a00a82
@@ -234,11 +234,24 @@ module Effective
234
234
  }
235
235
  end
236
236
 
237
- if EffectiveQbSync.quickbooks_tax_name.present?
237
+ surcharge_name = EffectiveOrders.try(:credit_card_surcharge_qb_item_name)
238
+ tax_name = EffectiveQbSync.quickbooks_tax_name
239
+
240
+ if surcharge_name.present? && order.surcharge != 0
241
+ xml.SalesReceiptLineAdd {
242
+ xml.ItemRef { xml.FullName(surcharge_name) }
243
+ xml.Desc(surcharge_name)
244
+ xml.Amount(qb_amount(order.surcharge))
245
+ }
246
+ end
247
+
248
+ # This is manual tax mode. Add the Tax and Surcharge Tax as an item.
249
+ # When tax name is blank, this is handled automatically by QuickBooks
250
+ if tax_name.present? && (order.tax != 0 || order.try(:surcharge_tax).to_i != 0)
238
251
  xml.SalesReceiptLineAdd {
239
- xml.ItemRef { xml.FullName(EffectiveQbSync.quickbooks_tax_name) }
240
- xml.Desc(EffectiveQbSync.quickbooks_tax_name)
241
- xml.Amount(qb_amount(order.tax))
252
+ xml.ItemRef { xml.FullName(tax_name) }
253
+ xml.Desc(tax_name)
254
+ xml.Amount(qb_amount(order.tax + order.try(:surcharge_tax).to_i))
242
255
  }
243
256
  end
244
257
  }
@@ -1,3 +1,3 @@
1
1
  module EffectiveQbSync
2
- VERSION = '1.3.8'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_qb_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8
4
+ version: 1.4.0
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: 2022-10-24 00:00:00.000000000 Z
11
+ date: 2022-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails