Fix cumulative tax calculation in FalukantService by using falukantUser.id instead of user.id for accurate regional tax assessments.
This commit is contained in:
@@ -1694,7 +1694,7 @@ class FalukantService extends BaseService {
|
|||||||
const knowledgeVal = item.productType.knowledges[0]?.knowledge || 0;
|
const knowledgeVal = item.productType.knowledges[0]?.knowledge || 0;
|
||||||
const regionId = item.stock.branch.regionId;
|
const regionId = item.stock.branch.regionId;
|
||||||
const pricePerUnit = await calcRegionalSellPrice(item.productType, knowledgeVal, 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 inflationFactor = cumulativeTax >= 100 ? 1 : (1 / (1 - cumulativeTax / 100));
|
||||||
const adjustedPricePerUnit = Math.round(pricePerUnit * inflationFactor * 100) / 100;
|
const adjustedPricePerUnit = Math.round(pricePerUnit * inflationFactor * 100) / 100;
|
||||||
total += item.quantity * adjustedPricePerUnit;
|
total += item.quantity * adjustedPricePerUnit;
|
||||||
|
|||||||
Reference in New Issue
Block a user