fix: incorrect amount in the material request item (backport #39567) (#39569)

fix: incorrect amount in the material request item (#39567)

fix: incoorect amount in the material request
(cherry picked from commit 2bdfdeeb9a5f2fd98cf67fc983a920790e56e1e1)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot] 2024-01-25 17:22:31 +05:30 committed by GitHub
parent 14aa9d3d0f
commit e0c35d60b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -514,6 +514,13 @@ erpnext.buying.MaterialRequestController = class MaterialRequestController exten
schedule_date() {
set_schedule_date(this.frm);
}
qty(doc, cdt, cdn) {
var row = frappe.get_doc(cdt, cdn);
row.amount = flt(row.qty) * flt(row.rate);
frappe.model.set_value(cdt, cdn, "amount", row.amount);
refresh_field("amount", row.name, row.parentfield);
}
};
// for backward compatibility: combine new and previous states