fix: po, rate set as zero against the item (#18242)

This commit is contained in:
rohitwaghchaure 2019-07-11 10:03:35 +05:30 committed by Nabin Hait
parent 8457fcf0c4
commit 4870e95b83

View File

@ -141,6 +141,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
price_list_rate: function(doc, cdt, cdn) {
var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["price_list_rate", "discount_percentage"]);
let item_rate = item.price_list_rate;
@ -154,6 +155,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
if (item.discount_amount) {
item.rate = flt((item.price_list_rate) - (item.discount_amount), precision('rate', item));
} else {
item.rate = item_rate;
}
this.calculate_taxes_and_totals();