fix: Consider discount_amount only when provided to calculate rate
After selecting item_code in items table and not entering rate, Clicking elsewhere will set rate to NaN. All DocTypes on buying side have this bug.
This commit is contained in:
parent
226ff5a797
commit
48585c94ff
@ -144,7 +144,9 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
item.discount_amount = flt(item_rate) * flt(item.discount_percentage) / 100;
|
item.discount_amount = flt(item_rate) * flt(item.discount_percentage) / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
item.rate = flt((item.price_list_rate) - (item.discount_amount), precision('rate', item));
|
if (item.discount_amount) {
|
||||||
|
item.rate = flt((item.price_list_rate) - (item.discount_amount), precision('rate', item));
|
||||||
|
}
|
||||||
|
|
||||||
this.calculate_taxes_and_totals();
|
this.calculate_taxes_and_totals();
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user