fix(manufacturing): align quantity split rounding

This commit is contained in:
Mihir Kandoi
2026-08-09 21:43:00 +05:30
parent beed05ac18
commit 317dd18ce5
2 changed files with 11 additions and 1 deletions

View File

@@ -1567,7 +1567,11 @@ class JobCard(Document):
return
precision = self.precision("total_completed_qty")
accounted_qty = flt(kwargs.qty) + flt(kwargs.pending_qty) + flt(kwargs.process_loss_qty)
accounted_qty = flt(
flt(kwargs.qty, precision)
+ flt(kwargs.pending_qty, precision)
+ flt(kwargs.process_loss_qty, precision)
)
if flt(accounted_qty, precision) == flt(kwargs.for_quantity, precision):
return

View File

@@ -1831,6 +1831,12 @@ class TestJobCard(ERPNextTestSuite):
frappe._dict(for_quantity=3, qty=3, pending_qty=2, process_loss_qty=0),
)
self.assertRaises(
frappe.ValidationError,
jc.validate_completion_qty_split,
frappe._dict(for_quantity=1, qty=0.3334, pending_qty=0.3334, process_loss_qty=0.3334),
)
def create_bom_with_multiple_operations():
"Create a BOM with multiple operations and Material Transfer against Job Card"