org.kuali.kfs.module.purap.document.service.impl
Class ReceivingServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.purap.document.service.impl.ReceivingServiceImpl
All Implemented Interfaces:
ReceivingService

@Transactional
public class ReceivingServiceImpl
extends Object
implements ReceivingService


Constructor Summary
ReceivingServiceImpl()
           
 
Method Summary
 void addNoteToReceivingDocument(ReceivingDocument receivingDocument, String note)
          Adds a note to a receiving document.
protected  void addUnorderedItemsToAmendment(PurchaseOrderAmendmentDocument amendment, LineItemReceivingDocument rlDoc)
          Adds an unordered item to a po amendment document.
protected  void appendDuplicateMessage(StringBuffer currentMessage, String duplicateMessageKey, Integer poId)
           
protected  void approveReceivingDoc(LineItemReceivingDocument receivingDoc)
           
 void approveReceivingDocsForPOAmendment()
          This method iterates all the line item receiving documents with Awaiting Purchase Order Open Status and approves it if the associated PO is available for amedment.
 boolean canCreateCorrectionReceivingDocument(LineItemReceivingDocument rl)
           
 boolean canCreateCorrectionReceivingDocument(LineItemReceivingDocument rl, String receivingCorrectionDocNumber)
           
 boolean canCreateLineItemReceivingDocument(Integer poId, String receivingDocumentNumber)
          Determines if a receiving line document can be created at the time the user requests it.
 boolean canCreateLineItemReceivingDocument(PurchaseOrderDocument po)
          Determines if a receiving line document can be created at the time the user requests it.
protected  boolean canCreateLineItemReceivingDocument(PurchaseOrderDocument po, String receivingDocumentNumber)
           
 void completeCorrectionReceivingDocument(ReceivingDocument correctionDocument)
          This method updates the corrected quantities on the receiving document.
 void completeReceivingDocument(ReceivingDocument receivingDocument)
          This method deletes unneeded items and updates the totals on the po and does any additional processing based on items i.e.
protected  List<org.kuali.rice.kns.bo.AdHocRoutePerson> createFyiFiscalOfficerList(ReceivingDocument recDoc)
          Creates a list of fiscal officers for new unordered items added to a purchase order.
 void createNoteForReturnedAndDamagedItems(ReceivingDocument recDoc)
           
protected  PurchaseOrderItem createPoItemFromReceivingLine(LineItemReceivingItem rlItem)
          Creates a PO item from a receiving line item.
 List<String> getCorrectionReceivingDocumentNumbersInProcessForPurchaseOrder(Integer poId, String receivingDocumentNumber)
          Returns a list of correction receiving documents in process for a purchase order
 List<String> getLineItemReceivingDocumentNumbersInProcessForPurchaseOrder(Integer poId, String receivingDocumentNumber)
          Returns a list of line item receiving documents in process for a purchase order
 List<LineItemReceivingDocument> getLineItemReceivingDocumentsInFinalForPurchaseOrder(Integer poId)
          Returns a list of line item receiving documents in final status for a purchase order
 String getReceivingDeliveryCampusCode(PurchaseOrderDocument po)
          Returns a delivery campus code on a receiving document based on the purchase order passed in.
protected  boolean hasDuplicateEntry(List<String> docNumbers)
          Looks at a list of doc numbers, but only considers an entry duplicate if the document is in a Final status.
protected  boolean hasNewUnorderedItem(LineItemReceivingDocument rlDoc)
          Checks the item list for newly added items.
protected  boolean isCorrectionReceivingDocumentInProcessForPurchaseOrder(Integer poId, String receivingDocumentNumber)
           
protected  boolean isCorrectionReceivingDocumentInProcessForReceivingLine(String receivingDocumentNumber, String receivingCorrectionDocNumber)
           
 boolean isLineItemReceivingDocumentGeneratedForPurchaseOrder(Integer poId)
          Determines if there is at least one receiving line document that has gone to final for a purchase order.
protected  boolean isLineItemReceivingDocumentInProcessForPurchaseOrder(Integer poId, String receivingDocumentNumber)
           
 boolean isPurchaseOrderActiveForLineItemReceivingDocumentCreation(Integer poId)
          Returns true, if the po is active for receiving document creation
