use of org.kuali.kfs.module.ld.businessobject.LaborObject in project cu-kfs by CU-CommunityApps.
the class CuScrubberValidatorImpl method checkAccountFringeIndicator.
/**
* Overridden to clear out the sub-account number on fringe transactions
* if the transaction had its account number modified.
*
* @see org.kuali.kfs.module.ld.batch.service.impl.ScrubberValidatorImpl#checkAccountFringeIndicator(
* org.kuali.kfs.module.ld.businessobject.LaborOriginEntry, org.kuali.kfs.module.ld.businessobject.LaborOriginEntry,
* org.kuali.kfs.coa.businessobject.Account, org.kuali.kfs.sys.businessobject.UniversityDate,
* org.kuali.kfs.module.ld.batch.service.LaborAccountingCycleCachingService)
*/
@Override
protected Message checkAccountFringeIndicator(LaborOriginEntry laborOriginEntry, LaborOriginEntry laborWorkingEntry, Account account, UniversityDate universityRunDate, LaborAccountingCycleCachingService laborAccountingCycleCachingService) {
LaborObject laborObject = laborAccountingCycleCachingService.getLaborObject(laborOriginEntry.getUniversityFiscalYear(), laborOriginEntry.getChartOfAccountsCode(), laborOriginEntry.getFinancialObjectCode());
boolean isFringeTransaction = laborObject != null && org.apache.commons.lang.StringUtils.equals(LaborConstants.BenefitExpenseTransfer.LABOR_LEDGER_BENEFIT_CODE, laborObject.getFinancialObjectFringeOrSalaryCode());
if (isFringeTransaction && !account.isAccountsFringesBnftIndicator()) {
Account altAccount = accountService.getByPrimaryId(laborOriginEntry.getAccount().getReportsToChartOfAccountsCode(), laborOriginEntry.getAccount().getReportsToAccountNumber());
if (ObjectUtils.isNotNull(altAccount)) {
laborWorkingEntry.setAccount(altAccount);
laborWorkingEntry.setAccountNumber(altAccount.getAccountNumber());
laborWorkingEntry.setChartOfAccountsCode(altAccount.getChartOfAccountsCode());
Message err = handleExpiredClosedAccount(altAccount, laborOriginEntry, laborWorkingEntry, universityRunDate);
if (err == null) {
err = MessageBuilder.buildMessageWithPlaceHolder(LaborKeyConstants.MESSAGE_FRINGES_MOVED_TO, Message.TYPE_WARNING, new Object[] { altAccount.getAccountNumber() });
}
clearSubAccountOnModifiedFringeTransaction(laborOriginEntry, laborWorkingEntry, laborAccountingCycleCachingService, err);
return err;
}
boolean suspenseAccountLogicInd = parameterService.getParameterValueAsBoolean(LaborScrubberStep.class, LaborConstants.Scrubber.SUSPENSE_ACCOUNT_LOGIC_PARAMETER);
if (suspenseAccountLogicInd) {
return useSuspenseAccount(laborWorkingEntry);
}
return MessageBuilder.buildMessage(LaborKeyConstants.ERROR_NON_FRINGE_ACCOUNT_ALTERNATIVE_NOT_FOUND, Message.TYPE_FATAL);
}
return handleExpiredClosedAccount(account, laborOriginEntry, laborWorkingEntry, universityRunDate);
}
use of org.kuali.kfs.module.ld.businessobject.LaborObject in project cu-kfs by CU-CommunityApps.
the class CULaborObjectDaoOjb method getByPrimaryId.
public LaborObject getByPrimaryId(int fiscalYear, String chartCode, String objectCode) {
Criteria criteria = new Criteria();
criteria.addEqualTo("universityFiscalYear", fiscalYear);
criteria.addEqualTo("chartOfAccountsCode", chartCode == null ? chartCode : chartCode.toUpperCase());
criteria.addEqualTo("financialObjectCode", objectCode == null ? objectCode : objectCode.toUpperCase());
return (LaborObject) getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(LaborObject.class, criteria));
}
use of org.kuali.kfs.module.ld.businessobject.LaborObject in project cu-kfs by CU-CommunityApps.
the class CULaborObjectServiceImplTest method testGetByPrimaryKey.
public void testGetByPrimaryKey() throws IOException {
LaborObject laborObject = cuLaborObjectService.getByPrimaryKey(2013, "IT", "5150");
assertEquals("S", laborObject.getFinancialObjectFringeOrSalaryCode());
}
use of org.kuali.kfs.module.ld.businessobject.LaborObject in project cu-kfs by CU-CommunityApps.
the class CULaborObjectServiceImplTest method testGetByPrimaryKeyBad.
public void testGetByPrimaryKeyBad() throws IOException {
LaborObject laborObject = cuLaborObjectService.getByPrimaryKey(2013, "IT", "1289");
assertNull(laborObject);
}
Aggregations