fix: do not reset the basic rate for the material receipt stock entry (#38896)

This commit is contained in:
rohitwaghchaure
2023-12-21 14:13:55 +05:30
committed by GitHub
parent 3a668bbe96
commit 98bfcc4c75

View File

@@ -517,7 +517,12 @@ frappe.ui.form.on('Stock Entry', {
},
callback: function(r) {
if (!r.exc) {
["actual_qty", "basic_rate"].forEach((field) => {
let fields = ["actual_qty", "basic_rate"];
if (frm.doc.purpose == "Material Receipt") {
fields = ["actual_qty"];
}
fields.forEach((field) => {
frappe.model.set_value(cdt, cdn, field, (r.message[field] || 0.0));
});
frm.events.calculate_basic_amount(frm, child);