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-11-19 19:14:15 +00:00
|
|
|
options: [
|
|
|
|
{ label: '', value: '' },
|
|
|
|
{ label: 'Sales Invoice', value: 'SalesInvoice' },
|
|
|
|
{ label: 'Payment', value: 'Payment' },
|
|
|
|
{ label: 'Purchase Invoice', value: 'PurchaseInvoice' }
|
|
|
|
],
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
2019-07-24 09:32:53 +00:00
|
|
|
label: 'Reference Type',
|
2019-11-19 19:14:15 +00:00
|
|
|
fieldname: 'referenceType',
|
|
|
|
placeholder: 'Reference Type'
|
2019-07-24 09:32:53 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'DynamicLink',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
|
|
|
placeholder: 'Reference Name',
|
2019-07-24 09:32:53 +00:00
|
|
|
references: 'referenceType',
|
|
|
|
label: 'Reference Name',
|
|
|
|
fieldname: 'referenceName'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Link',
|
|
|
|
target: 'Account',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
|
|
|
placeholder: 'Account',
|
2019-07-24 09:32:53 +00:00
|
|
|
label: 'Account',
|
|
|
|
fieldname: 'account'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Link',
|
|
|
|
target: 'Party',
|
|
|
|
label: 'Party',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
|
|
|
placeholder: 'Party',
|
2019-07-24 09:32:53 +00:00
|
|
|
fieldname: 'party'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
|
|
|
placeholder: 'From Date',
|
2019-07-24 09:32:53 +00:00
|
|
|
label: 'From Date',
|
|
|
|
fieldname: 'fromDate'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
|
|
|
placeholder: 'To Date',
|
2019-07-24 09:32:53 +00:00
|
|
|
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-08-14 07:43:49 +00:00
|
|
|
{
|
|
|
|
label: 'Clear Filters',
|
|
|
|
type: 'secondary',
|
|
|
|
action: async report => {
|
|
|
|
await report.getReportData({});
|
|
|
|
report.usedToReRender += 1;
|
|
|
|
}
|
|
|
|
},
|
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-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: 'Account',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Link',
|
|
|
|
fieldname: 'account'
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
2019-11-08 10:49:06 +00:00
|
|
|
{
|
|
|
|
label: 'Date',
|
|
|
|
fieldtype: 'Date',
|
|
|
|
fieldname: 'date'
|
|
|
|
},
|
2019-02-18 05:42:04 +00:00
|
|
|
{
|
|
|
|
label: 'Debit',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Currency',
|
|
|
|
fieldname: 'debit'
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Credit',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Currency',
|
|
|
|
fieldname: 'credit'
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Balance',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Currency',
|
|
|
|
fieldname: 'balance'
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Reference Type',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Data',
|
|
|
|
fieldname: 'referenceType'
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Reference Name',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Data',
|
|
|
|
fieldname: 'referenceName'
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Party',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Link',
|
|
|
|
fieldname: 'party'
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Description',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Data',
|
|
|
|
fieldname: 'description'
|
2019-02-18 05:42:04 +00:00
|
|
|
}
|
2018-07-14 14:26:18 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
};
|
2019-07-18 06:49:12 +00:00
|
|
|
|
|
|
|
module.exports = viewConfig;
|