fix: po, rate set as zero against the item (#18242)
This commit is contained in:
parent
8457fcf0c4
commit
4870e95b83
@ -141,6 +141,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
|
|
||||||
price_list_rate: function(doc, cdt, cdn) {
|
price_list_rate: function(doc, cdt, cdn) {
|
||||||
var item = frappe.get_doc(cdt, cdn);
|
var item = frappe.get_doc(cdt, cdn);
|
||||||
|
|
||||||
frappe.model.round_floats_in(item, ["price_list_rate", "discount_percentage"]);
|
frappe.model.round_floats_in(item, ["price_list_rate", "discount_percentage"]);
|
||||||
|
|
||||||
let item_rate = item.price_list_rate;
|
let item_rate = item.price_list_rate;
|
||||||
@ -154,6 +155,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
|
|
||||||
if (item.discount_amount) {
|
if (item.discount_amount) {
|
||||||
item.rate = flt((item.price_list_rate) - (item.discount_amount), precision('rate', item));
|
item.rate = flt((item.price_list_rate) - (item.discount_amount), precision('rate', item));
|
||||||
|
} else {
|
||||||
|
item.rate = item_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.calculate_taxes_and_totals();
|
this.calculate_taxes_and_totals();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user