fix: Percentage billing in Sales Order (#34606)

This commit is contained in:
Deepesh Garg 2023-03-28 15:33:59 +05:30 committed by GitHub
parent f7780cdb58
commit 12ad2aa2e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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