2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 11:29:00 +00:00
books/reports/BalanceSheet/viewConfig.js

49 lines
1.2 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';
export default {
title: 'Balance Sheet',
method: 'balance-sheet',
filterFields: [
{
fieldtype: 'Date',
fieldname: 'toDate',
size: 'small',
placeholder: 'ToDate',
2022-02-16 06:19:16 +00:00
label: t`To Date`,
required: 1,
default: async () => {
return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd;
},
},
{
fieldtype: 'Select',
placeholder: 'Select Period',
size: 'small',
options: ['Monthly', 'Quarterly', 'Half Yearly', 'Yearly'],
2022-02-16 06:19:16 +00:00
label: t`Periodicity`,
fieldname: 'periodicity',
default: 'Monthly',
},
],
2021-12-21 09:21:13 +00:00
actions: getCommonExportActions('balance-sheet'),
getColumns({ data }) {
const columns = [
2022-02-16 06:19:16 +00:00
{ label: t`Account`, fieldtype: 'Data', fieldname: 'account', width: 2 },
];
if (data && data.columns) {
const currencyColumns = data.columns;
const columnDefs = currencyColumns.map((name) => ({
label: name,
fieldname: name,
fieldtype: 'Currency',
}));
columns.push(...columnDefs);
}
return columns;
},
};