2
0
mirror of https://github.com/frappe/books.git synced 2024-12-28 21:02:44 +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';
2018-10-25 20:57:34 +00:00
const title = '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',
placeholder: 'From Date',
required: 1,
default: async () => {
return (await frappe.getSingle('AccountingSettings')).fiscalYearStart;
},
},
2019-08-14 07:43:49 +00:00
{
fieldtype: 'Date',
size: 'small',
placeholder: 'To Date',
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
};