mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-21 10:19:57 +00:00
- Replace MySQL-only `ifnull(...)` with `coalesce(...)` in the two source/second-source percentage subqueries that remain raw (they interpolate dynamic table/field names). - zero_amount_refdocs: raw `sql_list` → `frappe.get_all(pluck="name")`. - update_billing_status: two raw `ifnull(sum(qty), 0)` selects → frappe.qb `Sum`; an empty result yields None and flt(None) == 0, matching the old ifnull behaviour. Behaviour is unchanged on MariaDB. The percentage path (coalesce subquery) is exercised by test_selling_controller's Sales Order -> Delivery Note per_delivered test on both engines. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>