fix: rounding of percentage fields

Always round with precision of 2
This commit is contained in:
barredterra
2023-07-17 16:45:11 +02:00
parent 3b246fd7e6
commit ecaf0aba3c
6 changed files with 27 additions and 23 deletions

View File

@@ -6,7 +6,9 @@ def execute():
frappe.reload_doc("selling", "doctype", "sales_order_item")
for doctype in ["Sales Order", "Material Request"]:
condition = " and child_doc.stock_qty > child_doc.produced_qty and doc.per_delivered < 100"
condition = (
" and child_doc.stock_qty > child_doc.produced_qty and ROUND(doc.per_delivered, 2) < 100"
)
if doctype == "Material Request":
condition = " and doc.per_ordered < 100 and doc.material_request_type = 'Manufacture'"