2022-04-19 11:29:36 +05:30
|
|
|
import { t } from 'fyo';
|
2022-04-20 12:08:47 +05:30
|
|
|
import Avatar from 'src/components/Avatar.vue';
|
|
|
|
import { fyo } from 'src/initFyo';
|
2021-12-21 14:07:06 +05:30
|
|
|
import getCommonExportActions from '../commonExporter';
|
2019-12-03 15:53:54 +05:30
|
|
|
|
2022-04-20 12:08:47 +05:30
|
|
|
export function getPartyWithAvatar(partyName) {
|
|
|
|
return {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
imageURL: null,
|
|
|
|
label: null,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
Avatar,
|
|
|
|
},
|
|
|
|
async mounted() {
|
|
|
|
const p = await fyo.db.get('Party', partyName);
|
|
|
|
this.imageURL = p.image;
|
|
|
|
this.label = partyName;
|
|
|
|
},
|
|
|
|
template: `
|
|
|
|
<div class="flex items-center" v-if="label">
|
|
|
|
<Avatar class="flex-shrink-0" :imageURL="imageURL" :label="label" size="sm" />
|
|
|
|
<span class="ml-2 truncate">{{ label }}</span>
|
|
|
|
</div>
|
|
|
|
`,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-03-30 16:27:45 +05:30
|
|
|
let title = t`General Ledger`;
|
2019-07-18 12:19:12 +05:30
|
|
|
|
|
|
|
const viewConfig = {
|
|
|
|
title,
|
2019-07-24 15:02:53 +05:30
|
|
|
filterFields: [
|
|
|
|
{
|
|
|
|
fieldtype: 'Select',
|
2019-11-20 00:44:15 +05:30
|
|
|
options: [
|
2022-02-16 11:49:16 +05:30
|
|
|
{ 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-20 00:44:15 +05:30
|
|
|
],
|
2019-08-14 13:13:49 +05:30
|
|
|
size: 'small',
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Reference Type`,
|
2019-11-20 00:44:15 +05:30
|
|
|
fieldname: 'referenceType',
|
2022-03-30 16:27:45 +05:30
|
|
|
placeholder: t`Reference Type`,
|
2021-12-16 16:27:52 +05:30
|
|
|
default: 'All',
|
2019-07-24 15:02:53 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'DynamicLink',
|
2019-08-14 13:13:49 +05:30
|
|
|
size: 'small',
|
2022-03-30 16:27:45 +05:30
|
|
|
placeholder: t`Reference Name`,
|
2019-07-24 15:02:53 +05:30
|
|
|
references: 'referenceType',
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Reference Name`,
|
2021-12-16 15:56:18 +05:30
|
|
|
fieldname: 'referenceName',
|
2019-07-24 15:02:53 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Link',
|
|
|
|
target: 'Account',
|
2019-08-14 13:13:49 +05:30
|
|
|
size: 'small',
|
2022-03-30 16:27:45 +05:30
|
|
|
placeholder: t`Account`,
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Account`,
|
2021-12-16 15:56:18 +05:30
|
|
|
fieldname: 'account',
|
2019-07-24 15:02:53 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Link',
|
|
|
|
target: 'Party',
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Party`,
|
2019-08-14 13:13:49 +05:30
|
|
|
size: 'small',
|
2022-03-30 16:27:45 +05:30
|
|
|
placeholder: t`Party`,
|
2021-12-16 15:56:18 +05:30
|
|
|
fieldname: 'party',
|
2019-07-24 15:02:53 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
2019-08-14 13:13:49 +05:30
|
|
|
size: 'small',
|
2022-03-30 16:27:45 +05:30
|
|
|
placeholder: t`From Date`,
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`From Date`,
|
2021-12-16 15:56:18 +05:30
|
|
|
fieldname: 'fromDate',
|
2019-07-24 15:02:53 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
2019-08-14 13:13:49 +05:30
|
|
|
size: 'small',
|
2022-03-30 16:27:45 +05:30
|
|
|
placeholder: t`To Date`,
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`To Date`,
|
2021-12-16 15:56:18 +05:30
|
|
|
fieldname: 'toDate',
|
2021-10-21 23:10:14 +05:30
|
|
|
},
|
|
|
|
{
|
2021-12-16 15:56:18 +05:30
|
|
|
fieldtype: 'Check',
|
2021-10-21 23:10:14 +05:30
|
|
|
size: 'small',
|
2021-12-16 15:56:18 +05:30
|
|
|
default: 0,
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Cancelled`,
|
2021-12-16 15:56:18 +05:30
|
|
|
fieldname: 'reverted',
|
|
|
|
},
|
2019-07-24 15:02:53 +05:30
|
|
|
],
|
2018-07-14 19:56:18 +05:30
|
|
|
method: 'general-ledger',
|
2021-12-21 14:07:06 +05:30
|
|
|
actions: getCommonExportActions('general-ledger'),
|
2018-07-14 19:56:18 +05:30
|
|
|
getColumns() {
|
2019-07-18 12:19:12 +05:30
|
|
|
return [
|
2019-02-18 11:12:04 +05:30
|
|
|
{
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Account`,
|
2019-10-14 03:26:20 +05:30
|
|
|
fieldtype: 'Link',
|
2021-11-10 16:43:11 +05:30
|
|
|
fieldname: 'account',
|
2021-12-16 15:56:18 +05:30
|
|
|
width: 1.5,
|
2019-02-18 11:12:04 +05:30
|
|
|
},
|
2019-11-08 16:19:06 +05:30
|
|
|
{
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Date`,
|
2019-11-08 16:19:06 +05:30
|
|
|
fieldtype: 'Date',
|
2021-11-10 16:43:11 +05:30
|
|
|
fieldname: 'date',
|
2021-12-16 15:56:18 +05:30
|
|
|
width: 0.75,
|
2019-11-08 16:19:06 +05:30
|
|
|
},
|
2019-02-18 11:12:04 +05:30
|
|
|
{
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Debit`,
|
2019-10-14 03:26:20 +05:30
|
|
|
fieldtype: 'Currency',
|
2019-12-03 17:15:07 +05:30
|
|
|
fieldname: 'debit',
|
2021-12-16 15:56:18 +05:30
|
|
|
width: 1.25,
|
2019-02-18 11:12:04 +05:30
|
|
|
},
|
|
|
|
{
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Credit`,
|
2019-10-14 03:26:20 +05:30
|
|
|
fieldtype: 'Currency',
|
2019-12-03 17:15:07 +05:30
|
|
|
fieldname: 'credit',
|
2021-12-16 15:56:18 +05:30
|
|
|
width: 1.25,
|
2019-02-18 11:12:04 +05:30
|
|
|
},
|
|
|
|
{
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Balance`,
|
2019-10-14 03:26:20 +05:30
|
|
|
fieldtype: 'Currency',
|
2019-12-03 17:15:07 +05:30
|
|
|
fieldname: 'balance',
|
2021-12-16 15:56:18 +05:30
|
|
|
width: 1.25,
|
2019-02-18 11:12:04 +05:30
|
|
|
},
|
|
|
|
{
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Reference Type`,
|
2019-10-14 03:26:20 +05:30
|
|
|
fieldtype: 'Data',
|
2021-11-10 16:43:11 +05:30
|
|
|
fieldname: 'referenceType',
|
2019-02-18 11:12:04 +05:30
|
|
|
},
|
|
|
|
{
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Reference Name`,
|
2019-10-14 03:26:20 +05:30
|
|
|
fieldtype: 'Data',
|
2021-11-10 16:43:11 +05:30
|
|
|
fieldname: 'referenceName',
|
2019-02-18 11:12:04 +05:30
|
|
|
},
|
|
|
|
{
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Party`,
|
2019-10-14 03:26:20 +05:30
|
|
|
fieldtype: 'Link',
|
2019-12-03 15:53:54 +05:30
|
|
|
fieldname: 'party',
|
|
|
|
component(cellValue) {
|
2022-04-20 12:08:47 +05:30
|
|
|
return getPartyWithAvatar(cellValue);
|
2021-11-10 16:43:11 +05:30
|
|
|
},
|
2019-02-18 11:12:04 +05:30
|
|
|
},
|
2018-07-14 19:56:18 +05:30
|
|
|
];
|
2021-12-16 15:56:18 +05:30
|
|
|
},
|
2018-07-14 19:56:18 +05:30
|
|
|
};
|
2019-07-18 12:19:12 +05:30
|
|
|
|
2019-12-03 15:53:54 +05:30
|
|
|
export default viewConfig;
|