Merge branch 'master' into develop

This commit is contained in:
Vishwas Babu A J
2015-08-06 14:01:53 -07:00
4 changed files with 35 additions and 26 deletions
@@ -6,7 +6,6 @@
package org.mifosplatform.accounting.journalentry.handler;
import org.mifosplatform.accounting.journalentry.service.JournalEntryWritePlatformService;
import org.mifosplatform.commands.annotation.CommandType;
import org.mifosplatform.commands.handler.NewCommandSourceHandler;
import org.mifosplatform.infrastructure.core.api.JsonCommand;
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
@@ -15,7 +14,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@CommandType(entity = "JOURNALENTRY", action = "CREATE")
public class CreateJournalEntryCommandHandler implements NewCommandSourceHandler {
private final JournalEntryWritePlatformService writePlatformService;
@@ -6,7 +6,6 @@
package org.mifosplatform.accounting.journalentry.handler;
import org.mifosplatform.accounting.journalentry.service.JournalEntryWritePlatformService;
import org.mifosplatform.commands.annotation.CommandType;
import org.mifosplatform.commands.handler.NewCommandSourceHandler;
import org.mifosplatform.infrastructure.core.api.JsonCommand;
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
@@ -15,7 +14,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@CommandType(entity = "JOURNALENTRY", action = "REVERSE")
public class ReverseJournalEntryCommandHandler implements NewCommandSourceHandler {
private final JournalEntryWritePlatformService writePlatformService;
@@ -119,6 +119,10 @@ public class CommandWrapper {
return this.actionName.equalsIgnoreCase("CREATE");
}
public boolean isReverse() {
return this.actionName.equalsIgnoreCase("REVERSE");
}
public boolean isCreateDatatable() {
return this.actionName.equalsIgnoreCase("CREATE") && this.href.startsWith("/datatables/") && this.entityId == null;
}
@@ -184,6 +188,7 @@ public class CommandWrapper {
public Long getSubentityId() {
return this.subentityId;
}
public String getTransactionId() {
return this.transactionId;
}
@@ -212,6 +217,10 @@ public class CommandWrapper {
return this.href.startsWith("/survey/");
}
public boolean isJournalEntryResource() {
return this.entityName.equalsIgnoreCase("JOURNALENTRY");
}
public boolean isRegisterSurvey() {
return this.actionName.equalsIgnoreCase("REGISTER");
}
@@ -164,7 +164,7 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer
} else {
throw new UnsupportedCommandException(wrapper.commandName());
}
} else if (wrapper.isSurveyResource()) {
} else if (wrapper.isSurveyResource()) {
if (wrapper.isRegisterSurvey()) {
handler = this.applicationContext.getBean("registerSurveyCommandHandler", NewCommandSourceHandler.class);
} else if (wrapper.isFullFilSurvey()) {
@@ -172,7 +172,7 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer
} else {
throw new UnsupportedCommandException(wrapper.commandName());
}
} else if (wrapper.isLoanDisburseDetailResource()) {
} else if (wrapper.isLoanDisburseDetailResource()) {
if (wrapper.isUpdateDisbursementDate()) {
handler = this.applicationContext.getBean("updateLoanDisbuseDateCommandHandler", NewCommandSourceHandler.class);
} else if (wrapper.addAndDeleteDisbursementDetails()) {
@@ -180,10 +180,14 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer
} else {
throw new UnsupportedCommandException(wrapper.commandName());
}
}
else {
handler = this.commandHandlerProvider.getHandler(wrapper.entityName(), wrapper.actionName());
} else if (wrapper.isJournalEntryResource()) {
if (wrapper.isCreate()) {
handler = this.applicationContext.getBean("createJournalEntryCommandHandler", NewCommandSourceHandler.class);
} else if (wrapper.isReverse()) {
handler = this.applicationContext.getBean("reverseJournalEntryCommandHandler", NewCommandSourceHandler.class);
}
} else {
handler = this.commandHandlerProvider.getHandler(wrapper.entityName(), wrapper.actionName());
}
return handler;