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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations