From 30bdba48016820a63ea4ee9c35c624d56367e483 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 27 Jan 2024 10:12:45 +0530 Subject: [PATCH] fix: incorrect amount in the material request item (backport #39567) (backport #39569) (#39587) 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 (cherry picked from commit e0c35d60b4de223cf75af536189db5bb253b6819) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- erpnext/stock/doctype/material_request/material_request.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js index d90b71a47a..03fe20b93a 100644 --- a/erpnext/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -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