org.kuali.kfs.module.purap.service.impl
Class PdpExtractServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.purap.service.impl.PdpExtractServiceImpl
All Implemented Interfaces:
PdpExtractService

@Transactional
public class PdpExtractServiceImpl
extends Object
implements PdpExtractService

Implementation of PdpExtractService


Nested Class Summary
protected  class PdpExtractServiceImpl.AccountingInfo
          Holds temporary accounting information for combining into payment accounting details
protected  class PdpExtractServiceImpl.Totals
          Holds total count and amount for extract
 
Constructor Summary
PdpExtractServiceImpl()
           
 
Method Summary
protected  void addAccounts(AccountsPayableDocument accountsPayableDocument, PaymentDetail paymentDetail, String documentType)
          Add accounts to a PDP Payment Detail
protected  void addNotes(AccountsPayableDocument accountsPayableDocument, PaymentDetail paymentDetail)
          Add Notes to a PDP Payment Detail
protected  PaymentGroup buildPaymentGroup(List<PaymentRequestDocument> paymentRequests, List<VendorCreditMemoDocument> creditMemos, Batch batch)
          Create the PDP payment group from a list of payment requests & credit memos
protected  Batch createBatch(String campusCode, org.kuali.rice.kim.bo.Person puser, Date processRunDate)
          Create a new PDP batch
 void extractImmediatePaymentsOnly()
          Extract all payments marked immediate.
protected  void extractPayments(boolean immediateOnly, Date processRunDate)
          Extracts payments from the database
 void extractPayments(Date runDate)
          Extract all payments ready to be paid.
protected  void extractPaymentsForCampus(String campusCode, org.kuali.rice.kim.bo.Person puser, Date processRunDate, boolean immediateOnly)
          Handle a single campus
protected  PdpExtractServiceImpl.Totals extractRegularPaymentsForChart(String campusCode, org.kuali.rice.kim.bo.Person puser, Date processRunDate, Batch batch)
          Get all the payments that could be combined with credit memos
protected  PdpExtractServiceImpl.Totals extractSpecialPaymentsForChart(String campusCode, org.kuali.rice.kim.bo.Person puser, Date processRunDate, Batch batch, boolean immediatesOnly)
          Get all the special payments for a campus and process them
protected  List<String> getChartCodes(boolean immediatesOnly, Date processRunDate)
          Find all the campuses that have payments to process
 org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
          Gets the dataDictionaryService attribute.
protected  int getMaxNoteLines()
           
protected  org.kuali.rice.kim.service.PersonService<org.kuali.rice.kim.bo.Person> getPersonService()
           
protected  PaymentDetail populatePaymentDetail(PaymentRequestDocument paymentRequestDocument, Batch batch)
          Create a PDP Payment Detail record from a Payment Request document
protected  PaymentDetail populatePaymentDetail(VendorCreditMemoDocument creditMemoDocument, Batch batch)
          Create a PDP payment detail record from a Credit Memo document
protected  PaymentGroup populatePaymentGroup(PaymentRequestDocument paymentRequestDocument, Batch batch)
          Populate the PDP Payment Group from fields on a payment request
protected  PaymentGroup populatePaymentGroup(VendorCreditMemoDocument creditMemoDocument, Batch batch)
          Populates a PaymentGroup record from a Credit Memo document
protected  void processPaymentBundle(List<PaymentRequestDocument> paymentRequests, List<VendorCreditMemoDocument> creditMemos, PdpExtractServiceImpl.Totals totals, List<String> preqsWithOutstandingCreditMemos, org.kuali.rice.kim.bo.Person puser, Date processRunDate, Batch batch)
          Processes the list of payment requests and credit memos as a payment group pending
protected  PaymentGroup processSinglePaymentRequestDocument(PaymentRequestDocument paymentRequestDocument, Batch batch, org.kuali.rice.kim.bo.Person puser, Date processRunDate)
          Handle a single payment request with no credit memos
 void setBankService(BankService bankService)
          Sets the bankService attribute value.
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
          Sets the businessObjectService attribute value.
 void setCreditMemoService(CreditMemoService creditMemoService)
          Sets the creditMemoService attribute value.
 void setCustomerProfileService(CustomerProfileService customerProfileService)
          Sets the customerProfileService attribute value.
 void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
          Sets the dataDictionaryService attribute value.
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
          Sets the dateTimeService attribute value.
 void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
          Sets the documentService attribute value.
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
          Sets the parameterService attribute value.
 void setPaymentDetailService(PaymentDetailService paymentDetailService)
          Sets the paymentDetailService attribute value.
 void setPaymentFileEmailService(PdpEmailService paymentFileEmailService)
          Sets the paymentFileEmailService attribute value.
 void setPaymentFileService(PaymentFileService paymentFileService)
          Sets the paymentFileService attribute value.
 void setPaymentGroupService(PaymentGroupService paymentGroupService)
          Sets the paymentGroupService attribute value.
 void setPaymentRequestService(PaymentRequestService paymentRequestService)
          Sets the paymentRequestService attribute value.
 void setPurapAccountingService(PurapAccountingServiceImpl purapAccountingService)
           
 void setPurapRunDateService(PurapRunDateService purapRunDateService)
          Sets the purapRunDateService attribute value.
