In general ledger report opening amount is purely based on posting date

This commit is contained in:
Nabin Hait 2015-05-12 17:40:14 +05:30
parent 6c0c5702c5
commit b45d4e0e16

View File

@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, getdate
from frappe.utils import flt, getdate
from frappe import _
def execute(filters=None):
@ -153,10 +153,9 @@ def get_accountwise_gle(filters, gl_entries, gle_map):
for gle in gl_entries:
amount = flt(gle.debit, 3) - flt(gle.credit, 3)
if filters.get("account") and \
(gle.posting_date < getdate(filters.from_date) or cstr(gle.is_opening)=="Yes"):
gle_map[gle.account].opening += amount
opening += amount
if filters.get("account") and gle.posting_date < getdate(filters.from_date):
gle_map[gle.account].opening += amount
opening += amount
elif gle.posting_date <= getdate(filters.to_date):
gle_map[gle.account].entries.append(gle)
gle_map[gle.account].total_debit += flt(gle.debit, 3)