diff --git a/mifosng-provider/src/main/java/org/mifosplatform/commands/domain/CommandWrapper.java b/mifosng-provider/src/main/java/org/mifosplatform/commands/domain/CommandWrapper.java index 1ff8fcd4f..e492f0a87 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/commands/domain/CommandWrapper.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/commands/domain/CommandWrapper.java @@ -292,4 +292,18 @@ public class CommandWrapper { return this.actionName + "_" + this.entityName; } + public boolean isLoanDisburseDetailResource() { + return this.entityName.equalsIgnoreCase("DISBURSEMENTDETAIL"); + } + + public boolean isUpdateDisbursementDate() { + return this.actionName.equalsIgnoreCase("UPDATE") && this.entityName.equalsIgnoreCase("DISBURSEMENTDETAIL") + && this.entityId != null; + } + + public boolean addAndDeleteDisbursementDetails() { + return this.actionName.equalsIgnoreCase("UPDATE") && this.entityName.equalsIgnoreCase("DISBURSEMENTDETAIL") + && this.entityId == null; + } + } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java b/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java index cf48825fb..07ddee1ad 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java @@ -172,7 +172,15 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer } else { throw new UnsupportedCommandException(wrapper.commandName()); } - } + } else if (wrapper.isLoanDisburseDetailResource()) { + if (wrapper.isUpdateDisbursementDate()) { + handler = this.applicationContext.getBean("updateLoanDisbuseDateCommandHandler", NewCommandSourceHandler.class); + } else if (wrapper.addAndDeleteDisbursementDetails()) { + handler = this.applicationContext.getBean("addAndDeleteLoanDisburseDetailsCommandHandler", NewCommandSourceHandler.class); + } else { + throw new UnsupportedCommandException(wrapper.commandName()); + } + } else { handler = this.commandHandlerProvider.getHandler(wrapper.entityName(), wrapper.actionName());