Search in sources :

Example 21 with PaymentRequestDocument

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

the class CuPaymentRequestServiceImplTest method testRemoveIneligibleAdditionalCharges_NoEligibleItems.

public void testRemoveIneligibleAdditionalCharges_NoEligibleItems() throws Exception {
    changeCurrentUser(UserNameFixture.ccs1);
    PurchaseOrderDocument po = PurchaseOrderFixture.PO_NON_B2B_OPEN.createPurchaseOrderdDocument(SpringContext.getBean(DocumentService.class));
    changeCurrentUser(UserNameFixture.mo14);
    PaymentRequestDocument paymentRequestDocument = PaymentRequestFixture.PAYMENT_REQ_DOC.createPaymentRequestDocument(po.getPurapDocumentIdentifier());
    paymentRequestDocument.initiateDocument();
    paymentRequestDocument.populatePaymentRequestFromPurchaseOrder(po);
    int numberOfItems = paymentRequestDocument.getItems().size();
    paymentRequestService.removeIneligibleAdditionalCharges(paymentRequestDocument);
    assertEquals(numberOfItems, paymentRequestDocument.getItems().size());
}
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 22 with PaymentRequestDocument

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

the class CuPaymentRequestServiceImplTest method testAddHoldOnPaymentRequest.

public void testAddHoldOnPaymentRequest() 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.addHoldOnPaymentRequest(paymentRequestDocument, "test");
    assertTrue(paymentRequestDocument.isHoldIndicator());
    assertEquals(UserNameFixture.mo14.getPerson().getPrincipalId(), paymentRequestDocument.getLastActionPerformedByPersonId());
}
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 23 with PaymentRequestDocument

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

the class CuPaymentRequestServiceImplTest method testCancelExtractedPaymentRequest.

public void testCancelExtractedPaymentRequest() 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.cancelExtractedPaymentRequest(paymentRequestDocument, "test");
    assertTrue(PaymentRequestStatuses.CANCELLED_STATUSES.contains(paymentRequestDocument.getApplicationDocumentStatus()));
}
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 24 with PaymentRequestDocument

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

the class CuPaymentRequestServiceImplTest method testResetExtractedPaymentRequest.

public void testResetExtractedPaymentRequest() 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.setExtractedTimestamp(SpringContext.getBean(DateTimeService.class).getCurrentTimestamp());
    paymentRequestDocument.setPaymentPaidTimestamp(SpringContext.getBean(DateTimeService.class).getCurrentTimestamp());
    paymentRequestDocument.prepareForSave();
    AccountingDocumentTestUtils.saveDocument(paymentRequestDocument, SpringContext.getBean(DocumentService.class));
    paymentRequestService.resetExtractedPaymentRequest(paymentRequestDocument, "test");
    assertNull(paymentRequestDocument.getExtractedTimestamp());
    assertNull(paymentRequestDocument.getPaymentPaidTimestamp());
}
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 25 with PaymentRequestDocument

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

the class CuPaymentRequestServiceImplTest method testMarkPaid.

public void testMarkPaid() 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.setPaymentPaidTimestamp(null);
    paymentRequestDocument.prepareForSave();
    AccountingDocumentTestUtils.saveDocument(paymentRequestDocument, SpringContext.getBean(DocumentService.class));
    paymentRequestService.markPaid(paymentRequestDocument, SpringContext.getBean(DateTimeService.class).getCurrentSqlDate());
    assertNotNull(paymentRequestDocument.getPaymentPaidTimestamp());
}
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)

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