2
0
mirror of https://github.com/frappe/books.git synced 2025-01-03 15:17:30 +00:00

fix: show item discount amount & percent

This commit is contained in:
akshayitzme 2023-08-24 18:08:22 +05:30 committed by akshayitzme
parent b072253755
commit c483c4bf73

View File

@ -323,7 +323,15 @@ export default defineComponent({
}
for (const item of this.sinvDoc.items) {
itemDiscounts.add(item.itemDiscountedTotal as Money);
if (item.setItemDiscountAmount) {
itemDiscounts = itemDiscounts.add(item.itemDiscountAmount as Money);
}
if (item.amount && (item.itemDiscountPercent as number) > 1) {
itemDiscounts = itemDiscounts.add(
item.amount.percent(item.itemDiscountPercent as number)
);
}
}
this.itemDiscounts = itemDiscounts;