mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-13 03:45:08 +00:00
fix: precision issue on job card submission
(cherry picked from commit 80730908c9)
This commit is contained in:
@@ -979,14 +979,14 @@ class WorkOrder(Document):
|
|||||||
|
|
||||||
for d in self.get("operations"):
|
for d in self.get("operations"):
|
||||||
precision = d.precision("completed_qty")
|
precision = d.precision("completed_qty")
|
||||||
qty = flt(d.completed_qty, precision) + flt(d.process_loss_qty, precision)
|
qty = flt(flt(d.completed_qty, precision) + flt(d.process_loss_qty, precision), precision)
|
||||||
if not qty:
|
if not qty:
|
||||||
d.status = "Pending"
|
d.status = "Pending"
|
||||||
elif flt(qty) < flt(self.qty):
|
elif qty < flt(self.qty, precision):
|
||||||
d.status = "Work in Progress"
|
d.status = "Work in Progress"
|
||||||
elif flt(qty) == flt(self.qty):
|
elif qty == flt(self.qty, precision):
|
||||||
d.status = "Completed"
|
d.status = "Completed"
|
||||||
elif flt(qty) <= max_allowed_qty_for_wo:
|
elif qty <= flt(max_allowed_qty_for_wo, precision):
|
||||||
d.status = "Completed"
|
d.status = "Completed"
|
||||||
else:
|
else:
|
||||||
frappe.throw(_("Completed Qty cannot be greater than 'Qty to Manufacture'"))
|
frappe.throw(_("Completed Qty cannot be greater than 'Qty to Manufacture'"))
|
||||||
|
|||||||
Reference in New Issue
Block a user