protected  void updateCreditMemo(VendorCreditMemoDocument creditMemoDocument, org.kuali.rice.kim.bo.Person puser, Date processRunDate)
          Mark a credit memo as extracted
protected  void updatePaymentRequest(PaymentRequestDocument paymentRequestDocument, org.kuali.rice.kim.bo.Person puser, Date processRunDate)
          Mark a payment request as extracted
protected  boolean validatePaymentGroup(PaymentGroup paymentGroup)
          Checks payment group note lines does not exceed the maximum allowed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdpExtractServiceImpl

public PdpExtractServiceImpl()
Method Detail

extractImmediatePaymentsOnly

public void extractImmediatePaymentsOnly()
Description copied from interface: PdpExtractService
Extract all payments marked immediate. This won't combine any payments with credit memos.

Specified by:
extractImmediatePaymentsOnly in interface PdpExtractService
See Also:
PdpExtractService.extractImmediatePaymentsOnly()

extractPayments

public void extractPayments(Date runDate)
Description copied from interface: PdpExtractService
Extract all payments ready to be paid. This may combine payments with appropriate credit memos

Specified by:
extractPayments in interface PdpExtractService
Parameters:
runDate - the date to assume when the process (e.g. a batch Step or Job) was started to extract payments
See Also:
PdpExtractService.extractPayments(Date)

extractPayments

protected void extractPayments(boolean immediateOnly,
                               Date processRunDate)
Extracts payments from the database

Parameters:
immediateOnly - whether to pick up immediate payments only
processRunDate - time/date to use to put on the Batch that's created; and when immediateOnly is false, is also used as the maximum allowed PREQ pay date when searching PREQ documents eligible to have payments extracted

extractPaymentsForCampus

protected void extractPaymentsForCampus(String campusCode,
                                        org.kuali.rice.kim.bo.Person puser,
                                        Date processRunDate,
                                        boolean immediateOnly)
Handle a single campus

Parameters:
campusCode -
puser -
processRunDate -

extractRegularPaymentsForChart

protected PdpExtractServiceImpl.Totals extractRegularPaymentsForChart(String campusCode,
                                                                      org.kuali.rice.kim.bo.Person puser,
                                                                      Date processRunDate,
                                                                      Batch batch)
Get all the payments that could be combined with credit memos

Parameters:
campusCode -
puser -
processRunDate -
batch -
Returns:
Totals

processPaymentBundle

protected void processPaymentBundle(List<PaymentRequestDocument> paymentRequests,
                                    List<VendorCreditMemoDocument> creditMemos,
                                    PdpExtractServiceImpl.Totals totals,
                                    List<String> preqsWithOutstandingCreditMemos,
                                    org.kuali.rice.kim.bo.Person puser,
                                    Date processRunDate,
                                    Batch batch)
Processes the list of payment requests and credit memos as a payment group pending

Parameters:
paymentRequests -
creditMemos -
totals -
preqsWithOutstandingCreditMemos -
puser -
processRunDate -
batch -

processSinglePaymentRequestDocument

protected PaymentGroup processSinglePaymentRequestDocument(PaymentRequestDocument paymentRequestDocument,
                                                           Batch batch,
                                                           org.kuali.rice.kim.bo.Person puser,
                                                           Date processRunDate)
Handle a single payment request with no credit memos

Parameters:
paymentRequestDocument -
batch -
puser -
processRunDate -
Returns:
PaymentGroup

extractSpecialPaymentsForChart

protected PdpExtractServiceImpl.Totals extractSpecialPaymentsForChart(String campusCode,
                                                                      org.kuali.rice.kim.bo.Person puser,
                                                                      Date processRunDate,
                                                                      Batch batch,
                                                                      boolean immediatesOnly)
Get all the special payments for a campus and process them

Parameters:
campusCode -
puser -
processRunDate -
batch -
Returns:
Totals

updateCreditMemo

protected void updateCreditMemo(VendorCreditMemoDocument creditMemoDocument,
                                org.kuali.rice.kim.bo.Person puser,
                                Date processRunDate)
Mark a credit memo as extracted

Parameters:
creditMemoDocument -
puser -
processRunDate -

updatePaymentRequest

protected void updatePaymentRequest(PaymentRequestDocument paymentRequestDocument,
                                    org.kuali.rice.kim.bo.Person puser,
                                    Date processRunDate)
Mark a payment request as extracted

Parameters:
prd -
puser -
processRunDate -

buildPaymentGroup

protected PaymentGroup buildPaymentGroup(List<PaymentRequestDocument> paymentRequests,
                                         List<VendorCreditMemoDocument> creditMemos,
                                         Batch batch)
Create the PDP payment group from a list of payment requests & credit memos

Parameters:
paymentRequests -
creditMemos -
batch -
Returns:
PaymentGroup

validatePaymentGroup

protected boolean validatePaymentGroup(PaymentGroup paymentGroup)
Checks payment group note lines does not exceed the maximum allowed

