use of org.kuali.kfs.module.purap.util.PurapAccountingLineComparator 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