From 56f56863790e0d02bfdf4fea180acb58adb6203b Mon Sep 17 00:00:00 2001 From: Rahul Pawar Date: Tue, 28 Dec 2021 18:31:42 +0530 Subject: [PATCH] FINERACT-1375:ClientEntityPersonDataTable (#3444) Merging as we got approval from @luckyman20 --- app/global-translations/locale-en.json | 2 ++ .../client/ViewClientController.js | 21 +++++++++++++++---- app/views/clients/createclient.html | 4 ++-- app/views/system/createdatatable.html | 15 ++++++------- app/views/system/editdatatable.html | 3 ++- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/app/global-translations/locale-en.json b/app/global-translations/locale-en.json index 6254f29e..8ebafa7d 100644 --- a/app/global-translations/locale-en.json +++ b/app/global-translations/locale-en.json @@ -2797,6 +2797,8 @@ "label.loan": "Loan", "label.savingsaccount": "Savings account", "label.client": "Client", + "label.cliententity": "Client_Entity", + "label.clientperson": "Client_Person", "label.group": "Group", "label.center": "Center", "label.office": "Office", diff --git a/app/scripts/controllers/client/ViewClientController.js b/app/scripts/controllers/client/ViewClientController.js index 9ae5bdb2..763919d3 100644 --- a/app/scripts/controllers/client/ViewClientController.js +++ b/app/scripts/controllers/client/ViewClientController.js @@ -16,6 +16,7 @@ scope.showRecurring = false; scope.updateDefaultSavings = false; scope.charges = []; + scope.legalform = 'm_client'; // address @@ -269,7 +270,23 @@ resourceFactory.runReportsResource.get({reportSource: 'ClientSummary', genericResultSet: 'false', R_clientId: routeParams.id}, function (data) { scope.client.ClientSummary = data[0]; }); + + 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.deleteClient = function () { $uibModal.open({ templateUrl: 'deleteClient.html', @@ -664,10 +681,6 @@ }); }; - resourceFactory.DataTablesResource.getAllDataTables({apptable: 'm_client'}, function (data) { - scope.clientdatatables = data; - }); - scope.dataTableChange = function (clientdatatable) { resourceFactory.DataTablesResource.getTableDetails({datatablename: clientdatatable.registeredTableName, entityId: routeParams.id, genericResultSet: 'true'}, function (data) { diff --git a/app/views/clients/createclient.html b/app/views/clients/createclient.html index 01772976..b22cca50 100755 --- a/app/views/clients/createclient.html +++ b/app/views/clients/createclient.html @@ -37,7 +37,7 @@
- +
- - - - - - - + + + + + + + +
diff --git a/app/views/system/editdatatable.html b/app/views/system/editdatatable.html index 5954a3c7..fedc0129 100644 --- a/app/views/system/editdatatable.html +++ b/app/views/system/editdatatable.html @@ -28,7 +28,8 @@