desactiver le lettrage Provisoire = MoveLine
This commit is contained in:
@@ -948,11 +948,26 @@ public class MoveLineService {
|
||||
*
|
||||
* @param moveLineList
|
||||
*/
|
||||
public void reconcileMoveLinesWithCacheManagement(List<MoveLine> moveLineList) {
|
||||
public void reconcileMoveLinesWithCacheManagement(List<MoveLine> moveLineList) throws AxelorException{
|
||||
|
||||
List<MoveLine> reconciliableCreditMoveLineList = getReconciliableCreditMoveLines(moveLineList);
|
||||
List<MoveLine> reconciliableDebitMoveLineList = getReconciliableDebitMoveLines(moveLineList);
|
||||
|
||||
//pour desactiver le lettrage (Provisoire)
|
||||
BigDecimal totalDebit = BigDecimal.ZERO;
|
||||
BigDecimal totalCredit = BigDecimal.ZERO;
|
||||
|
||||
if (reconciliableCreditMoveLineList.size() > 0 && reconciliableDebitMoveLineList.size() > 0) {
|
||||
for (MoveLine moveLine : reconciliableCreditMoveLineList) {
|
||||
totalCredit = totalCredit.add(moveLine.getCredit());
|
||||
}
|
||||
for (MoveLine moveLine : reconciliableDebitMoveLineList) {
|
||||
totalDebit = totalDebit.add(moveLine.getDebit());
|
||||
}
|
||||
}
|
||||
//pour desactiver le lettrage (Provisoire)
|
||||
|
||||
if(totalDebit.equals(totalCredit)){
|
||||
Map<List<Object>, Pair<List<MoveLine>, List<MoveLine>>> moveLineMap = new HashMap<>();
|
||||
|
||||
populateCredit(moveLineMap, reconciliableCreditMoveLineList);
|
||||
@@ -973,6 +988,11 @@ public class MoveLineService {
|
||||
} finally {
|
||||
JPA.clear();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
throw new AxelorException(
|
||||
TraceBackRepository.CATEGORY_CONFIGURATION_ERROR,
|
||||
"(total Credit ="+totalCredit+") != (total Debit="+totalDebit+")");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user