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

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

@Transactional
public class PurapGeneralLedgerServiceImpl
extends Object
implements PurapGeneralLedgerService


Field Summary
 
Fields inherited from interface org.kuali.kfs.module.purap.service.PurapGeneralLedgerService
CANCEL_CREDIT_MEMO, CANCEL_PAYMENT_REQUEST, CREATE_CREDIT_MEMO, CREATE_PAYMENT_REQUEST, MODIFY_PAYMENT_REQUEST
 
Constructor Summary
PurapGeneralLedgerServiceImpl()
           
 
Method Summary
protected  org.kuali.rice.kns.util.KualiDecimal calculateQuantityChange(boolean cancel, PurchaseOrderItem poItem, org.kuali.rice.kns.util.KualiDecimal cmQuantity)
          Calculate quantity change for creating Credit Memo entries
 void customizeGeneralLedgerPendingEntry(PurchasingAccountsPayableDocument purapDocument, AccountingLine accountingLine, GeneralLedgerPendingEntry explicitEntry, Integer referenceDocumentNumber, String debitCreditCode, String docType, boolean isEncumbrance)
          Customize the given general ledger entry based on the document type.
protected  String entryDescription(String description)
          Format description for general ledger entry.
 void generateEntriesApproveAmendPurchaseOrder(PurchaseOrderDocument po)
          Generates general ledger pending entries for the amendment of a Purchase Order
 void generateEntriesCancelAccountsPayableDocument(AccountsPayableDocument apDocument)
          Generates general ledger pending entries for the cancellation of an Accounts Payable document.
protected  void generateEntriesCancelCreditMemo(VendorCreditMemoDocument cm)
          Called from generateEntriesCancelAccountsPayableDocument() for Payment Request Document
protected  void generateEntriesCancelPaymentRequest(PaymentRequestDocument preq)
          Called from generateEntriesCancelAccountsPayableDocument() for Payment Request Document
 void generateEntriesClosePurchaseOrder(PurchaseOrderDocument po)
          Generates general ledger pending entries for when a Purchase Order is closed which will disencumber all the remaining encumbrances
 void generateEntriesCreateCreditMemo(VendorCreditMemoDocument cm)
          Generates general ledger pending entries for the creation of a Credit Memo
 void generateEntriesCreatePaymentRequest(PaymentRequestDocument preq)
          Generates general ledger pending entries for the creation of a Payment Request
protected  boolean generateEntriesCreditMemo(VendorCreditMemoDocument cm, boolean isCancel)
          Creates the general ledger entries for Credit Memo actions.
 void generateEntriesModifyPaymentRequest(PaymentRequestDocument preq)
          Generates general ledger pending entries for the modification of a Payment Request.
protected  boolean generateEntriesPaymentRequest(PaymentRequestDocument preq, List encumbrances, List summaryAccounts, String processType)
          Creates the general ledger entries for Payment Request actions.
 void generateEntriesReopenPurchaseOrder(PurchaseOrderDocument po)
          Generates general ledger pending entries for when a Purchase Order is reopened which will calculate the funds to be re-encumbered
 void generateEntriesVoidPurchaseOrder(PurchaseOrderDocument po)
          Generates general ledger pending entries for when a Purchase Order is voided
protected  List<SourceAccountingLine> getCreditMemoEncumbrance(VendorCreditMemoDocument cm, PurchaseOrderDocument po, boolean cancel)
          Re-encumber the Encumbrance on a PO based on values in a PREQ.
protected  int getNextAvailableSequence(String documentNumber)
          Retrieves the next available sequence number from the general ledger pending entry table for this document
protected  PurchaseOrderItem getPoItem(PurchaseOrderDocument po, Integer nbr, ItemType itemType)
          Find item in PO based on given parameters.
protected  List<SourceAccountingLine> reencumberEncumbrance(PaymentRequestDocument preq)
          Re-encumber the Encumbrance on a PO based on values in a PREQ.
protected  List<SourceAccountingLine> relieveEncumbrance(PaymentRequestDocument preq)
          Relieve the Encumbrance on a PO based on values in a PREQ.
protected  void saveAccountsPayableSummaryAccounts(List<SummaryAccount> summaryAccounts, Integer purapDocumentIdentifier, String docType)
          Save the given accounts for the given document.
