org.kuali.kfs.module.purap.document.service
Interface PaymentRequestService

All Superinterfaces:
AccountsPayableDocumentSpecificService
All Known Implementing Classes:
PaymentRequestServiceImpl

public interface PaymentRequestService
extends AccountsPayableDocumentSpecificService

Defines methods that must be implemented by a PaymentRequestService implementation.


Method Summary
 PaymentRequestDocument addHoldOnPaymentRequest(PaymentRequestDocument document, String note)
          Marks a payment request on hold.
 boolean allowBackpost(PaymentRequestDocument paymentRequestDocument)
          Payment Requests created in the previous fiscal year get backdated if we're at the beginning of the new fiscal year (i.e.
 boolean autoApprovePaymentRequest(PaymentRequestDocument doc, org.kuali.rice.kns.util.KualiDecimal defaultMinimumLimit)
          Checks whether the payment request document is eligible for auto approval.
 boolean autoApprovePaymentRequest(String docNumber, org.kuali.rice.kns.util.KualiDecimal defaultMinimumLimit)
          Checks whether the payment request document is eligible for auto approval.
 boolean autoApprovePaymentRequests()
          Retrieve a list of PREQs that aren't approved, check to see if they match specific requirements, then auto-approve them if possible.
 Date calculatePayDate(Date invoiceDate, PaymentTermType terms)
          Calculate based on the terms and calculate a date 10 days from today.
 void calculatePaymentRequest(PaymentRequestDocument pr, boolean updateDiscount)
          Recalculate the payment request.
 void calculateTaxArea(PaymentRequestDocument preq)
          Performs calculations on the tax edit area, generates and adds NRA tax charge items as below the line items, with their accounting lines; the calculation will activate updates on the account summary tab and the general ledger entries as well.
 void cancelExtractedPaymentRequest(PaymentRequestDocument paymentRequest, String note)
          Cancels a PREQ that has already been extracted if allowed.
 void changeVendor(PaymentRequestDocument preq, Integer headerId, Integer detailId)
          Changes the current vendor to the vendor passed in.
 String createPreqDocumentDescription(Integer purchaseOrderIdentifier, String vendorName)
          A method to create the description for the payment request document.
 boolean encumberedItemExistsForInvoicing(PurchaseOrderDocument document)
           
 Collection<PaymentRequestDocument> getImmediatePaymentRequestsToExtract(String chartCode)
          Get all the payment requests that are immediate and need to be extracted to PDP.
 PaymentRequestDocument getPaymentRequestByDocumentNumber(String documentNumber)
          Obtains the payment request document given the document number.
 PaymentRequestDocument getPaymentRequestById(Integer poDocId)
          Obtains the payment request document given the purapDocumentIdentifier.
 List getPaymentRequestsByPOIdInvoiceAmountInvoiceDate(Integer poId, org.kuali.rice.kns.util.KualiDecimal invoiceAmount, Date invoiceDate)
          Obtains a list of payment request documents given the purchase order id, the invoice amount and the invoice date.
 List<PaymentRequestDocument> getPaymentRequestsByPurchaseOrderId(Integer poDocId)
          Obtains a list of payment request documents given the purchase order id.
 List getPaymentRequestsByVendorNumber(Integer vendorHeaderGeneratedIdentifier, Integer vendorDetailAssignedIdentifier)
          Obtains a list of payment request documents given the vendorHeaderGeneratedIdentifier, vendorDetailAssignedIdentifier and the invoice number.
 List getPaymentRequestsByVendorNumberInvoiceNumber(Integer vendorHeaderGeneratedIdentifier, Integer vendorDetailAssignedIdentifier, String invoiceNumber)
          Obtains a list of payment request documents given the vendorHeaderGeneratedIdentifier, vendorDetailAssignedIdentifier and the invoice number.
 Collection<PaymentRequestDocument> getPaymentRequestsToExtract(Date onOrBeforePaymentRequestPayDate)
          Get all the payment requests that need to be extracted.
 Iterator<PaymentRequestDocument> getPaymentRequestsToExtractByCM(String campusCode, VendorCreditMemoDocument cmd)
          Get all the payment requests that match a credit memo.
 Collection<PaymentRequestDocument> getPaymentRequestsToExtractByVendor(String campusCode, VendorGroupingHelper vendor, Date onOrBeforePaymentRequestPayDate)
          Get all the payment requests that match a vendor.
 Collection<PaymentRequestDocument> getPaymentRequestsToExtractSpecialPayments(String chartCode, Date onOrBeforePaymentRequestPayDate)
          Get all the special payment requests for a single chart that need to be extracted.
 Collection<PaymentRequestDocument> getPaymentRequestToExtractByChart(String chartCode, Date onOrBeforePaymentRequestPayDate)
          Get all the regular payment requests for a single campus.
 boolean hasActivePaymentRequestsForPurchaseOrder(Integer purchaseOrderIdentifier)
          Determines if there are active payment requests for a purchase order.
 boolean hasDiscountItem(PaymentRequestDocument preq)
          This method specifies whether the payment request document has a discount item.
 boolean isExtracted(PaymentRequestDocument document)
          Returns true if the payment request has been extracted
 boolean isInvoiceDateAfterToday(Date invoiceDate)
          Determines whether the invoice date is after today.
 boolean isPurchaseOrderValidForPaymentRequestDocumentCreation(PaymentRequestDocument paymentRequestDocument, PurchaseOrderDocument po)
           
 void markPaid(PaymentRequestDocument pr, Date processDate)
          Mark a payment request as being paid and set the payment request's paid date as the processDate.
 HashMap<String,String> paymentRequestDuplicateMessages(PaymentRequestDocument document)
          Performs the processing to check whether the payment request is a duplicate and if so, adds the information about the type of duplication into the resulting HashMap to be returned by this method.
 void populateAndSavePaymentRequest(PaymentRequestDocument preq)
          Populate and save payment request.
 void populatePaymentRequest(PaymentRequestDocument preq)
          Populate payment request.
 void processPaymentRequestInReceivingStatus()
           
 PaymentRequestDocument removeHoldOnPaymentRequest(PaymentRequestDocument document, String note)
          Removes a hold on a payment request.
 void removeIneligibleAdditionalCharges(PaymentRequestDocument document)
          Removes additional charge items that are not eligible on the payment request document.
 void removeRequestCancelOnPaymentRequest(PaymentRequestDocument document, String note)
          Removes a request cancel on payment request.
 void requestCancelOnPaymentRequest(PaymentRequestDocument document, String note)
          Marks a payment request as requested to be canceled.
 void resetExtractedPaymentRequest(PaymentRequestDocument paymentRequest, String note)
          Resets a Payment Request that had an associated Payment Request or Credit Memo cancelled externally.
 
