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