protected  void saveGLEntries(List<GeneralLedgerPendingEntry> glEntries)
          Save the given general ledger entries
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
           
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
           
 void setGeneralLedgerPendingEntryService(GeneralLedgerPendingEntryService generalLedgerPendingEntryService)
           
 void setKualiRuleService(org.kuali.rice.kns.service.KualiRuleService kualiRuleService)
           
 void setObjectCodeService(ObjectCodeService objectCodeService)
           
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
           
 void setPaymentRequestService(PaymentRequestService paymentRequestService)
           
 void setPurapAccountingService(PurapAccountingService purapAccountingService)
           
 void setPurchaseOrderService(PurchaseOrderService purchaseOrderService)
           
 void setSubObjectCodeService(SubObjectCodeService subObjectCodeService)
           
 void setUniversityDateService(UniversityDateService universityDateService)
           
protected  boolean shouldGenerateGLPEForPurchaseOrder(PurchaseOrderDocument po)
          We should not generate general ledger pending entries for Purchase Order Close Document and Purchase Order Reopen Document with $0 amount.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PurapGeneralLedgerServiceImpl

public PurapGeneralLedgerServiceImpl()
Method Detail

customizeGeneralLedgerPendingEntry

public void customizeGeneralLedgerPendingEntry(PurchasingAccountsPayableDocument purapDocument,
                                               AccountingLine accountingLine,
                                               GeneralLedgerPendingEntry explicitEntry,
                                               Integer referenceDocumentNumber,
                                               String debitCreditCode,
                                               String docType,
                                               boolean isEncumbrance)
Description copied from interface: PurapGeneralLedgerService
Customize the given general ledger entry based on the document type.

Specified by:
customizeGeneralLedgerPendingEntry in interface PurapGeneralLedgerService
Parameters:
purapDocument - Document creating entries
accountingLine - AccountingLine from document used to create the pending entry
explicitEntry - GeneralLedgerPendingEntry that has been created with account info
referenceDocumentNumber - Number of the referenced document
debitCreditCode - String field indicating if the entry is a debit or credit
docType - Document type creating the pending entries
isEncumbrance - Boolean to indicate if the entry is an encumbrance
See Also:
PurapGeneralLedgerService.customizeGeneralLedgerPendingEntry(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument, org.kuali.kfs.sys.businessobject.AccountingLine, org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry, java.lang.Integer, java.lang.String, java.lang.String, boolean)

generateEntriesCancelAccountsPayableDocument

public void generateEntriesCancelAccountsPayableDocument(AccountsPayableDocument apDocument)
Description copied from interface: PurapGeneralLedgerService
Generates general ledger pending entries for the cancellation of an Accounts Payable document.

Specified by:
generateEntriesCancelAccountsPayableDocument in interface PurapGeneralLedgerService
Parameters:
apDocument - AccountsPayableDocument which holds the accounts to create the entries for the cancellation
See Also:
PurapGeneralLedgerService.generateEntriesCancelAccountsPayableDocument(org.kuali.kfs.module.purap.document.AccountsPayableDocument)

generateEntriesCreatePaymentRequest

public void generateEntriesCreatePaymentRequest(PaymentRequestDocument preq)
Description copied from interface: PurapGeneralLedgerService
Generates general ledger pending entries for the creation of a Payment Request

Specified by:
generateEntriesCreatePaymentRequest in interface PurapGeneralLedgerService
Parameters:
preq - PaymentRequestDocument which holds the accounts to create the entries
See Also:
PurapGeneralLedgerService.generateEntriesCreatePaymentRequest(org.kuali.kfs.module.purap.document.PaymentRequestDocument)

generateEntriesCancelPaymentRequest

protected void generateEntriesCancelPaymentRequest(PaymentRequestDocument preq)
Called from generateEntriesCancelAccountsPayableDocument() for Payment Request Document

Parameters:
preq - Payment Request document to cancel
See Also:
PurapGeneralLedgerService.generateEntriesCancelAccountsPayableDocument(org.kuali.kfs.module.purap.document.AccountsPayableDocument)

generateEntriesModifyPaymentRequest

public void generateEntriesModifyPaymentRequest(PaymentRequestDocument preq)
Description copied from interface: PurapGeneralLedgerService
Generates general ledger pending entries for the modification of a Payment Request. No entries will be created if the calculated change is zero (meaning no change was made). Also, no encumbrance entries will be created.

