Skip to content

Commit

Permalink
Anomaly RM#89736: Batch accounting Cutoff does not link anomaly
Browse files Browse the repository at this point in the history
  • Loading branch information
bsu-axelor committed Feb 14, 2025
1 parent 6eeec00 commit ca28bcb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,18 @@ public BatchAccountingCutOff(

@Override
protected void process() {
AccountingBatch accountingBatch = batch.getAccountingBatch();
try {
AccountingBatch accountingBatch = batch.getAccountingBatch();

LocalDate moveDate = accountingBatch.getMoveDate();
int accountingCutOffTypeSelect = accountingBatch.getAccountingCutOffTypeSelect();
this.updateBatch(moveDate, accountingCutOffTypeSelect);
LocalDate moveDate = accountingBatch.getMoveDate();
int accountingCutOffTypeSelect = accountingBatch.getAccountingCutOffTypeSelect();
this.updateBatch(moveDate, accountingCutOffTypeSelect);

super.process();
super.process();
} catch (Exception e) {
TraceBackService.trace(e, null, batch.getId());
incrementAnomaly();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,30 @@ public BatchAccountingCutOffSupplyChain(

@Override
protected void process() {
AccountingBatch accountingBatch = batch.getAccountingBatch();

LocalDate moveDate = accountingBatch.getMoveDate();
int accountingCutOffTypeSelect = accountingBatch.getAccountingCutOffTypeSelect();
updateBatch(moveDate, accountingCutOffTypeSelect);
try {
AccountingBatch accountingBatch = batch.getAccountingBatch();

if (accountingCutOffTypeSelect
< AccountingBatchRepository.ACCOUNTING_CUT_OFF_TYPE_PREPAID_EXPENSES) {
if (this.recordIdList == null) {
this._processStockMovesByQuery(accountingBatch);
} else {
this._processStockMovesByIds(accountingBatch);
}
} else {
if (this.recordIdList == null) {
this._processByQuery(accountingBatch);
LocalDate moveDate = accountingBatch.getMoveDate();
int accountingCutOffTypeSelect = accountingBatch.getAccountingCutOffTypeSelect();
updateBatch(moveDate, accountingCutOffTypeSelect);

if (accountingCutOffTypeSelect
< AccountingBatchRepository.ACCOUNTING_CUT_OFF_TYPE_PREPAID_EXPENSES) {
if (this.recordIdList == null) {
this._processStockMovesByQuery(accountingBatch);
} else {
this._processStockMovesByIds(accountingBatch);
}
} else {
this._processByIds(accountingBatch);
if (this.recordIdList == null) {
this._processByQuery(accountingBatch);
} else {
this._processByIds(accountingBatch);
}
}
} catch (Exception e) {
TraceBackService.trace(e, null, batch.getId());
incrementAnomaly();
}
}

Expand Down
3 changes: 3 additions & 0 deletions changelogs/unreleased/89736.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: "Accounting batch: fixed the issue where batch accounting cut-off does not link anomaly."
module: axelor-account

0 comments on commit ca28bcb

Please sign in to comment.