use of org.kuali.kfs.module.purap.document.PurchaseOrderDocument in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestServiceImplTest method createPaymentRequestForTestingPOAmountLimit.
protected CuPaymentRequestDocument createPaymentRequestForTestingPOAmountLimit(PurchaseOrderFixture poFixture) throws Exception {
changeCurrentUser(UserNameFixture.ccs1);
PurchaseOrderDocument po = poFixture.createPurchaseOrderdDocument(SpringContext.getBean(DocumentService.class));
changeCurrentUser(UserNameFixture.mo14);
PaymentRequestDocument paymentRequestDocument = PaymentRequestFixture.PAYMENT_REQ_DOC.createPaymentRequestDocument(po.getPurapDocumentIdentifier());
paymentRequestDocument.initiateDocument();
paymentRequestDocument.populatePaymentRequestFromPurchaseOrder(po);
return (CuPaymentRequestDocument) paymentRequestDocument;
}
use of org.kuali.kfs.module.purap.document.PurchaseOrderDocument in project cu-kfs by CU-CommunityApps.
the class CuPurchaseOrderServiceImplTest method testCompletePurchaseOrderAmendment_NonB2B.
/**
* Tests that the PurchaseOrderService would do the completePurchaseOrder
* for non B2B purchase orders.
*
* @throws Exception
*/
public void testCompletePurchaseOrderAmendment_NonB2B() throws Exception {
PurchaseOrderDocument po = PurchaseOrderFixture.PO_NON_B2B_IN_PROCESS.createPurchaseOrderdDocument(documentService);
purchaseOrderService.completePurchaseOrderAmendment(po);
assertTrue(po.isPurchaseOrderCurrentIndicator());
assertFalse(po.isPendingActionIndicator());
}
use of org.kuali.kfs.module.purap.document.PurchaseOrderDocument in project cu-kfs by CU-CommunityApps.
the class CuPurchaseOrderServiceImplTest method testPerformPurchaseOrderFirstTransmitViaPrinting.
public void testPerformPurchaseOrderFirstTransmitViaPrinting() throws Exception {
PurchaseOrderDocument po = PurchaseOrderFixture.PO_NON_B2B_OPEN.createPurchaseOrderdDocument(documentService);
try {
purchaseOrderService.performPurchaseOrderFirstTransmitViaPrinting(po);
assertTrue(po.getPurchaseOrderFirstTransmissionTimestamp() != null);
assertTrue(po.getPurchaseOrderLastTransmitTimestamp() != null);
} catch (ValidationException e) {
LOG.warn("Caught ValidationException while trying to retransmit PO with doc id " + po.getDocumentNumber());
}
}
use of org.kuali.kfs.module.purap.document.PurchaseOrderDocument in project cu-kfs by CU-CommunityApps.
the class CuPurapGeneralLedgerServiceImplTest method testGenerateEntriesPaymentRequest.
public void testGenerateEntriesPaymentRequest() throws Exception {
changeCurrentUser(UserNameFixture.ccs1);
PurchaseOrderDocument po = PurchaseOrderFixture.PO_NON_B2B_OPEN_WITH_ITEMS.createPurchaseOrderdDocument(SpringContext.getBean(DocumentService.class));
po.setVendorShippingPaymentTermsCode("AL");
po.setVendorPaymentTermsCode("00N30");
po.refreshNonUpdateableReferences();
changeCurrentUser(UserNameFixture.mo14);
CuPaymentRequestDocument preq = (CuPaymentRequestDocument) PaymentRequestFixture.PAYMENT_REQ_DOC.createPaymentRequestDocument(po.getPurapDocumentIdentifier());
preq.initiateDocument();
preq.populatePaymentRequestFromPurchaseOrder(po);
preq.setPaymentMethodCode("F");
preq.setApplicationDocumentStatus(PurapConstants.PaymentRequestStatuses.APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW);
((PaymentRequestItem) (preq.getItems().get(0))).setExtendedPrice(new KualiDecimal(1));
AccountingDocumentTestUtils.saveDocument(preq, SpringContext.getBean(DocumentService.class));
List<SummaryAccount> summaryAccounts = purapAccountingService.generateSummaryAccountsWithNoZeroTotalsNoUseTax(preq);
cuPurapGeneralLedgerServiceImpl.generateEntriesPaymentRequest(preq, null, summaryAccounts, "create");
boolean noBankOffsetGenerated = true;
for (GeneralLedgerPendingEntry pe : preq.getGeneralLedgerPendingEntries()) {
if (KFSKeyConstants.Bank.DESCRIPTION_GLPE_BANK_OFFSET.equalsIgnoreCase(pe.getTransactionLedgerEntryDescription())) {
noBankOffsetGenerated = false;
break;
}
}
assertEquals(2, preq.getGeneralLedgerPendingEntries().size());
assertTrue(noBankOffsetGenerated);
}
use of org.kuali.kfs.module.purap.document.PurchaseOrderDocument in project cu-kfs by CU-CommunityApps.
the class CuPurapGeneralLedgerServiceImplTest method testReencumberEncumbrance.
public void testReencumberEncumbrance() throws Exception {
changeCurrentUser(UserNameFixture.ccs1);
PurchaseOrderDocument po = PurchaseOrderFixture.PO_NON_B2B_OPEN_WITH_ITEMS.createPurchaseOrderdDocument(SpringContext.getBean(DocumentService.class));
po.setVendorShippingPaymentTermsCode("AL");
po.setVendorPaymentTermsCode("00N30");
po.getItem(0).setItemQuantity(new KualiDecimal(6));
((PurchaseOrderItem) po.getItem(0)).setItemInvoicedTotalQuantity(new KualiDecimal(4));
po.refreshNonUpdateableReferences();
AccountingDocumentTestUtils.saveDocument(po, SpringContext.getBean(DocumentService.class));
changeCurrentUser(UserNameFixture.mo14);
CuPaymentRequestDocument preq = (CuPaymentRequestDocument) PaymentRequestFixture.PAYMENT_REQ_DOC.createPaymentRequestDocument(po.getPurapDocumentIdentifier());
preq.initiateDocument();
preq.populatePaymentRequestFromPurchaseOrder(po);
preq.setPaymentMethodCode("F");
preq.setApplicationDocumentStatus(PurapConstants.PaymentRequestStatuses.APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW);
((PaymentRequestItem) (preq.getItems().get(0))).setExtendedPrice(KualiDecimal.ZERO);
((PaymentRequestItem) (preq.getItems().get(0))).setItemUnitPrice(BigDecimal.ZERO);
((PaymentRequestItem) (preq.getItems().get(0))).setItemQuantity(new KualiDecimal(2));
AccountingDocumentTestUtils.saveDocument(preq, SpringContext.getBean(DocumentService.class));
cuPurapGeneralLedgerServiceImpl.reencumberEncumbrance(preq);
PurchaseOrderDocument po2 = purchaseOrderService.getCurrentPurchaseOrder(preq.getPurchaseOrderIdentifier());
assertEquals(new KualiDecimal(2), ((PurchaseOrderItem) po2.getItem(0)).getItemInvoicedTotalQuantity());
}
Aggregations