diff --git a/app/global-translations/locale-en.json b/app/global-translations/locale-en.json index 38b7d3432e..91181bb80a 100755 --- a/app/global-translations/locale-en.json +++ b/app/global-translations/locale-en.json @@ -5520,6 +5520,29 @@ "label.heading.editloanemipack":"Edit EMI Pack", "label.input.filterbytext":"Filter by Text", "label.heading.chooseloanemipack":"Choose EMI Pack", + "label.heading.possible.duplicate.matches":"There are possible duplicate matches, Review and choose Force Create to Activate", + "label.input.force.activate":"Force Activate", + "label.input.choose.client":"Choose Client for Compare", + "label.heading.current.client":"Current Client", + "label.heading.client.possible.match":"Client Possible Match", + "label.anchor.dedup":"Client Deduplication Weightages", + "label.anchor.dedup.description":"Manage Client attribute match weightages for Client Deduplication", + "label.heading.weightagesperson":"Weightages for Person", + "label.heading.weightagesentity":"Weightages for Entity", + "label.input.firstnameExact":"First Name Exact Match", + "label.input.firstnameLike":"First Name Like Match", + "label.input.middlenameExact":"Middle Name Exact Match", + "label.input.middlenameLike":"Middle Name Like Match", + "label.input.lastnameExact":"Last Name Exact Match", + "label.input.lastnameLike":"Last Name Like Match", + "label.input.fullnameExact":"Full Name Exact Match", + "label.input.fullnameLike":"Full Name Like Match", + "label.input.mobileNo":"Mobile Number Match", + "label.input.dateOfBirth":"Date of Birth Match", + "label.input.genderCvId":"Gender Match", + "label.input.incorpNo":"Incorporation Number Match", + "label.input.clientIdentifier":"Identifiers Match", + "label.heading.matchcriteria":"Matching Criteria", "label.button.changeemipack":"Change EMI Pack", "label.input.brokenperiodmethodtype":"Initial broken-period interest computation", "label.heading.brokenperiodmethodtype":"Initial broken-period interest computation", diff --git a/app/scripts/controllers/client/ClientActionsController.js b/app/scripts/controllers/client/ClientActionsController.js index 548450e6dc..240797ef86 100644 --- a/app/scripts/controllers/client/ClientActionsController.js +++ b/app/scripts/controllers/client/ClientActionsController.js @@ -14,11 +14,21 @@ switch (scope.action) { case "activate": - resourceFactory.clientResource.get({clientId: routeParams.id}, function (data) { + resourceFactory.clientResourceTemplate.getActivateTemplate({clientId: routeParams.id, command : 'activate'}, function (data) { scope.client = data; if (data.timeline.submittedOnDate) { scope.mindate = new Date(data.timeline.submittedOnDate); } + if(scope.client.possibleClientMatches){ + resourceFactory.clientIdenfierResource.getAll({clientId:scope.client.id}, function(data){ + if(data){ + scope.clientIdentities = data.sort(function(a,b) { + return (a.documentType.id > b.documentType.id) ? 1 + : ((b.documentType.id > a.documentType.id) ? -1 : 0);} ); + scope.client.identitiesCompiled = compileDocuments(scope.clientIdentities); + } + }); + } }); scope.labelName = 'label.input.activationdate'; scope.breadcrumbName = 'label.anchor.activate'; @@ -176,6 +186,70 @@ location.path('/viewclient/' + routeParams.id); } + scope.matchClient = function(clientId){ + if(scope.client.possibleClientMatches){ + var len = scope.client.possibleClientMatches.length; + for(var i=0; i b.documentType.id) ? 1 + : ((b.documentType.id > a.documentType.id) ? -1 : 0);} ); + scope.possibleMatch.identitiesCompiled = ""; + var len = scope.possibleMatchIdentities.length; + for(var i=0; i',scope.possibleMatchIdentities[index].documentType.name, ' : ', + scope.possibleMatchIdentities[index].documentKey, '
'); + scope.possibleMatchIdentities.splice(index,1); + } + } + scope.possibleMatch.identitiesCompiled += compileDocuments(scope.possibleMatchIdentities); + for(var i=0; i < scope.clientIdentities.length; i++){ + if(scope.possibleMatch.identitiesCompiled.indexOf(scope.clientIdentities[i].documentKey) >= 0){ + scope.possibleMatch.identitiesCompiled = scope.possibleMatch.identitiesCompiled + .replace(scope.clientIdentities[i].documentKey, + ''+scope.clientIdentities[i].documentKey+''); + scope.client.identitiesCompiled = scope.client.identitiesCompiled + .replace(scope.clientIdentities[i].documentKey, + ''+scope.clientIdentities[i].documentKey+''); + } + } + } + }); + } + } + + function compileDocuments(data) { + var len = data.length; + var str = ""; + for (var i = 0; i < len; i++) { + str = str.concat('', data[i].documentType.name, ' : ', data[i].documentKey,'
'); + } + return str; + } + + function containsDocumentType(a, obj) { + for (var i = 0; i < a.length; i++) { + if (a[i].documentType.id === obj.documentType.id) { + return i; + } + } + return -1; + } + scope.submit = function () { this.formData.locale = scope.optlang.code; this.formData.dateFormat = scope.df; @@ -185,7 +259,7 @@ if (scope.action == "activate") { var queryParams = {clientId: routeParams.id, command: 'activate'}; - if(scope.forcedSubmit){ + if(scope.forcedSubmit || scope.forceActivate){ queryParams = {clientId: routeParams.id, command: 'forceActivate'}; } resourceFactory.clientResource.save(queryParams, this.formData, function (data) { diff --git a/app/scripts/controllers/configurations/DedupController.js b/app/scripts/controllers/configurations/DedupController.js new file mode 100644 index 0000000000..ab7eb0ed48 --- /dev/null +++ b/app/scripts/controllers/configurations/DedupController.js @@ -0,0 +1,41 @@ +(function (module) { + mifosX.controllers = _.extend(module, { + DedupController: function (scope, resourceFactory, location, route) { + scope.data = {}; + scope.editPerson = false; + scope.editEntity = false; + resourceFactory.dedupResource.get(function (data) { + scope.data = data; + if(data[0].legalForm === 1){ + scope.person = data[0]; + }else{ + scope.entity = data[0]; + } + + if(data[1].legalForm === 1){ + scope.person = data[1]; + }else{ + scope.entity = data[1]; + } + }); + + scope.updatePerson = function () { + scope.person.locale = scope.optlang.code; + resourceFactory.dedupResource.update({id:1}, scope.person, function(data){ + route.reload(); + }) + }; + + scope.updateEntity = function () { + scope.entity.locale = scope.optlang.code; + resourceFactory.dedupResource.update({id:2}, scope.entity, function(data){ + route.reload(); + }) + }; + + } + }); + mifosX.ng.application.controller('DedupController', ['$scope', 'ResourceFactory', '$location', '$route', mifosX.controllers.DedupController]).run(function ($log) { + $log.info("DedupController initialized"); + }); +}(mifosX.controllers || {})); diff --git a/app/scripts/mifosXComponents.js b/app/scripts/mifosXComponents.js index 0e14bd554c..ff92bf260a 100755 --- a/app/scripts/mifosXComponents.js +++ b/app/scripts/mifosXComponents.js @@ -470,7 +470,8 @@ define(['Q', 'underscore', 'mifosX'], function (Q) { 'organization/funds/ViewFundController', 'organization/funds/EditFundController', 'organization/funds/AssignFundController', - 'main/AdvancedSearchController' + 'main/AdvancedSearchController', + 'configurations/DedupController' ], filters: [ 'StatusLookup', diff --git a/app/scripts/routes.js b/app/scripts/routes.js index a1435b5ff5..f66cb96296 100755 --- a/app/scripts/routes.js +++ b/app/scripts/routes.js @@ -1457,6 +1457,9 @@ .when('/addloanemipacks/:loanProductId', { templateUrl: 'views/products/loanemipacks/addloanemipacks.html' }) + .when('/dedup', { + templateUrl: 'views/administration/dedup.html' + }) .when('/editloanemipacks/:loanProductId/:loanEMIPackId', { templateUrl: 'views/products/loanemipacks/editloanemipacks.html' }) diff --git a/app/scripts/services/ResourceFactoryProvider.js b/app/scripts/services/ResourceFactoryProvider.js index b0d28e1ef6..fecda19e0e 100755 --- a/app/scripts/services/ResourceFactoryProvider.js +++ b/app/scripts/services/ResourceFactoryProvider.js @@ -54,6 +54,9 @@ getAllClientDocuments: {method: 'GET', params: {}, isArray: true}, update: { method: 'PUT'} }), + clientResourceTemplate: defineResource(apiVer + "/clients/:clientId/template", {clientId: '@clientId', command: '@command'}, { + getActivateTemplate: {method: 'GET', params: {command : 'activate'}} + }), clientChargesResource: defineResource(apiVer + "/clients/:clientId/charges/:resourceType", {clientId: '@clientId', resourceType: '@resourceType'}, { getCharges: {method: 'GET'}, waive:{method:'POST' , params:{command : 'waive'}} @@ -98,7 +101,8 @@ get: {method: 'GET', params: {}} }), clientIdenfierResource: defineResource(apiVer + "/clients/:clientId/identifiers/:id", {clientId: '@clientId', id: '@id'}, { - get: {method: 'GET', params: {}} + get: {method: 'GET', params: {}}, + getAll:{method: 'GET', params: {}, isArray:true} }), surveyTemplateResource: defineResource(apiVer + "/surveys/template", {}, { get: {method: 'GET', params: {}} @@ -500,6 +504,10 @@ get: {method: 'GET', params: {}}, update: {method: 'PUT', params: {}} }), + dedupResource: defineResource(apiVer + "/clientdedup/weightages/:id", {id: '@id'}, { + get: {method: 'GET', params: {}, isArray: true}, + update: {method: 'PUT', params: {}} + }), cacheResource: defineResource(apiVer + "/caches", {}, { get: {method: 'GET', params: {}, isArray: true}, update: {method: 'PUT', params: {}} diff --git a/app/styles/app.css b/app/styles/app.css index 78817c099c..b5406cebe3 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -1622,4 +1622,8 @@ figure { .statusreject { color:red; +} + +.highlight { + background-color:#98FB98; } \ No newline at end of file diff --git a/app/views/administration/dedup.html b/app/views/administration/dedup.html new file mode 100644 index 0000000000..46c824b780 --- /dev/null +++ b/app/views/administration/dedup.html @@ -0,0 +1,135 @@ +
+
+ +
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{'label.heading.weightagesperson' | translate}} +
+
+ + +
+
+
{{'label.input.firstnameExact' | translate}}{{person.firstnameExact}}
{{'label.input.firstnameLike' | translate}}{{person.firstnameLike}}
{{'label.input.middlenameExact' | translate}}{{person.middlenameExact}}
{{'label.input.middlenameLike' | translate}}{{person.middlenameLike}}
{{'label.input.lastnameExact' | translate}}{{person.lastnameExact}}
{{'label.input.lastnameLike' | translate}}{{person.lastnameLike}}
{{'label.input.mobileNo' | translate}}{{person.mobileNo}}
{{'label.input.dateOfBirth' | translate}}{{person.dateOfBirth}}
{{'label.input.genderCvId' | translate}}{{person.genderCvId}}
{{'label.input.clientIdentifier' | translate}}{{person.clientIdentifier}}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{'label.heading.weightagesentity' | translate}} +
+
+ + +
+
+
{{'label.input.fullnameExact' | translate}}{{entity.fullnameExact}}
{{'label.input.fullnameLike' | translate}}{{entity.fullnameLike}}
{{'label.input.mobileNo' | translate}}{{entity.mobileNo}}
{{'label.input.incorpNo' | translate}}{{entity.incorpNo}}
{{'label.input.clientIdentifier' | translate}}{{entity.clientIdentifier}}
+
+
+
+
diff --git a/app/views/administration/system.html b/app/views/administration/system.html index e31dfdcf59..60c9e8d7d7 100644 --- a/app/views/administration/system.html +++ b/app/views/administration/system.html @@ -94,6 +94,12 @@

&nb | translate}}

