use of com.axelor.apps.account.db.ReconcileGroup in project axelor-open-suite by axelor.
the class ReconcileGroupServiceImpl method mergeReconcileGroups.
@Override
@Transactional
public ReconcileGroup mergeReconcileGroups(List<ReconcileGroup> reconcileGroupList) {
Company company = reconcileGroupList.get(0).getCompany();
ReconcileGroup reconcileGroup = createReconcileGroup(company);
List<Reconcile> reconcileList = reconcileRepository.all().filter("self.reconcileGroup.id IN (:reconcileGroupIds)").bind("reconcileGroupIds", reconcileGroupList.stream().map(ReconcileGroup::getId).collect(Collectors.toList())).fetch();
reconcileList.forEach(reconcile -> addToReconcileGroup(reconcileGroup, reconcile));
for (ReconcileGroup toDeleteReconcileGroup : reconcileGroupList) {
reconcileGroupRepository.remove(toDeleteReconcileGroup);
}
return reconcileGroupRepository.save(reconcileGroup);
}
use of com.axelor.apps.account.db.ReconcileGroup in project axelor-open-suite by axelor.
the class ReconcileServiceImpl method addToReconcileGroup.
@Override
public void addToReconcileGroup(Reconcile reconcile) throws AxelorException {
ReconcileGroupService reconcileGroupService = Beans.get(ReconcileGroupService.class);
ReconcileGroup reconcileGroup = reconcileGroupService.findOrCreateGroup(reconcile);
reconcileGroupService.addAndValidate(reconcileGroup, reconcile);
}
Aggregations