use of org.kuali.kfs.module.ar.businessobject.CashControlDetail in project cu-kfs by CU-CommunityApps.
the class CashControlDocument method recalculateTotals.
public void recalculateTotals() {
KualiDecimal total = KualiDecimal.ZERO;
for (CashControlDetail cashControlDetail : getCashControlDetails()) {
total = total.add(cashControlDetail.getFinancialDocumentLineAmount());
}
cashControlTotalAmount = total;
getFinancialSystemDocumentHeader().setFinancialDocumentTotalAmount(total);
// from 'A' to 'N' and GLPEs won't be correctly processed into G/L entries / cleared.
if (getDocumentHeader().getWorkflowDocument().isInitiated() || getDocumentHeader().getWorkflowDocument().isSaved() || getDocumentHeader().getWorkflowDocument().isEnroute() || getDocumentHeader().getWorkflowDocument().isException()) {
recalculateGeneralLedgerPendingEntries();
}
// end of FINP-7340
}
use of org.kuali.kfs.module.ar.businessobject.CashControlDetail in project cu-kfs by CU-CommunityApps.
the class PaymentApplicationForm method isFinalOrProcessed.
private boolean isFinalOrProcessed() {
final Collection<WorkflowDocument> workflowDocuments = new LinkedList<>();
final PaymentApplicationDocument appDocument = getPaymentApplicationDocument();
// Include this APP
final WorkflowDocument appWorkflowDocument = extractWorkFlowDocument(appDocument);
workflowDocuments.add(appWorkflowDocument);
if (appDocument.hasCashControlDetail()) {
final CashControlDocument cashControlDocument = appDocument.getCashControlDocument();
// Include this APP's CashControl
final WorkflowDocument ccWorkflowDocument = extractWorkFlowDocument(cashControlDocument);
workflowDocuments.add(ccWorkflowDocument);
// Include any other APPs associated with the CashControl
final List<CashControlDetail> cashControlDetails = cashControlDocument.getCashControlDetails();
for (final CashControlDetail cashControlDetail : cashControlDetails) {
final PaymentApplicationDocument otherAppDocument = cashControlDetail.getReferenceFinancialDocument();
if (otherAppDocument.getDocumentNumber().equals(appDocument.getDocumentNumber())) {
// Do not add this Document again; it was added above
continue;
}
final WorkflowDocument otherAppWorkflowDocument = extractWorkFlowDocument(otherAppDocument);
workflowDocuments.add(otherAppWorkflowDocument);
}
}
return workflowDocuments.stream().allMatch(wfDocument -> wfDocument.isFinal() || wfDocument.isProcessed());
}
Aggregations