2
0
mirror of https://github.com/frappe/books.git synced 2025-04-07 02:31:50 +00:00

Merge pull request #1085 from AbleKSaju/fix-discount-amount

fix: calculation of tax amount
This commit is contained in:
Akshay 2025-01-13 10:30:42 +05:30 committed by GitHub
commit 8a7559bc4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 6 deletions

View File

@ -173,6 +173,7 @@ export abstract class InvoiceItem extends Doc {
'party', 'party',
'exchangeRate', 'exchangeRate',
'item', 'item',
'quantity',
'itemTaxedTotal', 'itemTaxedTotal',
'itemDiscountedTotal', 'itemDiscountedTotal',
'setItemDiscountAmount', 'setItemDiscountAmount',

View File

@ -433,9 +433,10 @@ export default defineComponent({
); );
} }
this.selectedItemRow.setItemDiscountAmount = true; await this.selectedItemRow.set('setItemDiscountAmount', true);
this.selectedItemRow.itemDiscountAmount = this.fyo.pesa( await this.selectedItemRow.set(
Number(this.selectedValue) 'itemDiscountAmount',
this.fyo.pesa(Number(this.selectedValue))
); );
} }
} else { } else {

View File

@ -541,9 +541,12 @@ export default defineComponent({
existingItems[0].rate = item.rate as Money; existingItems[0].rate = item.rate as Money;
} }
existingItems[0].quantity = quantity await existingItems[0].set(
? (existingItems[0].quantity as number) + quantity 'quantity',
: (existingItems[0].quantity as number) + 1; quantity
? (existingItems[0].quantity as number) + quantity
: (existingItems[0].quantity as number) + 1
);
await this.applyPricingRule(); await this.applyPricingRule();
await this.sinvDoc.runFormulas(); await this.sinvDoc.runFormulas();