Search in sources :

Example 1 with CuDisbursementVoucherPayeeDetail

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

the class CuDisbursementVoucherDocument method populateDocumentForRouting.

@Override
public void populateDocumentForRouting() {
    CuDisbursementVoucherPayeeDetail payeeDetail = getDvPayeeDetail();
    if (payeeDetail.isVendor()) {
        payeeDetail.setDisbVchrPayeeEmployeeCode(getVendorService().isVendorInstitutionEmployee(payeeDetail.getDisbVchrVendorHeaderIdNumberAsInteger()));
        payeeDetail.setDvPayeeSubjectPaymentCode(getVendorService().isSubjectPaymentVendor(payeeDetail.getDisbVchrVendorHeaderIdNumberAsInteger()));
    } else if (payeeDetail.isEmployee() || payeeDetail.isStudent() || payeeDetail.isAlumni()) {
        // Determine if employee student or alumni is a research subject
        ParameterEvaluator researchPaymentReasonCodeEvaluator = /*REFACTORME*/
        SpringContext.getBean(ParameterEvaluatorService.class).getParameterEvaluator(DisbursementVoucherDocument.class, DisbursementVoucherConstants.RESEARCH_PAYMENT_REASONS_PARM_NM, payeeDetail.getDisbVchrPaymentReasonCode());
        if (researchPaymentReasonCodeEvaluator.evaluationSucceeds()) {
            if (getParameterService().parameterExists(DisbursementVoucherDocument.class, DisbursementVoucherConstants.RESEARCH_NON_VENDOR_PAY_LIMIT_AMOUNT_PARM_NM)) {
                String researchPayLimit = getParameterService().getParameterValueAsString(DisbursementVoucherDocument.class, DisbursementVoucherConstants.RESEARCH_NON_VENDOR_PAY_LIMIT_AMOUNT_PARM_NM);
                if (StringUtils.isNotBlank(researchPayLimit)) {
                    KualiDecimal payLimit = new KualiDecimal(researchPayLimit);
                    if (getDisbVchrCheckTotalAmount().isLessThan(payLimit)) {
                        payeeDetail.setDvPayeeSubjectPaymentCode(true);
                    }
                }
            }
        }
    }
    // Call last, serializes to XML
    super.populateDocumentForRouting();
}
Also used : CuDisbursementVoucherPayeeDetail(edu.cornell.kfs.fp.businessobject.CuDisbursementVoucherPayeeDetail) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) ParameterEvaluator(org.kuali.rice.core.api.parameter.ParameterEvaluator) DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

Example 2 with CuDisbursementVoucherPayeeDetail

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

the class CuDisbursementVoucherDocument method clearPayee.

protected void clearPayee(String messageKey) {
    dvPayeeDetail = new CuDisbursementVoucherPayeeDetail();
    getDvPayeeDetail().setDisbVchrPayeeIdNumber(StringUtils.EMPTY);
    clearDvPayeeIdType();
    KNSGlobalVariables.getMessageList().add(messageKey);
}
Also used : CuDisbursementVoucherPayeeDetail(edu.cornell.kfs.fp.businessobject.CuDisbursementVoucherPayeeDetail)

Example 3 with CuDisbursementVoucherPayeeDetail

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

the class CuDisbursementVoucherDocumentTest method setupEmployeePayeeDetail.

public void setupEmployeePayeeDetail(String employeeId) {
    CuDisbursementVoucherPayeeDetail dvPayeeDetail = new TestEmployeeDisbursementVoucherPayeeDetail();
    dvPayeeDetail.setDisbVchrPayeeIdNumber(employeeId);
    dvPayeeDetail.setDisbursementVoucherPayeeTypeCode(KFSConstants.PaymentPayeeTypes.EMPLOYEE);
    cuDisbursementVoucherDocument.setDvPayeeDetail(dvPayeeDetail);
}
Also used : CuDisbursementVoucherPayeeDetail(edu.cornell.kfs.fp.businessobject.CuDisbursementVoucherPayeeDetail)

