Merge branch 'develop' into dev-work-order-bugs
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js
index 1789a1f..7bc2138 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.js
+++ b/erpnext/manufacturing/doctype/work_order/work_order.js
@@ -395,6 +395,11 @@
}
});
}
+ },
+
+ additional_operating_cost: function(frm) {
+ erpnext.work_order.calculate_cost(frm.doc);
+ erpnext.work_order.calculate_total_cost(frm);
}
});
@@ -534,9 +539,8 @@
},
calculate_total_cost: function(frm) {
- var variable_cost = frm.doc.actual_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));
+ let variable_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))
},
set_default_warehouse: function(frm) {