2019-02-18 05:42:04 +00:00
|
|
|
const title = 'Bank Reconciliation';
|
2022-02-16 06:19:16 +00:00
|
|
|
import { t } from 'frappe';
|
2021-11-04 10:31:26 +00:00
|
|
|
import ImportWizard from '../../src/components/ImportWizart';
|
|
|
|
import BankReconciliationImport from './BankReconciliationImport';
|
|
|
|
|
|
|
|
export default {
|
2019-02-18 05:42:04 +00:00
|
|
|
title: title,
|
|
|
|
method: 'bank-reconciliation',
|
2019-07-22 09:56:30 +00:00
|
|
|
filterFields: [
|
|
|
|
{
|
2019-02-18 05:42:04 +00:00
|
|
|
fieldtype: 'Link',
|
|
|
|
target: 'Account',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
2022-03-30 10:57:45 +00:00
|
|
|
placeholder: t`Payment Account`,
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Payment Account`,
|
2019-07-22 09:56:30 +00:00
|
|
|
fieldname: 'paymentAccount',
|
|
|
|
getFilters: () => {
|
|
|
|
return {
|
|
|
|
accountType: 'Bank',
|
2021-11-04 10:31:26 +00:00
|
|
|
isGroup: 0,
|
2019-07-22 09:56:30 +00:00
|
|
|
};
|
2021-11-04 10:31:26 +00:00
|
|
|
},
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Link',
|
|
|
|
target: 'Party',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Party`,
|
2022-03-30 10:57:45 +00:00
|
|
|
placeholder: t`Party`,
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldname: 'party',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
2022-03-30 10:57:45 +00:00
|
|
|
placeholder: t`From Date`,
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`From Date`,
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldname: 'fromDate',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldtype: 'Date',
|
2019-08-14 07:43:49 +00:00
|
|
|
size: 'small',
|
2022-03-30 10:57:45 +00:00
|
|
|
placeholder: t`To Date`,
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`To Date`,
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldname: 'toDate',
|
|
|
|
},
|
2019-02-18 05:42:04 +00:00
|
|
|
],
|
2021-12-21 06:07:36 +00:00
|
|
|
actions: [
|
2019-09-03 09:43:16 +00:00
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Reconcile`,
|
2019-09-03 09:43:16 +00:00
|
|
|
type: 'secondary',
|
2021-11-04 10:31:26 +00:00
|
|
|
condition: (report) => report.currentFilters.paymentAccount,
|
|
|
|
action: async (report) => {
|
2019-09-03 09:43:16 +00:00
|
|
|
report.$modal.show({
|
|
|
|
modalProps: {
|
|
|
|
title: `Import Bank Account Statement`,
|
2021-11-04 10:31:26 +00:00
|
|
|
noFooter: true,
|
2019-09-03 09:43:16 +00:00
|
|
|
},
|
2021-11-04 10:31:26 +00:00
|
|
|
component: ImportWizard,
|
2019-09-03 09:43:16 +00:00
|
|
|
props: {
|
2021-11-04 10:31:26 +00:00
|
|
|
importHandler: BankReconciliationImport.fileImportHandler,
|
|
|
|
report,
|
|
|
|
},
|
2019-09-03 09:43:16 +00:00
|
|
|
});
|
2021-11-04 10:31:26 +00:00
|
|
|
},
|
2019-09-03 09:43:16 +00:00
|
|
|
},
|
2019-08-14 07:43:49 +00:00
|
|
|
],
|
2019-02-18 05:42:04 +00:00
|
|
|
getColumns() {
|
2019-07-22 09:56:30 +00:00
|
|
|
return [
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Posting Date`,
|
2019-02-18 05:42:04 +00:00
|
|
|
fieldtype: 'Date',
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldname: 'date',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Payment Account`,
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldtype: 'Link',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Debit`,
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldtype: 'Currency',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Credit`,
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldtype: 'Currency',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Balance`,
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldtype: 'Currency',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
2019-09-03 09:43:16 +00:00
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Ref/Cheque ID`,
|
2019-09-03 09:43:16 +00:00
|
|
|
fieldtype: 'Data',
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldname: 'referenceId',
|
2019-09-03 09:43:16 +00:00
|
|
|
},
|
2019-07-24 09:32:53 +00:00
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Clearance Date`,
|
2019-07-24 09:32:53 +00:00
|
|
|
fieldtype: 'Date',
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldname: 'clearanceDate',
|
2019-07-24 09:32:53 +00:00
|
|
|
},
|
2019-02-18 05:42:04 +00:00
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Ref. Type`,
|
2019-02-18 05:42:04 +00:00
|
|
|
fieldtype: 'Data',
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldname: 'referenceType',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Ref. Name`,
|
2019-02-18 05:42:04 +00:00
|
|
|
fieldtype: 'Data',
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldname: 'referenceName',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Ref. Date`,
|
2019-02-18 05:42:04 +00:00
|
|
|
fieldtype: 'Date',
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldname: 'referenceDate',
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
2019-07-24 09:32:53 +00:00
|
|
|
|
2019-02-18 05:42:04 +00:00
|
|
|
{
|
2022-02-16 06:19:16 +00:00
|
|
|
label: t`Party`,
|
2021-11-04 10:31:26 +00:00
|
|
|
fieldtype: 'Link',
|
|
|
|
},
|
2019-02-18 05:42:04 +00:00
|
|
|
];
|
2021-11-04 10:31:26 +00:00
|
|
|
},
|
2019-02-18 05:42:04 +00:00
|
|
|
};
|