Search in sources :

Example 1 with RecurringDisbursementVoucherPDPStatus

use of edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherPDPStatus in project cu-kfs by CU-CommunityApps.

the class RecurringDisbursementVoucherDocumentServiceImpl method findPaymentDetailsFromRecurringDisbursementVoucher.

@Override
public Collection<PaymentDetail> findPaymentDetailsFromRecurringDisbursementVoucher(RecurringDisbursementVoucherDocument recurringDisbursementVoucherDocument) {
    Collection<PaymentDetail> paymentDetails = new ArrayList<PaymentDetail>();
    List<RecurringDisbursementVoucherPDPStatus> statuses = findPdpStatuses(recurringDisbursementVoucherDocument);
    for (RecurringDisbursementVoucherPDPStatus status : statuses) {
        Map fieldValues = new HashMap();
        fieldValues.put(PdpPropertyConstants.PaymentDetail.PAYMENT_CUSTOMER_DOC_NUMBER, status.getDocumentNumber());
        paymentDetails.addAll(getBusinessObjectService().findMatching(PaymentDetail.class, fieldValues));
    }
    return paymentDetails;
}
Also used : PaymentDetail(org.kuali.kfs.pdp.businessobject.PaymentDetail) RecurringDisbursementVoucherPDPStatus(edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherPDPStatus) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Map(java.util.Map) HashMap(java.util.HashMap) TreeMap(java.util.TreeMap)

Example 2 with RecurringDisbursementVoucherPDPStatus

use of edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherPDPStatus in project cu-kfs by CU-CommunityApps.

the class RecurringDisbursementVoucherDocumentServiceImpl method buildRecurringDisbursementVoucherPDPStatus.

private RecurringDisbursementVoucherPDPStatus buildRecurringDisbursementVoucherPDPStatus(DisbursementVoucherDocument disbursementVoucherDocument) {
    RecurringDisbursementVoucherPDPStatus pdpStatus = new RecurringDisbursementVoucherPDPStatus();
    pdpStatus.setDocumentNumber(disbursementVoucherDocument.getDocumentNumber());
    pdpStatus.setCancelDate(disbursementVoucherDocument.getCancelDate());
    pdpStatus.setExtractDate(disbursementVoucherDocument.getExtractDate());
    pdpStatus.setPaidDate(disbursementVoucherDocument.getPaidDate());
    pdpStatus.setPdpStatus(disbursementVoucherDocument.getDisbursementVoucherPdpStatus());
    pdpStatus.setPaymentDetailDocumentType(disbursementVoucherDocument.getPaymentDetailDocumentType());
    pdpStatus.setDueDate(disbursementVoucherDocument.getDisbursementVoucherDueDate());
    pdpStatus.setDvStatus(disbursementVoucherDocument.getDocumentHeader().getWorkflowDocument().getStatus().getLabel());
    return pdpStatus;
}
Also used : RecurringDisbursementVoucherPDPStatus(edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherPDPStatus)

Example 3 with RecurringDisbursementVoucherPDPStatus

use of edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherPDPStatus in project cu-kfs by CU-CommunityApps.

the class RecurringDisbursementVoucherDocumentServiceImpl method findPdpStatuses.

@Override
public List<RecurringDisbursementVoucherPDPStatus> findPdpStatuses(RecurringDisbursementVoucherDocument recurringDV) {
    List<RecurringDisbursementVoucherPDPStatus> pdpStatuses = new ArrayList<RecurringDisbursementVoucherPDPStatus>();
    for (RecurringDisbursementVoucherDetail detail : recurringDV.getRecurringDisbursementVoucherDetails()) {
        if (StringUtils.isNotEmpty(detail.getDvDocumentNumber())) {
            DisbursementVoucherDocument disbursementVoucherDocument;
            try {
                disbursementVoucherDocument = (DisbursementVoucherDocument) getDocumentService().getByDocumentHeaderId(detail.getDvDocumentNumber());
            } catch (WorkflowException e) {
                LOG.error("findPdpStatuses: There was a problem getting DV from the recurring DV detail: " + e);
                throw new RuntimeException(e);
            }
            pdpStatuses.add(buildRecurringDisbursementVoucherPDPStatus(disbursementVoucherDocument));
        }
    }
    Collections.sort(pdpStatuses);
    return pdpStatuses;
}
Also used : RecurringDisbursementVoucherPDPStatus(edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherPDPStatus) WorkflowException(org.kuali.rice.kew.api.exception.WorkflowException) ArrayList(java.util.ArrayList) RecurringDisbursementVoucherDetail(edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherDetail) RecurringDisbursementVoucherDocument(edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument) DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument) CuDisbursementVoucherDocument(edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)

Aggregations

RecurringDisbursementVoucherPDPStatus (edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherPDPStatus)3 ArrayList (java.util.ArrayList)2 RecurringDisbursementVoucherDetail (edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherDetail)1 CuDisbursementVoucherDocument (edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)1 RecurringDisbursementVoucherDocument (edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 DisbursementVoucherDocument (org.kuali.kfs.fp.document.DisbursementVoucherDocument)1 PaymentDetail (org.kuali.kfs.pdp.businessobject.PaymentDetail)1 WorkflowException (org.kuali.rice.kew.api.exception.WorkflowException)1