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