mirror of
https://github.com/frappe/books.git
synced 2024-11-14 01:14:03 +00:00
1a8a23d2a2
- refactor Common Js imports to ES6
73 lines
1.6 KiB
JavaScript
73 lines
1.6 KiB
JavaScript
import frappe from 'frappejs';
|
|
|
|
const title = 'Trial Balance';
|
|
|
|
export default {
|
|
title: title,
|
|
method: 'trial-balance',
|
|
treeView: true,
|
|
filterFields: [
|
|
{
|
|
fieldtype: 'Date',
|
|
fieldname: 'fromDate',
|
|
label: 'From Date',
|
|
size: 'small',
|
|
placeholder: 'From Date',
|
|
required: 1,
|
|
default: async () => {
|
|
return (await frappe.getSingle('AccountingSettings')).fiscalYearStart;
|
|
}
|
|
},
|
|
{
|
|
fieldtype: 'Date',
|
|
size: 'small',
|
|
placeholder: 'To Date',
|
|
fieldname: 'toDate',
|
|
label: 'To Date',
|
|
required: 1,
|
|
default: async () => {
|
|
return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd;
|
|
}
|
|
}
|
|
],
|
|
linkFields: [
|
|
{
|
|
label: 'Clear Filters',
|
|
type: 'secondary',
|
|
action: async report => {
|
|
await report.getReportData({});
|
|
report.usedToReRender += 1;
|
|
}
|
|
}
|
|
],
|
|
getColumns(data) {
|
|
const columns = [
|
|
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 2 },
|
|
{
|
|
label: 'Opening (Dr)',
|
|
fieldtype: 'Currency',
|
|
fieldname: 'openingDebit'
|
|
},
|
|
{
|
|
label: 'Opening (Cr)',
|
|
fieldtype: 'Currency',
|
|
fieldname: 'openingCredit'
|
|
},
|
|
{ label: 'Debit', fieldtype: 'Currency', fieldname: 'debit' },
|
|
{ label: 'Credit', fieldtype: 'Currency', fieldname: 'credit' },
|
|
{
|
|
label: 'Closing (Dr)',
|
|
fieldtype: 'Currency',
|
|
fieldname: 'closingDebit'
|
|
},
|
|
{
|
|
label: 'Closing (Cr)',
|
|
fieldtype: 'Currency',
|
|
fieldname: 'closingCredit'
|
|
}
|
|
];
|
|
|
|
return columns;
|
|
}
|
|
};
|