Methods inherited from interface org.kuali.kfs.module.purap.document.service.AccountsPayableDocumentSpecificService
generateGLEntriesCreateAccountsPayableDocument, getPersonForCancel, poItemEligibleForAp, shouldPurchaseOrderBeReversed, takePurchaseOrderCancelAction, updateStatusByNode
 

Method Detail

getPaymentRequestsByPurchaseOrderId

List<PaymentRequestDocument> getPaymentRequestsByPurchaseOrderId(Integer poDocId)
Obtains a list of payment request documents given the purchase order id.

Parameters:
poDocId - The purchase order id to be used to obtain a list of payment request documents.
Returns:
The List of payment request documents given the purchase order id.

getPaymentRequestsByPOIdInvoiceAmountInvoiceDate

List getPaymentRequestsByPOIdInvoiceAmountInvoiceDate(Integer poId,
                                                      org.kuali.rice.kns.util.KualiDecimal invoiceAmount,
                                                      Date invoiceDate)
Obtains a list of payment request documents given the purchase order id, the invoice amount and the invoice date.

Parameters:
poId - The purchase order id used to obtain the payment request documents.
invoiceAmount - The invoice amount used to obtain the payment request documents.
invoiceDate - The invoice date used to obtain the payment request documents.
Returns:
The List of payment request documents that match the given criterias (purchase order id, invoice amount and invoice date).

getPaymentRequestsByVendorNumber

List getPaymentRequestsByVendorNumber(Integer vendorHeaderGeneratedIdentifier,
                                      Integer vendorDetailAssignedIdentifier)
Obtains a list of payment request documents given the vendorHeaderGeneratedIdentifier, vendorDetailAssignedIdentifier and the invoice number.

Parameters:
vendorHeaderGeneratedIdentifier - The vendorHeaderGeneratedIdentifier used to obtain the payment request documents.
vendorDetailAssignedIdentifier - The vendorDetailAssignedIdentifier used to obtain the payment request documents.
Returns:
The List of payment request documents that match the given criterias.

