use of org.kuali.kfs.module.purap.businessobject.PurApAccountingLine 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.module.purap.businessobject.PurApAccountingLine 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;
}
use of org.kuali.kfs.module.purap.businessobject.PurApAccountingLine in project cu-kfs by CU-CommunityApps.
the class PurchaseOrderDocument method getCustomDocumentTitle.
/**
* Returns a custom document title based on the workflow document title.
* Depending on what route level the document is currently in, various info may be added to the documents title.
*
* @return - Customized document title text dependent upon route level.
*/
protected String getCustomDocumentTitle() {
String poNumber = getPurapDocumentIdentifier().toString();
String cmCode = getContractManagerCode().toString();
String vendorName = StringUtils.trimToEmpty(getVendorName());
String totalAmount = getTotalDollarAmount().toString();
PurApAccountingLine accountingLine = getFirstAccount();
String chartAcctCode = accountingLine != null ? accountingLine.getChartOfAccountsCode() : "";
String accountNumber = accountingLine != null ? accountingLine.getAccountNumber() : "";
String chartCode = getChartOfAccountsCode();
String orgCode = getOrganizationCode();
String deliveryCampus = getDeliveryCampus() != null ? getDeliveryCampus().getCampus().getShortName() : "";
String documentTitle = "";
Set<String> nodeNames = this.getFinancialSystemDocumentHeader().getWorkflowDocument().getCurrentNodeNames();
String routeLevel = "";
if (CollectionUtils.isNotEmpty(nodeNames) && nodeNames.size() >= 1) {
routeLevel = nodeNames.iterator().next();
}
if (StringUtils.equals(getApplicationDocumentStatus(), PurchaseOrderStatuses.APPDOC_OPEN)) {
documentTitle = super.getDocumentTitle();
} else if (routeLevel.equals(PurchaseOrderStatuses.NODE_BUDGET_OFFICE_REVIEW) || routeLevel.equals(PurchaseOrderStatuses.NODE_CONTRACTS_AND_GRANTS_REVIEW)) {
// Budget & C&G approval levels
documentTitle = "PO: " + poNumber + " Account Number: " + chartAcctCode + "-" + accountNumber + " Dept: " + chartCode + "-" + orgCode + " Delivery Campus: " + deliveryCampus;
} else // KFSUPGRADE-348
// else if (routeLevel.equals(PurchaseOrderStatuses.NODE_VENDOR_TAX_REVIEW)) {
// // Tax approval level
// documentTitle = "Vendor: " + vendorName + " PO: " + poNumber + " Account Number: " + chartCode + "-" + accountNumber + " Dept: " + chartCode + "-" + orgCode + " Delivery Campus: " + deliveryCampus;
// }
{
documentTitle += "PO: " + poNumber + " Contract Manager: " + cmCode + " Vendor: " + vendorName + " Amount: " + totalAmount;
}
return documentTitle;
}
use of org.kuali.kfs.module.purap.businessobject.PurApAccountingLine in project cu-kfs by CU-CommunityApps.
the class PurchasingAccountsPayableDocumentBase method refreshNonUpdateableReferences.
@Override
public void refreshNonUpdateableReferences() {
super.refreshNonUpdateableReferences();
for (PurApItem item : (List<PurApItem>) this.getItems()) {
// refresh the accounts if they do exist...
for (PurApAccountingLine account : item.getSourceAccountingLines()) {
account.refreshNonUpdateableReferences();
}
}
fixItemReferences();
}
use of org.kuali.kfs.module.purap.businessobject.PurApAccountingLine in project cu-kfs by CU-CommunityApps.
the class PurchasingAccountsPayableDocumentBase method getIndexedErrorPathPrefix.
private String getIndexedErrorPathPrefix(String errorPathPrefix, AccountingLine currentLine) {
int idx = 0;
int i = 0;
for (PurApItem item : (List<PurApItem>) this.getItems()) {
int j = 0;
// the error icon may be placed in wrong line.
if (CollectionUtils.isNotEmpty(item.getSourceAccountingLines())) {
Collections.sort(item.getSourceAccountingLines(), new PurapAccountingLineComparator());
}
for (PurApAccountingLine acctLine : item.getSourceAccountingLines()) {
if (acctLine == currentLine) {
return errorPathPrefix + i + "]." + KFSConstants.EXISTING_SOURCE_ACCT_LINE_PROPERTY_NAME + "[" + j + "]";
} else {
j++;
}
}
i++;
}
return errorPathPrefix + 0 + "]." + KFSConstants.EXISTING_SOURCE_ACCT_LINE_PROPERTY_NAME + "[" + 0 + "]";
}
Aggregations