use of org.kuali.kfs.coreservice.framework.parameter.ParameterService in project cu-kfs by CU-CommunityApps.
the class CuPurchaseOrderAmendmentDocument method isSeparationOfDutiesReviewRequired.
protected boolean isSeparationOfDutiesReviewRequired() {
try {
Set<Person> priorApprovers = getAllPriorApprovers();
// then no need for separation of duties
if (priorApprovers.size() > 0) {
return false;
}
} catch (WorkflowException we) {
LOG.error("Exception while attempting to retrieve all prior approvers from workflow: " + we);
}
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
KualiDecimal maxAllowedAmount = new KualiDecimal(parameterService.getParameterValueAsString(RequisitionDocument.class, PurapParameterConstants.SEPARATION_OF_DUTIES_DOLLAR_AMOUNT));
// if app param amount is greater than or equal to documentTotalAmount... no need for separation of duties
KualiDecimal totalAmount = getFinancialSystemDocumentHeader().getFinancialDocumentTotalAmount();
if (ObjectUtils.isNotNull(maxAllowedAmount) && ObjectUtils.isNotNull(totalAmount) && (maxAllowedAmount.compareTo(totalAmount) >= 0)) {
return false;
} else {
return true;
}
}
use of org.kuali.kfs.coreservice.framework.parameter.ParameterService in project cu-kfs by CU-CommunityApps.
the class CuRequisitionDocument method isAwardReviewRequired.
protected boolean isAwardReviewRequired() {
boolean requiresAwardReview = false;
this.getAccountsForRouting();
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
// If the award amount is less than the threshold, then there's no reason to review the object codes, return false
if (!isAwardAmountGreaterThanThreshold()) {
return requiresAwardReview;
}
for (PurApItem item : (List<PurApItem>) this.getItems()) {
for (PurApAccountingLine accountingLine : item.getSourceAccountingLines()) {
requiresAwardReview = isObjectCodeAllowedForAwardRouting(accountingLine, parameterService);
// level.
if (requiresAwardReview) {
return requiresAwardReview;
}
}
}
return requiresAwardReview;
}
use of org.kuali.kfs.coreservice.framework.parameter.ParameterService in project cu-kfs by CU-CommunityApps.
the class CuRequisitionDocument method isAwardAmountGreaterThanThreshold.
protected boolean isAwardAmountGreaterThanThreshold() {
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
String dollarThreshold = parameterService.getParameterValueAsString("KFS-PURAP", "Requisition", DOLLAR_THRESHOLD_REQUIRING_AWARD_REVIEW);
KualiDecimal dollarThresholdDecimal = new KualiDecimal(dollarThreshold);
if (this.getTotalPreTaxDollarAmount().isGreaterEqual(dollarThresholdDecimal)) {
return true;
}
return false;
}
use of org.kuali.kfs.coreservice.framework.parameter.ParameterService in project cu-kfs by CU-CommunityApps.
the class CuLaborPendingEntryGenerator method generateBenefitPendingEntries.
public static List<LaborLedgerPendingEntry> generateBenefitPendingEntries(LaborLedgerPostingDocument document, ExpenseTransferAccountingLine accountingLine, GeneralLedgerPendingEntrySequenceHelper sequenceHelper) {
accountingLine.refreshReferenceObject(KFSPropertyConstants.LABOR_OBJECT);
if (ObjectUtils.isNull(accountingLine.getLaborObject())) {
return null;
}
String FringeOrSalaryCode = accountingLine.getLaborObject().getFinancialObjectFringeOrSalaryCode();
if (!LaborConstants.SalaryExpenseTransfer.LABOR_LEDGER_SALARY_CODE.equals(FringeOrSalaryCode)) {
return null;
}
Integer payrollFiscalyear = accountingLine.getPayrollEndDateFiscalYear();
String chartOfAccountsCode = accountingLine.getChartOfAccountsCode();
String objectCode = accountingLine.getFinancialObjectCode();
Collection<PositionObjectBenefit> positionObjectBenefits = SpringContext.getBean(LaborPositionObjectBenefitService.class).getActivePositionObjectBenefits(payrollFiscalyear, chartOfAccountsCode, objectCode);
List<LaborLedgerPendingEntry> benefitPendingEntries = new ArrayList<LaborLedgerPendingEntry>();
for (PositionObjectBenefit positionObjectBenefit : positionObjectBenefits) {
positionObjectBenefit.setLaborBenefitRateCategoryCode(accountingLine.getAccount().getLaborBenefitRateCategoryCode());
String fringeBenefitObjectCode = retrieveFringeBenefitObjectCode(accountingLine, chartOfAccountsCode);
KualiDecimal benefitAmount = SpringContext.getBean(LaborBenefitsCalculationService.class).calculateFringeBenefit(positionObjectBenefit, accountingLine.getAmount(), accountingLine.getAccountNumber(), accountingLine.getSubAccountNumber());
if (benefitAmount.isNonZero() && positionObjectBenefit.getBenefitsCalculation().isActive()) {
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
Boolean enableFringeBenefitCalculationByBenefitRate = parameterService.getParameterValueAsBoolean(KfsParameterConstants.FINANCIAL_SYSTEM_ALL.class, LaborConstants.BenefitCalculation.ENABLE_FRINGE_BENEFIT_CALC_BY_BENEFIT_RATE_CATEGORY_PARAMETER);
// If fringeBenefitObjectCode is empty and its enable to use calculation by benefit rate
if (StringUtils.isEmpty(fringeBenefitObjectCode) && enableFringeBenefitCalculationByBenefitRate) {
String laborBenefitRateCategoryCode = positionObjectBenefit.getLaborBenefitRateCategoryCode();
// Use parameter default if labor benefit rate category code is blank
if (StringUtils.isBlank(laborBenefitRateCategoryCode)) {
laborBenefitRateCategoryCode = parameterService.getParameterValueAsString(Account.class, LaborConstants.BenefitCalculation.DEFAULT_BENEFIT_RATE_CATEGORY_CODE_PARAMETER);
}
// create a map for the search criteria to lookup the fringe benefit percentage
Map<String, Object> fieldValues = new HashMap<String, Object>();
fieldValues.put(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, positionObjectBenefit.getUniversityFiscalYear());
fieldValues.put(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, positionObjectBenefit.getChartOfAccountsCode());
fieldValues.put(LaborPropertyConstants.POSITION_BENEFIT_TYPE_CODE, positionObjectBenefit.getFinancialObjectBenefitsTypeCode());
fieldValues.put(LaborPropertyConstants.LABOR_BENEFIT_RATE_CATEGORY_CODE, laborBenefitRateCategoryCode);
BenefitsCalculation bc = (BenefitsCalculation) SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(BenefitsCalculation.class, fieldValues);
fringeBenefitObjectCode = bc.getPositionFringeBenefitObjectCode();
}
List<LaborLedgerPendingEntry> pendingEntries = generateBenefitPendingEntries(document, accountingLine, sequenceHelper, benefitAmount, fringeBenefitObjectCode);
benefitPendingEntries.addAll(pendingEntries);
}
}
return benefitPendingEntries;
}
use of org.kuali.kfs.coreservice.framework.parameter.ParameterService in project cu-kfs by CU-CommunityApps.
the class PurchaseOrderDocument method isAwardReviewRequired.
protected boolean isAwardReviewRequired() {
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
boolean objectCodeAllowed = true;
for (PurApItem item : (List<PurApItem>) this.getItems()) {
for (PurApAccountingLine accountingLine : item.getSourceAccountingLines()) {
objectCodeAllowed = isObjectCodeAllowedForAwardRouting(accountingLine, parameterService);
// level.
if (objectCodeAllowed) {
return objectCodeAllowed;
}
}
}
return objectCodeAllowed;
}
Aggregations