getPaymentRequestsByVendorNumberInvoiceNumber

List getPaymentRequestsByVendorNumberInvoiceNumber(Integer vendorHeaderGeneratedIdentifier,
                                                   Integer vendorDetailAssignedIdentifier,
                                                   String invoiceNumber)
Obtains a list of payment request documents given the vendorHeaderGeneratedIdentifier, vendorDetailAssignedIdentifier and the invoice number.

Parameters:
vendorHeaderGeneratedIdentifier - The vendorHeaderGeneratedIdentifier used to obtain the payment request documents.
vendorDetailAssignedIdentifier - The vendorDetailAssignedIdentifier used to obtain the payment request documents.
invoiceNumber - The invoice number used to obtain the payment request documents.
Returns:
The List of payment request documents that match the given criterias.

isInvoiceDateAfterToday

boolean isInvoiceDateAfterToday(Date invoiceDate)
Determines whether the invoice date is after today.

Parameters:
invoiceDate - The invoice date to be determined whether it's after today.
Returns:
boolean true if the given invoice date is after today.

paymentRequestDuplicateMessages

HashMap<String,String> paymentRequestDuplicateMessages(PaymentRequestDocument document)
Performs the processing to check whether the payment request is a duplicate and if so, adds the information about the type of duplication into the resulting HashMap to be returned by this method.

Parameters:
document - The payment request document to be processed/checked for duplicates.
Returns:
The HashMap containing "PREQDuplicateInvoice" as the key and the string describing the types of duplication as the value.

calculatePayDate

Date calculatePayDate(Date invoiceDate,
                      PaymentTermType terms)
Calculate based on the terms and calculate a date 10 days from today. Pick the one that is the farthest out. We always calculate the discount date, if there is one.

Parameters:
invoiceDate - The invoice date to be used in the pay date calculation.
terms - The payment term type to be used in the pay date calculation.
Returns:
The resulting pay date given the invoice date and the terms.

addHoldOnPaymentRequest

PaymentRequestDocument addHoldOnPaymentRequest(PaymentRequestDocument document,
                                               String note)
                                               throws Exception
Marks a payment request on hold.

Parameters:
document - The payment request document to be marked as on hold.
note - The note to be added to the payment request document while being marked as on hold.
Returns:
The PaymentRequestDocument with updated information.
Throws:
Exception

removeHoldOnPaymentRequest

PaymentRequestDocument removeHoldOnPaymentRequest(PaymentRequestDocument document,
                                                  String note)
                                                  throws Exception
Removes a hold on a payment request.

Parameters:
document - The payment request document whose hold is to be removed.
note - The note to be added to the payment request document while its hold is being removed.
Returns:
The PaymentRequestDocument with updated information.
Throws:
Exception

getPaymentRequestById

PaymentRequestDocument getPaymentRequestById(Integer poDocId)
Obtains the payment request document given the purapDocumentIdentifier.

Parameters:
poDocId - The purapDocumentIdentifier of the payment request document to be obtained.
Returns:
The payment request document whose purapDocumentIdentifier matches with the input parameter.

getPaymentRequestByDocumentNumber

PaymentRequestDocument getPaymentRequestByDocumentNumber(String documentNumber)
Obtains the payment request document given the document number.

Parameters:
documentNumber - The document number to be used to obtain the payment request document.
Returns:
The payment request document whose document number matches with the given input parameter.

requestCancelOnPaymentRequest

void requestCancelOnPaymentRequest(PaymentRequestDocument document,
                                   String note)
                                   throws Exception
Marks a payment request as requested to be canceled.

Parameters:
document - The payment request document to be marked as requested to be canceled.
note - The note to be added to the payment request document while being marked as requested to be canceled.
Throws:
Exception

isExtracted

boolean isExtracted(PaymentRequestDocument document)
Returns true if the payment request has been extracted

Parameters:
document - The payment request document to be determined whether it is extracted.
Returns:
boolean true if the payment request document is extracted.

removeRequestCancelOnPaymentRequest

void removeRequestCancelOnPaymentRequest(PaymentRequestDocument document,
                                         String note)
                                         throws Exception
Removes a request cancel on payment request.

Parameters:
document - The payment request document to be used for request cancel.
note - The note to be added to the payment request document upon the removal of the request cancel.
Throws:
Exception

