[Fix] Division by zero issue (#13362)
This commit is contained in:
parent
a3714e1678
commit
23fa8893a8
@ -285,7 +285,7 @@ class StatusUpdater(Document):
|
||||
ifnull((select
|
||||
ifnull(sum(if(%(target_ref_field)s > %(target_field)s, abs(%(target_field)s), abs(%(target_ref_field)s))), 0)
|
||||
/ sum(abs(%(target_ref_field)s)) * 100
|
||||
from `tab%(target_dt)s` where parent="%(name)s"), 0), 2)
|
||||
from `tab%(target_dt)s` where parent="%(name)s" having sum(abs(%(target_ref_field)s)) > 0), 0), 2)
|
||||
%(update_modified)s
|
||||
where name='%(name)s'""" % args)
|
||||
|
||||
|
@ -309,6 +309,7 @@ class DeliveryNote(SellingController):
|
||||
|
||||
for dn in set(updated_delivery_notes):
|
||||
dn_doc = self if (dn == self.name) else frappe.get_doc("Delivery Note", dn)
|
||||
if dn_doc.net_total > 0:
|
||||
dn_doc.update_billing_percentage(update_modified=update_modified)
|
||||
|
||||
self.load_from_db()
|
||||
|
Loading…
x
Reference in New Issue
Block a user