protected  boolean isPurchaseOrderValidForLineItemReceivingDocumentCreation(PurchaseOrderDocument po)
           
 void populateAndSaveLineItemReceivingDocument(LineItemReceivingDocument rlDoc)
          A save is done passing the continue purap event so as to call a populate within prepare for save.
 void populateCorrectionReceivingDocument(CorrectionReceivingDocument rcDoc)
          Populates the receiving correction document.
 void populateCorrectionReceivingFromReceivingLine(CorrectionReceivingDocument rcDoc)
          Populates a Receiving Correction Document with information from a Receiving Line.
 void populateReceivingLineFromPurchaseOrder(LineItemReceivingDocument rlDoc)
          Populates a Receiving Line Document with information from a Purchase Order.
 HashMap<String,String> receivingLineDuplicateMessages(LineItemReceivingDocument rlDoc)
          Checks for duplicate Receiving Line documents and passes back a list of those found where vendor date, packing slip number or bill of lading match on previous receiving line documents by purchase order.
protected  void sendFyiForItems(ReceivingDocument recDoc)
          Sends an FYI to fiscal officers for new unordered items.
 void setConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService configurationService)
           
 void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
           
 void setNoteService(org.kuali.rice.kns.service.NoteService noteService)
           
 void setPurapService(PurapService purapService)
           
 void setPurchaseOrderService(PurchaseOrderService purchaseOrderService)
           
 void setReceivingDao(ReceivingDao receivingDao)
           
 void setWorkflowDocumentService(org.kuali.rice.kns.workflow.service.WorkflowDocumentService workflowDocumentService)
           
protected  void spawnPoAmendmentForUnorderedItems(ReceivingDocument receivingDocument, PurchaseOrderDocument po)
          Spawns PO amendments for new unordered items on a receiving document.
protected  void updateReceivingTotalsOnPurchaseOrder(ReceivingDocument receivingDocument, PurchaseOrderDocument poDoc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReceivingServiceImpl

public ReceivingServiceImpl()
Method Detail

setPurchaseOrderService

public void setPurchaseOrderService(PurchaseOrderService purchaseOrderService)

setReceivingDao

public void setReceivingDao(ReceivingDao receivingDao)

setDocumentService

public void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)

setWorkflowDocumentService

public void setWorkflowDocumentService(org.kuali.rice.kns.workflow.service.WorkflowDocumentService workflowDocumentService)

setConfigurationService

public void setConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService configurationService)

setPurapService

public void setPurapService(PurapService purapService)

setNoteService

public void setNoteService(org.kuali.rice.kns.service.NoteService noteService)

populateReceivingLineFromPurchaseOrder

public void populateReceivingLineFromPurchaseOrder(LineItemReceivingDocument rlDoc)
Description copied from interface: ReceivingService
Populates a Receiving Line Document with information from a Purchase Order.

Specified by:
populateReceivingLineFromPurchaseOrder in interface ReceivingService
See Also:
ReceivingService.populateReceivingLineFromPurchaseOrder(org.kuali.kfs.module.purap.document.LineItemReceivingDocument)

populateCorrectionReceivingFromReceivingLine

public void populateCorrectionReceivingFromReceivingLine(CorrectionReceivingDocument rcDoc)
Description copied from interface: ReceivingService
Populates a Receiving Correction Document with information from a Receiving Line.

Specified by:
populateCorrectionReceivingFromReceivingLine in interface ReceivingService

populateAndSaveLineItemReceivingDocument

public void populateAndSaveLineItemReceivingDocument(LineItemReceivingDocument rlDoc)
                                              throws org.kuali.rice.kew.exception.WorkflowException
Description copied from interface: ReceivingService
A save is done passing the continue purap event so as to call a populate within prepare for save.

Specified by:
populateAndSaveLineItemReceivingDocument in interface ReceivingService
Throws:
org.kuali.rice.kew.exception.WorkflowException
See Also:
ReceivingService.populateAndSaveLineItemReceivingDocument(org.kuali.kfs.module.purap.document.LineItemReceivingDocument)

populateCorrectionReceivingDocument

public void populateCorrectionReceivingDocument(CorrectionReceivingDocument rcDoc)
Description copied from interface: ReceivingService
Populates the receiving correction document.

Specified by:
populateCorrectionReceivingDocument in interface ReceivingService
See Also:
ReceivingService.populateCorrectionReceivingDocument(org.kuali.kfs.module.purap.document.CorrectionReceivingDocument)

canCreateLineItemReceivingDocument

public boolean canCreateLineItemReceivingDocument(Integer poId,
                                                  String receivingDocumentNumber)
                                           throws RuntimeException
Description copied from interface: ReceivingService
Determines if a receiving line document can be created at the time the user requests it. This version looks up the current purchase order by po id and also excludes the current receiving document from the check.

Specified by:
canCreateLineItemReceivingDocument in interface ReceivingService
Returns:
Throws:
RuntimeException
See Also:
ReceivingService.canCreateLineItemReceivingDocument(java.lang.Integer, java.lang.String)

