Skip to content

Commit

Permalink
Merge pull request #1085 from AbleKSaju/fix-discount-amount
Browse files Browse the repository at this point in the history
fix: calculation of tax amount
  • Loading branch information
akshayitzme authored Jan 13, 2025
2 parents 0a72f24 + 12a2e3d commit 8a7559b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions models/baseModels/InvoiceItem/InvoiceItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export abstract class InvoiceItem extends Doc {
'party',
'exchangeRate',
'item',
'quantity',
'itemTaxedTotal',
'itemDiscountedTotal',
'setItemDiscountAmount',
Expand Down
7 changes: 4 additions & 3 deletions src/pages/POS/KeyboardModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,10 @@ export default defineComponent({
);
}
this.selectedItemRow.setItemDiscountAmount = true;
this.selectedItemRow.itemDiscountAmount = this.fyo.pesa(
Number(this.selectedValue)
await this.selectedItemRow.set('setItemDiscountAmount', true);
await this.selectedItemRow.set(
'itemDiscountAmount',
this.fyo.pesa(Number(this.selectedValue))
);
}
} else {
Expand Down
9 changes: 6 additions & 3 deletions src/pages/POS/POS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,12 @@ export default defineComponent({
existingItems[0].rate = item.rate as Money;
}
existingItems[0].quantity = quantity
? (existingItems[0].quantity as number) + quantity
: (existingItems[0].quantity as number) + 1;
await existingItems[0].set(
'quantity',
quantity
? (existingItems[0].quantity as number) + quantity
: (existingItems[0].quantity as number) + 1
);
await this.applyPricingRule();
await this.sinvDoc.runFormulas();
Expand Down

0 comments on commit 8a7559b

Please sign in to comment.