mirror of
https://github.com/frappe/books.git
synced 2024-12-23 11:29:03 +00:00
17e5187c51
- Models - Bill - Quotation (extended from Invoice) - Journal Entry - Reports - Sales Register - Purchase Register
24 lines
821 B
JavaScript
24 lines
821 B
JavaScript
const frappe = require('frappejs');
|
|
|
|
class GeneralLedger {
|
|
async run(params) {
|
|
const filters = {};
|
|
if (params.account) filters.account = params.account;
|
|
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];
|
|
|
|
let data = await frappe.db.getAll({
|
|
doctype: 'AccountingLedgerEntry',
|
|
fields: ['date', 'account', 'party', 'referenceType', 'referenceName', 'debit', 'credit'],
|
|
filters: filters
|
|
});
|
|
|
|
return data;
|
|
}
|
|
}
|
|
|
|
module.exports = GeneralLedger;
|