canCreateLineItemReceivingDocument

public boolean canCreateLineItemReceivingDocument(PurchaseOrderDocument po)
                                           throws RuntimeException
Description copied from interface: ReceivingService
Determines if a receiving line document can be created at the time the user requests it. This version requires the purchase order being evaluated to be passed in.

Specified by:
canCreateLineItemReceivingDocument in interface ReceivingService
Returns:
Throws:
RuntimeException
See Also:
ReceivingService.canCreateLineItemReceivingDocument(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

canCreateLineItemReceivingDocument

protected boolean canCreateLineItemReceivingDocument(PurchaseOrderDocument po,
                                                     String receivingDocumentNumber)

isPurchaseOrderActiveForLineItemReceivingDocumentCreation

public boolean isPurchaseOrderActiveForLineItemReceivingDocumentCreation(Integer poId)
Description copied from interface: ReceivingService
Returns true, if the po is active for receiving document creation

Specified by:
isPurchaseOrderActiveForLineItemReceivingDocumentCreation in interface ReceivingService

isPurchaseOrderValidForLineItemReceivingDocumentCreation

protected boolean isPurchaseOrderValidForLineItemReceivingDocumentCreation(PurchaseOrderDocument po)

canCreateCorrectionReceivingDocument

public boolean canCreateCorrectionReceivingDocument(LineItemReceivingDocument rl)
                                             throws RuntimeException
Specified by:
canCreateCorrectionReceivingDocument in interface ReceivingService
Returns:
Throws:
RuntimeException

canCreateCorrectionReceivingDocument

public boolean canCreateCorrectionReceivingDocument(LineItemReceivingDocument rl,
                                                    String receivingCorrectionDocNumber)
                                             throws RuntimeException
Specified by:
canCreateCorrectionReceivingDocument in interface ReceivingService
Returns:
Throws:
RuntimeException

isLineItemReceivingDocumentInProcessForPurchaseOrder

protected boolean isLineItemReceivingDocumentInProcessForPurchaseOrder(Integer poId,
                                                                       String receivingDocumentNumber)
                                                                throws RuntimeException
Throws:
RuntimeException

getLineItemReceivingDocumentNumbersInProcessForPurchaseOrder

public List<String> getLineItemReceivingDocumentNumbersInProcessForPurchaseOrder(Integer poId,
                                                                                 String receivingDocumentNumber)
Description copied from interface: ReceivingService
Returns a list of line item receiving documents in process for a purchase order

Specified by:
getLineItemReceivingDocumentNumbersInProcessForPurchaseOrder in interface ReceivingService
Returns:

getLineItemReceivingDocumentsInFinalForPurchaseOrder

public List<LineItemReceivingDocument> getLineItemReceivingDocumentsInFinalForPurchaseOrder(Integer poId)
Description copied from interface: ReceivingService
Returns a list of line item receiving documents in final status for a purchase order

Specified by:
getLineItemReceivingDocumentsInFinalForPurchaseOrder in interface ReceivingService
Returns:

isCorrectionReceivingDocumentInProcessForPurchaseOrder

protected boolean isCorrectionReceivingDocumentInProcessForPurchaseOrder(Integer poId,
                                                                         String receivingDocumentNumber)
                                                                  throws RuntimeException
Throws:
RuntimeException

getCorrectionReceivingDocumentNumbersInProcessForPurchaseOrder

public List<String> getCorrectionReceivingDocumentNumbersInProcessForPurchaseOrder(Integer poId,
                                                                                   String receivingDocumentNumber)
Description copied from interface: ReceivingService
Returns a list of correction receiving documents in process for a purchase order

Specified by:
getCorrectionReceivingDocumentNumbersInProcessForPurchaseOrder in interface ReceivingService
Returns:

isCorrectionReceivingDocumentInProcessForReceivingLine

protected boolean isCorrectionReceivingDocumentInProcessForReceivingLine(String receivingDocumentNumber,
                                                                         String receivingCorrectionDocNumber)
                                                                  throws RuntimeException
Throws:
RuntimeException

receivingLineDuplicateMessages

public HashMap<String,String> receivingLineDuplicateMessages(LineItemReceivingDocument rlDoc)
Description copied from interface: ReceivingService
Checks for duplicate Receiving Line documents and passes back a list of those found where vendor date, packing slip number or bill of lading match on previous receiving line documents by purchase order.

Specified by:
receivingLineDuplicateMessages in interface ReceivingService
Returns:
See Also:
ReceivingService.receivingLineDuplicateMessages(org.kuali.kfs.module.purap.document.LineItemReceivingDocument)

hasDuplicateEntry

protected boolean hasDuplicateEntry(List<String> docNumbers)
Looks at a list of doc numbers, but only considers an entry duplicate if the document is in a Final status.

Parameters:
docNumbers -
Returns:

appendDuplicateMessage

protected void appendDuplicateMessage(StringBuffer currentMessage,
                                      String duplicateMessageKey,
                                      Integer poId)

completeCorrectionReceivingDocument

public void completeCorrectionReceivingDocument(ReceivingDocument correctionDocument)
Description copied from interface: ReceivingService
This method updates the corrected quantities on the receiving document.

Specified by:
completeCorrectionReceivingDocument in interface ReceivingService

completeReceivingDocument

public void completeReceivingDocument(ReceivingDocument receivingDocument)
This method deletes unneeded items and updates the totals on the po and does any additional processing based on items i.e. FYI etc

Specified by:
completeReceivingDocument in interface ReceivingService
Parameters:
receivingDocument - receiving document

createNoteForReturnedAndDamagedItems

public void createNoteForReturnedAndDamagedItems(ReceivingDocument recDoc)
Specified by:
createNoteForReturnedAndDamagedItems in interface ReceivingService

updateReceivingTotalsOnPurchaseOrder

protected void updateReceivingTotalsOnPurchaseOrder(ReceivingDocument receivingDocument,
                                                    PurchaseOrderDocument poDoc)

spawnPoAmendmentForUnorderedItems

protected void spawnPoAmendmentForUnorderedItems(ReceivingDocument receivingDocument,
                                                 PurchaseOrderDocument po)
Spawns PO amendments for new unordered items on a receiving document.

Parameters:
receivingDocument -
po -

hasNewUnorderedItem

protected boolean hasNewUnorderedItem(LineItemReceivingDocument rlDoc)
Checks the item list for newly added items.

Parameters:
rlDoc -
Returns:

addUnorderedItemsToAmendment

protected void addUnorderedItemsToAmendment(PurchaseOrderAmendmentDocument amendment,
                                            LineItemReceivingDocument rlDoc)
Adds an unordered item to a po amendment document.

Parameters:
amendment -
rlDoc -

createPoItemFromReceivingLine

protected PurchaseOrderItem createPoItemFromReceivingLine(LineItemReceivingItem rlItem)
Creates a PO item from a receiving line item.

Parameters:
rlItem -
Returns:

createFyiFiscalOfficerList

protected List<org.kuali.rice.kns.bo.AdHocRoutePerson> createFyiFiscalOfficerList(ReceivingDocument recDoc)
Creates a list of fiscal officers for new unordered items added to a purchase order.

Parameters:
po -
Returns:

sendFyiForItems

protected void sendFyiForItems(ReceivingDocument recDoc)
Sends an FYI to fiscal officers for new unordered items.

Parameters:
po -

addNoteToReceivingDocument

public void addNoteToReceivingDocument(ReceivingDocument receivingDocument,
                                       String note)
                                throws Exception
Description copied from interface: ReceivingService
Adds a note to a receiving document.

Specified by:
addNoteToReceivingDocument in interface ReceivingService
Throws:
Exception

getReceivingDeliveryCampusCode

public String getReceivingDeliveryCampusCode(PurchaseOrderDocument po)
Description copied from interface: ReceivingService
Returns a delivery campus code on a receiving document based on the purchase order passed in.

Specified by:
getReceivingDeliveryCampusCode in interface ReceivingService
Returns:

isLineItemReceivingDocumentGeneratedForPurchaseOrder

public boolean isLineItemReceivingDocumentGeneratedForPurchaseOrder(Integer poId)
                                                             throws RuntimeException
Description copied from interface: ReceivingService
Determines if there is at least one receiving line document that has gone to final for a purchase order.

Specified by:
isLineItemReceivingDocumentGeneratedForPurchaseOrder in interface ReceivingService
Returns:
Throws:
RuntimeException
See Also:
ReceivingService.isLineItemReceivingDocumentGeneratedForPurchaseOrder(java.lang.Integer)

approveReceivingDocsForPOAmendment

public void approveReceivingDocsForPOAmendment()
Description copied from interface: ReceivingService
This method iterates all the line item receiving documents with Awaiting Purchase Order Open Status and approves it if the associated PO is available for amedment.

Specified by:
approveReceivingDocsForPOAmendment in interface ReceivingService

approveReceivingDoc

protected void approveReceivingDoc(LineItemReceivingDocument receivingDoc)


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