2
0
mirror of https://github.com/frappe/books.git synced 2024-12-28 04:55:40 +00:00
books/reports/TrialBalance/viewConfig.js

65 lines
1.6 KiB
JavaScript
Raw Normal View History

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';
2022-03-30 10:57:45 +00:00
const title = t`Trial Balance`;
export default {
2018-10-25 20:57:34 +00:00
title: title,
method: 'trial-balance',
treeView: true,
2018-10-25 20:57:34 +00:00
filterFields: [
{
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`,
required: 1,
default: async () => {
return (await frappe.getSingle('AccountingSettings')).fiscalYearStart;
},
},
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`,
required: 1,
default: async () => {
return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd;
},
2021-12-16 06:20:56 +00:00
},
],
2021-12-21 09:21:13 +00:00
actions: getCommonExportActions('trial-balance'),
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 },
{
2022-02-16 06:19:16 +00:00
label: t`Opening (Dr)`,
fieldtype: 'Currency',
fieldname: 'openingDebit',
},
{
2022-02-16 06:19:16 +00:00
label: t`Opening (Cr)`,
fieldtype: 'Currency',
fieldname: 'openingCredit',
},
2022-02-16 06:19:16 +00:00
{ label: t`Debit`, fieldtype: 'Currency', fieldname: 'debit' },
{ label: t`Credit`, fieldtype: 'Currency', fieldname: 'credit' },
{
2022-02-16 06:19:16 +00:00
label: t`Closing (Dr)`,
fieldtype: 'Currency',
fieldname: 'closingDebit',
},
{
2022-02-16 06:19:16 +00:00
label: t`Closing (Cr)`,
fieldtype: 'Currency',
fieldname: 'closingCredit',
},
2018-10-25 20:57:34 +00:00
];
return columns;
},
2018-10-25 20:57:34 +00:00
};