update
This commit is contained in:
@@ -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,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user