Parameters:
paymentGroup - group to validate
Returns:
true if group is valid, false otherwise

getMaxNoteLines

protected int getMaxNoteLines()
Returns:
configured maximum number of note lines allowed

populatePaymentDetail

protected PaymentDetail populatePaymentDetail(VendorCreditMemoDocument creditMemoDocument,
                                              Batch batch)
Create a PDP payment detail record from a Credit Memo document

Parameters:
creditMemoDocument - Credit Memo to use for payment detail
batch - current PDP batch object
Returns:
populated PaymentDetail line

populatePaymentDetail

protected PaymentDetail populatePaymentDetail(PaymentRequestDocument paymentRequestDocument,
                                              Batch batch)
Create a PDP Payment Detail record from a Payment Request document

Parameters:
paymentRequestDocument - Payment Request to use for Payment Detail
batch - current PDP batch object
Returns:
populated PaymentDetail line

addAccounts

protected void addAccounts(AccountsPayableDocument accountsPayableDocument,
                           PaymentDetail paymentDetail,
                           String documentType)
Add accounts to a PDP Payment Detail

Parameters:
accountsPayableDocument -
paymentDetail -
documentType -

addNotes

protected void addNotes(AccountsPayableDocument accountsPayableDocument,
                        PaymentDetail paymentDetail)
Add Notes to a PDP Payment Detail

Parameters:
accountsPayableDocument -
paymentDetail -

populatePaymentGroup

protected PaymentGroup populatePaymentGroup(PaymentRequestDocument paymentRequestDocument,
                                            Batch batch)
Populate the PDP Payment Group from fields on a payment request

Parameters:
paymentRequestDocument -
batch -
Returns:
PaymentGroup

populatePaymentGroup

protected PaymentGroup populatePaymentGroup(VendorCreditMemoDocument creditMemoDocument,
                                            Batch batch)
Populates a PaymentGroup record from a Credit Memo document

Parameters:
creditMemoDocument -
batch -
Returns:
PaymentGroup

createBatch

protected Batch createBatch(String campusCode,
                            org.kuali.rice.kim.bo.Person puser,
                            Date processRunDate)
Create a new PDP batch

Parameters:
campusCode -
puser -
processRunDate -
Returns:
Batch

getChartCodes

protected List<String> getChartCodes(boolean immediatesOnly,
                                     Date processRunDate)
Find all the campuses that have payments to process

Returns:
List

setPaymentRequestService

public void setPaymentRequestService(PaymentRequestService paymentRequestService)
Sets the paymentRequestService attribute value.

Parameters:
paymentRequestService - The paymentRequestService to set.

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
Sets the businessObjectService attribute value.

Parameters:
businessObjectService - The businessObjectService to set.

setPaymentFileService

public void setPaymentFileService(PaymentFileService paymentFileService)
Sets the paymentFileService attribute value.

Parameters:
paymentFileService - The paymentFileService to set.

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
Sets the parameterService attribute value.

Parameters:
parameterService - The parameterService to set.

setCustomerProfileService

public void setCustomerProfileService(CustomerProfileService customerProfileService)
Sets the customerProfileService attribute value.

Parameters:
customerProfileService - The customerProfileService to set.

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
Sets the dateTimeService attribute value.

Parameters:
dateTimeService - The dateTimeService to set.

setPaymentGroupService

public void setPaymentGroupService(PaymentGroupService paymentGroupService)
Sets the paymentGroupService attribute value.

Parameters:
paymentGroupService - The paymentGroupService to set.

setPaymentDetailService

public void setPaymentDetailService(PaymentDetailService paymentDetailService)
Sets the paymentDetailService attribute value.

Parameters:
paymentDetailService - The paymentDetailService to set.

setCreditMemoService

public void setCreditMemoService(CreditMemoService creditMemoService)
Sets the creditMemoService attribute value.

Parameters:
creditMemoService - The creditMemoService to set.

setDocumentService

public void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
Sets the documentService attribute value.

Parameters:
documentService - The documentService to set.

setPurapRunDateService

public void setPurapRunDateService(PurapRunDateService purapRunDateService)
Sets the purapRunDateService attribute value.

Parameters:
purapRunDateService - The purapRunDateService to set.

setPaymentFileEmailService

public void setPaymentFileEmailService(PdpEmailService paymentFileEmailService)
Sets the paymentFileEmailService attribute value.

Parameters:
paymentFileEmailService - The paymentFileEmailService to set.

setBankService

public void setBankService(BankService bankService)
Sets the bankService attribute value.

Parameters:
bankService - The bankService to set.

getDataDictionaryService

public org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
Gets the dataDictionaryService attribute.

Returns:
Returns the dataDictionaryService.

setDataDictionaryService

public void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
Sets the dataDictionaryService attribute value.

Parameters:
dataDictionaryService - The dataDictionaryService to set.

setPurapAccountingService

public void setPurapAccountingService(PurapAccountingServiceImpl purapAccountingService)

getPersonService

protected org.kuali.rice.kim.service.PersonService<org.kuali.rice.kim.bo.Person> getPersonService()
Returns:
Returns the personService.


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