2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 19:29:02 +00:00
books/reports/FinancialStatements/FinancialStatementsView.js
Faris Ansari 180825243f Reports
- Common FinancialStatementsView
- Add BalanceSheet
- Add Fiscal Year in Accounting Settings
2018-04-24 13:28:57 +05:30

42 lines
1.0 KiB
JavaScript

const ReportPage = require('frappejs/client/desk/reportpage');
const frappe = require('frappejs');
const { unique } = require('frappejs/utils');
module.exports = class FinancialStatementsView extends ReportPage {
constructor(opts) {
super({
title: opts.title,
filterFields: opts.filterFields
});
this.method = opts.method;
this.datatableOptions = {
treeView: true,
layout: 'fixed'
}
}
getRowsForDataTable(data) {
return data.rows || [];
}
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;
}
}