2019-12-03 10:23:54 +00:00
|
|
|
import { partyWithAvatar } from '@/utils';
|
2021-12-21 08:37:06 +00:00
|
|
|
import getCommonExportActions from '../commonExporter';
|
2019-12-03 10:23:54 +00:00
|
|
|
|
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: [
|
2022-02-16 06:19:16 +00:00
|
|
|
{ label: t`All References`, value: 'All' },
|
|
|
|
{ label: t`Invoices`, value: 'SalesInvoice' },
|
|
|
|
{ label: t`Bills`, value: 'PurchaseInvoice' },
|
|
|
|
{ label: t`Payment`, value: 'Payment' },
|
|
|
|
{ label: t`Journal Entry`, value: 'JournalEntry' },
|
2019-11-19 19:14:15 +00:00
|
|
|
],
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Reference Type`,
|
2019-11-19 19:14:15 +00:00
|
|
|
fieldname: 'referenceType',
|
2021-12-16 10:26:18 +00:00
|
|
|
placeholder: 'Reference Type',
|
2021-12-16 10:57:52 +00:00
|
|
|
default: 'All',
|
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',
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Reference Name`,
|
2021-12-16 10:26:18 +00:00
|
|
|
fieldname: 'referenceName',
|
2019-07-24 09:32:53 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Link',
|
|
|
|
target: 'Account',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
|
|
|
placeholder: 'Account',
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Account`,
|
2021-12-16 10:26:18 +00:00
|
|
|
fieldname: 'account',
|
2019-07-24 09:32:53 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Link',
|
|
|
|
target: 'Party',
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Party`,
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
|
|
|
placeholder: 'Party',
|
2021-12-16 10:26:18 +00:00
|
|
|
fieldname: 'party',
|
2019-07-24 09:32:53 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
|
|
|
placeholder: 'From Date',
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`From Date`,
|
2021-12-16 10:26:18 +00:00
|
|
|
fieldname: 'fromDate',
|
2019-07-24 09:32:53 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
|
|
|
placeholder: 'To Date',
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`To Date`,
|
2021-12-16 10:26:18 +00:00
|
|
|
fieldname: 'toDate',
|
2021-10-21 17:40:14 +00:00
|
|
|
},
|
|
|
|
{
|
2021-12-16 10:26:18 +00:00
|
|
|
fieldtype: 'Check',
|
2021-10-21 17:40:14 +00:00
|
|
|
size: 'small',
|
2021-12-16 10:26:18 +00:00
|
|
|
default: 0,
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Cancelled`,
|
2021-12-16 10:26:18 +00:00
|
|
|
fieldname: 'reverted',
|
|
|
|
},
|
2019-07-24 09:32:53 +00:00
|
|
|
],
|
2018-07-14 14:26:18 +00:00
|
|
|
method: 'general-ledger',
|
2021-12-21 08:37:06 +00:00
|
|
|
actions: getCommonExportActions('general-ledger'),
|
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
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Account`,
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Link',
|
2021-11-10 11:13:11 +00:00
|
|
|
fieldname: 'account',
|
2021-12-16 10:26:18 +00:00
|
|
|
width: 1.5,
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
2019-11-08 10:49:06 +00:00
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Date`,
|
2019-11-08 10:49:06 +00:00
|
|
|
fieldtype: 'Date',
|
2021-11-10 11:13:11 +00:00
|
|
|
fieldname: 'date',
|
2021-12-16 10:26:18 +00:00
|
|
|
width: 0.75,
|
2019-11-08 10:49:06 +00:00
|
|
|
},
|
2019-02-18 05:42:04 +00:00
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Debit`,
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Currency',
|
2019-12-03 11:45:07 +00:00
|
|
|
fieldname: 'debit',
|
2021-12-16 10:26:18 +00:00
|
|
|
width: 1.25,
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Credit`,
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Currency',
|
2019-12-03 11:45:07 +00:00
|
|
|
fieldname: 'credit',
|
2021-12-16 10:26:18 +00:00
|
|
|
width: 1.25,
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Balance`,
|
2019-10-13 21:56:20 +00:00
|
|
|
fieldtype: 'Currency',
|
2019-12-03 11:45:07 +00:00
|
|
|
fieldname: 'balance',
|
2021-12-16 10:26:18 +00:00
|
|
|
width: 1.25,
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`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
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`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
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`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
|
|
|
];
|
2021-12-16 10:26:18 +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;
|