fix: po, rate set as zero against the item (#18242)
diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js
index 824b8d9..750900e 100644
--- a/erpnext/public/js/controllers/buying.js
+++ b/erpnext/public/js/controllers/buying.js
@@ -141,6 +141,7 @@
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 @@
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();