mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
Merge pull request #50952 from rtdany10/wo-flt-issue
This commit is contained in:
@@ -1326,14 +1326,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