loan react

This commit is contained in:
roshelrao
2021-06-15 14:06:38 +05:30
parent 3eaf290a58
commit 07aea4cdf0

View File

@@ -2,13 +2,22 @@
Copyright (c) 2018 [Glacies UG, Berlin, Germany] (http://glacies.de)
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
*/
import AdapterBase from '../../../api/AdapterBase';
//import AdapterBase from '../../../api/AdapterBase';
import ReactModalAdapterBase from '../../../api/ReactModalAdapterBase';
/**
* CompanyLoanAdapter
*/
class CompanyLoanAdapter extends AdapterBase {
class CompanyLoanAdapter extends ReactModalAdapterBase {
constructor(endPoint, tab, filter, orderBy) {
super(endPoint, tab, filter, orderBy);
this.fieldNameMap = {};
this.hiddenFields = {};
this.tableFields = {};
this.formOnlyFields = {};
}
getDataMapping() {
return [
'id',
@@ -25,13 +34,35 @@ class CompanyLoanAdapter extends AdapterBase {
];
}
getTableColumns() {
return [
{
title: 'Name',
dataIndex: 'name',
sorter: true,
},
{
title: 'Details',
dataIndex: 'details',
sorter: true,
}
];
}
getFormFields() {
if(this.showSave){
return [
['id', { label: 'ID', type: 'hidden' }],
['name', { label: 'Name', type: 'text', validation: '' }],
['details', { label: 'Details', type: 'textarea', validation: 'none' }],
];
}
return [
['id', { label: 'ID', type: 'hidden' }],
['name', { label: 'Name', type: 'text', validation: '' }],
['details', { label: 'Details', type: 'textarea', validation: 'none' }],
];
}
}
@@ -39,7 +70,15 @@ class CompanyLoanAdapter extends AdapterBase {
* EmployeeCompanyLoanAdapter
*/
class EmployeeCompanyLoanAdapter extends AdapterBase {
class EmployeeCompanyLoanAdapter extends ReactModalAdapterBase {
constructor(endPoint, tab, filter, orderBy) {
super(endPoint, tab, filter, orderBy);
this.fieldNameMap = {};
this.hiddenFields = {};
this.tableFields = {};
this.formOnlyFields = {};
}
getDataMapping() {
return [
'id',
@@ -66,6 +105,46 @@ class EmployeeCompanyLoanAdapter extends AdapterBase {
];
}
getTableColumns() {
return [
{
title: 'Employee',
dataIndex: 'employee',
sorter: true,
},
{
title: 'Loan Type',
dataIndex: 'loan',
sorter: true,
},
{
title: 'Loan Start Date',
dataIndex: 'start_date',
sorter: true,
},
{
title: 'Loan Period (Months)',
dataIndex: 'period_months',
sorter: true,
},
{
title: 'Currency',
dataIndex: 'currency',
sorter: true,
},
{
title: 'Amount',
dataIndex: 'amount',
sorter: true,
},
{
title: 'Status',
dataIndex: 'status',
sorter: true,
}
];
}
getFormFields() {
return [
['id', { label: 'ID', type: 'hidden' }],