2
0
mirror of https://github.com/frappe/books.git synced 2025-01-22 22:58:28 +00:00

Fix date filter in general ledger

This commit is contained in:
Suraj Shetty 2018-07-14 19:58:41 +05:30
parent 52f8beffdc
commit 5df04af570

View File

@ -7,8 +7,11 @@ class GeneralLedger {
if (params.party) filters.party = params.party;
if (params.referenceType) filters.referenceType = params.referenceType;
if (params.referenceName) filters.referenceName = params.referenceName;
if (params.fromDate) filters.date = ['>=', params.fromDate];
if (params.toDate) filters.date = ['<=', params.toDate];
if (params.toDate || params.fromDate) {
filters.date = [];
if (params.toDate) filters.date.push('<=', params.toDate);
if (params.fromDate) filters.date.push('>=', params.fromDate);
}
let data = await frappe.db.getAll({
doctype: 'AccountingLedgerEntry',