Files
erpnext/erpnext
Mihir Kandoi 727f8d0967 fix(stock): guard production-plan received-qty division against a zero divisor (Postgres)
update_received_qty_if_from_pp divides received_qty by (qty / fg_item_qty) over
Purchase Order Items. Both qty and fg_item_qty are Float with no non-zero
constraint, so a zero qty (or fg_item_qty) drives the divisor to 0.

MariaDB returns NULL for x/0 (dropped by the surrounding Sum); PostgreSQL
raises `division by zero` and aborts the Purchase Receipt submit/cancel.
Wrapping both divisors in NullIf(..., 0) makes the zero row contribute NULL on
both engines, leaving MariaDB output unchanged.
2026-06-23 18:41:44 +05:30
..
2026-01-13 12:15:21 +05:30