mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 11:36:48 +00:00
FINERACT-1375:ClientEntityFix (#3451)
thanks for the code review @luckyman20
This commit is contained in:
parent
88d63ad43e
commit
ed9f555c3c
@ -2799,8 +2799,8 @@
|
||||
"label.loan": "Loan",
|
||||
"label.savingsaccount": "Savings account",
|
||||
"label.client": "Client",
|
||||
"label.cliententity": "Client_Entity",
|
||||
"label.clientperson": "Client_Person",
|
||||
"label.entity": "ENTITY",
|
||||
"label.person": "PERSON",
|
||||
"label.group": "Group",
|
||||
"label.center": "Center",
|
||||
"label.office": "Office",
|
||||
|
||||
@ -270,22 +270,19 @@
|
||||
resourceFactory.runReportsResource.get({reportSource: 'ClientSummary', genericResultSet: 'false', R_clientId: routeParams.id}, function (data) {
|
||||
scope.client.ClientSummary = data[0];
|
||||
});
|
||||
scope.entitySubType = data.legalForm.value;
|
||||
|
||||
if(data.legalForm.value != null){
|
||||
if (data.legalForm.value === 'PERSON') {
|
||||
scope.legalform = 'm_client_person'
|
||||
} else if (data.legalForm.value === 'ENTITY') {
|
||||
scope.legalform = 'm_client_entity'
|
||||
}
|
||||
resourceFactory.DataTablesResource.getAllDataTables({apptable: scope.legalform}, function (data) {
|
||||
scope.clientdatatables = data;
|
||||
});
|
||||
resourceFactory.DataTablesResource.getAllDataTables({apptable: 'm_client'}, function (data) {
|
||||
scope.clientdatatables = data;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
scope.entitySubTypeFilter = function (datatable) {
|
||||
if (datatable.entitySubType === scope.entitySubType) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
resourceFactory.DataTablesResource.getAllDataTables({apptable: 'm_client'}, function (data) {
|
||||
scope.clientdatatables = data;
|
||||
});
|
||||
}
|
||||
|
||||
scope.deleteClient = function () {
|
||||
$uibModal.open({
|
||||
@ -682,8 +679,10 @@
|
||||
};
|
||||
|
||||
scope.dataTableChange = function (clientdatatable) {
|
||||
resourceFactory.DataTablesResource.getTableDetails({datatablename: clientdatatable.registeredTableName,
|
||||
entityId: routeParams.id, genericResultSet: 'true'}, function (data) {
|
||||
resourceFactory.DataTablesResource.getTableDetails({
|
||||
datatablename: clientdatatable.registeredTableName,
|
||||
entityId: routeParams.id, genericResultSet: 'true'
|
||||
}, function (data) {
|
||||
scope.datatabledetails = data;
|
||||
scope.datatabledetails.isData = data.data.length > 0 ? true : false;
|
||||
scope.datatabledetails.isMultirow = data.columnHeaders[0].columnName == "id" ? true : false;
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
scope.columns = [];
|
||||
scope.columnnameerror = false;
|
||||
scope.columntypeerror = false;
|
||||
scope.showLegalForm = false;
|
||||
scope.datatableTemplate = {};
|
||||
scope.labelerror = "requiredfield";
|
||||
|
||||
@ -43,6 +44,14 @@
|
||||
}
|
||||
};
|
||||
|
||||
scope.legalFormChange = function (apptableName) {
|
||||
if (apptableName == 'm_client') {
|
||||
scope.showLegalForm = true;
|
||||
}
|
||||
else{
|
||||
scope.showLegalForm = false;
|
||||
}
|
||||
}
|
||||
scope.submit = function () {
|
||||
if (scope.columns.length == 0) {
|
||||
scope.errorDetails = [];
|
||||
|
||||
@ -7,16 +7,34 @@
|
||||
scope.formData = {};
|
||||
scope.columnnameerror = false;
|
||||
scope.columntypeerror = false;
|
||||
scope.showLegalForm = true;
|
||||
scope.datatableTemplate = {};
|
||||
|
||||
resourceFactory.codeResources.getAllCodes({}, function (data) {
|
||||
scope.codes = data;
|
||||
});
|
||||
|
||||
scope.legalFormChange = function (apptableName) {
|
||||
if (apptableName == 'm_client') {
|
||||
scope.showLegalForm = true;
|
||||
}
|
||||
else{
|
||||
scope.showLegalForm = false;
|
||||
}
|
||||
}
|
||||
|
||||
resourceFactory.DataTablesResource.getTableDetails({datatablename: routeParams.tableName}, function (data) {
|
||||
scope.datatable = data;
|
||||
|
||||
scope.formData.apptableName = data.applicationTableName;
|
||||
scope.formData.entitySubType = data.entitySubType;
|
||||
|
||||
if(scope.formData.apptableName == 'm_client'){
|
||||
scope.showLegalForm = true;
|
||||
}
|
||||
else{
|
||||
scope.showLegalForm = false;
|
||||
}
|
||||
|
||||
var temp = [];
|
||||
var colName = data.columnHeaderData[0].columnName;
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
<div class="col-sm-3">
|
||||
<select id="legalFormId" ng-model="formData.legalFormId" class="form-control"
|
||||
ng-options="legalForm.id as legalForm.value for legalForm in clientLegalFormOptions"
|
||||
value="{{legalForm.id}}" ng-change="displayPersonOrNonPersonOptions(formData.legalFormId)">
|
||||
value="{{legalForm.id}}" ng-change="displayPersonOrNonPersonOptions(formData.legalFormId)" late-Validate>
|
||||
<option value="">--{{'label.menu.legalForm' | translate}}--</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -1185,8 +1185,8 @@
|
||||
<object height="60%" width="70%" ng-show="preview" data="{{fileUrl}}" type="{{fileType}}"></object>
|
||||
</div>
|
||||
</uib-tab>
|
||||
<uib-tab heading="{{clientdatatable.registeredTableName}}" ng-repeat="clientdatatable in clientdatatables"
|
||||
select="dataTableChange(clientdatatable)" has-permission='READ_{{clientdatatable.registeredTableName}}'>
|
||||
<uib-tab heading="{{clientdatatable.registeredTableName}}" ng-repeat="clientdatatable in clientdatatables | filter:entitySubTypeFilter"
|
||||
select="dataTableChange(clientdatatable)" has-permission='READ_{{clientdatatable.registeredTableName}}' >
|
||||
<api-validate></api-validate>
|
||||
<div>
|
||||
<div data-ng-hide="isClosedClient" class="btn-group pull-right">
|
||||
|
||||
@ -29,10 +29,9 @@
|
||||
class="required">*</span></label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<select id="apptableName" ng-model="formData.apptableName" name="apptable" class="form-control" required>
|
||||
<select id="apptableName" ng-model="formData.apptableName" name="apptable" class="form-control" ng-change="legalFormChange(formData.apptableName)" required>
|
||||
<option class="displaynone" value="">{{'label.selectone' | translate}}</option>
|
||||
<option value="m_client_entity">{{'label.cliententity' | translate}}</option>
|
||||
<option value="m_client_person">{{'label.clientperson' | translate}}</option>
|
||||
<option value="m_client">{{'label.client' | translate}}</option>
|
||||
<option value="m_group">{{'label.group' | translate}}</option>
|
||||
<option value="m_center">{{'label.center' | translate}}</option>
|
||||
<option value="m_loan">{{'label.loan' | translate}}</option>
|
||||
@ -40,9 +39,19 @@
|
||||
<option value="m_savings_account">{{'label.savingsaccount' | translate}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="createdatatableform" valattribute="apptable"/>
|
||||
</div>
|
||||
<div class="col-sm-5" ng-show="showLegalForm">
|
||||
<label class="control-label col-sm-2" for="entitySubType">{{ 'label.input.legalForm' | translate }}<span class="required">*</span></label>
|
||||
<div class="col-sm-7">
|
||||
<select id="entitySubType" ng-model="formData.entitySubType" name="entitySubType" class="form-control" required>
|
||||
<option class="width100" value="">{{'label.selectone' | translate}}</option>
|
||||
<option value="ENTITY">{{'label.entity' | translate}}</option>
|
||||
<option value="PERSON">{{'label.person' | translate}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="createdatatableform" valattribute="apptable"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{ 'label.input.multirow' | translate }}</label>
|
||||
|
||||
@ -26,10 +26,9 @@
|
||||
<label class="control-label col-sm-2">{{ 'label.input.apptablename' | translate }}<span class="required">*</span></label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<select id="apptableName" ng-model="formData.apptableName" class="form-control" required="required">
|
||||
<select id="apptableName" ng-model="formData.apptableName" class="form-control" ng-change="legalFormChange(formData.apptableName)" required="required">
|
||||
<option class="width100" value="">{{'label.selectone' | translate}}</option>
|
||||
<option value="m_client_entity">{{'label.cliententity' | translate}}</option>
|
||||
<option value="m_client_person">{{'label.clientperson' | translate}}</option>
|
||||
<option value="m_client">{{'label.client' | translate}}</option>
|
||||
<option value="m_group">{{'label.group' | translate}}</option>
|
||||
<option value="m_center">{{'label.center' | translate}}</option>
|
||||
<option value="m_loan">{{'label.loan' | translate}}</option>
|
||||
@ -37,6 +36,16 @@
|
||||
<option value="m_savings_account">{{'label.savingsaccount' | translate}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-5" ng-show="showLegalForm">
|
||||
<label class="control-label col-sm-2" for="entitySubType">{{ 'label.input.legalForm' | translate }}<span
|
||||
class="required">*</span></label>
|
||||
<div class="col-sm-7">
|
||||
<select id="entitySubType" ng-model="formData.entitySubType" name="entitySubType" class="form-control" required>
|
||||
<option value="ENTITY">{{'label.entity' | translate}}</option>
|
||||
<option value="PERSON">{{'label.person' | translate}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{ 'label.input.addcolumns' | translate }}</label>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user