Search in sources :

Example 26 with PaymentRequestDocument

use of org.kuali.kfs.module.purap.document.PaymentRequestDocument in project cu-kfs by CU-CommunityApps.

the class CuPaymentRequestServiceImplTest method testRemoveIneligibleAdditionalCharges_WithEligibleItems.

public void testRemoveIneligibleAdditionalCharges_WithEligibleItems() throws Exception {
    changeCurrentUser(UserNameFixture.ccs1);
    PurchaseOrderDocument po = PurchaseOrderFixture.PO_NON_B2B_OPEN_TRADE_IN_ITEMS.createPurchaseOrderdDocument(SpringContext.getBean(DocumentService.class));
    changeCurrentUser(UserNameFixture.mo14);
    PaymentRequestDocument paymentRequestDocument = PaymentRequestFixture.PAYMENT_REQ_DOC.createPaymentRequestDocument(po.getPurapDocumentIdentifier());
    paymentRequestDocument.initiateDocument();
    paymentRequestDocument.populatePaymentRequestFromPurchaseOrder(po);
    PaymentRequestItem preqItem = new PaymentRequestItem();
    preqItem.setItemTypeCode(ItemTypeCodes.ITEM_TYPE_TRADE_IN_CODE);
    preqItem.setItemDescription("test");
    preqItem.setItemUnitOfMeasureCode("EA");
    paymentRequestDocument.addItem(preqItem);
    int numberOfItems = paymentRequestDocument.getItems().size();
    paymentRequestService.removeIneligibleAdditionalCharges(paymentRequestDocument);
    assertFalse(numberOfItems == paymentRequestDocument.getItems().size());
}
Also used : PaymentRequestItem(org.kuali.kfs.module.purap.businessobject.PaymentRequestItem) PurchaseOrderDocument(org.kuali.kfs.module.purap.document.PurchaseOrderDocument) CuPaymentRequestDocument(edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument) PaymentRequestDocument(org.kuali.kfs.module.purap.document.PaymentRequestDocument) DocumentService(org.kuali.kfs.krad.service.DocumentService)

Example 27 with PaymentRequestDocument

use of org.kuali.kfs.module.purap.document.PaymentRequestDocument in project cu-kfs by CU-CommunityApps.

the class CuPaymentRequestServiceImplTest method testRequestCancelOnPaymentRequest.

public void testRequestCancelOnPaymentRequest() throws Exception {
    changeCurrentUser(UserNameFixture.ccs1);
    PurchaseOrderDocument po = PurchaseOrderFixture.PO_NON_B2B_OPEN.createPurchaseOrderdDocument(SpringContext.getBean(DocumentService.class));
    po.setVendorShippingPaymentTermsCode("AL");
    po.setVendorPaymentTermsCode("00N30");
    po.refreshNonUpdateableReferences();
    changeCurrentUser(UserNameFixture.mo14);
    PaymentRequestDocument paymentRequestDocument = PaymentRequestFixture.PAYMENT_REQ_DOC.createPaymentRequestDocument(po.getPurapDocumentIdentifier());
    paymentRequestDocument.initiateDocument();
    paymentRequestDocument.populatePaymentRequestFromPurchaseOrder(po);
    paymentRequestDocument.prepareForSave();
    AccountingDocumentTestUtils.saveDocument(paymentRequestDocument, SpringContext.getBean(DocumentService.class));
    paymentRequestService.requestCancelOnPaymentRequest(paymentRequestDocument, "test");
    assertTrue(paymentRequestDocument.isPaymentRequestedCancelIndicator());
    assertNotNull(paymentRequestDocument.getLastActionPerformedByPersonId());
    assertNotNull(paymentRequestDocument.getAccountsPayableRequestCancelIdentifier());
}
Also used : PurchaseOrderDocument(org.kuali.kfs.module.purap.document.PurchaseOrderDocument) CuPaymentRequestDocument(edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument) PaymentRequestDocument(org.kuali.kfs.module.purap.document.PaymentRequestDocument) DocumentService(org.kuali.kfs.krad.service.DocumentService)

Example 28 with PaymentRequestDocument

use of org.kuali.kfs.module.purap.document.PaymentRequestDocument in project cu-kfs by CU-CommunityApps.

the class CuPaymentRequestServiceImplTest method createPaymentRequestForTestingPOAmountLimit.

protected CuPaymentRequestDocument createPaymentRequestForTestingPOAmountLimit(PurchaseOrderFixture poFixture) throws Exception {
    changeCurrentUser(UserNameFixture.ccs1);
    PurchaseOrderDocument po = poFixture.createPurchaseOrderdDocument(SpringContext.getBean(DocumentService.class));
    changeCurrentUser(UserNameFixture.mo14);
    PaymentRequestDocument paymentRequestDocument = PaymentRequestFixture.PAYMENT_REQ_DOC.createPaymentRequestDocument(po.getPurapDocumentIdentifier());
    paymentRequestDocument.initiateDocument();
    paymentRequestDocument.populatePaymentRequestFromPurchaseOrder(po);
    return (CuPaymentRequestDocument) paymentRequestDocument;
}
Also used : CuPaymentRequestDocument(edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument) PurchaseOrderDocument(org.kuali.kfs.module.purap.document.PurchaseOrderDocument) CuPaymentRequestDocument(edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument) PaymentRequestDocument(org.kuali.kfs.module.purap.document.PaymentRequestDocument) DocumentService(org.kuali.kfs.krad.service.DocumentService)

