From 7344353ac57ec70aba532235f6118dd26cf72161 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Mon, 11 Nov 2013 12:47:49 +0530 Subject: [PATCH] [report] [fix] accounts payable fixed for get_ageing_date() --- accounts/report/accounts_receivable/accounts_receivable.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/accounts/report/accounts_receivable/accounts_receivable.py b/accounts/report/accounts_receivable/accounts_receivable.py index 87ca4c7ad9..df7c93ac49 100644 --- a/accounts/report/accounts_receivable/accounts_receivable.py +++ b/accounts/report/accounts_receivable/accounts_receivable.py @@ -141,13 +141,13 @@ class AccountsReceivableReport(object): def execute(filters=None): return AccountsReceivableReport(filters).run() -def get_ageing_data(age_as_on, entry_date, oustanding_amount): +def get_ageing_data(age_as_on, entry_date, outstanding_amount): # [0-30, 30-60, 60-90, 90-above] outstanding_range = [0.0, 0.0, 0.0, 0.0] if not (age_as_on and entry_date): return [0] + outstanding_range - age = (age_as_on - getdate(entry_date)).days or 0 + age = (getdate(age_as_on) - getdate(entry_date)).days or 0 index = None for i, days in enumerate([30, 60, 90]): if age <= days: @@ -155,6 +155,6 @@ def get_ageing_data(age_as_on, entry_date, oustanding_amount): break if index is None: index = 3 - outstanding_range[index] = oustanding_amount + outstanding_range[index] = outstanding_amount return [age] + outstanding_range \ No newline at end of file