org.kuali.kfs.module.purap.document.dataaccess.impl
Class PaymentRequestDaoOjb

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springmodules.orm.ojb.support.PersistenceBrokerDaoSupport
          extended by org.kuali.rice.kns.dao.impl.PlatformAwareDaoBaseOjb
              extended by org.kuali.kfs.module.purap.document.dataaccess.impl.PaymentRequestDaoOjb
All Implemented Interfaces:
PaymentRequestDao, org.kuali.rice.kns.dao.PlatformAwareDao, org.springframework.beans.factory.InitializingBean

public class PaymentRequestDaoOjb
extends org.kuali.rice.kns.dao.impl.PlatformAwareDaoBaseOjb
implements PaymentRequestDao

OJB Implementation of PaymentRequestDao.


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
PaymentRequestDaoOjb()
           
 
Method Summary
 List<String> getActivePaymentRequestDocumentNumbersForPurchaseOrder(Integer purchaseOrderId)
          Retrieves a list of potentially active payment requests for a purchase order by status code.
 List<PaymentRequestDocument> getActivePaymentRequestsByPOIdInvoiceAmountInvoiceDate(Integer poId, org.kuali.rice.kns.util.KualiDecimal vendorInvoiceAmount, Date invoiceDate)
          Retrieves a list of Payment Requests with the given PO Id, invoice amount, and invoice date.
 List<PaymentRequestDocument> getActivePaymentRequestsByVendorNumber(Integer vendorHeaderGeneratedId, Integer vendorDetailAssignedId)
          Retrieves a list of payment requests with the given vendor id and invoice number.
 List<PaymentRequestDocument> getActivePaymentRequestsByVendorNumberInvoiceNumber(Integer vendorHeaderGeneratedId, Integer vendorDetailAssignedId, String invoiceNumber)
          Retrieves a list of payment requests with the given vendor id and invoice number.
 String getDocumentNumberByPaymentRequestId(Integer id)
          Get a payment request document number by id.
protected  String getDocumentNumberOfPaymentRequestByCriteria(org.apache.ojb.broker.query.Criteria criteria)
          Retrieves a document number for a payment request by user defined criteria.
 List<String> getDocumentNumbersByPurchaseOrderId(Integer poPurApId)
          Retrieves a list of document numbers by purchase order id.
protected  Iterator<Object[]> getDocumentNumbersOfPaymentRequestByCriteria(org.apache.ojb.broker.query.Criteria criteria, boolean orderByAscending)
          Retrieves a document number for a payment request by user defined criteria and sorts the values ascending if orderByAscending parameter is true, descending otherwise.
 List<PaymentRequestDocument> getEligibleForAutoApproval()
          Get all payment request documents that are eligible for auto-approval.
 Collection<PaymentRequestDocument> getImmediatePaymentRequestsToExtract(String chartCode)
          Get all the payment requests that are marked immediate that need to be extracted to PDP.
 List<PaymentRequestDocument> getPaymentRequestInReceivingStatus()
          Get all payment request which are waiting in receiving status queue
protected  List<PaymentRequestDocument> getPaymentRequestsByQueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria qbc)
          Retrieves a list of payment requests by user defined criteria.
 Collection<PaymentRequestDocument> getPaymentRequestsToExtract(boolean onlySpecialPayments, String chartCode, Date onOrBeforePaymentRequestPayDate)
          The special payments query should be this: select * from pur.ap_pmt_rqst_t where pmt_rqst_stat_cd in ('AUTO', 'DPTA') and prcs_cmp_cd = ? and pmt_extrt_ts is NULL and pmt_hld_ind = 'N' and ( ( ( pmt_spcl_handlg_instrc_ln1_txt is not NULL or pmt_spcl_handlg_instrc_ln2_txt is not NULL or pmt_spcl_handlg_instrc_ln3_txt is not NULL or pmt_att_ind = 'Y') and trunc (pmt_rqst_pay_dt) <= trunc (sysdate)) or IMD_PMT_IND = 'Y')})
 Iterator<PaymentRequestDocument> getPaymentRequestsToExtract(String campusCode, Integer paymentRequestIdentifier, Integer purchaseOrderIdentifier, Integer vendorHeaderGeneratedIdentifier, Integer vendorDetailAssignedIdentifier)
          Get all the payment requests that need to be extracted that match a credit memo.
 Collection<PaymentRequestDocument> getPaymentRequestsToExtractForVendor(String campusCode, VendorGroupingHelper vendor, Date onOrBeforePaymentRequestPayDate)
          Get all the payment requests that need to be extracted that match a credit memo.
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
           
 void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService)
           
 void setNegativePaymentRequestApprovalLimitDao(NegativePaymentRequestApprovalLimitDao negativePaymentRequestApprovalLimitDao)
           
 void setPurapAccountingService(PurapAccountingService purapAccountingService)
           
 void setPurapRunDateService(PurapRunDateService purapRunDateService)
           
 
