2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 11:29:00 +00:00
books/reports/GeneralLedger/viewConfig.js
Faris Ansari 6e2c5cdf96 fix: JournalEntry fixes
- Form actions
- Set debit / credit in 2nd row automatically
- Validate before update and insert
- Add JournalEntry as filter option in General Ledger
- Commonify actions for document in InvoiceForm, JournalEntryForm and QuickEditForm
- DropdownWithActions component
2019-12-20 12:14:31 +05:30

135 lines
2.8 KiB
JavaScript

import { partyWithAvatar } from '@/utils';
let title = 'General Ledger';
const viewConfig = {
title,
filterFields: [
{
fieldtype: 'Select',
options: [
{ label: '', value: '' },
{ label: 'Sales Invoice', value: 'SalesInvoice' },
{ label: 'Purchase Invoice', value: 'PurchaseInvoice' },
{ label: 'Payment', value: 'Payment' },
{ label: 'Journal Entry', value: 'JournalEntry' }
],
size: 'small',
label: 'Reference Type',
fieldname: 'referenceType',
placeholder: 'Reference Type'
},
{
fieldtype: 'DynamicLink',
size: 'small',
placeholder: 'Reference Name',
references: 'referenceType',
label: 'Reference Name',
fieldname: 'referenceName'
},
{
fieldtype: 'Link',
target: 'Account',
size: 'small',
placeholder: 'Account',
label: 'Account',
fieldname: 'account'
},
{
fieldtype: 'Link',
target: 'Party',
label: 'Party',
size: 'small',
placeholder: 'Party',
fieldname: 'party'
},
{
fieldtype: 'Date',
size: 'small',
placeholder: 'From Date',
label: 'From Date',
fieldname: 'fromDate'
},
{
fieldtype: 'Date',
size: 'small',
placeholder: 'To Date',
label: 'To Date',
fieldname: 'toDate'
}
],
method: 'general-ledger',
linkFields: [
{
label: 'Clear Filters',
type: 'secondary',
action: async report => {
await report.getReportData({});
report.usedToReRender += 1;
}
},
{
label: 'Export',
type: 'primary',
action: () => {}
}
],
getColumns() {
return [
{
label: 'Account',
fieldtype: 'Link',
fieldname: 'account'
},
{
label: 'Date',
fieldtype: 'Date',
fieldname: 'date'
},
{
label: 'Debit',
fieldtype: 'Currency',
fieldname: 'debit',
width: 0.5
},
{
label: 'Credit',
fieldtype: 'Currency',
fieldname: 'credit',
width: 0.5
},
{
label: 'Balance',
fieldtype: 'Currency',
fieldname: 'balance',
width: 0.5
},
{
label: 'Reference Type',
fieldtype: 'Data',
fieldname: 'referenceType'
},
{
label: 'Reference Name',
fieldtype: 'Data',
fieldname: 'referenceName'
},
{
label: 'Party',
fieldtype: 'Link',
fieldname: 'party',
component(cellValue) {
return partyWithAvatar(cellValue);
}
},
{
label: 'Description',
fieldtype: 'Data',
fieldname: 'description'
}
];
}
};
export default viewConfig;