/** * <p>Recalculate if need for all balances for all dates less * or equals pDateFor, this method is always invoked by report ledger.</p> * @param pDateFor date for * @throws Exception - an exception **/ @Override public final synchronized void recalculateAllIfNeed( final Date pDateFor) throws Exception { evalBalanceStorePeriod(); //must be before evalDateBalanceStoreStart!!! evalDateBalanceStoreStart(); Date datePeriodStartFor = evalDatePeriodStartFor(pDateFor); if (datePeriodStartFor.getTime() > lazyGetBalanceAtAllDirtyCheck() .getCurrentBalanceDate().getTime() || lazyGetBalanceAtAllDirtyCheck() .getLeastAccountingEntryDate() .getTime() < lazyGetBalanceAtAllDirtyCheck() .getCurrentBalanceDate().getTime()) { recalculateAll(pDateFor, false); } }
recalculateAll(pAddParam, pDateFor, false); } else if (datePeriodStartFor.getTime() > this.balanceAtAllDirtyCheck .getCurrentBalanceDate().getTime() || this.balanceAtAllDirtyCheck .getLeastAccountingEntryDate() .getTime() < this.balanceAtAllDirtyCheck .getCurrentBalanceDate().getTime()) { recalculateAll(pAddParam, pDateFor, false);
if (lazyGetBalanceAtAllDirtyCheck().getLeastAccountingEntryDate() .getTime() < lazyGetBalanceAtAllDirtyCheck() .getCurrentBalanceDate().getTime()) { .getCurrentBalanceDate()); getLogger().info(SrvBalanceStd.class, SrvBalanceStd.class.getSimpleName() + ": recalculating balances from current end " + date + " <- " + lazyGetBalanceAtAllDirtyCheck().getCurrentBalanceDate()); .getCurrentBalanceDate()); getSrvOrm().updateEntity(lazyGetBalanceAtAllDirtyCheck()); getLogger().info(SrvBalanceStd.class, SrvBalanceStd.class.getSimpleName()
if (this.balanceAtAllDirtyCheck.getLeastAccountingEntryDate() .getTime() < this.balanceAtAllDirtyCheck .getCurrentBalanceDate().getTime()) { this.balanceAtAllDirtyCheck.getCurrentBalanceDate()); getLogger().info(null, SrvBalanceStd.class, "recalculating balances from current end " + date + " <- " + this.balanceAtAllDirtyCheck.getCurrentBalanceDate()); .getCurrentBalanceDate()); getSrvOrm() .updateEntity(pAddParam, this.balanceAtAllDirtyCheck);