use of org.kuali.kfs.gl.businessobject.SufficientFundRebuild in project cu-kfs by CU-CommunityApps.
the class Account method preUpdate.
@Override
protected void preUpdate() {
super.preUpdate();
try {
// KULCOA-549: update the sufficient funds table
// get the current data from the database
BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
Account originalAcct = (Account) boService.retrieve(this);
if (originalAcct != null) {
if (!originalAcct.getSufficientFundsCode().equals(getSufficientFundsCode()) || originalAcct.isExtrnlFinEncumSufficntFndIndicator() != isExtrnlFinEncumSufficntFndIndicator() || originalAcct.isIntrnlFinEncumSufficntFndIndicator() != isIntrnlFinEncumSufficntFndIndicator() || originalAcct.isPendingAcctSufficientFundsIndicator() != isPendingAcctSufficientFundsIndicator() || originalAcct.isFinPreencumSufficientFundIndicator() != isFinPreencumSufficientFundIndicator()) {
SufficientFundRebuild sfr = new SufficientFundRebuild();
sfr.setAccountFinancialObjectTypeCode(SufficientFundRebuild.REBUILD_ACCOUNT);
sfr.setChartOfAccountsCode(getChartOfAccountsCode());
sfr.setAccountNumberFinancialObjectCode(getAccountNumber());
if (boService.retrieve(sfr) == null) {
boService.save(sfr);
}
}
}
} catch (Exception ex) {
LOG.error("Problem updating sufficient funds rebuild table: ", ex);
}
}
Aggregations