RS - platform dependent record set typepublic class SrBlnc<RS> extends Object implements ISrBlnc
Service that maintenance Blnc and implements dirty check for all account. If balance for account at given date is NULL then it will be no record Blnc, this is cheap approach. All work include recalculation all balances is executed in single transaction. It works if there is any entry.
| Constructor and Description |
|---|
SrBlnc() |
| Modifier and Type | Method and Description |
|---|---|
int |
chngSacsIfNd(Map<String,Object> pRvs)
Changes if need entries Entr.sacNm, Entr.sadNm, Blnc.SaNm.
|
Date |
evBlStDt(Map<String,Object> pRvs,
Map<String,Object> pVs)
Evaluate date start of stored balances according settings,
this is the first month of the first accounting entry.
|
org.beigesoft.mdl.EPeriod |
evBlStPer(Map<String,Object> pRvs,
Map<String,Object> pVs)
Evaluate period of stored balances according settings,
if it's changed then it switch on "current balances are dirty".
|
Date |
evDtNxtPerSt(Map<String,Object> pRvs,
Map<String,Object> pVs,
Date pDtFor)
Evaluate date start of next balance store period.
|
Date |
evDtPrvPerSt(Map<String,Object> pRvs,
Map<String,Object> pVs,
Date pDtFor)
Evaluate date start of previous balance store period.
|
Date |
evDtStPer(Map<String,Object> pRvs,
Date pDtFor)
Evaluate start of period nearest to pDtFor.
|
String |
evQuBlnc(Map<String,Object> pRvs,
Date pDt)
Evaluate Trial Balance query.
|
boolean |
getIsAndr()
Getter for isAndr.
|
org.beigesoft.log.ILog |
getLog()
Geter for log.
|
org.beigesoft.rdb.IOrm |
getOrm()
Getter for orm.
|
String |
getQuBlnc()
Getter for quBlnc.
|
org.beigesoft.rdb.IRdb<RS> |
getRdb()
Geter for rdb.
|
ISrAcStg |
getSrAcStg()
Getter for srAcStg.
|
org.beigesoft.rdb.SrvClVl |
getSrvClVl()
Getter for srvClVl.
|
void |
hndNewEntr(Map<String,Object> pRvs,
Date pDtAt)
Handle new accounting entry to check dirty of stored balances.
|
void |
hndRlBk(Map<String,Object> pRvs)
Handle rollback, e.g.
|
void |
hndSacntCh(Map<String,Object> pRvs,
ISacnt pSacnt)
Handle subaccount has been changed.
|
BlnCh |
lazBlnCh(Map<String,Object> pRvs,
Map<String,Object> pVs)
Lazy getter for blnCh.
|
String |
loadStr(String pFlNm)
Load string file (usually SQL query).
|
void |
recalc(Map<String,Object> pRvs,
Map<String,Object> pVs,
Date pDtFor)
Forced recalculation all balances for all dates less
or equals maximum (pDtFor, max date entry, max date balance).
|
boolean |
recalcIfNd(Map<String,Object> pRvs,
Date pDtFor)
Recalculate if need for all balances for all dates less
or equals maximum (pDtFor, max date entry, max date balance),
this method is always invoked by reports.
|
List<TrBlLn> |
retBlnLnsToSv(String pQu)
Retrieve Trial Balance lines with given query to save into DB.
|
List<TrBlLn> |
retTrBlnc(Map<String,Object> pRvs,
Date pDt)
Retrieve Trial Balance report.
|
void |
setIsAndr(boolean pIsAndr)
Setter for isAndr.
|
void |
setLog(org.beigesoft.log.ILog pLog)
Setter for log.
|
void |
setOrm(org.beigesoft.rdb.IOrm pOrm)
Setter for orm.
|
void |
setQuBlnc(String pQuBlnc)
Setter for quBlnc.
|
void |
setRdb(org.beigesoft.rdb.IRdb<RS> pRdb)
Setter for rdb.
|
void |
setSrAcStg(ISrAcStg pSrAcStg)
Setter for srAcStg.
|
void |
setSrvClVl(org.beigesoft.rdb.SrvClVl pSrvClVl)
Setter for srvClVl.
|
public final List<TrBlLn> retTrBlnc(Map<String,Object> pRvs, Date pDt) throws Exception
Retrieve Trial Balance report.
public final boolean recalcIfNd(Map<String,Object> pRvs, Date pDtFor) throws Exception
Recalculate if need for all balances for all dates less or equals maximum (pDtFor, max date entry, max date balance), this method is always invoked by reports.
recalcIfNd in interface ISrBlncpRvs - Request scoped variablespDtFor - date forException - - an exceptionpublic final void hndNewEntr(Map<String,Object> pRvs, Date pDtAt) throws Exception
Handle new accounting entry to check dirty of stored balances.
hndNewEntr in interface ISrBlncpRvs - Request scoped variablespDtAt - date atException - - an exceptionpublic final Date evDtStPer(Map<String,Object> pRvs, Date pDtFor) throws Exception
Evaluate start of period nearest to pDtFor. Tested in blc org.beigesoft.test.CalendarTest.
public final int chngSacsIfNd(Map<String,Object> pRvs) throws Exception
Changes if need entries Entr.sacNm, Entr.sadNm, Blnc.SaNm. It should be invoked together with recalcIfNd, and service must be locked (synchronized).
chngSacsIfNd in interface ISrBlncpRvs - Request scoped variablesException - - an exceptionpublic final void hndSacntCh(Map<String,Object> pRvs, ISacnt pSacnt) throws Exception
Handle subaccount has been changed.
hndSacntCh in interface ISrBlncpRvs - Request scoped variablespSacnt - subaccountException - - an exceptionpublic final Date evDtNxtPerSt(Map<String,Object> pRvs, Map<String,Object> pVs, Date pDtFor) throws Exception
Evaluate date start of next balance store period. Tested in blc org.beigesoft.test.CalendarTest.
evDtNxtPerSt in interface ISrBlncpRvs - Request scoped variablespVs - Invoker scoped variablespDtFor - date forException - - an exceptionpublic final Date evDtPrvPerSt(Map<String,Object> pRvs, Map<String,Object> pVs, Date pDtFor) throws Exception
Evaluate date start of previous balance store period. Tested in blc org.beigesoft.test.CalendarTest.
evDtPrvPerSt in interface ISrBlncpRvs - Request scoped variablespVs - Invoker scoped variablespDtFor - date forException - - an exceptionpublic final void hndRlBk(Map<String,Object> pRvs) throws Exception
Handle rollback, e.g. clears cached data.
hndRlBk in interface org.beigesoft.hnd.IHnTrRlBkpRvs - Request scoped variablesException - - an exceptionpublic final void recalc(Map<String,Object> pRvs, Map<String,Object> pVs, Date pDtFor) throws Exception
Forced recalculation all balances for all dates less or equals maximum (pDtFor, max date entry, max date balance). If balance for account at given date is NULL then it will be no recorded into Blnc, this is cheap approach.
pRvs - Request scoped variablespVs - Invoker scoped variablespDtFor - date forException - - an exceptionpublic final org.beigesoft.mdl.EPeriod evBlStPer(Map<String,Object> pRvs, Map<String,Object> pVs) throws Exception
Evaluate period of stored balances according settings, if it's changed then it switch on "current balances are dirty".
pRvs - Request scoped variablespVs - Invoker scoped variablesException - - an exceptionpublic final Date evBlStDt(Map<String,Object> pRvs, Map<String,Object> pVs) throws Exception
Evaluate date start of stored balances according settings, this is the first month of the first accounting entry. It also may change date start in BlnCh.
pRvs - Request scoped variablespVs - Invoker scoped variablesException - - an exceptionpublic final String evQuBlnc(Map<String,Object> pRvs, Date pDt) throws Exception
Evaluate Trial Balance query.
pRvs - Request scoped variablespDt - date of balanceException - - an exceptionpublic final List<TrBlLn> retBlnLnsToSv(String pQu) throws Exception
Retrieve Trial Balance lines with given query to save into DB.
pQu - dateException - - an exceptionpublic final String loadStr(String pFlNm) throws IOException
Load string file (usually SQL query).
pFlNm - file nameIOException - - IO exceptionpublic final BlnCh lazBlnCh(Map<String,Object> pRvs, Map<String,Object> pVs) throws Exception
Lazy getter for blnCh.
pRvs - Request scoped variablespVs - Invoker scoped variablesException - - an exceptionpublic final org.beigesoft.rdb.IOrm getOrm()
Getter for orm.
public final void setOrm(org.beigesoft.rdb.IOrm pOrm)
Setter for orm.
pOrm - referencepublic final org.beigesoft.rdb.IRdb<RS> getRdb()
Geter for rdb.
public final void setRdb(org.beigesoft.rdb.IRdb<RS> pRdb)
Setter for rdb.
pRdb - referencepublic final String getQuBlnc()
Getter for quBlnc.
public final void setQuBlnc(String pQuBlnc)
Setter for quBlnc.
pQuBlnc - referencepublic final org.beigesoft.log.ILog getLog()
Geter for log.
public final void setLog(org.beigesoft.log.ILog pLog)
Setter for log.
pLog - referencepublic final ISrAcStg getSrAcStg()
Getter for srAcStg.
public final void setSrAcStg(ISrAcStg pSrAcStg)
Setter for srAcStg.
pSrAcStg - referencepublic final org.beigesoft.rdb.SrvClVl getSrvClVl()
Getter for srvClVl.
public final void setSrvClVl(org.beigesoft.rdb.SrvClVl pSrvClVl)
Setter for srvClVl.
pSrvClVl - referencepublic final boolean getIsAndr()
Getter for isAndr.
public final void setIsAndr(boolean pIsAndr)
Setter for isAndr.
pIsAndr - referenceCopyright © 2019. All rights reserved.