mirror of
https://github.com/frappe/books.git
synced 2024-11-14 01:14:03 +00:00
e5480bbfef
- Blank state
52 lines
1.1 KiB
JavaScript
52 lines
1.1 KiB
JavaScript
const frappe = require('frappejs');
|
|
|
|
module.exports = {
|
|
title: 'Balance Sheet',
|
|
method: 'balance-sheet',
|
|
filterFields: [
|
|
{
|
|
fieldtype: 'Date',
|
|
fieldname: 'toDate',
|
|
size: 'small',
|
|
placeholder: 'ToDate',
|
|
label: 'To Date',
|
|
required: 1,
|
|
default: async () => {
|
|
return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd;
|
|
}
|
|
},
|
|
{
|
|
fieldtype: 'Select',
|
|
size: 'small',
|
|
options: [
|
|
'Select Period...',
|
|
'Monthly',
|
|
'Quarterly',
|
|
'Half Yearly',
|
|
'Yearly'
|
|
],
|
|
label: 'Periodicity',
|
|
fieldname: 'periodicity',
|
|
default: 'Monthly'
|
|
}
|
|
],
|
|
getColumns(data) {
|
|
const columns = [
|
|
{ label: '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;
|
|
}
|
|
};
|