Merge pull request #17980 from adityahase/fix-buying-items-rate

fix: Consider discount_amount only when provided to calculate rate
This commit is contained in:
rohitwaghchaure 2019-06-19 14:47:06 +05:30 committed by GitHub
commit d849ce7ce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,7 +144,9 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
item.discount_amount = flt(item_rate) * flt(item.discount_percentage) / 100;
}
if (item.discount_amount) {
item.rate = flt((item.price_list_rate) - (item.discount_amount), precision('rate', item));
}
this.calculate_taxes_and_totals();
},