2019-12-03 10:23:54 +00:00
|
|
|
import { partyWithAvatar } from '@/utils';
|
|
|
|
|
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' },
|
2019-12-20 06:44:31 +00:00
|
|
|
{ label: 'Purchase Invoice', value: 'PurchaseInvoice' },
|
2019-11-19 19:14:15 +00:00
|
|
|
{ label: 'Payment', value: 'Payment' },
|
2019-12-20 06:44:31 +00:00
|
|
|
{ label: 'Journal Entry', value: 'JournalEntry' }
|
2019-11-19 19:14:15 +00:00
|
|
|
],
|
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'
|
2021-10-21 17:40:14 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Select',
|
2021-10-27 16:02:40 +00:00
|
|
|
options: [
|
2021-11-21 13:38:04 +00:00
|
|
|
{ label: 'Show Cancelled', value: '' },
|
|
|
|
{ label: 'Hide Cancelled', value: '0' }
|
2021-10-27 16:02:40 +00:00
|
|
|
],
|
2021-10-21 17:40:14 +00:00
|
|
|
size: 'small',
|
2021-10-27 16:02:40 +00:00
|
|
|
default: '0',
|
2021-10-25 19:50:35 +00:00
|
|
|
label: 'Reverted',
|
2021-10-21 17:40:14 +00:00
|
|
|
fieldname: 'reverted'
|
2019-07-24 09:32:53 +00:00
|
|
|
}
|
|
|
|
],
|
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-12-20 06:44:31 +00:00
|
|
|
action: () => {}
|
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',
|
2021-11-10 11:13:11 +00:00
|
|
|
fieldname: 'account',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
2019-11-08 10:49:06 +00:00
|
|
|
{
|
|
|
|
label: 'Date',
|
|
|
|
fieldtype: 'Date',
|
2021-11-10 11:13:11 +00:00
|
|
|
fieldname: 'date',
|
2019-11-08 10:49:06 +00:00
|
|
|
},
|
2019-02-18 05:42:04 +00:00
|
|
|
{
|
|
|
|
label: 'Debit',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Currency',
|
2019-12-03 11:45:07 +00:00
|
|
|
fieldname: 'debit',
|
2021-11-10 11:13:11 +00:00
|
|
|
width: 0.5,
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Credit',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Currency',
|
2019-12-03 11:45:07 +00:00
|
|
|
fieldname: 'credit',
|
2021-11-10 11:13:11 +00:00
|
|
|
width: 0.5,
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Balance',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Currency',
|
2019-12-03 11:45:07 +00:00
|
|
|
fieldname: 'balance',
|
2021-11-10 11:13:11 +00:00
|
|
|
width: 0.5,
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Reference Type',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Data',
|
2021-11-10 11:13:11 +00:00
|
|
|
fieldname: 'referenceType',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Reference Name',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Data',
|
2021-11-10 11:13:11 +00:00
|
|
|
fieldname: 'referenceName',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Party',
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Link',
|
2019-12-03 10:23:54 +00:00
|
|
|
fieldname: 'party',
|
|
|
|
component(cellValue) {
|
|
|
|
return partyWithAvatar(cellValue);
|
2021-11-10 11:13:11 +00:00
|
|
|
},
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
2018-07-14 14:26:18 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
};
|
2019-07-18 06:49:12 +00:00
|
|
|
|
2019-12-03 10:23:54 +00:00
|
|
|
export default viewConfig;
|