2021-11-04 10:31:26 +00:00
|
|
|
import frappe from 'frappejs';
|
2019-11-19 19:14:15 +00:00
|
|
|
|
2018-10-25 20:57:34 +00:00
|
|
|
const title = 'Trial Balance';
|
2021-11-04 10:31:26 +00:00
|
|
|
|
|
|
|
export default {
|
2018-10-25 20:57:34 +00:00
|
|
|
title: title,
|
|
|
|
method: 'trial-balance',
|
2019-07-18 10:45:44 +00:00
|
|
|
treeView: true,
|
2018-10-25 20:57:34 +00:00
|
|
|
filterFields: [
|
2019-07-18 10:45:44 +00:00
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
|
|
|
fieldname: 'fromDate',
|
|
|
|
label: 'From Date',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
|
|
|
placeholder: 'From Date',
|
2019-11-19 19:14:15 +00:00
|
|
|
required: 1,
|
|
|
|
default: async () => {
|
|
|
|
return (await frappe.getSingle('AccountingSettings')).fiscalYearStart;
|
2021-12-21 06:07:36 +00:00
|
|
|
},
|
2019-07-18 10:45:44 +00:00
|
|
|
},
|
2019-08-14 07:43:49 +00:00
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
|
|
|
size: 'small',
|
|
|
|
placeholder: 'To Date',
|
|
|
|
fieldname: 'toDate',
|
|
|
|
label: 'To Date',
|
2019-11-19 19:14:15 +00:00
|
|
|
required: 1,
|
|
|
|
default: async () => {
|
|
|
|
return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd;
|
2021-12-21 06:07:36 +00:00
|
|
|
},
|
2021-12-16 06:20:56 +00:00
|
|
|
},
|
|
|
|
],
|
2021-12-21 06:07:36 +00:00
|
|
|
actions: [],
|
2018-10-25 20:57:34 +00:00
|
|
|
getColumns(data) {
|
|
|
|
const columns = [
|
2019-12-03 12:15:10 +00:00
|
|
|
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 2 },
|
2019-07-18 10:45:44 +00:00
|
|
|
{
|
|
|
|
label: 'Opening (Dr)',
|
|
|
|
fieldtype: 'Currency',
|
2021-12-21 06:07:36 +00:00
|
|
|
fieldname: 'openingDebit',
|
2019-07-18 10:45:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Opening (Cr)',
|
|
|
|
fieldtype: 'Currency',
|
2021-12-21 06:07:36 +00:00
|
|
|
fieldname: 'openingCredit',
|
2019-07-18 10:45:44 +00:00
|
|
|
},
|
2018-10-25 20:57:34 +00:00
|
|
|
{ label: 'Debit', fieldtype: 'Currency', fieldname: 'debit' },
|
|
|
|
{ label: 'Credit', fieldtype: 'Currency', fieldname: 'credit' },
|
2019-07-18 10:45:44 +00:00
|
|
|
{
|
|
|
|
label: 'Closing (Dr)',
|
|
|
|
fieldtype: 'Currency',
|
2021-12-21 06:07:36 +00:00
|
|
|
fieldname: 'closingDebit',
|
2019-07-18 10:45:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Closing (Cr)',
|
|
|
|
fieldtype: 'Currency',
|
2021-12-21 06:07:36 +00:00
|
|
|
fieldname: 'closingCredit',
|
|
|
|
},
|
2018-10-25 20:57:34 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
return columns;
|
2021-12-21 06:07:36 +00:00
|
|
|
},
|
2018-10-25 20:57:34 +00:00
|
|
|
};
|