Example 4 with CuDisbursementVoucherPayeeDetail

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

the class CuDisbursementVoucherDocumentTest method setupPayeeDetail.

public void setupPayeeDetail(String disbVchrVendorDetailAssignedIdNumber, String disbVchrVendorHeaderIdNumber) {
    CuDisbursementVoucherPayeeDetail dvPayeeDetail = new TestDisbursementVoucherPayeeDetail();
    dvPayeeDetail.setDisbVchrPayeeIdNumber(disbVchrVendorHeaderIdNumber + "-" + disbVchrVendorDetailAssignedIdNumber);
    dvPayeeDetail.setDisbVchrVendorHeaderIdNumber(disbVchrVendorHeaderIdNumber);
    dvPayeeDetail.setDisbVchrVendorDetailAssignedIdNumber(disbVchrVendorDetailAssignedIdNumber);
    dvPayeeDetail.setDisbursementVoucherPayeeTypeCode(KFSConstants.PaymentPayeeTypes.VENDOR);
    cuDisbursementVoucherDocument.setDvPayeeDetail(dvPayeeDetail);
}
Also used : CuDisbursementVoucherPayeeDetail(edu.cornell.kfs.fp.businessobject.CuDisbursementVoucherPayeeDetail)

Example 5 with CuDisbursementVoucherPayeeDetail

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

the class RecurringDisbursementVoucherDocumentServiceImpl method buildCuDisbursementVoucherDocument.

private CuDisbursementVoucherDocument buildCuDisbursementVoucherDocument(RecurringDisbursementVoucherDocument recurringDV) throws WorkflowException {
    CuDisbursementVoucherDocument dv = (CuDisbursementVoucherDocument) getDocumentService().getNewDocument(CuDisbursementVoucherDocument.class);
    dv.setDisbVchrContactPersonName(recurringDV.getDisbVchrContactPersonName());
    dv.setDisbVchrContactPhoneNumber(recurringDV.getDisbVchrContactPhoneNumber());
    dv.setDisbVchrContactEmailId(recurringDV.getDisbVchrContactEmailId());
    dv.setDisbVchrAttachmentCode(recurringDV.isDisbVchrAttachmentCode());
    dv.setDisbVchrSpecialHandlingCode(recurringDV.isDisbVchrSpecialHandlingCode());
    dv.setDisbVchrForeignCurrencyInd(recurringDV.isDisbVchrForeignCurrencyInd());
    dv.setDisbursementVoucherDocumentationLocationCode(recurringDV.getDisbursementVoucherDocumentationLocationCode());
    dv.setDisbVchrCheckStubText(recurringDV.getDisbVchrCheckStubText());
    dv.setDvCheckStubOverflowCode(recurringDV.getDvCheckStubOverflowCode());
    dv.setCampusCode(recurringDV.getCampusCode());
    dv.setDisbVchrPayeeTaxControlCode(recurringDV.getDisbVchrPayeeTaxControlCode());
    dv.setDisbVchrPayeeChangedInd(recurringDV.isDisbVchrPayeeChangedInd());
    dv.setExceptionIndicator(recurringDV.isExceptionIndicator());
    dv.setDisbursementVoucherPdpStatus(recurringDV.getDisbursementVoucherPdpStatus());
    dv.setDisbVchrBankCode(recurringDV.getDisbVchrBankCode());
    dv.setPayeeAssigned(recurringDV.isPayeeAssigned());
    dv.setEditW9W8BENbox(recurringDV.isEditW9W8BENbox());
    dv.setDisbVchrPdpBankCode(recurringDV.getDisbVchrPdpBankCode());
    dv.setImmediatePaymentIndicator(recurringDV.isImmediatePaymentIndicator());
    dv.setDisbExcptAttachedIndicator(recurringDV.isDisbExcptAttachedIndicator());
    dv.setDisbVchrPayeeW9CompleteCode(recurringDV.getDisbVchrPayeeW9CompleteCode());
    dv.setDisbVchrPaymentMethodCode(recurringDV.getDisbVchrPaymentMethodCode());
    CuDisbursementVoucherPayeeDetail payeeDetail = (CuDisbursementVoucherPayeeDetail) ObjectUtils.deepCopy(recurringDV.getDvPayeeDetail());
    payeeDetail.setDocumentNumber(dv.getDocumentNumber());
    dv.setDvPayeeDetail(payeeDetail);
    PaymentSourceWireTransfer wireTransfer = (PaymentSourceWireTransfer) ObjectUtils.deepCopy(recurringDV.getWireTransfer());
    wireTransfer.setDocumentNumber(dv.getDocumentNumber());
    dv.setWireTransfer(wireTransfer);
    DisbursementVoucherNonEmployeeTravel nonEmployeeTravel = (DisbursementVoucherNonEmployeeTravel) ObjectUtils.deepCopy(recurringDV.getDvNonEmployeeTravel());
    nonEmployeeTravel.setDocumentNumber(dv.getDocumentNumber());
    dv.setDvNonEmployeeTravel(nonEmployeeTravel);
    DisbursementVoucherNonResidentAlienTax nonAlienTax = (DisbursementVoucherNonResidentAlienTax) ObjectUtils.deepCopy(recurringDV.getDvNonResidentAlienTax());
    nonAlienTax.setDocumentNumber(dv.getDocumentNumber());
    dv.setDvNonResidentAlienTax(nonAlienTax);
    DisbursementVoucherPreConferenceDetail conferenceDetail = (DisbursementVoucherPreConferenceDetail) ObjectUtils.deepCopy(recurringDV.getDvPreConferenceDetail());
    conferenceDetail.setDocumentNumber(dv.getDocumentNumber());
    dv.setDvPreConferenceDetail(conferenceDetail);
    return dv;
}
Also used : CuDisbursementVoucherDocument(edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument) DisbursementVoucherNonEmployeeTravel(org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeTravel) DisbursementVoucherPreConferenceDetail(org.kuali.kfs.fp.businessobject.DisbursementVoucherPreConferenceDetail) PaymentSourceWireTransfer(org.kuali.kfs.sys.businessobject.PaymentSourceWireTransfer) CuDisbursementVoucherPayeeDetail(edu.cornell.kfs.fp.businessobject.CuDisbursementVoucherPayeeDetail) DisbursementVoucherNonResidentAlienTax(org.kuali.kfs.fp.businessobject.DisbursementVoucherNonResidentAlienTax)

