mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-21 10:19:57 +00:00
get_already_delivered_qty used two raw frappe.db.sql sums (Delivery Note Item, and Sales Invoice Item joined to Sales Invoice) and get_so_qty_and_warehouse used a raw select. Convert to frappe.qb (Sum) and frappe.db.get_value. Engine-portable and MariaDB-identical. Adds a test (Sales Order -> partial Delivery Note) that asserts per_delivered, exercising get_already_delivered_qty / get_so_qty_and_warehouse (and the StatusUpdater percentage path) on both engines. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>