resetExtractedPaymentRequest

void resetExtractedPaymentRequest(PaymentRequestDocument paymentRequest,
                                  String note)
Resets a Payment Request that had an associated Payment Request or Credit Memo cancelled externally.

Parameters:
paymentRequest - The extracted payment request document to be resetted.
note - The note to be added to the payment request document upon its reset.

cancelExtractedPaymentRequest

void cancelExtractedPaymentRequest(PaymentRequestDocument paymentRequest,
                                   String note)
Cancels a PREQ that has already been extracted if allowed.

Parameters:
paymentRequest - The extracted payment request document to be canceled.
note - The note to be added to the payment request document.

getImmediatePaymentRequestsToExtract

Collection<PaymentRequestDocument> getImmediatePaymentRequestsToExtract(String chartCode)
Get all the payment requests that are immediate and need to be extracted to PDP.

Parameters:
chartCode - The chart code to be used as one of the criterias to retrieve the payment request documents.
Returns:
The iterator of the list of the resulting payment request documents returned by the paymentRequestDao.

getPaymentRequestsToExtractByCM

Iterator<PaymentRequestDocument> getPaymentRequestsToExtractByCM(String campusCode,
                                                                 VendorCreditMemoDocument cmd)
Get all the payment requests that match a credit memo.

Parameters:
cmd - The credit memo document to be used to obtain the payment requests.
Returns:
The iterator of the resulting payment request documents returned by the paymentRequestDao.

getPaymentRequestsToExtractByVendor

Collection<PaymentRequestDocument> getPaymentRequestsToExtractByVendor(String campusCode,
                                                                       VendorGroupingHelper vendor,
                                                                       Date onOrBeforePaymentRequestPayDate)
Get all the payment requests that match a vendor.

Parameters:
vendor -
onOrBeforePaymentRequestPayDate - only payment requests with a pay date on or before this date will be extracted
Returns:
Collection of the resulting payment request documents returned by the paymentRequestDao.

getPaymentRequestsToExtract

Collection<PaymentRequestDocument> getPaymentRequestsToExtract(Date onOrBeforePaymentRequestPayDate)
Get all the payment requests that need to be extracted.

Returns:
The Collection of the resulting payment request documents returned by the paymentRequestDao.

getPaymentRequestsToExtractSpecialPayments

Collection<PaymentRequestDocument> getPaymentRequestsToExtractSpecialPayments(String chartCode,
                                                                              Date onOrBeforePaymentRequestPayDate)
Get all the special payment requests for a single chart that need to be extracted.

Parameters:
chartCode - The chart code to be used as one of the criterias to retrieve the payment request documents.
Returns:
The Collection of the resulting payment request documents returned by the paymentRequestDao.

getPaymentRequestToExtractByChart

Collection<PaymentRequestDocument> getPaymentRequestToExtractByChart(String chartCode,
                                                                     Date onOrBeforePaymentRequestPayDate)
Get all the regular payment requests for a single campus.

Parameters:
chartCode - The chart code to be used as one of the criterias to retrieve the payment request documents.
Returns:
The collection of the resulting payment request documents returned by the paymentRequestDao.

calculatePaymentRequest

void calculatePaymentRequest(PaymentRequestDocument pr,
                             boolean updateDiscount)
Recalculate the payment request.

Parameters:
pr - The payment request document to be calculated.
updateDiscount - boolean true if we also want to calculate the discount items for the payment request.

calculateTaxArea

void calculateTaxArea(PaymentRequestDocument preq)
Performs calculations on the tax edit area, generates and adds NRA tax charge items as below the line items, with their accounting lines; the calculation will activate updates on the account summary tab and the general ledger entries as well. The non-resident alien (NRA) tax lines consist of four possible sets of tax lines: - Federal tax lines - Federal Gross up tax lines - State tax lines - State Gross up tax lines Federal tax lines are generated if the federal tax rate in the payment request is not zero. State tax lines are generated if the state tax rate in the payment request is not zero. Gross up tax lines are generated if the tax gross up indicator is set on the payment request and the tax rate is not zero.

Parameters:
preq - The payment request the NRA tax lines will be added to.

populatePaymentRequest

void populatePaymentRequest(PaymentRequestDocument preq)
Populate payment request.

Parameters:
preq - The payment request document to be populated.

populateAndSavePaymentRequest

