Merge pull request #1278 from nabinhait/hotfix
Fixes in overbilling validation
This commit is contained in:
commit
d12d7142c6
@ -388,8 +388,9 @@ class AccountsController(TransactionBase):
|
|||||||
for item in self.doclist.get({"parentfield": "entries"}):
|
for item in self.doclist.get({"parentfield": "entries"}):
|
||||||
if item.fields.get(item_ref_dn):
|
if item.fields.get(item_ref_dn):
|
||||||
already_billed = webnotes.conn.sql("""select sum(%s) from `tab%s`
|
already_billed = webnotes.conn.sql("""select sum(%s) from `tab%s`
|
||||||
where %s=%s and docstatus=1""" % (based_on, self.tname, item_ref_dn, '%s'),
|
where %s=%s and docstatus=1 and parent != %s""" %
|
||||||
item.fields[item_ref_dn])[0][0]
|
(based_on, self.tname, item_ref_dn, '%s', '%s'),
|
||||||
|
(item.fields[item_ref_dn], self.doc.name), debug=1)[0][0]
|
||||||
|
|
||||||
total_billed_amt = flt(flt(already_billed) + flt(item.fields[based_on]),
|
total_billed_amt = flt(flt(already_billed) + flt(item.fields[based_on]),
|
||||||
self.precision(based_on, item))
|
self.precision(based_on, item))
|
||||||
|
Loading…
Reference in New Issue
Block a user