This commit is contained in:
2026-05-17 08:44:11 +03:30
parent 60ee6a0c24
commit 73df354f9b
2 changed files with 20 additions and 10 deletions
@@ -83,14 +83,24 @@ export class PosLandingStore {
readonly payments = computed(() => this.state$().payments);
readonly orderPricingInfo = computed(() => {
const totalAmount = 0;
const taxAmount = totalAmount * 0.1;
let totalAmount = 0;
let taxAmount = 0;
let totalBaseAmount = 0;
let discountAmount = 0;
this.inOrderGoods().forEach((inOrderGood) => {
totalBaseAmount += parseInt(inOrderGood.base_total_amount + '') || 0;
totalAmount += parseInt(inOrderGood.total_amount + '') || 0;
taxAmount += parseInt(inOrderGood.tax_amount + '') || 0;
discountAmount += parseInt(inOrderGood.discount_amount + '') || 0;
});
return {
totalItems: this.inOrderGoods().length,
totalBaseAmount: this.inOrderGoods().reduce((acc, curr) => acc + curr.base_total_amount, 0),
totalAmount: this.inOrderGoods().reduce((acc, curr) => acc + curr.total_amount, 0),
taxAmount: this.inOrderGoods().reduce((acc, curr) => acc + curr.tax_amount, 0),
discountAmount: this.inOrderGoods().reduce((acc, curr) => acc + curr.discount_amount, 0),
totalBaseAmount,
totalAmount,
taxAmount,
discountAmount,
payableAmount: totalAmount + taxAmount,
};
});