Skip to content

Commit

Permalink
fix(taxes): also consider taxes in product not only variant
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerald Baulig committed Sep 25, 2024
1 parent b1cdfff commit 95b8eb2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1372,8 +1372,10 @@ export class OrderingService
order.customer_type === CustomerType.PRIVATE &&
country?.economic_areas?.some(
ea => billing_country?.payload?.economic_areas?.includes(ea)
) &&
(variant?.tax_ids?.length && variant.tax_ids?.includes(t.id!))
) && (
product.payload.product.tax_ids?.includes(t.id!)
|| variant.tax_ids?.includes(t.id!)
)
)
).map(
t => ({
Expand All @@ -1384,6 +1386,7 @@ export class OrderingService
const net = vats.reduce((a, b) => b.vat! + a, gross);
item.unit_price = unit_price;
item.amount = {
currency_id: unit_price.currency_id,
gross,
net,
vats,
Expand Down

0 comments on commit 95b8eb2

Please sign in to comment.