fix(manufacturing): apply precision for bom amount and rm_cost_per_qty

This commit is contained in:
Pugazhendhi Velu
2025-11-19 14:19:26 +00:00
parent 4efe681a5c
commit 57f9353d90
2 changed files with 4 additions and 2 deletions

View File

@@ -202,7 +202,7 @@ class SubcontractingOrder(SubcontractingController):
for item in self.get("items"):
bom = frappe.get_doc("BOM", item.bom)
rm_cost = sum(flt(rm_item.amount) for rm_item in bom.items)
item.rm_cost_per_qty = rm_cost / flt(bom.quantity)
item.rm_cost_per_qty = flt(rm_cost / flt(bom.quantity), item.precision("rm_cost_per_qty"))
def calculate_items_qty_and_amount(self):
total_qty = total = 0