use of org.kuali.kfs.coreservice.framework.parameter.ParameterService in project cu-kfs by CU-CommunityApps.
the class EzraCGCodeMappingParametersTest method setupMockParameterServiceWithMultiValueParms.
protected void setupMockParameterServiceWithMultiValueParms(ParameterNameAndMultiValue... parameters) {
ParameterService parameterService = EasyMock.createMock(ParameterServiceImpl.class);
for (ParameterNameAndMultiValue parameter : parameters) {
EasyMock.expect(parameterService.getParameterValuesAsString(KFSConstants.OptionalModuleNamespaces.CONTRACTS_AND_GRANTS, KfsParameterConstants.BATCH_COMPONENT, parameter.name)).andStubReturn(createParameterValueStrings(parameter.values));
}
EasyMock.replay(parameterService);
ezraService.setParameterService(parameterService);
}
use of org.kuali.kfs.coreservice.framework.parameter.ParameterService in project cu-kfs by CU-CommunityApps.
the class CuPurchaseOrderAmendmentDocument method isContractManagementReviewRequired.
// KFSUPGRADE-339
protected boolean isContractManagementReviewRequired() {
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
KualiDecimal automaticPurchaseOrderDefaultLimit = new KualiDecimal(parameterService.getParameterValueAsString(RequisitionDocument.class, PurapParameterConstants.AUTOMATIC_PURCHASE_ORDER_DEFAULT_LIMIT_AMOUNT));
return ((ObjectUtils.isNull(automaticPurchaseOrderDefaultLimit)) || (automaticPurchaseOrderDefaultLimit.compareTo(this.getTotalDollarAmount()) < 0));
}
use of org.kuali.kfs.coreservice.framework.parameter.ParameterService in project cu-kfs by CU-CommunityApps.
the class CuRequisitionDocument method isB2BTotalAmountForAutoPO.
protected boolean isB2BTotalAmountForAutoPO() {
boolean returnValue = false;
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
String autoPOAmountString = new String(parameterService.getParameterValueAsString(RequisitionDocument.class, CUPurapParameterConstants.B2B_TOTAL_AMOUNT_FOR_AUTO_PO));
KualiDecimal autoPOAmount = new KualiDecimal(autoPOAmountString);
// KFSPTS-1625
String routedBy = getRoutedByPrincipalId();
if (StringUtils.isBlank(routedBy)) {
routedBy = this.getDocumentHeader().getWorkflowDocument().getInitiatorPrincipalId();
}
if (KimApiServiceLocator.getPermissionService().hasPermission(routedBy, CUKFSConstants.ParameterNamespaces.PURCHASING, CUPurapConstants.B2B_HIGHER_LIMIT_PERMISSION)) {
String paramVal = parameterService.getParameterValueAsString(RequisitionDocument.class, CUPurapParameterConstants.B2B_TOTAL_AMOUNT_FOR_SUPER_USER_AUTO_PO);
if (StringUtils.isNotBlank(paramVal)) {
autoPOAmount = new KualiDecimal(paramVal);
}
}
RequisitionDocument document = null;
try {
document = (RequisitionDocument) (SpringContext.getBean(DocumentService.class).getByDocumentHeaderId(this.getDocumentNumber()));
} catch (WorkflowException we) {
}
KualiDecimal totalAmount = document.getFinancialSystemDocumentHeader().getFinancialDocumentTotalAmount();
if (ObjectUtils.isNotNull(autoPOAmount) && ObjectUtils.isNotNull(totalAmount) && (autoPOAmount.compareTo(totalAmount) >= 0)) {
returnValue = true;
} else {
returnValue = false;
}
return returnValue;
}
use of org.kuali.kfs.coreservice.framework.parameter.ParameterService in project cu-kfs by CU-CommunityApps.
the class CuRequisitionDocument method getAccountsForAwardRouting.
public List<Account> getAccountsForAwardRouting() {
List<Account> accounts = new ArrayList<Account>();
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
for (PurApItem item : (List<PurApItem>) this.getItems()) {
for (PurApAccountingLine accountingLine : item.getSourceAccountingLines()) {
if (isObjectCodeAllowedForAwardRouting(accountingLine, parameterService)) {
if (ObjectUtils.isNull(accountingLine.getAccount())) {
accountingLine.refreshReferenceObject("account");
}
if (accountingLine.getAccount() != null && !accounts.contains(accountingLine.getAccount())) {
accounts.add(accountingLine.getAccount());
}
}
}
}
return accounts;
}
Aggregations