Merge branch 'develop' of github.com:openMF/mifosx into develop
This commit is contained in:
+1
-1
@@ -185,7 +185,7 @@ public class ProductToGLAccountMappingHelper {
|
|||||||
* Accounts in the system
|
* Accounts in the system
|
||||||
**/
|
**/
|
||||||
final Set<Long> existingCharges = new HashSet<>();
|
final Set<Long> existingCharges = new HashSet<>();
|
||||||
if (chargeToIncomeAccountMappingArray != null && chargeToIncomeAccountMappingArray.size() > 0) {
|
if (chargeToIncomeAccountMappingArray != null) {
|
||||||
if (changes != null) {
|
if (changes != null) {
|
||||||
changes.put(arrayFragmentName, command.jsonFragment(arrayFragmentName));
|
changes.put(arrayFragmentName, command.jsonFragment(arrayFragmentName));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,6 +217,10 @@ public final class Group extends AbstractPersistable<Long> {
|
|||||||
|
|
||||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||||
activate(currentUser, activationLocalDate, dataValidationErrors);
|
activate(currentUser, activationLocalDate, dataValidationErrors);
|
||||||
|
if (this.isCenter() && this.hasStaff()) {
|
||||||
|
Staff staff = this.getStaff();
|
||||||
|
this.reassignStaff(staff, activationLocalDate);
|
||||||
|
}
|
||||||
throwExceptionIfErrors(dataValidationErrors);
|
throwExceptionIfErrors(dataValidationErrors);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -492,6 +496,11 @@ public final class Group extends AbstractPersistable<Long> {
|
|||||||
return this.groupMembers.contains(group);
|
return this.groupMembers.contains(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasStaff() {
|
||||||
|
if (this.staff != null) { return true; }
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> associateGroups(final Set<Group> groupMembersSet) {
|
public List<String> associateGroups(final Set<Group> groupMembersSet) {
|
||||||
|
|
||||||
final List<String> differences = new ArrayList<>();
|
final List<String> differences = new ArrayList<>();
|
||||||
@@ -635,7 +644,7 @@ public final class Group extends AbstractPersistable<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// StaffAssignmentHistory[during center creation]
|
// 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) {
|
if (this.isCenter() && this.isActive() && staff != null) {
|
||||||
this.staff = newStaff;
|
this.staff = newStaff;
|
||||||
final StaffAssignmentHistory staffAssignmentHistory = StaffAssignmentHistory.createNew(this, this.staff, assignmentDate);
|
final StaffAssignmentHistory staffAssignmentHistory = StaffAssignmentHistory.createNew(this, this.staff, assignmentDate);
|
||||||
|
|||||||
+1
-1
@@ -189,7 +189,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
|||||||
newGroup.generateHierarchy();
|
newGroup.generateHierarchy();
|
||||||
|
|
||||||
this.groupRepository.saveAndFlush(newGroup);
|
this.groupRepository.saveAndFlush(newGroup);
|
||||||
newGroup.caputreStaffHistoryDuringCenterCreation(staff, activationDate);
|
newGroup.captureStaffHistoryDuringCenterCreation(staff, activationDate);
|
||||||
return new CommandProcessingResultBuilder() //
|
return new CommandProcessingResultBuilder() //
|
||||||
.withCommandId(command.commandId()) //
|
.withCommandId(command.commandId()) //
|
||||||
.withOfficeId(groupOffice.getId()) //
|
.withOfficeId(groupOffice.getId()) //
|
||||||
|
|||||||
Reference in New Issue
Block a user