2022-02-16 06:19:16 +00:00
|
|
|
import frappe, { t } from 'frappe';
|
2021-12-21 09:21:13 +00:00
|
|
|
import getCommonExportActions from '../commonExporter';
|
2019-11-19 19:14:15 +00:00
|
|
|
|
2022-03-30 10:57:45 +00:00
|
|
|
const title = t`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',
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`From Date`,
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
2022-03-30 10:57:45 +00:00
|
|
|
placeholder: t`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',
|
2022-03-30 10:57:45 +00:00
|
|
|
placeholder: t`To Date`,
|
2019-08-14 07:43:49 +00:00
|
|
|
fieldname: 'toDate',
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`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 09:21:13 +00:00
|
|
|
actions: getCommonExportActions('trial-balance'),
|
2021-12-29 05:22:31 +00:00
|
|
|
getColumns() {
|
2018-10-25 20:57:34 +00:00
|
|
|
const columns = [
|
2022-02-16 06:19:16 +00:00
|
|
|
{ label: t`Account`, fieldtype: 'Data', fieldname: 'account', width: 2 },
|
2019-07-18 10:45:44 +00:00
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Opening (Dr)`,
|
2019-07-18 10:45:44 +00:00
|
|
|
fieldtype: 'Currency',
|
2021-12-21 06:07:36 +00:00
|
|
|
fieldname: 'openingDebit',
|
2019-07-18 10:45:44 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Opening (Cr)`,
|
2019-07-18 10:45:44 +00:00
|
|
|
fieldtype: 'Currency',
|
2021-12-21 06:07:36 +00:00
|
|
|
fieldname: 'openingCredit',
|
2019-07-18 10:45:44 +00:00
|
|
|
},
|
2022-02-16 06:19:16 +00:00
|
|
|
{ label: t`Debit`, fieldtype: 'Currency', fieldname: 'debit' },
|
|
|
|
{ label: t`Credit`, fieldtype: 'Currency', fieldname: 'credit' },
|
2019-07-18 10:45:44 +00:00
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Closing (Dr)`,
|
2019-07-18 10:45:44 +00:00
|
|
|
fieldtype: 'Currency',
|
2021-12-21 06:07:36 +00:00
|
|
|
fieldname: 'closingDebit',
|
2019-07-18 10:45:44 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Closing (Cr)`,
|
2019-07-18 10:45:44 +00:00
|
|
|
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
|
|
|
};
|