use of org.kuali.kfs.coa.businessobject.SubObjectCode in project cu-kfs by CU-CommunityApps.
the class MockSubObjectCodeService method createSubObjectCode.
private SubObjectCode createSubObjectCode(String chartOfAccountsCode, String accountNumber, String financialObjectCode, String financialSubObjectCode) {
SubObjectCode subObjectCode = new SubObjectCode();
subObjectCode.setChartOfAccountsCode(chartOfAccountsCode);
subObjectCode.setAccountNumber(accountNumber);
subObjectCode.setFinancialObjectCode(financialObjectCode);
subObjectCode.setFinancialSubObjectCode(financialSubObjectCode);
return subObjectCode;
}
use of org.kuali.kfs.coa.businessobject.SubObjectCode in project cu-kfs by CU-CommunityApps.
the class AmazonWebServicesBillingServiceImpl method updateTransactionDTOObjectCodes.
private void updateTransactionDTOObjectCodes(AmazonBillingDistributionOfIncomeTransactionDTO transactionDTO, AmazonBillingCostCenterDTO costCenterDTO) {
if (StringUtils.isNotBlank(costCenterDTO.getObjectCode())) {
ObjectCode objectCode = getObjectCodeService().getByPrimaryIdForCurrentYear(transactionDTO.getChartCode(), costCenterDTO.getObjectCode());
if (ObjectUtils.isNotNull(objectCode)) {
transactionDTO.setObjectCodeNumber(objectCode.getFinancialObjectCode());
if (StringUtils.isNotBlank(costCenterDTO.getSubObjectCode())) {
SubObjectCode subObjectCode = getSubObjectCodeService().getByPrimaryIdForCurrentYear(transactionDTO.getChartCode(), transactionDTO.getAccountNumber(), objectCode.getFinancialObjectCode(), costCenterDTO.getSubObjectCode());
if (ObjectUtils.isNotNull(subObjectCode)) {
transactionDTO.setSubObjectCodeNumber(subObjectCode.getFinancialSubObjectCode());
} else {
LOG.info("updateTransactionDTOObjectCodes() Invalid Sub Object Code.");
transactionDTO.setTransactionInputError(true);
}
}
} else {
LOG.info("updateTransactionDTOObjectCodes() Invalid Object Code.");
transactionDTO.setTransactionInputError(true);
}
} else {
transactionDTO.setObjectCodeNumber(getTransactionObjectCode());
}
}
use of org.kuali.kfs.coa.businessobject.SubObjectCode in project cu-kfs by CU-CommunityApps.
the class ScrubberValidatorImpl method validateSubObjectCode.
/**
* Validates the sub object code of the origin entry
*
* @param originEntry the origin entry being scrubbed
* @param workingEntry the scrubbed version of the origin entry
* @return a Message if an error was encountered, otherwise null
*/
protected Message validateSubObjectCode(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, AccountingCycleCachingService accountingCycleCachingService) {
LOG.debug("validateFinancialSubObjectCode() started");
if (!StringUtils.hasText(originEntry.getFinancialSubObjectCode())) {
workingEntry.setFinancialSubObjectCode(KFSConstants.getDashFinancialSubObjectCode());
return null;
}
if (!KFSConstants.getDashFinancialSubObjectCode().equals(originEntry.getFinancialSubObjectCode())) {
SubObjectCode originEntrySubObject = accountingCycleCachingService.getSubObjectCode(originEntry.getUniversityFiscalYear(), originEntry.getChartOfAccountsCode(), originEntry.getAccountNumber(), originEntry.getFinancialObjectCode(), originEntry.getFinancialSubObjectCode());
if (originEntrySubObject != null) {
// Exists
if (!originEntrySubObject.isActive()) {
// if NOT active, set it to dashes
workingEntry.setFinancialSubObjectCode(KFSConstants.getDashFinancialSubObjectCode());
return null;
}
} else {
// Doesn't exist
workingEntry.setFinancialSubObjectCode(KFSConstants.getDashFinancialSubObjectCode());
return null;
}
}
workingEntry.setFinancialSubObjectCode(originEntry.getFinancialSubObjectCode());
return null;
}
use of org.kuali.kfs.coa.businessobject.SubObjectCode in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceImpl method checkSubObjectCode.
public ValidationResult checkSubObjectCode(String chartOfAccountsCode, String accountNumber, String objectCode, String subObjectCodeParm) {
ValidationResult validationResult = new ValidationResult();
if (StringUtils.isNotBlank(subObjectCodeParm)) {
SubObjectCode subObjectCode = subObjectCodeService.getByPrimaryIdForCurrentYear(chartOfAccountsCode, accountNumber, objectCode, subObjectCodeParm);
String subObjectCodeErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.SUB_OBJECT_CODE, chartOfAccountsCode, accountNumber, objectCode, subObjectCodeParm);
validationResult = checkMissingOrInactive(subObjectCode, MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.ERROR_EXISTENCE), subObjectCodeErrorMessageString), MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.ERROR_INACTIVE), subObjectCodeErrorMessageString));
}
return validationResult;
}
use of org.kuali.kfs.coa.businessobject.SubObjectCode in project cu-kfs by CU-CommunityApps.
the class SubObjectCodeGlobalEdit method generateGlobalChangesToPersist.
/**
* @see org.kuali.kfs.krad.bo.GlobalBusinessObject#generateGlobalChangesToPersist()
*/
@Override
public List<PersistableBusinessObject> generateGlobalChangesToPersist() {
// the list of persist-ready BOs
List<PersistableBusinessObject> persistables = new ArrayList<PersistableBusinessObject>();
// walk over each change detail record
for (SubObjectCodeGlobalEditDetail detail : subObjCdGlobalEditDetails) {
// load the object by keys
SubObjectCode subObjectCode = SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(SubObjectCode.class, detail.getPrimaryKeys());
// if we got a valid subObjectCode, inactivate it
if (subObjectCode != null) {
subObjectCode.setActive(false);
persistables.add(subObjectCode);
}
}
return persistables;
}
Aggregations