Aggregations

CuDisbursementVoucherPayeeDetail (edu.cornell.kfs.fp.businessobject.CuDisbursementVoucherPayeeDetail)8 CuDisbursementVoucherDocument (edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)3 DisbursementVoucherDocument (org.kuali.kfs.fp.document.DisbursementVoucherDocument)2 VendorDetail (org.kuali.kfs.vnd.businessobject.VendorDetail)2 ParameterEvaluator (org.kuali.rice.core.api.parameter.ParameterEvaluator)2 RecurringDisbursementVoucherDocument (edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument)1 Test (org.junit.Test)1 DvToPdpExtractStep (org.kuali.kfs.fp.batch.DvToPdpExtractStep)1 DisbursementVoucherNonEmployeeTravel (org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeTravel)1 DisbursementVoucherNonResidentAlienTax (org.kuali.kfs.fp.businessobject.DisbursementVoucherNonResidentAlienTax)1 DisbursementVoucherPreConferenceDetail (org.kuali.kfs.fp.businessobject.DisbursementVoucherPreConferenceDetail)1 MessageMap (org.kuali.kfs.krad.util.MessageMap)1 PaymentDetail (org.kuali.kfs.pdp.businessobject.PaymentDetail)1 PaymentGroup (org.kuali.kfs.pdp.businessobject.PaymentGroup)1 PaymentSourceWireTransfer (org.kuali.kfs.sys.businessobject.PaymentSourceWireTransfer)1 VendorService (org.kuali.kfs.vnd.document.service.VendorService)1 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)1 Person (org.kuali.rice.kim.api.identity.Person)1