diff --git a/app/global-translations/locale-en.json b/app/global-translations/locale-en.json index 48e12b98..2be5aff9 100755 --- a/app/global-translations/locale-en.json +++ b/app/global-translations/locale-en.json @@ -594,7 +594,8 @@ "label.anchor.rejecttransfer": "Reject Transfer Client", "label.anchor.undotransfer": "Undo Transfer Client", "label.anchor.reactivate":"Reactivate", - + "label.anchor.undoReject":"Undo Rejection", + "label.anchor.undoWithdrawn":"Undo Withdrawal", "#Inputs": "..", "label.input.filterbynameaccno": "Filter display by name/client#/staff/office", "label.input.searchByNameAccNo" : "Find by name/mobile#/client#/externalId/identifier#", @@ -613,6 +614,7 @@ "label.input.withdrawalreason":"Withdrawal reason", "label.input.clientName":"Client Name", "label.input.clientId":"Client Id", + "label.input.reopeneddate":"Re Opened Date", "#Buttons": "..", "label.button.createclient": "Create Client", @@ -638,7 +640,8 @@ "label.button.clear": "Clear", "label.button.viewclosedshares":"View Closed Shares", "label.button.viewactiveshares":"View Active Shares", - + "label.button.undoReject":"Undo Rejection", + "label.button.undoWithdrawn":"Undo Withdrawal", "#Misc Labels": "..", "label.numofloancycles": "# of loan cycles", "label.lastloanamount": "Last loan amount", @@ -700,7 +703,15 @@ "validation.msg.CLIENTCHARGE.transaction.invalid.charge.amount.paid.in.access":"Excess payments are not allowed on Client charges", "validation.msg.CLIENTCHARGE.dueDate.cannot.be.blank":"Due date is mandatory for client charge", "validation.msg.CLIENTCHARGE.transaction.invalid.account.charge.is.already.waived":"Charge is already waived", - + "error.msg.client.reopened.date.cannot.before.client.rejected.date":"Reopened Date cannot be before Client Rejected Date", + "error.msg.client.reopened.date.cannot.before.client.withdrawal.date":"Reopened Date cannot be before Client Withdrawal Date", + "error.msg.clients.submittedOnDate.after.reopened.date":"Activation Date cannot be before Reopened Date", + "error.msg.client.rejection.date.cannot.before.client.submitted.date":"Rejection Date cannot be before Submitted Date", + "error.msg.client.withdrawal.date.cannot.before.client.submitted.date":"Withdrawn Date cannot be before Submitted Date", + "validation.msg.client.rejectionReasonId.cannot.be.blank":"Client Rejection reason cannot be blank", + "validation.msg.client.withdrawalReasonId.cannot.be.blank":"Client Withdrawal reason cannot be blank", + "validation.msg.client.rejectionDate.cannot.be.blank":"Client Rejection Date cannot be blank", + "validation.msg.client.withdrawalDate.cannot.be.blank":"Client Withrawal Date cannot be blank", "#--------": "------------", "#Groups": "....", diff --git a/app/scripts/controllers/client/ClientActionsController.js b/app/scripts/controllers/client/ClientActionsController.js index f2da8056..91ef930a 100644 --- a/app/scripts/controllers/client/ClientActionsController.js +++ b/app/scripts/controllers/client/ClientActionsController.js @@ -140,9 +140,36 @@ scope.showDateField = false; scope.taskPermissionName = 'REACTIVATE_CLIENT'; break; + case "undoReject": + resourceFactory.clientResource.get({clientId: routeParams.id}, function (data) { + scope.client = data; + if (data.timeline.submittedOnDate) { + scope.mindate = new Date(data.timeline.submittedOnDate); + } + }); + scope.labelName = 'label.input.reopeneddate'; + scope.breadcrumbName = 'label.anchor.undoReject'; + scope.modelName = 'reopenedDate'; + scope.showActivationDateField = true; + scope.showDateField = false; + scope.taskPermissionName = 'UNDOREJECT_CLIENT'; + break; + case "undoWithdrawn": + resourceFactory.clientResource.get({clientId: routeParams.id}, function (data) { + scope.client = data; + if (data.timeline.submittedOnDate) { + scope.mindate = new Date(data.timeline.submittedOnDate); + } + }); + scope.labelName = 'label.input.reopeneddate'; + scope.breadcrumbName = 'label.anchor.undoWithdrawn'; + scope.modelName = 'reopenedDate'; + scope.showActivationDateField = true; + scope.showDateField = false; + scope.taskPermissionName = 'UNDOWITHDRAWAL_CLIENT'; + break; } - scope.cancel = function () { location.path('/viewclient/' + routeParams.id); } @@ -194,6 +221,16 @@ location.path('/viewclient/' + data.clientId); }); } + if (scope.action == "undoReject") { + resourceFactory.clientResource.save({clientId: routeParams.id, command: 'undoRejection'}, this.formData, function (data) { + location.path('/viewclient/' + data.clientId); + }); + } + if (scope.action == "undoWithdrawn") { + resourceFactory.clientResource.save({clientId: routeParams.id, command: 'undoWithdrawal'}, this.formData, function (data) { + location.path('/viewclient/' + data.clientId); + }); + } if (scope.action == "acceptclienttransfer") { delete this.formData.locale; delete this.formData.dateFormat; diff --git a/app/scripts/models/clientStatus.js b/app/scripts/models/clientStatus.js index 638edc73..b9cb4077 100644 --- a/app/scripts/models/clientStatus.js +++ b/app/scripts/models/clientStatus.js @@ -60,6 +60,27 @@ taskPermissionName: "REACTIVATE_CLIENT" } + ], + "Rejected":[ + { + name: "label.button.undoReject", + href: "#/client", + subhref: "undoReject", + icon: "icon-ok-sign", + taskPermissionName: "UNDOREJECT_CLIENT" + } + + ], + "Withdrawn":[ + { + name: "label.button.undoWithdrawn", + href: "#/client", + subhref: "undoWithdrawn", + icon: "icon-ok-sign", + taskPermissionName: "UNDOWITHDRAWAL_CLIENT" + } + + ], "Active": [ { @@ -105,7 +126,8 @@ subhref: "close", icon: "icon-remove-circle", taskPermissionName: "CLOSE_CLIENT" - } + }, + ], "Transfer in progress": [ {