Merge pull request #173 from anandpdoshi/master
Dont show bank balance if no ledger of type "Bank or Cash"
This commit is contained in:
commit
3ca92bb3e4
@ -121,6 +121,8 @@ class DocType:
|
|||||||
#webnotes.msgprint(query)
|
#webnotes.msgprint(query)
|
||||||
#webnotes.msgprint(res)
|
#webnotes.msgprint(res)
|
||||||
result[query] = (res and len(res)==1) and res[0] or (res and res or None)
|
result[query] = (res and len(res)==1) and res[0] or (res and res or None)
|
||||||
|
if result[query] is None:
|
||||||
|
del result[query]
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -586,7 +588,7 @@ class DocType:
|
|||||||
},
|
},
|
||||||
|
|
||||||
'bank_balance': {
|
'bank_balance': {
|
||||||
'table': 'bank_balance' in result and table({
|
'table': 'bank_balance' in result and result['bank_balance'] and table({
|
||||||
'head': 'Bank Balance',
|
'head': 'Bank Balance',
|
||||||
'body': [
|
'body': [
|
||||||
[
|
[
|
||||||
@ -658,7 +660,7 @@ class DocType:
|
|||||||
if self.doc.fields[k]:
|
if self.doc.fields[k]:
|
||||||
if k in result:
|
if k in result:
|
||||||
table_list.append(body_dict[k]['table'])
|
table_list.append(body_dict[k]['table'])
|
||||||
elif k in ['collections', 'payments']:
|
elif k in ['collections', 'payments', 'bank_balance']:
|
||||||
table_list.append(\
|
table_list.append(\
|
||||||
"<div style='font-size: 16px; color: grey'>[" + \
|
"<div style='font-size: 16px; color: grey'>[" + \
|
||||||
k.capitalize() + \
|
k.capitalize() + \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user