Specified by:
generateEntriesModifyPaymentRequest in interface PurapGeneralLedgerService
Parameters:
preq - PaymentRequestDocument which holds the accounts to create the entries
See Also:
PurapGeneralLedgerService.generateEntriesModifyPaymentRequest(org.kuali.kfs.module.purap.document.PaymentRequestDocument)

generateEntriesCreateCreditMemo

public void generateEntriesCreateCreditMemo(VendorCreditMemoDocument cm)
Description copied from interface: PurapGeneralLedgerService
Generates general ledger pending entries for the creation of a Credit Memo

Specified by:
generateEntriesCreateCreditMemo in interface PurapGeneralLedgerService
Parameters:
cm - CreditMemoDocument which holds the accounts to create the entries
See Also:
org.kuali.kfs.module.purap.service.PurapGeneralLedgerService#generateEntriesCreateCreditMemo(org.kuali.kfs.module.purap.document.CreditMemoDocument)

generateEntriesCancelCreditMemo

protected void generateEntriesCancelCreditMemo(VendorCreditMemoDocument cm)
Called from generateEntriesCancelAccountsPayableDocument() for Payment Request Document

Parameters:
preq - Payment Request document to cancel
See Also:
PurapGeneralLedgerService.generateEntriesCancelAccountsPayableDocument(org.kuali.kfs.module.purap.document.AccountsPayableDocument)

getNextAvailableSequence

protected int getNextAvailableSequence(String documentNumber)
Retrieves the next available sequence number from the general ledger pending entry table for this document

Parameters:
documentNumber - Document number to find next sequence number
Returns:
Next available sequence number

generateEntriesPaymentRequest

protected boolean generateEntriesPaymentRequest(PaymentRequestDocument preq,
                                                List encumbrances,
                                                List summaryAccounts,
                                                String processType)
Creates the general ledger entries for Payment Request actions.

Parameters:
preq - Payment Request document to create entries
encumbrances - List of encumbrance accounts if applies
accountingLines - List of preq accounts to create entries
processType - Type of process (create, modify, cancel)
Returns:
Boolean returned indicating whether entry creation succeeded

generateEntriesCreditMemo

protected boolean generateEntriesCreditMemo(VendorCreditMemoDocument cm,
                                            boolean isCancel)
Creates the general ledger entries for Credit Memo actions.

Parameters:
cm - Credit Memo document to create entries
isCancel - Indicates if request is a cancel or create
Returns:
Boolean returned indicating whether entry creation succeeded

generateEntriesApproveAmendPurchaseOrder

public void generateEntriesApproveAmendPurchaseOrder(PurchaseOrderDocument po)
Description copied from interface: PurapGeneralLedgerService
Generates general ledger pending entries for the amendment of a Purchase Order

