fix: operating cost calculation in JS
This commit is contained in:
parent
504e52ff46
commit
a656151ee9
@ -385,6 +385,11 @@ frappe.ui.form.on("Work Order", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
additional_operating_cost: function(frm) {
|
||||||
|
erpnext.work_order.calculate_cost(frm.doc);
|
||||||
|
erpnext.work_order.calculate_total_cost(frm);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -524,9 +529,8 @@ erpnext.work_order = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
calculate_total_cost: function(frm) {
|
calculate_total_cost: function(frm) {
|
||||||
var variable_cost = frm.doc.actual_operating_cost ?
|
let variable_cost = flt(frm.doc.actual_operating_cost) || flt(frm.doc.planned_operating_cost);
|
||||||
flt(frm.doc.actual_operating_cost) : flt(frm.doc.planned_operating_cost);
|
frm.set_value("total_operating_cost", (flt(frm.doc.additional_operating_cost) + variable_cost))
|
||||||
frm.set_value("total_operating_cost", (flt(frm.doc.additional_operating_cost) + variable_cost));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
set_default_warehouse: function(frm) {
|
set_default_warehouse: function(frm) {
|
||||||
|
Loading…
Reference in New Issue
Block a user