From 95b8eb2367b41aacdaceb762823157327100e91c Mon Sep 17 00:00:00 2001 From: Gerald Baulig Date: Wed, 25 Sep 2024 17:30:42 +0200 Subject: [PATCH] fix(taxes): also consider taxes in product not only variant --- src/service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/service.ts b/src/service.ts index 095d183..689e346 100644 --- a/src/service.ts +++ b/src/service.ts @@ -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 => ({ @@ -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,