Specified by:
generateEntriesApproveAmendPurchaseOrder in interface PurapGeneralLedgerService
Parameters:
po - PurchaseOrderDocument which holds the accounts to create the entries
See Also:
PurapGeneralLedgerService.generateEntriesApproveAmendPurchaseOrder(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

generateEntriesClosePurchaseOrder

public void generateEntriesClosePurchaseOrder(PurchaseOrderDocument po)
Description copied from interface: PurapGeneralLedgerService
Generates general ledger pending entries for when a Purchase Order is closed which will disencumber all the remaining encumbrances

Specified by:
generateEntriesClosePurchaseOrder in interface PurapGeneralLedgerService
Parameters:
po - PurchaseOrderDocument which holds the accounts to create the entries
See Also:
PurapGeneralLedgerService.generateEntriesClosePurchaseOrder(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

shouldGenerateGLPEForPurchaseOrder

protected boolean shouldGenerateGLPEForPurchaseOrder(PurchaseOrderDocument po)
We should not generate general ledger pending entries for Purchase Order Close Document and Purchase Order Reopen Document with $0 amount.

Parameters:
po -
Returns:

generateEntriesReopenPurchaseOrder

public void generateEntriesReopenPurchaseOrder(PurchaseOrderDocument po)
Description copied from interface: PurapGeneralLedgerService
Generates general ledger pending entries for when a Purchase Order is reopened which will calculate the funds to be re-encumbered

Specified by:
generateEntriesReopenPurchaseOrder in interface PurapGeneralLedgerService
Parameters:
po - PurchaseOrderDocument which holds the accounts to create the entries
See Also:
PurapGeneralLedgerService.generateEntriesReopenPurchaseOrder(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

generateEntriesVoidPurchaseOrder

public void generateEntriesVoidPurchaseOrder(PurchaseOrderDocument po)
Description copied from interface: PurapGeneralLedgerService
Generates general ledger pending entries for when a Purchase Order is voided

Specified by:
generateEntriesVoidPurchaseOrder in interface PurapGeneralLedgerService
Parameters:
po - PurchaseOrderDocument which holds the accounts to create the entries
See Also:
PurapGeneralLedgerService.generateEntriesVoidPurchaseOrder(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

relieveEncumbrance

protected List<SourceAccountingLine> relieveEncumbrance(PaymentRequestDocument preq)
Relieve the Encumbrance on a PO based on values in a PREQ. This is to be called when a PREQ is created. Note: This modifies the encumbrance values on the PO and saves the PO

Parameters:
preq - PREQ for invoice
Returns:
List of accounting lines to use to create the pending general ledger entries

reencumberEncumbrance

protected List<SourceAccountingLine> reencumberEncumbrance(PaymentRequestDocument preq)
Re-encumber the Encumbrance on a PO based on values in a PREQ. This is used when a PREQ is cancelled. Note: This modifies the encumbrance values on the PO and saves the PO

Parameters:
preq - PREQ for invoice
Returns:
List of accounting lines to use to create the pending general ledger entries

getCreditMemoEncumbrance

protected List<SourceAccountingLine> getCreditMemoEncumbrance(VendorCreditMemoDocument cm,
                                                              PurchaseOrderDocument po,
                                                              boolean cancel)
Re-encumber the Encumbrance on a PO based on values in a PREQ. This is used when a PREQ is cancelled. Note: This modifies the encumbrance values on the PO and saves the PO

Parameters:
cm - Credit Memo document
po - Purchase Order document modify encumbrances
Returns:
List of accounting lines to use to create the pending general ledger entries

saveGLEntries

protected void saveGLEntries(List<GeneralLedgerPendingEntry> glEntries)
Save the given general ledger entries

Parameters:
glEntries - List of GeneralLedgerPendingEntries to be saved

saveAccountsPayableSummaryAccounts

protected void saveAccountsPayableSummaryAccounts(List<SummaryAccount> summaryAccounts,
                                                  Integer purapDocumentIdentifier,
                                                  String docType)
Save the given accounts for the given document.

Parameters:
sourceLines - Accounts to be saved
purapDocumentIdentifier - Purap document id for accounts

getPoItem

protected PurchaseOrderItem getPoItem(PurchaseOrderDocument po,
                                      Integer nbr,
                                      ItemType itemType)
Find item in PO based on given parameters. Must send either the line # or item type.

Parameters:
po - Purchase Order containing list of items
nbr - Line # of desired item (could be null)
itemType - Item type of desired item
Returns:
PurcahseOrderItem found matching given criteria

entryDescription

protected String entryDescription(String description)
Format description for general ledger entry. Currently making sure length is less than 40 char.

Parameters:
description - String to be formatted
Returns:
Formatted String

calculateQuantityChange

protected org.kuali.rice.kns.util.KualiDecimal calculateQuantityChange(boolean cancel,
                                                                       PurchaseOrderItem poItem,
                                                                       org.kuali.rice.kns.util.KualiDecimal cmQuantity)
Calculate quantity change for creating Credit Memo entries

Parameters:
cancel - Boolean indicating whether entries are for creation or cancellation of credit memo
poItem - Purchase Order Item
cmQuantity - Quantity on credit memo item
Returns:
Calculated change

setDateTimeService

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

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)

setGeneralLedgerPendingEntryService

public void setGeneralLedgerPendingEntryService(GeneralLedgerPendingEntryService generalLedgerPendingEntryService)

setKualiRuleService

public void setKualiRuleService(org.kuali.rice.kns.service.KualiRuleService kualiRuleService)

setPurapAccountingService

public void setPurapAccountingService(PurapAccountingService purapAccountingService)

setUniversityDateService

public void setUniversityDateService(UniversityDateService universityDateService)

setPurchaseOrderService

public void setPurchaseOrderService(PurchaseOrderService purchaseOrderService)

setObjectCodeService

public void setObjectCodeService(ObjectCodeService objectCodeService)

setSubObjectCodeService

public void setSubObjectCodeService(SubObjectCodeService subObjectCodeService)

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)

setPaymentRequestService

public void setPaymentRequestService(PaymentRequestService paymentRequestService)


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