Search in sources :

Example 6 with RequisitionDocument

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

the class CuRequisitionServiceImplTest method testCheckAPORulesPerItemForCommodityCodes_Active.

public void testCheckAPORulesPerItemForCommodityCodes_Active() throws WorkflowException {
    RequisitionDocument requisitionDocument = RequisitionFixture.REQ_NON_B2B_CAP_ASSET_ITEM.createRequisition();
    String result = cuRequisitionServiceImpl.checkAPORulesPerItemForCommodityCodes(RequisitionItemFixture.REQ_ITEM.createRequisitionItem(true), requisitionDocument.getVendorDetail().getVendorCommodities(), true);
    // check for active commodity code removed in customization, active commodity code should be fine
    assertEquals(KFSConstants.EMPTY_STRING, result);
}
Also used : RequisitionDocument(org.kuali.kfs.module.purap.document.RequisitionDocument)

Example 7 with RequisitionDocument

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

the class IWantDocumentServiceImplTest method testSetUpRequisitionDetailsFromIWantDoc.

public void testSetUpRequisitionDetailsFromIWantDoc() throws Exception {
    IWantDocument iWantDocument = IWantDocumentFixture.I_WANT_DOC.createIWantDocument();
    RequisitionDocument requisitionDocumentBase = (RequisitionDocument) SpringContext.getBean(DocumentService.class).getNewDocument(RequisitionDocument.class);
    requisitionDocumentBase.initiateDocument();
    RequisitionForm requisitionForm = new RequisitionForm();
    iWantDocumentService.setUpRequisitionDetailsFromIWantDoc(iWantDocument, requisitionDocumentBase, requisitionForm);
    assertEquals(CUPurapConstants.RequisitionSources.IWNT, requisitionDocumentBase.getRequisitionSourceCode());
    assertEquals(iWantDocument.getVendorHeaderGeneratedIdentifier(), requisitionDocumentBase.getVendorHeaderGeneratedIdentifier());
}
Also used : RequisitionDocument(org.kuali.kfs.module.purap.document.RequisitionDocument) RequisitionForm(org.kuali.kfs.module.purap.document.web.struts.RequisitionForm) IWantDocument(edu.cornell.kfs.module.purap.document.IWantDocument)

Example 8 with RequisitionDocument

use of org.kuali.kfs.module.purap.document.RequisitionDocument 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)

Example 9 with RequisitionDocument

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

the class CuElectronicInvoiceHelperServiceImplTest method testRejectDocumentCreationInvalidData.

public void testRejectDocumentCreationInvalidData() throws Exception {
    String rejectFile = "reject.xml";
    RequisitionDocument reqDoc = RequisitionFixture.REQ_NON_B2B_WITH_ITEMS.createRequisition();
    Integer reqId = reqDoc.getPurapDocumentIdentifier();
    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.getCXMLForRejectDocCreation(vendorDUNS, poNumber);
    writeXMLFile(xmlChunk, rejectFile);
    ElectronicInvoiceLoad load = cuElectronicInvoiceHelperService.loadElectronicInvoices();
    assertTrue(load.containsRejects());
    ElectronicInvoiceRejectDocument rejectDoc = (ElectronicInvoiceRejectDocument) load.getRejectDocuments().get(0);
    assertNotNull(rejectDoc);
    assertEquals(rejectDoc.getInvoiceFileName(), rejectFile);
    assertEquals(1, rejectDoc.getInvoiceRejectReasons().size());
    File rejectedFileInRejectDir = new File(electronicInvoiceInputFileType.getDirectoryPath() + File.separator + "reject" + File.separator + rejectFile);
    assertTrue(rejectedFileInRejectDir.exists());
}
Also used : RequisitionDocument(org.kuali.kfs.module.purap.document.RequisitionDocument) ElectronicInvoiceLoad(org.kuali.kfs.module.purap.businessobject.ElectronicInvoiceLoad) ElectronicInvoiceRejectDocument(org.kuali.kfs.module.purap.document.ElectronicInvoiceRejectDocument) PurchaseOrderDocument(org.kuali.kfs.module.purap.document.PurchaseOrderDocument) File(java.io.File)

Example 10 with RequisitionDocument

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

the class CuPurapAccountingServiceImplTest method testIsFiscalOfficersForAllAcctLines_True.

public void testIsFiscalOfficersForAllAcctLines_True() throws Exception {
    RequisitionDocument requisitionDocument = RequisitionFixture.REQ_NON_B2B_WITH_ITEMS.createRequisition();
    requisitionDocument.getFinancialSystemDocumentHeader().setFinancialDocumentTotalAmount(new KualiDecimal(200));
    requisitionDocument.addItem(RequisitionItemFixture.REQ_ITEM3.createRequisitionItem(true));
    changeCurrentUser(UserNameFixture.nja3);
    assertTrue(cuPurapAccountingServiceImpl.isFiscalOfficersForAllAcctLines(requisitionDocument));
}
Also used : RequisitionDocument(org.kuali.kfs.module.purap.document.RequisitionDocument) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal)

Aggregations

RequisitionDocument (org.kuali.kfs.module.purap.document.RequisitionDocument)21 PurchaseOrderDocument (org.kuali.kfs.module.purap.document.PurchaseOrderDocument)6 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)6 WorkflowException (org.kuali.rice.kew.api.exception.WorkflowException)4 PaymentRequestItem (org.kuali.kfs.module.purap.businessobject.PaymentRequestItem)3 PaymentRequestDocument (org.kuali.kfs.module.purap.document.PaymentRequestDocument)3 IWantDocument (edu.cornell.kfs.module.purap.document.IWantDocument)2 File (java.io.File)2 BigDecimal (java.math.BigDecimal)2 ArrayList (java.util.ArrayList)2 Iterator (java.util.Iterator)2 List (java.util.List)2 DocumentService (org.kuali.kfs.krad.service.DocumentService)2 ElectronicInvoiceLoad (org.kuali.kfs.module.purap.businessobject.ElectronicInvoiceLoad)2 PaymentRequestAccount (org.kuali.kfs.module.purap.businessobject.PaymentRequestAccount)2 RequisitionItem (org.kuali.kfs.module.purap.businessobject.RequisitionItem)2 WorkflowDocument (org.kuali.rice.kew.api.WorkflowDocument)2 CuPaymentRequestItemExtension (edu.cornell.kfs.module.purap.businessobject.CuPaymentRequestItemExtension)1 CuPaymentRequestDocument (edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument)1 CuRequisitionDocument (edu.cornell.kfs.module.purap.document.CuRequisitionDocument)1