mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 19:35:09 +00:00
Merge pull request #50296 from rohitwaghchaure/fixed-github-48129
fix: hourly rate not fetched on selection of workstation type
This commit is contained in:
@@ -833,6 +833,31 @@ frappe.ui.form.on("BOM Operation", "workstation", function (frm, cdt, cdn) {
|
||||
});
|
||||
});
|
||||
|
||||
frappe.ui.form.on("BOM Operation", "workstation_type", function (frm, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
if (!d.workstation_type) return;
|
||||
frappe.call({
|
||||
method: "frappe.client.get",
|
||||
args: {
|
||||
doctype: "Workstation Type",
|
||||
name: d.workstation_type,
|
||||
},
|
||||
callback: function (data) {
|
||||
frappe.model.set_value(d.doctype, d.name, "base_hour_rate", data.message.hour_rate);
|
||||
frappe.model.set_value(
|
||||
d.doctype,
|
||||
d.name,
|
||||
"hour_rate",
|
||||
flt(flt(data.message.hour_rate) / flt(frm.doc.conversion_rate)),
|
||||
2
|
||||
);
|
||||
|
||||
erpnext.bom.calculate_op_cost(frm.doc);
|
||||
erpnext.bom.calculate_total(frm.doc);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
frappe.ui.form.on("BOM Item", {
|
||||
do_not_explode: function (frm, cdt, cdn) {
|
||||
get_bom_material_detail(frm.doc, cdt, cdn, false);
|
||||
|
||||
Reference in New Issue
Block a user