2019-07-18 06:49:12 +00:00
|
|
|
let title = 'General Ledger';
|
|
|
|
let filterFields = [
|
|
|
|
{
|
|
|
|
fieldtype: 'Select',
|
2019-07-19 13:24:31 +00:00
|
|
|
options: ['', 'Invoice', 'Payment', 'Bill'],
|
2019-07-18 06:49:12 +00:00
|
|
|
label: 'Reference Type',
|
|
|
|
fieldname: 'referenceType'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'DynamicLink',
|
|
|
|
references: 'referenceType',
|
|
|
|
label: 'Reference Name',
|
|
|
|
fieldname: 'referenceName'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Link',
|
|
|
|
target: 'Account',
|
|
|
|
label: 'Account',
|
|
|
|
fieldname: 'account'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Link',
|
|
|
|
target: 'Party',
|
|
|
|
label: 'Party',
|
|
|
|
fieldname: 'party'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
|
|
|
label: 'From Date',
|
|
|
|
fieldname: 'fromDate'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
|
|
|
label: 'To Date',
|
|
|
|
fieldname: 'toDate'
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
const viewConfig = {
|
|
|
|
title,
|
|
|
|
filterFields,
|
2018-07-14 14:26:18 +00:00
|
|
|
method: 'general-ledger',
|
2019-07-18 06:49:12 +00:00
|
|
|
linkFields: [
|
2019-02-18 05:42:04 +00:00
|
|
|
{
|
2019-07-18 06:49:12 +00:00
|
|
|
label: 'Export',
|
2019-07-18 10:45:44 +00:00
|
|
|
type: 'primary',
|
2019-07-18 06:49:12 +00:00
|
|
|
action: async report => {
|
|
|
|
async function getReportDetails() {
|
|
|
|
let [rows, columns] = await report.getReportData(filterFields);
|
|
|
|
let columnData = columns.map(column => {
|
|
|
|
return {
|
|
|
|
id: column.id,
|
|
|
|
content: column.content,
|
|
|
|
checked: true
|
|
|
|
};
|
|
|
|
});
|
|
|
|
return {
|
|
|
|
title: title,
|
|
|
|
rows: rows,
|
|
|
|
columnData: columnData
|
|
|
|
};
|
|
|
|
}
|
|
|
|
report.$modal.show({
|
|
|
|
modalProps: {
|
|
|
|
title: `Export ${title}`,
|
|
|
|
noFooter: true
|
|
|
|
},
|
|
|
|
component: require('../../src/components/ExportWizard').default,
|
|
|
|
props: await getReportDetails()
|
|
|
|
});
|
|
|
|
}
|
2019-07-18 10:45:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Clear Filters',
|
|
|
|
type: 'secondary',
|
|
|
|
action: async report => {
|
2019-07-19 13:24:31 +00:00
|
|
|
await report.$router.replace(`/report/general-ledger`);
|
2019-07-18 10:45:44 +00:00
|
|
|
}
|
2019-02-18 05:42:04 +00:00
|
|
|
}
|
2018-07-14 14:26:18 +00:00
|
|
|
],
|
|
|
|
getColumns() {
|
2019-07-18 06:49:12 +00:00
|
|
|
return [
|
|
|
|
{
|
2019-02-18 05:42:04 +00:00
|
|
|
label: 'Date',
|
|
|
|
fieldtype: 'Date'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Account',
|
|
|
|
fieldtype: 'Link'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Debit',
|
|
|
|
fieldtype: 'Currency'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Credit',
|
|
|
|
fieldtype: 'Currency'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Balance',
|
|
|
|
fieldtype: 'Currency'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Reference Type',
|
|
|
|
fieldtype: 'Data'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Reference Name',
|
|
|
|
fieldtype: 'Data'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Party',
|
|
|
|
fieldtype: 'Link'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Description',
|
|
|
|
fieldtype: 'Data'
|
|
|
|
}
|
2018-07-14 14:26:18 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
};
|
2019-07-18 06:49:12 +00:00
|
|
|
|
|
|
|
module.exports = viewConfig;
|