2019-07-18 06:49:12 +00:00
|
|
|
let title = 'General Ledger';
|
|
|
|
|
|
|
|
const viewConfig = {
|
|
|
|
title,
|
2019-07-24 09:32:53 +00:00
|
|
|
filterFields: [
|
|
|
|
{
|
|
|
|
fieldtype: 'Select',
|
2019-08-01 11:52:58 +00:00
|
|
|
options: ['', 'SalesInvoice', 'Payment', 'PurchaseInvoice'],
|
2019-07-24 09:32:53 +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'
|
|
|
|
}
|
|
|
|
],
|
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() {
|
2019-07-24 09:32:53 +00:00
|
|
|
let [rows, columns] = await report.getReportData(
|
|
|
|
report.currentFilters
|
|
|
|
);
|
2019-07-18 06:49:12 +00:00
|
|
|
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-24 09:32:53 +00:00
|
|
|
await report.$router.push(`/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;
|