From 12ad2aa2e5f5f173c9f52c07fb95e00b069dd403 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 28 Mar 2023 15:33:59 +0530 Subject: [PATCH] fix: Percentage billing in Sales Order (#34606) --- erpnext/controllers/status_updater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index dd2a67032f..58cab147a4 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -464,7 +464,7 @@ class StatusUpdater(Document): ifnull((select ifnull(sum(case when abs(%(target_ref_field)s) > abs(%(target_field)s) then abs(%(target_field)s) else abs(%(target_ref_field)s) end), 0) / sum(abs(%(target_ref_field)s)) * 100 - from `tab%(target_dt)s` where parent='%(name)s' having sum(abs(%(target_ref_field)s)) > 0), 0), 6) + from `tab%(target_dt)s` where parent='%(name)s' and parenttype='%(target_parent_dt)s' having sum(abs(%(target_ref_field)s)) > 0), 0), 6) %(update_modified)s where name='%(name)s'""" % args