use of org.kuali.kfs.module.purap.document.PurchaseOrderDocument in project cu-kfs by CU-CommunityApps.
the class CuB2BPurchaseOrderSciquestServiceImplTest method testSendPurchaseOrder.
public void testSendPurchaseOrder() throws Exception {
PurchaseOrderDocument po = PurchaseOrderFixture.PO_B2B.createPurchaseOrderdDocument(documentService);
String errors = b2bPurchaseOrderService.sendPurchaseOrder(po);
assertTrue(errors.isEmpty());
}
use of org.kuali.kfs.module.purap.document.PurchaseOrderDocument 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());
}
use of org.kuali.kfs.module.purap.document.PurchaseOrderDocument 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());
}
use of org.kuali.kfs.module.purap.document.PurchaseOrderDocument 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()));
}
use of org.kuali.kfs.module.purap.document.PurchaseOrderDocument 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());
}
Aggregations