[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,6 +1,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import getdate, nowdate, flt, cstr
from webnotes import msgprint, _
from accounts.report.accounts_receivable.accounts_receivable import get_ageing_data
def execute(filters=None):
@@ -79,13 +80,16 @@ def get_conditions(filters, before_report_date=True):
supplier_accounts = []
if filters.get("account"):
supplier_accounts = [filters["account"]]
elif filters.get("company"):
else:
supplier_accounts = webnotes.conn.sql_list("""select name from `tabAccount`
where ifnull(master_type, '') = 'Supplier' and docstatus < 2 %s""" %
conditions, filters)
if supplier_accounts:
conditions += " and account in (%s)" % (", ".join(['%s']*len(supplier_accounts)))
else:
msgprint(_("No Supplier Accounts found. Supplier Accounts are identified based on \
'Master Type' value in account record."), raise_exception=1)
if filters.get("report_date"):
if before_report_date: