2
0
mirror of https://github.com/frappe/books.git synced 2024-12-24 20:00:29 +00:00
books/reports/TrialBalance/viewConfig.js

65 lines
1.5 KiB
JavaScript
Raw Normal View History

import frappe from 'frappejs';
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',
label: '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',
label: '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 = [
2019-12-03 12:15:10 +00:00
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 2 },
{
label: 'Opening (Dr)',
fieldtype: 'Currency',
fieldname: 'openingDebit',
},
{
label: 'Opening (Cr)',
fieldtype: 'Currency',
fieldname: 'openingCredit',
},
2018-10-25 20:57:34 +00:00
{ label: 'Debit', fieldtype: 'Currency', fieldname: 'debit' },
{ label: 'Credit', fieldtype: 'Currency', fieldname: 'credit' },
{
label: 'Closing (Dr)',
fieldtype: 'Currency',
fieldname: 'closingDebit',
},
{
label: 'Closing (Cr)',
fieldtype: 'Currency',
fieldname: 'closingCredit',
},
2018-10-25 20:57:34 +00:00
];
return columns;
},
2018-10-25 20:57:34 +00:00
};