fix: dont hardcode precision in routing
Co-Authored-By: Suraj Shetty <surajshetty3416@gmail.com>
This commit is contained in:
parent
f8ac4c082a
commit
9ef35ef773
@ -17,7 +17,7 @@ frappe.ui.form.on('Routing', {
|
||||
},
|
||||
|
||||
calculate_operating_cost: function(frm, child) {
|
||||
const operating_cost = flt(flt(child.hour_rate) * flt(child.time_in_mins) / 60, 2);
|
||||
const operating_cost = flt(flt(child.hour_rate) * flt(child.time_in_mins) / 60, precision("operating_cost", child));
|
||||
frappe.model.set_value(child.doctype, child.name, "operating_cost", operating_cost);
|
||||
}
|
||||
});
|
||||
|
@ -20,7 +20,8 @@ class Routing(Document):
|
||||
for operation in self.operations:
|
||||
if not operation.hour_rate:
|
||||
operation.hour_rate = frappe.db.get_value("Workstation", operation.workstation, 'hour_rate')
|
||||
operation.operating_cost = flt(flt(operation.hour_rate) * flt(operation.time_in_mins) / 60, 2)
|
||||
operation.operating_cost = flt(flt(operation.hour_rate) * flt(operation.time_in_mins) / 60,
|
||||
operation.precision("operating_cost"))
|
||||
|
||||
def set_routing_id(self):
|
||||
sequence_id = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user