mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-20 15:25:13 +00:00
fix: precision loss causing process loss variance
This commit is contained in:
@@ -483,7 +483,7 @@ class StockEntry(StockController):
|
|||||||
if self.process_loss_qty:
|
if self.process_loss_qty:
|
||||||
total += flt(self.process_loss_qty, precision)
|
total += flt(self.process_loss_qty, precision)
|
||||||
|
|
||||||
if self.fg_completed_qty != total:
|
if self.fg_completed_qty != flt(total, precision):
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
_(
|
_(
|
||||||
"The finished product {0} quantity {1} and For Quantity {2} cannot be different"
|
"The finished product {0} quantity {1} and For Quantity {2} cannot be different"
|
||||||
@@ -610,7 +610,9 @@ class StockEntry(StockController):
|
|||||||
completed_qty = (
|
completed_qty = (
|
||||||
d.completed_qty + d.process_loss_qty + (allowance_percentage / 100 * d.completed_qty)
|
d.completed_qty + d.process_loss_qty + (allowance_percentage / 100 * d.completed_qty)
|
||||||
)
|
)
|
||||||
if total_completed_qty > flt(completed_qty):
|
if flt(total_completed_qty, self.precision("fg_completed_qty")) > flt(
|
||||||
|
completed_qty, self.precision("fg_completed_qty")
|
||||||
|
):
|
||||||
job_card = frappe.db.get_value("Job Card", {"operation_id": d.name}, "name")
|
job_card = frappe.db.get_value("Job Card", {"operation_id": d.name}, "name")
|
||||||
if not job_card:
|
if not job_card:
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
|
|||||||
Reference in New Issue
Block a user