mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-13 06:31:48 +00:00
fix(manufacturing): align quantity split rounding
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user