super_good-solidus_taxjar 0.11.1 → 0.12.0

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: 16f78fd5b5f06f886e1155ac73da728cafe195ccbf6680cad6399ce8048fcb96
4
- data.tar.gz: dd18d3f4cf47e6eda8a2d537cbfac8ef82d15bb49e4042122f18f40e7ba14975
3
+ metadata.gz: 383b1f52471f45dc1f4d51c3bcf7c3b6063313202997858a59bc3107444939ee
4
+ data.tar.gz: 348d9b9942e4def84a74ba612124f337438d0d1260408593058eca9867f821c3
5
5
  SHA512:
6
- metadata.gz: bca92e9d73c6cbb601f551aef6ba99a19a0780aa351c82fab1281b6cf27c75c6cc931802e537dcff84012b92697b4510a2e0b02297c3a55ee2dff32bac8ee8cf
7
- data.tar.gz: 75097f4c136e756add39300058309c7253f889006f52c781aa8b39514310906eaa1bdacf85c7f4d55585ceb1e1bb4e4f069c20e66a8a5150157a197a25823ab1
6
+ metadata.gz: a0afc95de0aa4073290d7c6c8a5a8c7bb21988c96811eecc4a9be55f0b66339d632861123d814927d1adfa09126cb54d4014d39bde08fe0b16b5a90cebe05057
7
+ data.tar.gz: f9ae6f8fb17e5f806aafd5e88adc6b31024814d7182823190a20b4ed46c6e43d0a5e4d36b80d83af7898199e72ee8b99bddf53d7420737b0f524ada22585e6a6
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## v0.12.0
6
+
7
+ - Report no tax collected on order and line items when order total zeroed out.
8
+
5
9
  ## v0.11.1
6
10
 
7
11
  - Avoid sending negative amounts for order totals.
@@ -30,7 +30,7 @@ module SuperGood
30
30
  transaction_date: order.completed_at.to_formatted_s(:iso8601),
31
31
  amount: [order.total - order.additional_tax_total, 0].max,
32
32
  shipping: shipping(order),
33
- sales_tax: order.additional_tax_total
33
+ sales_tax: sales_tax(order)
34
34
  )
35
35
  end
36
36
 
@@ -85,7 +85,7 @@ module SuperGood
85
85
  product_tax_code: line_item.tax_category&.tax_code,
86
86
  unit_price: line_item.price,
87
87
  discount: discount(line_item),
88
- sales_tax: line_item.additional_tax_total
88
+ sales_tax: line_item_sales_tax(line_item)
89
89
  }
90
90
  end
91
91
  }
@@ -106,6 +106,18 @@ module SuperGood
106
106
  def shipping(order)
107
107
  SuperGood::SolidusTaxJar.shipping_calculator.(order)
108
108
  end
109
+
110
+ def sales_tax(order)
111
+ return 0 if order.total.zero?
112
+
113
+ order.additional_tax_total
114
+ end
115
+
116
+ def line_item_sales_tax(line_item)
117
+ return 0 if line_item.order.total.zero?
118
+
119
+ line_item.additional_tax_total
120
+ end
109
121
  end
110
122
  end
111
123
  end
@@ -1,5 +1,5 @@
1
1
  module SuperGood
2
2
  module SolidusTaxJar
3
- VERSION = "0.11.1"
3
+ VERSION = "0.12.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_good-solidus_taxjar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Norman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-11 00:00:00.000000000 Z
11
+ date: 2019-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  - !ruby/object:Gem::Version
195
195
  version: '0'
196
196
  requirements: []
197
- rubygems_version: 3.0.1
197
+ rubygems_version: 3.0.3
198
198
  signing_key:
199
199
  specification_version: 4
200
200
  summary: Support for using TaxJar to handle tax calculations in Solidus