Commit d6d78c4c authored by Atul Gaware's avatar Atul Gaware Committed by Atul Gaware
Browse files

Fixes BUG-0045372: The process "Reset accounting" modifies

records with the period closed

** Get records between the lowest date of the dateFrom and
the periodStartDate, and the highest date from dateTo
and periodEndDate
parent b0165a99
......@@ -180,20 +180,8 @@ public class ResetAccounting {
" and e.accountingDate >= :dateFrom" +
" and e.accountingDate <= :dateTo";
final String exceptionsSql = myQuery + consDate;
consDate +=
" and not exists " +
" (" +
" select a" +
" from FinancialMgmtAccountingFact a" +
" where a.recordID = e.recordID" +
" and a.table.id = e.table.id" +
" and" +
" (" +
" a.accountingDate < :dateFrom" +
" or a.accountingDate > :dateTo" +
" )" +
" )";
consDate += " and e.accountingDate >= :periodStartDate "+
" and e.accountingDate <= :periodEndDate ";
final Query<String> query = OBDal.getInstance()
.getSession()
.createQuery(myQuery + consDate, String.class)
......@@ -206,6 +194,8 @@ public class ResetAccounting {
: p[0])
.setParameter("dateTo",
StringUtils.isNotEmpty(strdateto) ? OBDateUtils.getDate(strdateto) : p[1])
.setParameter("periodStartDate", p[0])
.setParameter("periodEndDate", p[1])
.setParameter("organizationId", organization);
if (localRecordId != null && !"".equals(localRecordId)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment