fix: change total price to net price

pull/100/head
shancheas 2024-09-21 07:24:16 +07:00
parent b2be2e0160
commit f2fef65f20
1 changed files with 2 additions and 6 deletions

View File

@ -97,18 +97,14 @@ export class PriceCalculator {
}); });
const formulas = [...taxFormula, ...taxShareFormulas]; const formulas = [...taxFormula, ...taxShareFormulas];
const values = { const values = {
total: transaction.total_price, total: transaction.total_net_price,
...this.initialValue(formulas), ...this.initialValue(formulas),
...taxes, ...taxes,
}; };
// const dpp = formulas.find((formula) => formula.value_for == 'dpp'); // const dpp = formulas.find((formula) => formula.value_for == 'dpp');
const dppValue = calculateFormula( const dppValue = calculateFormula(dpp.formula_string, taxes, values.total);
dpp.formula_string,
taxes,
transaction.total_net_price,
);
values['dpp'] = dppValue; values['dpp'] = dppValue;
values['dpp_value'] = dppValue; values['dpp_value'] = dppValue;