void populateAndSavePaymentRequest(PaymentRequestDocument preq)
                                   throws org.kuali.rice.kew.exception.WorkflowException
Populate and save payment request.

Parameters:
preq - The payment request document to be populated and saved.
Throws:
org.kuali.rice.kew.exception.WorkflowException

autoApprovePaymentRequests

boolean autoApprovePaymentRequests()
Retrieve a list of PREQs that aren't approved, check to see if they match specific requirements, then auto-approve them if possible.

Returns:
boolean true if the auto approval of payment requests has at least one error.

autoApprovePaymentRequest

boolean autoApprovePaymentRequest(String docNumber,
                                  org.kuali.rice.kns.util.KualiDecimal defaultMinimumLimit)
Checks whether the payment request document is eligible for auto approval. If so, then updates the status of the document to auto approved and calls the documentService to blanket approve the document, then returns false. If the document is not eligible for auto approval then returns true.

Parameters:
docNumber - The payment request document number (not the payment request ID) to be auto approved.
defaultMinimumLimit - The default minimum limit amount to be used in determining the eligibility of the document to be auto approved.
Returns:
boolean true if the payment request document is not eligible for auto approval.
Throws:
RuntimeException - To indicate to Spring transactional management that the transaction for this document should be rolled back

autoApprovePaymentRequest

boolean autoApprovePaymentRequest(PaymentRequestDocument doc,
                                  org.kuali.rice.kns.util.KualiDecimal defaultMinimumLimit)
Checks whether the payment request document is eligible for auto approval. If so, then updates the status of the document to auto approved and calls the documentService to blanket approve the document, then returns false. If the document is not eligible for auto approval then returns true.

Parameters:
doc - The payment request document to be auto approved.
defaultMinimumLimit - The default minimum limit amount to be used in determining the eligibility of the document to be auto approved.
Returns:
boolean true if the payment request document is not eligible for auto approval.
Throws:
RuntimeException - To indicate to Spring transactional management that the transaction for this document should be rolled back

markPaid

void markPaid(PaymentRequestDocument pr,
              Date processDate)
Mark a payment request as being paid and set the payment request's paid date as the processDate.

Parameters:
pr - The payment request document to be marked as paid and paid date to be set.
processDate - The date to be set as the payment request's paid date.

hasDiscountItem

boolean hasDiscountItem(PaymentRequestDocument preq)
This method specifies whether the payment request document has a discount item.

Parameters:
preq - The payment request document to be verified whether it has a discount item.
Returns:
boolean true if the payment request document has at least one discount item.

changeVendor

void changeVendor(PaymentRequestDocument preq,
                  Integer headerId,
                  Integer detailId)
Changes the current vendor to the vendor passed in.

Parameters:
preq -
headerId -
detailId -
primaryHeaderId -
primaryDetailId -

createPreqDocumentDescription

String createPreqDocumentDescription(Integer purchaseOrderIdentifier,
                                     String vendorName)
A method to create the description for the payment request document.

Parameters:
purchaseOrderIdentifier - The purchase order identifier to be used as part of the description.
vendorName - The vendor name to be used as part of the description.
Returns:
The resulting description string for the payment request document.

hasActivePaymentRequestsForPurchaseOrder

boolean hasActivePaymentRequestsForPurchaseOrder(Integer purchaseOrderIdentifier)
Determines if there are active payment requests for a purchase order.

Parameters:
purchaseOrderIdentifier -
Returns:

processPaymentRequestInReceivingStatus

void processPaymentRequestInReceivingStatus()

allowBackpost

boolean allowBackpost(PaymentRequestDocument paymentRequestDocument)
Payment Requests created in the previous fiscal year get backdated if we're at the beginning of the new fiscal year (i.e. prior to first closing)

Parameters:
paymentRequestDocument -
Returns:

isPurchaseOrderValidForPaymentRequestDocumentCreation

boolean isPurchaseOrderValidForPaymentRequestDocumentCreation(PaymentRequestDocument paymentRequestDocument,
                                                              PurchaseOrderDocument po)

removeIneligibleAdditionalCharges

void removeIneligibleAdditionalCharges(PaymentRequestDocument document)
Removes additional charge items that are not eligible on the payment request document.

Parameters:
document -

encumberedItemExistsForInvoicing

boolean encumberedItemExistsForInvoicing(PurchaseOrderDocument document)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.