Example 29 with PaymentRequestDocument

use of org.kuali.kfs.module.purap.document.PaymentRequestDocument in project cu-kfs by CU-CommunityApps.

the class CuBatchExtractServiceImplTest method testFindPaymentRequestDocument.

@Test
public void testFindPaymentRequestDocument() {
    PaymentRequestDocument paymentRequestDocument = cuBatchExtractServiceImpl.findPaymentRequestDocument(EntryFixture.PREQ_5773686.createEntry());
    assertNotNull("Payment request document should have been non-null", paymentRequestDocument);
    assertEquals("Wrong payment request document was retrieved", CuCamsTestConstants.DOC_5773686, paymentRequestDocument.getDocumentNumber());
    paymentRequestDocument = cuBatchExtractServiceImpl.findPaymentRequestDocument(EntryFixture.PREQ_NONEXISTENT_DOC.createEntry());
    assertNull("Payment request document should have been null", paymentRequestDocument);
}
Also used : CuPaymentRequestDocument(edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument) PaymentRequestDocument(org.kuali.kfs.module.purap.document.PaymentRequestDocument) Test(org.junit.Test)

Example 30 with PaymentRequestDocument

use of org.kuali.kfs.module.purap.document.PaymentRequestDocument in project cu-kfs by CU-CommunityApps.

the class CuPaymentRequestDocumentPresentationController method getEditModes.

@Override
public Set<String> getEditModes(Document document) {
    Set<String> editModes = super.getEditModes(document);
    WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
    PaymentRequestDocument paymentRequestDocument = (PaymentRequestDocument) document;
    if (workflowDocument.isInitiated() || workflowDocument.isSaved()) {
        // KFSPTS-1891
        editModes.add(KfsAuthorizationConstants.TransactionalEditMode.FRN_ENTRY);
        editModes.add(KfsAuthorizationConstants.TransactionalEditMode.WIRE_ENTRY);
    }
    // KFSPTS-1891
    if (canApprove(paymentRequestDocument) && canEditAmount(paymentRequestDocument)) {
        editModes.add(CUPaymentRequestEditMode.EDIT_AMOUNT);
    }
    if (paymentRequestDocument.isDocumentStoppedInRouteNode(PaymentRequestStatuses.NODE_PAYMENT_METHOD_REVIEW)) {
        editModes.add(CUPaymentRequestEditMode.WAIVE_WIRE_FEE_EDITABLE);
        // KFSPTS-1891
        editModes.add(KfsAuthorizationConstants.TransactionalEditMode.FRN_ENTRY);
        editModes.add(KfsAuthorizationConstants.TransactionalEditMode.WIRE_ENTRY);
        // KFSPTS-2968 allows DM to edit additional charge amount
        editModes.add(CUPaymentRequestEditMode.ADDITONAL_CHARGE_AMOUNT_EDITABLE);
    }
    if (editModes.contains(PaymentRequestEditMode.TAX_INFO_VIEWABLE)) {
        editModes.remove(PaymentRequestEditMode.TAX_INFO_VIEWABLE);
    }
    // KFSPTS-2712 : allow payment method review to view tax info
    if ((PaymentRequestStatuses.APPDOC_DEPARTMENT_APPROVED.equals(paymentRequestDocument.getApplicationDocumentStatus()) || PaymentRequestStatuses.APPDOC_PAYMENT_METHOD_REVIEW.equals(paymentRequestDocument.getApplicationDocumentStatus())) && // if and only if the preq has gone through tax review would TaxClassificationCode be non-empty
    !StringUtils.isEmpty(paymentRequestDocument.getTaxClassificationCode())) {
        editModes.add(PaymentRequestEditMode.TAX_INFO_VIEWABLE);
    }
    return editModes;
}
Also used : WorkflowDocument(org.kuali.rice.kew.api.WorkflowDocument) CuPaymentRequestDocument(edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument) PaymentRequestDocument(org.kuali.kfs.module.purap.document.PaymentRequestDocument)

Aggregations

PaymentRequestDocument (org.kuali.kfs.module.purap.document.PaymentRequestDocument)36 CuPaymentRequestDocument (edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument)21 PurchaseOrderDocument (org.kuali.kfs.module.purap.document.PurchaseOrderDocument)15 DocumentService (org.kuali.kfs.krad.service.DocumentService)12 PaymentRequestItem (org.kuali.kfs.module.purap.businessobject.PaymentRequestItem)6 WorkflowException (org.kuali.rice.kew.api.exception.WorkflowException)5 VendorCreditMemoDocument (org.kuali.kfs.module.purap.document.VendorCreditMemoDocument)4 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)4 RemoteException (java.rmi.RemoteException)3 KualiRuleService (org.kuali.kfs.krad.service.KualiRuleService)3 PurApItem (org.kuali.kfs.module.purap.businessobject.PurApItem)3 PaymentRequestService (org.kuali.kfs.module.purap.document.service.PaymentRequestService)3 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 BigDecimal (java.math.BigDecimal)2 HashMap (java.util.HashMap)2 ActionForward (org.apache.struts.action.ActionForward)2 ValidationException (org.kuali.kfs.krad.exception.ValidationException)2 MessageMap (org.kuali.kfs.krad.util.MessageMap)2 WorkflowDocumentService (org.kuali.kfs.krad.workflow.service.WorkflowDocumentService)2