Methods inherited from class org.kuali.rice.kns.dao.impl.PlatformAwareDaoBaseOjb
getDbPlatform, setDbPlatform
 
Methods inherited from class org.springmodules.orm.ojb.support.PersistenceBrokerDaoSupport
checkDaoConfig, convertOjbAccessException, createPersistenceBrokerTemplate, getJcdAlias, getPersistenceBroker, getPersistenceBrokerTemplate, releasePersistenceBroker, setJcdAlias, setPersistenceBrokerTemplate
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaymentRequestDaoOjb

public PaymentRequestDaoOjb()
Method Detail

setNegativePaymentRequestApprovalLimitDao

public void setNegativePaymentRequestApprovalLimitDao(NegativePaymentRequestApprovalLimitDao negativePaymentRequestApprovalLimitDao)

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)

setPurapAccountingService

public void setPurapAccountingService(PurapAccountingService purapAccountingService)

setKualiConfigurationService

public void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService)

setPurapRunDateService

public void setPurapRunDateService(PurapRunDateService purapRunDateService)

getPaymentRequestsToExtract

public Collection<PaymentRequestDocument> getPaymentRequestsToExtract(boolean onlySpecialPayments,
                                                                      String chartCode,
                                                                      Date onOrBeforePaymentRequestPayDate)
The special payments query should be this: select * from pur.ap_pmt_rqst_t where pmt_rqst_stat_cd in ('AUTO', 'DPTA') and prcs_cmp_cd = ? and pmt_extrt_ts is NULL and pmt_hld_ind = 'N' and ( ( ( pmt_spcl_handlg_instrc_ln1_txt is not NULL or pmt_spcl_handlg_instrc_ln2_txt is not NULL or pmt_spcl_handlg_instrc_ln3_txt is not NULL or pmt_att_ind = 'Y') and trunc (pmt_rqst_pay_dt) <= trunc (sysdate)) or IMD_PMT_IND = 'Y')})

Specified by:
getPaymentRequestsToExtract in interface PaymentRequestDao
Parameters:
onlySpecialPayments - - true only include special payments, False - include all
chartCode - - if not null, limit results to a single chart
Returns:
- Collection of payment requests
See Also:
org.kuali.kfs.module.purap.document.dataaccess.PaymentRequestDao#getPaymentRequestsToExtract(boolean, java.lang.String)

getImmediatePaymentRequestsToExtract

public Collection<PaymentRequestDocument> getImmediatePaymentRequestsToExtract(String chartCode)
Description copied from interface: PaymentRequestDao
Get all the payment requests that are marked immediate that need to be extracted to PDP.

Specified by:
getImmediatePaymentRequestsToExtract in interface PaymentRequestDao
Parameters:
chartCode - - chart of accounts code
Returns:
- Collection of payment requests
See Also:
PaymentRequestDao.getImmediatePaymentRequestsToExtract(java.lang.String)

getPaymentRequestsToExtract

public Iterator<PaymentRequestDocument> getPaymentRequestsToExtract(String campusCode,
                                                                    Integer paymentRequestIdentifier,
                                                                    Integer purchaseOrderIdentifier,
                                                                    Integer vendorHeaderGeneratedIdentifier,
                                                                    Integer vendorDetailAssignedIdentifier)
Description copied from interface: PaymentRequestDao
Get all the payment requests that need to be extracted that match a credit memo.

Specified by:
getPaymentRequestsToExtract in interface PaymentRequestDao
Parameters:
campusCode - - limit results to a single chart
paymentRequestIdentifier - - Payment Request Identifier (can be null)
purchaseOrderIdentifier - - PO Identifier (can be null)
vendorHeaderGeneratedIdentifier - - Vendor Header ID
vendorDetailAssignedIdentifier - - Vendor Detail ID
Returns:
- list of payment requests that need to be extracted
See Also:
PaymentRequestDao.getPaymentRequestsToExtract(java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer)

getPaymentRequestsToExtractForVendor

public Collection<PaymentRequestDocument> getPaymentRequestsToExtractForVendor(String campusCode,
                                                                               VendorGroupingHelper vendor,
                                                                               Date onOrBeforePaymentRequestPayDate)
Description copied from interface: PaymentRequestDao
Get all the payment requests that need to be extracted that match a credit memo.

Specified by:
getPaymentRequestsToExtractForVendor in interface PaymentRequestDao
Parameters:
campusCode - - limit results to a single chart
vendor - - Vendor Header ID, Vendor Detail ID, Country, Zip Code
onOrBeforePaymentRequestPayDate - only payment requests with a pay date on or before this value will be returned in the iterator
Returns:
- list of payment requests that need to be extracted
See Also:
org.kuali.kfs.module.purap.document.dataaccess.PaymentRequestDao#getPaymentRequestsToExtractForVendor(java.lang.String, org.kuali.kfs.module.purap.util.VendorGroupingHelper)

getEligibleForAutoApproval

public List<PaymentRequestDocument> getEligibleForAutoApproval()
Description copied from interface: PaymentRequestDao
Get all payment request documents that are eligible for auto-approval. Whether or not a document is eligible for auto-approval is determined according to whether or not the document total is below a pre-determined minimum amount. This amount is derived from the accounts, charts and/or organizations associated with a given document. If no minimum amount can be determined from chart associations a default minimum specified as a system parameter is used to determine the minimum amount threshold.

Specified by:
getEligibleForAutoApproval in interface PaymentRequestDao
Returns:
- an Iterator over all payment request documents eligible for automatic approval
See Also:
PaymentRequestDao.getEligibleForAutoApproval()

getDocumentNumberByPaymentRequestId

public String getDocumentNumberByPaymentRequestId(Integer id)
Description copied from interface: PaymentRequestDao
Get a payment request document number by id.

Specified by:
getDocumentNumberByPaymentRequestId in interface PaymentRequestDao
Parameters:
id - - PaymentRequest Id
Returns:
- PaymentRequest or null if not found
See Also:
PaymentRequestDao.getDocumentNumberByPaymentRequestId(java.lang.Integer)

getDocumentNumbersByPurchaseOrderId

public List<String> getDocumentNumbersByPurchaseOrderId(Integer poPurApId)
Description copied from interface: PaymentRequestDao
Retrieves a list of document numbers by purchase order id.

Specified by:
getDocumentNumbersByPurchaseOrderId in interface PaymentRequestDao
Parameters:
poPurApId - - purchase order id
Returns:
- list of document numbers
See Also:
PaymentRequestDao.getDocumentNumbersByPurchaseOrderId(java.lang.Integer)

getDocumentNumberOfPaymentRequestByCriteria

protected String getDocumentNumberOfPaymentRequestByCriteria(org.apache.ojb.broker.query.Criteria criteria)
Retrieves a document number for a payment request by user defined criteria.

Parameters:
criteria - - list of criteria to use in the retrieve
Returns:
- document number

getDocumentNumbersOfPaymentRequestByCriteria

protected Iterator<Object[]> getDocumentNumbersOfPaymentRequestByCriteria(org.apache.ojb.broker.query.Criteria criteria,
                                                                          boolean orderByAscending)
Retrieves a document number for a payment request by user defined criteria and sorts the values ascending if orderByAscending parameter is true, descending otherwise.

Parameters:
criteria - - list of criteria to use in the retrieve
orderByAscending - - boolean to sort results ascending if true, descending otherwise
Returns:
- Iterator of document numbers

getPaymentRequestsByQueryByCriteria

protected List<PaymentRequestDocument> getPaymentRequestsByQueryByCriteria(org.apache.ojb.broker.query.QueryByCriteria qbc)
Retrieves a list of payment requests by user defined criteria.

Parameters:
qbc - - query with criteria
Returns:
- list of payment requests

getActivePaymentRequestsByVendorNumberInvoiceNumber

public List<PaymentRequestDocument> getActivePaymentRequestsByVendorNumberInvoiceNumber(Integer vendorHeaderGeneratedId,
                                                                                        Integer vendorDetailAssignedId,
                                                                                        String invoiceNumber)
Retrieves a list of payment requests with the given vendor id and invoice number.

Specified by:
getActivePaymentRequestsByVendorNumberInvoiceNumber in interface PaymentRequestDao
Parameters:
vendorHeaderGeneratedId - - header id of the vendor id
vendorDetailAssignedId - - detail id of the vendor id
invoiceNumber - - invoice number as entered by AP
Returns:
- List of payment requests.

getActivePaymentRequestsByVendorNumber

public List<PaymentRequestDocument> getActivePaymentRequestsByVendorNumber(Integer vendorHeaderGeneratedId,
                                                                           Integer vendorDetailAssignedId)
Retrieves a list of payment requests with the given vendor id and invoice number.

Specified by:
getActivePaymentRequestsByVendorNumber in interface PaymentRequestDao
Parameters:
vendorHeaderGeneratedId - - header id of the vendor id
vendorDetailAssignedId - - detail id of the vendor id
invoiceNumber - - invoice number as entered by AP
Returns:
- List of payment requests.

getActivePaymentRequestsByPOIdInvoiceAmountInvoiceDate

public List<PaymentRequestDocument> getActivePaymentRequestsByPOIdInvoiceAmountInvoiceDate(Integer poId,
                                                                                           org.kuali.rice.kns.util.KualiDecimal vendorInvoiceAmount,
                                                                                           Date invoiceDate)
Description copied from interface: PaymentRequestDao
Retrieves a list of Payment Requests with the given PO Id, invoice amount, and invoice date.

Specified by:
getActivePaymentRequestsByPOIdInvoiceAmountInvoiceDate in interface PaymentRequestDao
Parameters:
poId - - purchase order ID
vendorInvoiceAmount - - amount of the invoice as entered by AP
invoiceDate - - date of the invoice as entered by AP
Returns:
- List of Pay Reqs.
See Also:
PaymentRequestDao.getActivePaymentRequestsByPOIdInvoiceAmountInvoiceDate(java.lang.Integer, org.kuali.rice.kns.util.KualiDecimal, java.sql.Date)

getActivePaymentRequestDocumentNumbersForPurchaseOrder

public List<String> getActivePaymentRequestDocumentNumbersForPurchaseOrder(Integer purchaseOrderId)
Description copied from interface: PaymentRequestDao
Retrieves a list of potentially active payment requests for a purchase order by status code. Active being defined as being enroute and before final. The issue is that a status of vendor_tax_review may not mean that it's in review, but could be in final (as there isn't a final status code for payment request). Workflow status must be checked further after retrieval.

Specified by:
getActivePaymentRequestDocumentNumbersForPurchaseOrder in interface PaymentRequestDao
Returns:

getPaymentRequestInReceivingStatus

public List<PaymentRequestDocument> getPaymentRequestInReceivingStatus()
Description copied from interface: PaymentRequestDao
Get all payment request which are waiting in receiving status queue

Specified by:
getPaymentRequestInReceivingStatus in interface PaymentRequestDao
Returns:


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