use of org.kuali.kfs.module.purap.document.service.PaymentRequestService in project cu-kfs by CU-CommunityApps.
the class CuPurchasingAccountsPayableModuleServiceImpl method handlePurchasingBatchCancels.
/**
* @see org.kuali.kfs.integration.pdp.service.PurchasingAccountsPayableModuleService#handlePurchasingBatchCancels(java.lang.String)
*/
public void handlePurchasingBatchCancels(String documentNumber, String documentTypeCode, boolean primaryCancel, boolean disbursedPayment, boolean crCancel) {
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
PaymentRequestService paymentRequestService = SpringContext.getBean(PaymentRequestService.class);
CreditMemoService creditMemoService = SpringContext.getBean(CreditMemoService.class);
String preqCancelNote = parameterService.getParameterValueAsString(PaymentRequestDocument.class, PurapParameterConstants.PURAP_PDP_PREQ_CANCEL_NOTE);
String preqResetNote = parameterService.getParameterValueAsString(PaymentRequestDocument.class, PurapParameterConstants.PURAP_PDP_PREQ_RESET_NOTE);
String cmCancelNote = parameterService.getParameterValueAsString(VendorCreditMemoDocument.class, PurapParameterConstants.PURAP_PDP_CM_CANCEL_NOTE);
String cmResetNote = parameterService.getParameterValueAsString(VendorCreditMemoDocument.class, PurapParameterConstants.PURAP_PDP_CM_RESET_NOTE);
if (PurapConstants.PurapDocTypeCodes.PAYMENT_REQUEST_DOCUMENT.equals(documentTypeCode)) {
PaymentRequestDocument pr = paymentRequestService.getPaymentRequestByDocumentNumber(documentNumber);
if (pr != null) {
if (disbursedPayment || primaryCancel || crCancel) {
if (!crCancel) {
paymentRequestService.cancelExtractedPaymentRequest(pr, preqCancelNote);
}
} else {
paymentRequestService.resetExtractedPaymentRequest(pr, preqResetNote);
}
} else {
LOG.error("processPdpCancels() DOES NOT EXIST, CANNOT PROCESS - Payment Request with doc type of " + documentTypeCode + " with id " + documentNumber);
}
} else if (PurapConstants.PurapDocTypeCodes.CREDIT_MEMO_DOCUMENT.equals(documentTypeCode)) {
VendorCreditMemoDocument cm = creditMemoService.getCreditMemoByDocumentNumber(documentNumber);
if (cm != null) {
if (disbursedPayment || primaryCancel || crCancel) {
if (!crCancel) {
creditMemoService.cancelExtractedCreditMemo(cm, cmCancelNote);
}
} else {
creditMemoService.resetExtractedCreditMemo(cm, cmResetNote);
}
} else {
LOG.error("processPdpCancels() DOES NOT EXIST, CANNOT PROCESS - Credit Memo with doc type of " + documentTypeCode + " with id " + documentNumber);
}
}
}
use of org.kuali.kfs.module.purap.document.service.PaymentRequestService in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestAction method clearTaxInfo.
/**
* Calls service to clear tax info.
*/
public ActionForward clearTaxInfo(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
PaymentRequestForm prForm = (PaymentRequestForm) form;
PaymentRequestDocument document = (PaymentRequestDocument) prForm.getDocument();
PaymentRequestService taxService = SpringContext.getBean(PaymentRequestService.class);
/* call service to clear previous lines */
taxService.clearTax(document);
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
use of org.kuali.kfs.module.purap.document.service.PaymentRequestService in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestServiceImplTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
paymentRequestService = SpringContext.getBean(PaymentRequestService.class);
// Override auto-approval-limit parameter for the duration of the test. The old value will be restored by the post-test rollback.
// NOTE: If this test class ever gets configured to not roll back, then this override should change accordingly to restore the old param value.
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
Parameter oldAmountLimit = parameterService.getParameter(PaymentRequestDocument.class, CUPurapParameterConstants.DEFAULT_PURCHASE_ORDER_POS_APRVL_LMT_FOR_PREQ);
Parameter.Builder newAmountLimit = Parameter.Builder.create(oldAmountLimit);
newAmountLimit.setValue(RequisitionItemFixture.REQ_QTY_ITEM_AMOUNT_AT_5K.extendedPrice.toString());
parameterService.updateParameter(newAmountLimit.build());
}
Aggregations