[script report] payments made with ageing

This commit is contained in:
Nabin Hait
2013-05-02 15:19:00 +05:30
parent d7889cd5d5
commit 4d7a1c1f35
8 changed files with 173 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
from __future__ import unicode_literals
import webnotes
from webnotes import msgprint, _
from webnotes.utils import getdate, nowdate, flt, cstr
def execute(filters=None):
@@ -68,13 +69,16 @@ def get_conditions(filters, upto_report_date=True):
customer_accounts = []
if filters.get("account"):
customer_accounts = [filters["account"]]
elif filters.get("company"):
else:
customer_accounts = webnotes.conn.sql_list("""select name from `tabAccount`
where ifnull(master_type, '') = 'Customer' and docstatus < 2 %s""" %
conditions, filters)
if customer_accounts:
conditions += " and account in (%s)" % (", ".join(['%s']*len(customer_accounts)))
else:
msgprint(_("No Customer Accounts found. Customer Accounts are identified based on \
'Master Type' value in account record."), raise_exception=1)
if filters.get("report_date"):
if upto_report_date: