Merge branches '1310' and 'master' of github.com:webnotes/erpnext

This commit is contained in:
Anand Doshi 2013-11-07 21:10:38 +05:30
commit 0516fc6161

View File

@ -43,7 +43,7 @@ class AccountsReceivableReport(object):
outstanding_amount] outstanding_amount]
entry_date = due_date if self.filters.ageing_based_on=="Due Date" \ entry_date = due_date if self.filters.ageing_based_on=="Due Date" \
else gle.posting_date else gle.posting_date
row += get_age(self.age_as_on, entry_date, outstanding_amount) row += get_ageing_data(self.age_as_on, entry_date, outstanding_amount)
data.append(row) data.append(row)
return data return data
@ -144,10 +144,10 @@ def execute(filters=None):
def get_ageing_data(age_as_on, entry_date, oustanding_amount): def get_ageing_data(age_as_on, entry_date, oustanding_amount):
# [0-30, 30-60, 60-90, 90-above] # [0-30, 30-60, 60-90, 90-above]
outstanding_range = [0.0, 0.0, 0.0, 0.0] outstanding_range = [0.0, 0.0, 0.0, 0.0]
if not (self.age_as_on and entry_date): if not (age_as_on and entry_date):
return [0] + outstanding_range return [0] + outstanding_range
age = (self.age_as_on - getdate(entry_date)).days or 0 age = (age_as_on - getdate(entry_date)).days or 0
index = None index = None
for i, days in enumerate([30, 60, 90]): for i, days in enumerate([30, 60, 90]):
if age <= days: if age <= days: