From c69a414f782647967c933bd4520892494f3ffede Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Sat, 20 Dec 2025 11:04:21 +0100 Subject: [PATCH] Fix cumulative tax calculation in FalukantService by using falukantUser.id instead of user.id for accurate regional tax assessments. --- backend/services/falukantService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/services/falukantService.js b/backend/services/falukantService.js index eb8ad10..3f9fd51 100644 --- a/backend/services/falukantService.js +++ b/backend/services/falukantService.js @@ -1694,7 +1694,7 @@ class FalukantService extends BaseService { const knowledgeVal = item.productType.knowledges[0]?.knowledge || 0; const regionId = item.stock.branch.regionId; const pricePerUnit = await calcRegionalSellPrice(item.productType, knowledgeVal, regionId); - const cumulativeTax = await getCumulativeTaxPercentWithExemptions(user.id, regionId); + const cumulativeTax = await getCumulativeTaxPercentWithExemptions(falukantUser.id, regionId); const inflationFactor = cumulativeTax >= 100 ? 1 : (1 / (1 - cumulativeTax / 100)); const adjustedPricePerUnit = Math.round(pricePerUnit * inflationFactor * 100) / 100; total += item.quantity * adjustedPricePerUnit;