fix: display tax-inclusive prices in POS loyalty reward lines for cashier consistency

This commit is contained in:
Suherdy Yacob 2026-06-15 22:32:25 +07:00
parent e80a34711a
commit 228a84c867

View File

@ -60,16 +60,21 @@ patch(PosOrderline.prototype, {
line => line.reward_group_id === this.reward_group_id
);
// Display uses priceIncl (tax-inclusive) so cashier sees the full
// discount amount (e.g. Rp 20,000) instead of the pre-tax amount
// (e.g. Rp 18,181.82). The actual journal entry still uses the
// pre-tax price_unit computed in loyalty.js — this is display only.
let totalDisplayPrice = 0;
for (const line of groupLines) {
totalDisplayPrice += line.priceExcl;
totalDisplayPrice += line.priceIncl;
}
return formatCurrency(totalDisplayPrice, this.currency.id);
}
if (this.is_reward_line) {
return formatCurrency(this.priceExcl, this.currency.id);
// Same rationale: show tax-inclusive amount to cashier.
return formatCurrency(this.priceIncl, this.currency.id);
}
return super.currencyDisplayPrice;
},