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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.3 KiB
JavaScript
Raw Normal View History

import { t } from 'fyo';
2021-12-21 09:21:13 +00:00
import getCommonExportActions from '../commonExporter';
import { fyo } from 'src/initFyo';
2022-03-30 10:57:45 +00:00
const periodicityMap = {
Monthly: t`Monthly`,
Quarterly: t`Quarterly`,
'Half Yearly': t`Half Yearly`,
Yearly: t`Yearly`,
};
export default {
2022-03-30 10:57:45 +00:00
title: t`Balance Sheet`,
method: 'balance-sheet',
filterFields: [
{
fieldtype: 'Date',
fieldname: 'toDate',
size: 'small',
2022-03-30 10:57:45 +00:00
placeholder: t`To Date`,
2022-02-16 06:19:16 +00:00
label: t`To Date`,
required: 1,
default: async () => {
return (await fyo.doc.getSingle('AccountingSettings')).fiscalYearEnd;
},
},
{
fieldtype: 'Select',
2022-03-30 10:57:45 +00:00
placeholder: t`Select Period`,
size: 'small',
2022-03-30 10:57:45 +00:00
options: Object.keys(periodicityMap),
map: periodicityMap,
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;
},
};