use of org.kuali.kfs.module.purap.document.PaymentRequestDocument in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestServiceImplTest method testRemoveIneligibleAdditionalCharges_WithEligibleItems.
public void testRemoveIneligibleAdditionalCharges_WithEligibleItems() throws Exception {
changeCurrentUser(UserNameFixture.ccs1);
PurchaseOrderDocument po = PurchaseOrderFixture.PO_NON_B2B_OPEN_TRADE_IN_ITEMS.createPurchaseOrderdDocument(SpringContext.getBean(DocumentService.class));
changeCurrentUser(UserNameFixture.mo14);
PaymentRequestDocument paymentRequestDocument = PaymentRequestFixture.PAYMENT_REQ_DOC.createPaymentRequestDocument(po.getPurapDocumentIdentifier());
paymentRequestDocument.initiateDocument();
paymentRequestDocument.populatePaymentRequestFromPurchaseOrder(po);
PaymentRequestItem preqItem = new PaymentRequestItem();
preqItem.setItemTypeCode(ItemTypeCodes.ITEM_TYPE_TRADE_IN_CODE);
preqItem.setItemDescription("test");
preqItem.setItemUnitOfMeasureCode("EA");
paymentRequestDocument.addItem(preqItem);
int numberOfItems = paymentRequestDocument.getItems().size();
paymentRequestService.removeIneligibleAdditionalCharges(paymentRequestDocument);
assertFalse(numberOfItems == paymentRequestDocument.getItems().size());
}
use of org.kuali.kfs.module.purap.document.PaymentRequestDocument in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestServiceImplTest method testRequestCancelOnPaymentRequest.
public void testRequestCancelOnPaymentRequest() 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.requestCancelOnPaymentRequest(paymentRequestDocument, "test");
assertTrue(paymentRequestDocument.isPaymentRequestedCancelIndicator());
assertNotNull(paymentRequestDocument.getLastActionPerformedByPersonId());
assertNotNull(paymentRequestDocument.getAccountsPayableRequestCancelIdentifier());
}
use of org.kuali.kfs.module.purap.document.PaymentRequestDocument 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.PaymentRequestDocument in project cu-kfs by CU-CommunityApps.
the class CuBatchExtractServiceImplTest method testFindPaymentRequestDocument.
@Test
public void testFindPaymentRequestDocument() {
PaymentRequestDocument paymentRequestDocument = cuBatchExtractServiceImpl.findPaymentRequestDocument(EntryFixture.PREQ_5773686.createEntry());
assertNotNull("Payment request document should have been non-null", paymentRequestDocument);
assertEquals("Wrong payment request document was retrieved", CuCamsTestConstants.DOC_5773686, paymentRequestDocument.getDocumentNumber());
paymentRequestDocument = cuBatchExtractServiceImpl.findPaymentRequestDocument(EntryFixture.PREQ_NONEXISTENT_DOC.createEntry());
assertNull("Payment request document should have been null", paymentRequestDocument);
}
use of org.kuali.kfs.module.purap.document.PaymentRequestDocument in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestDocumentPresentationController method getEditModes.
@Override
public Set<String> getEditModes(Document document) {
Set<String> editModes = super.getEditModes(document);
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
PaymentRequestDocument paymentRequestDocument = (PaymentRequestDocument) document;
if (workflowDocument.isInitiated() || workflowDocument.isSaved()) {
// KFSPTS-1891
editModes.add(KfsAuthorizationConstants.TransactionalEditMode.FRN_ENTRY);
editModes.add(KfsAuthorizationConstants.TransactionalEditMode.WIRE_ENTRY);
}
// KFSPTS-1891
if (canApprove(paymentRequestDocument) && canEditAmount(paymentRequestDocument)) {
editModes.add(CUPaymentRequestEditMode.EDIT_AMOUNT);
}
if (paymentRequestDocument.isDocumentStoppedInRouteNode(PaymentRequestStatuses.NODE_PAYMENT_METHOD_REVIEW)) {
editModes.add(CUPaymentRequestEditMode.WAIVE_WIRE_FEE_EDITABLE);
// KFSPTS-1891
editModes.add(KfsAuthorizationConstants.TransactionalEditMode.FRN_ENTRY);
editModes.add(KfsAuthorizationConstants.TransactionalEditMode.WIRE_ENTRY);
// KFSPTS-2968 allows DM to edit additional charge amount
editModes.add(CUPaymentRequestEditMode.ADDITONAL_CHARGE_AMOUNT_EDITABLE);
}
if (editModes.contains(PaymentRequestEditMode.TAX_INFO_VIEWABLE)) {
editModes.remove(PaymentRequestEditMode.TAX_INFO_VIEWABLE);
}
// KFSPTS-2712 : allow payment method review to view tax info
if ((PaymentRequestStatuses.APPDOC_DEPARTMENT_APPROVED.equals(paymentRequestDocument.getApplicationDocumentStatus()) || PaymentRequestStatuses.APPDOC_PAYMENT_METHOD_REVIEW.equals(paymentRequestDocument.getApplicationDocumentStatus())) && // if and only if the preq has gone through tax review would TaxClassificationCode be non-empty
!StringUtils.isEmpty(paymentRequestDocument.getTaxClassificationCode())) {
editModes.add(PaymentRequestEditMode.TAX_INFO_VIEWABLE);
}
return editModes;
}
Aggregations