2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/reports/ProfitAndLoss/viewConfig.js
thefalconx33 562b4759e0 - Bug Fixes
- PnL & Balance Sheet
- Search Keyboard Navigation
2019-08-20 14:27:27 +05:30

56 lines
1.1 KiB
JavaScript

const title = 'Profit and Loss';
module.exports = {
title: title,
method: 'profit-and-loss',
treeView: true,
filterFields: [
{
fieldtype: 'Date',
fieldname: 'fromDate',
size: 'small',
placeholder: 'From Date',
label: 'From Date',
required: 1
},
{
fieldtype: 'Date',
fieldname: 'toDate',
size: 'small',
placeholder: 'To Date',
label: 'To Date',
required: 1
},
{
fieldtype: 'Select',
size: 'small',
options: [
'Select Period...',
'Monthly',
'Quarterly',
'Half Yearly',
'Yearly'
],
label: 'Periodicity',
fieldname: 'periodicity'
}
],
getColumns(data) {
const columns = [
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 340 }
];
if (data && data.columns) {
const currencyColumns = data.columns;
const columnDefs = currencyColumns.map(name => ({
label: name,
fieldname: name,
fieldtype: 'Currency'
}));
columns.push(...columnDefs);
}
return columns;
}
};