{{'label.anchor.surveys.description' | translate}}

+ +

  {{'label.anchor.dedup' + | translate}}

+ +

{{'label.anchor.dedup.description' | translate}}

+
\ No newline at end of file diff --git a/app/views/clients/clientactions.html b/app/views/clients/clientactions.html index 6d7dfd00d9..cc3c304421 100644 --- a/app/views/clients/clientactions.html +++ b/app/views/clients/clientactions.html @@ -63,6 +63,101 @@ +
+ +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{'label.heading.matchcriteria' | translate}}{{'label.heading.current.client' | translate}}{{'label.heading.client.possible.match' | translate}}
{{'label.heading.clientid' | translate}}{{client.id}}{{possibleMatch.id}}
{{'label.input.firstname' | translate}}{{client.firstname}}{{possibleMatch.firstname}}
{{'label.input.middlename' | translate}}{{client.middlename}}{{possibleMatch.middlename}}
{{'label.input.lastname' | translate}}{{client.lastname}}{{possibleMatch.lastname}}
{{'label.input.fullname' | translate}}{{client.fullname}}{{possibleMatch.fullname}}
{{'label.input.mobilenumber' | translate}}{{client.mobileNo}}{{possibleMatch.mobileNo}}
{{'label.input.gender' | translate}}{{client.gender.name | translate}}{{possibleMatch.gender.name | translate}}
{{'label.input.dateofbirth' | translate}}{{client.dateOfBirth | DateFormat}}{{possibleMatch.dateOfBirth | DateFormat}}
{{'label.input.incorpNumber' | translate}}{{client.clientNonPersonDetails.incorpNumber}}{{possibleMatch.clientNonPersonDetails.incorpNumber}}
{{'label.heading.identities' | translate}} + +
+
+