2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00
books/reports/BankReconciliation/viewConfig.js
18alantom de7e5ba807 refactor: rename 'frappe' to 'fyo' outside src
- cause now most of it is different from what it was
2022-05-23 16:18:22 +05:30

123 lines
2.6 KiB
JavaScript

const title = 'Bank Reconciliation';
import { t } from 'fyo';
import ImportWizard from '../../src/components/ImportWizart';
import BankReconciliationImport from './BankReconciliationImport';
export default {
title: title,
method: 'bank-reconciliation',
filterFields: [
{
fieldtype: 'Link',
target: 'Account',
size: 'small',
placeholder: t`Payment Account`,
label: t`Payment Account`,
fieldname: 'paymentAccount',
getFilters: () => {
return {
accountType: 'Bank',
isGroup: 0,
};
},
},
{
fieldtype: 'Link',
target: 'Party',
size: 'small',
label: t`Party`,
placeholder: t`Party`,
fieldname: 'party',
},
{
fieldtype: 'Date',
size: 'small',
placeholder: t`From Date`,
label: t`From Date`,
fieldname: 'fromDate',
},
{
fieldtype: 'Date',
size: 'small',
placeholder: t`To Date`,
label: t`To Date`,
fieldname: 'toDate',
},
],
actions: [
{
label: t`Reconcile`,
type: 'secondary',
condition: (report) => report.currentFilters.paymentAccount,
action: async (report) => {
report.$modal.show({
modalProps: {
title: `Import Bank Account Statement`,
noFooter: true,
},
component: ImportWizard,
props: {
importHandler: BankReconciliationImport.fileImportHandler,
report,
},
});
},
},
],
getColumns() {
return [
{
label: t`Posting Date`,
fieldtype: 'Date',
fieldname: 'date',
},
{
label: t`Payment Account`,
fieldtype: 'Link',
},
{
label: t`Debit`,
fieldtype: 'Currency',
},
{
label: t`Credit`,
fieldtype: 'Currency',
},
{
label: t`Balance`,
fieldtype: 'Currency',
},
{
label: t`Ref/Cheque ID`,
fieldtype: 'Data',
fieldname: 'referenceId',
},
{
label: t`Clearance Date`,
fieldtype: 'Date',
fieldname: 'clearanceDate',
},
{
label: t`Ref. Type`,
fieldtype: 'Data',
fieldname: 'referenceType',
},
{
label: t`Ref. Name`,
fieldtype: 'Data',
fieldname: 'referenceName',
},
{
label: t`Ref. Date`,
fieldtype: 'Date',
fieldname: 'referenceDate',
},
{
label: t`Party`,
fieldtype: 'Link',
},
];
},
};