Search in sources :

Example 1 with CashControlDetail

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
}
Also used : CashControlDetail(org.kuali.kfs.module.ar.businessobject.CashControlDetail) KualiDecimal(org.kuali.kfs.core.api.util.type.KualiDecimal)

Example 2 with CashControlDetail

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());
}
Also used : CashControlDocument(org.kuali.kfs.module.ar.document.CashControlDocument) WorkflowDocument(org.kuali.kfs.kew.api.WorkflowDocument) CashControlDetail(org.kuali.kfs.module.ar.businessobject.CashControlDetail) PaymentApplicationDocument(org.kuali.kfs.module.ar.document.PaymentApplicationDocument) LinkedList(java.util.LinkedList)

Aggregations

CashControlDetail (org.kuali.kfs.module.ar.businessobject.CashControlDetail)2 LinkedList (java.util.LinkedList)1 KualiDecimal (org.kuali.kfs.core.api.util.type.KualiDecimal)1 WorkflowDocument (org.kuali.kfs.kew.api.WorkflowDocument)1 CashControlDocument (org.kuali.kfs.module.ar.document.CashControlDocument)1 PaymentApplicationDocument (org.kuali.kfs.module.ar.document.PaymentApplicationDocument)1