Search in sources :

Example 16 with PurchaseOrderDocument

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

the class CuPaymentRequestServiceImplTest method testRemoveHoldOnPaymentRequest.

public void testRemoveHoldOnPaymentRequest() 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.removeHoldOnPaymentRequest(paymentRequestDocument, "test");
    assertFalse(paymentRequestDocument.isHoldIndicator());
    assertNull(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 17 with PurchaseOrderDocument

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

the class CuPaymentRequestServiceImplTest method testRemoveRequestCancelOnPaymentRequest.

public void testRemoveRequestCancelOnPaymentRequest() 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.removeRequestCancelOnPaymentRequest(paymentRequestDocument, "test");
    assertFalse(paymentRequestDocument.isPaymentRequestedCancelIndicator());
    assertNull(paymentRequestDocument.getLastActionPerformedByPersonId());
    assertNull(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 18 with PurchaseOrderDocument

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

the class CuPaymentRequestServiceImplTest method testChangeVendor.

public void testChangeVendor() 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);
    CuPaymentRequestDocument paymentRequestDocument = (CuPaymentRequestDocument) PaymentRequestFixture.PAYMENT_REQ_DOC.createPaymentRequestDocument(po.getPurapDocumentIdentifier());
    paymentRequestDocument.initiateDocument();
    paymentRequestDocument.populatePaymentRequestFromPurchaseOrder(po);
    paymentRequestDocument.prepareForSave();
    AccountingDocumentTestUtils.saveDocument(paymentRequestDocument, SpringContext.getBean(DocumentService.class));
    paymentRequestService.changeVendor(paymentRequestDocument, 5314, 0);
    assertEquals("P", paymentRequestDocument.getPaymentMethodCode());
}
Also used : CuPaymentRequestDocument(edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument) PurchaseOrderDocument(org.kuali.kfs.module.purap.document.PurchaseOrderDocument) DocumentService(org.kuali.kfs.krad.service.DocumentService)

Example 19 with PurchaseOrderDocument

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

the class CuPurchaseOrderServiceImplTest method testCompletePurchaseOrderAmendment_B2B.

/**
 * Tests that the PurchaseOrderService would do the completePurchaseOrder
 * for B2B purchase orders.
 *
 * @throws Exception
 */
public void testCompletePurchaseOrderAmendment_B2B() throws Exception {
    PurchaseOrderDocument po = PurchaseOrderFixture.PO_B2B.createPurchaseOrderdDocument(documentService);
    po.setPurchaseOrderTransmissionMethodCode(PurapConstants.POTransmissionMethods.ELECTRONIC);
    purchaseOrderService.completePurchaseOrderAmendment(po);
    assertTrue(po.isPurchaseOrderCurrentIndicator());
    assertFalse(po.isPendingActionIndicator());
    assertNotNull(po.getPurchaseOrderLastTransmitTimestamp());
}
Also used : PurchaseOrderDocument(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

Example 20 with PurchaseOrderDocument

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

the class CuElectronicInvoiceHelperServiceImplTest method testPaymentRequestDocumentCreation.

public void testPaymentRequestDocumentCreation() throws Exception {
    String acceptFile = "accept.xml";
    changeCurrentUser(UserNameFixture.ccs1);
    RequisitionDocument reqDoc = RequisitionFixture.REQ_NON_B2B_WITH_ITEMS.createRequisition();
    Integer reqId = reqDoc.getPurapDocumentIdentifier();
    changeCurrentUser(kfs);
    PurchaseOrderDocument poDocument = createPODoc(reqId);
    poDocument.setVendorShippingPaymentTermsCode("AL");
    poDocument.setVendorPaymentTermsCode("00N30");
    poDocument.refreshNonUpdateableReferences();
    AccountingDocumentTestUtils.saveDocument(poDocument, documentService);
    String poNumber = String.valueOf(poDocument.getPurapDocumentIdentifier());
    String vendorDUNS = "133251074";
    String xmlChunk = CuElectronicInvoiceHelperServiceFixture.getCXMLForPaymentDocCreation(vendorDUNS, poNumber);
    writeXMLFile(xmlChunk, acceptFile);
    ElectronicInvoiceLoad load = cuElectronicInvoiceHelperService.loadElectronicInvoices();
    assertFalse(load.containsRejects());
    File acceptedFileInAcceptDir = new File(electronicInvoiceInputFileType.getDirectoryPath() + File.separator + "accept" + File.separator + acceptFile);
    assertTrue(acceptedFileInAcceptDir.exists());
}
Also used : RequisitionDocument(org.kuali.kfs.module.purap.document.RequisitionDocument) ElectronicInvoiceLoad(org.kuali.kfs.module.purap.businessobject.ElectronicInvoiceLoad) PurchaseOrderDocument(org.kuali.kfs.module.purap.document.PurchaseOrderDocument) File(java.io.File)

Aggregations

PurchaseOrderDocument (org.kuali.kfs.module.purap.document.PurchaseOrderDocument)52 CuPaymentRequestDocument (edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument)17 DocumentService (org.kuali.kfs.krad.service.DocumentService)16 PaymentRequestDocument (org.kuali.kfs.module.purap.document.PaymentRequestDocument)14 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)12 PaymentRequestItem (org.kuali.kfs.module.purap.businessobject.PaymentRequestItem)9 ArrayList (java.util.ArrayList)6 PurchaseOrderItem (org.kuali.kfs.module.purap.businessobject.PurchaseOrderItem)6 RequisitionDocument (org.kuali.kfs.module.purap.document.RequisitionDocument)5 PurchaseOrderService (org.kuali.kfs.module.purap.document.service.PurchaseOrderService)5 HashMap (java.util.HashMap)4 List (java.util.List)4 Map (java.util.Map)4 BusinessObjectService (org.kuali.kfs.krad.service.BusinessObjectService)4 MessageMap (org.kuali.kfs.krad.util.MessageMap)4 PurchaseOrderAmendmentDocument (org.kuali.kfs.module.purap.document.PurchaseOrderAmendmentDocument)4 PurapService (org.kuali.kfs.module.purap.document.service.PurapService)4 File (java.io.File)3 BigDecimal (java.math.BigDecimal)3 Iterator (java.util.Iterator)3