Merge branch 'develop' of github.com:openMF/mifosx into develop

This commit is contained in:
Vishwas Babu A J
2015-03-04 23:30:14 +05:30
3 changed files with 12 additions and 3 deletions
@@ -185,7 +185,7 @@ public class ProductToGLAccountMappingHelper {
* Accounts in the system
**/
final Set<Long> existingCharges = new HashSet<>();
if (chargeToIncomeAccountMappingArray != null && chargeToIncomeAccountMappingArray.size() > 0) {
if (chargeToIncomeAccountMappingArray != null) {
if (changes != null) {
changes.put(arrayFragmentName, command.jsonFragment(arrayFragmentName));
}
@@ -217,6 +217,10 @@ public final class Group extends AbstractPersistable<Long> {
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
activate(currentUser, activationLocalDate, dataValidationErrors);
if (this.isCenter() && this.hasStaff()) {
Staff staff = this.getStaff();
this.reassignStaff(staff, activationLocalDate);
}
throwExceptionIfErrors(dataValidationErrors);
}
@@ -492,6 +496,11 @@ public final class Group extends AbstractPersistable<Long> {
return this.groupMembers.contains(group);
}
public boolean hasStaff() {
if (this.staff != null) { return true; }
return false;
}
public List<String> associateGroups(final Set<Group> groupMembersSet) {
final List<String> differences = new ArrayList<>();
@@ -635,7 +644,7 @@ public final class Group extends AbstractPersistable<Long> {
}
// StaffAssignmentHistory[during center creation]
public void caputreStaffHistoryDuringCenterCreation(final Staff newStaff, final LocalDate assignmentDate) {
public void captureStaffHistoryDuringCenterCreation(final Staff newStaff, final LocalDate assignmentDate) {
if (this.isCenter() && this.isActive() && staff != null) {
this.staff = newStaff;
final StaffAssignmentHistory staffAssignmentHistory = StaffAssignmentHistory.createNew(this, this.staff, assignmentDate);
@@ -189,7 +189,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
newGroup.generateHierarchy();
this.groupRepository.saveAndFlush(newGroup);
newGroup.caputreStaffHistoryDuringCenterCreation(staff, activationDate);
newGroup.captureStaffHistoryDuringCenterCreation(staff, activationDate);
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withOfficeId(groupOffice.getId()) //