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

java.lang.Object
  extended by org.kuali.kfs.module.purap.document.service.impl.PurchaseOrderServiceImpl
All Implemented Interfaces:
PurchaseOrderService, PurchasingDocumentSpecificService

@Transactional
public class PurchaseOrderServiceImpl
extends Object
implements PurchaseOrderService


Field Summary
protected  org.kuali.rice.kns.service.DateTimeService dateTimeService
           
protected  PurapService purapService
           
 
Constructor Summary
PurchaseOrderServiceImpl()
           
 
Method Summary
protected  void addNoteForCommodityCodeToVendor(org.kuali.rice.kns.maintenance.Maintainable maintainable, String documentNumber, Integer poID)
          Creates a note to be added to the Vendor Maintenance Document which is spawned from the PurchaseOrderDocument.
protected  void addStringErrorMessagesToErrorMap(String errorKey, Collection<String> errors)
          Loops through the collection of error messages and adding each of them to the error map.
protected  void attemptSetupOfInitialOpenOfDocument(PurchaseOrderDocument po)
          If the status of the purchase order is not OPEN and the initial open date is null, sets the initial open date to current date and update the status to OPEN, then save the purchase order.
 boolean autoCloseFullyDisencumberedOrders()
          This gets a list of Purchase Orders in Open status and checks to see if their line item encumbrances are all fully disencumbered and if so then the Purchase Order is closed and notes added to indicate the change occurred in batch
 boolean autoCloseRecurringOrders()
          - PO status is OPEN - Recurring payment type code is not null - Vendor Choice is not Sub-Contract - PO End Date <= parm date (comes from system parameter) - Verify that the system parameter date entered is not greater than the current date minus three months.
 boolean canAmendPurchaseOrder(PurchaseOrderDocument purchaseOrder)
          Determines whether to display the amend button for the purchase order document.
 boolean canHoldPayment(PurchaseOrderDocument purchaseOrder)
          Determines whether to display the amend and payment hold buttons for the purchase order document.
 HashMap<String,List<PurchaseOrderItem>> categorizeItemsForSplit(List<PurchaseOrderItem> items)
          Used to provide sublists of the list of the original PO's items according to whether they are marked to be moved or not.
protected  boolean checkForLockingDocument(org.kuali.rice.kns.document.MaintenanceDocument document)
          Checks whether the vendor is currently locked.
protected  boolean completeB2BPurchaseOrder(PurchaseOrderDocument po)
           
 void completePurchaseOrder(PurchaseOrderDocument po)
          Performs the steps needed to complete the newly approved purchase order document, which consists of setting the current and pending indicators for the purchase order document and if the status is not pending transmission, then calls the attemptsSetupOfInitialOpenOfDocument to set the statuses, the initial open date and save the document.
 void completePurchaseOrderAmendment(PurchaseOrderDocument poa)
           
 PurchaseOrderDocument createAndRoutePotentialChangeDocument(String documentNumber, String docType, String annotation, List adhocRoutingRecipients, String currentDocumentStatusCode)
          Creates and routes the purchase order change document (for example, PurchaseOrderCloseDocument) based on an existing purchase order document.
 PurchaseOrderDocument createAndSavePotentialChangeDocument(String documentNumber, String docType, String currentDocumentStatusCode)
          Creates and saves the purchase order change document (for example, PurchaseOrderAmendmentDocument) based on an existing purchase order document.
 PurchaseOrderSplitDocument createAndSavePurchaseOrderSplitDocument(List<PurchaseOrderItem> newPOItems, PurchaseOrderDocument currentDocument, boolean copyNotes, String splitNoteText)
          Creates and saves a Purchase Order Split document based on the old PO document, and the items from that PO that the new Split PO is to contain.
 void createAutomaticPurchaseOrderDocument(RequisitionDocument reqDocument)
          Creates an automatic purchase order document using the given requisition document
 PurchasingCapitalAssetItem createCamsItem(PurchasingDocument purDoc, PurApItem purapItem)
           
 CapitalAssetSystem createCapitalAssetSystem()
           
protected  List<org.kuali.rice.kns.bo.AdHocRoutePerson> createFyiFiscalOfficerListForNewUnorderedItems(PurchaseOrderDocument po)
          Creates a list of fiscal officers for new unordered items added to a purchase order.
protected  void createNoteForAutoCloseOrders(PurchaseOrderDocument purchaseOrderDocument, String annotation)
          Creates and add a note to the purchase order document using the annotation String in the input parameter.
 PurchaseOrderDocument createPurchaseOrderDocument(RequisitionDocument reqDocument, String newSessionUserId, Integer contractManagerCode)
          Creates a PurchaseOrderDocument from given RequisitionDocument.
protected  PurchaseOrderDocument createPurchaseOrderDocumentFromSourceDocument(PurchaseOrderDocument sourceDocument, String docType)
          This method creates a new Purchase Order Document using the given document type based off the given source document.
protected  void fixDbNoteFields(PurchaseOrderDocument documentBusinessObject, List<org.kuali.rice.kns.bo.Note> dbNotes)
          This method fixes non ojb managed missing fields from the db
protected  void fixItemReferences(PurchaseOrderDocument po)
          This method fixes the item references in this document
protected  PurchaseOrderDocument generatePurchaseOrderFromRequisition(RequisitionDocument reqDocument)
          Create Purchase Order and populate with data from Requisition and other default data
protected  Set<Class> getClassesToExcludeFromCopy()
          Gets a set of classes to exclude from those whose fields will be copied during a copy operation from one Document to another.
 PurchaseOrderDocument getCurrentPurchaseOrder(Integer id)
          Obtains the purchase order document whose current indicator is true, given a purchase order id which is the purapDocumentIdentifier.
protected  String getCurrentRouteNodeName(org.kuali.rice.kns.workflow.service.KualiWorkflowDocument wd)
          Returns the current route node name.
protected  List<String> getExcludedVendorChoiceCodes()
          Gets a List of excluded vendor choice codes from PurapConstants.
 org.kuali.rice.kns.util.KualiDecimal getInternalPurchasingDollarLimit(PurchaseOrderDocument document)
          Obtains the internal purchasing dollar limit amount for a purchase order document.
 PurchaseOrderDocument getOldestPurchaseOrder(PurchaseOrderDocument po, PurchaseOrderDocument documentBusinessObject)
          Obtains the oldest purchase order given the purchase order object to be used to search, then calls the updateNotes method to set the notes on the oldest purchase order and finally return the oldest purchase order.
 List getPendingPurchaseOrderFaxes()
          This method gets all the Purchase orders that are waiting for faxing
protected  org.kuali.rice.kim.service.PersonService<org.kuali.rice.kim.bo.Person> getPersonService()
           
 PurchaseOrderDocument getPurchaseOrderByDocumentNumber(String documentNumber)
          Obtains the purchase order document given the document number.
 ArrayList<org.kuali.rice.kns.bo.Note> getPurchaseOrderNotes(Integer id)
          Obtains all the notes that belong to this purchase order given the purchase order id.
 ArrayList<PurchaseOrderQuoteStatus> getPurchaseOrderQuoteStatusCodes()
           
protected  Calendar getTodayMinusThreeMonths()
          Creates and returns a Calendar object of today minus three months.
 boolean hasNewUnorderedItem(PurchaseOrderDocument po)
          Checks the item list for newly added unordered items.
 boolean isNewItemForAmendment(PurchaseOrderItem poItem)
          Determines if a purchase order item is newly added on the Purchase Order Amendment Document.
 boolean isNewUnorderedItem(PurchaseOrderItem poItem)
          Determines if a purchase order item is new unordered item.
 boolean isPurchaseOrderOpenForProcessing(Integer poId)
           
 boolean isPurchaseOrderOpenForProcessing(PurchaseOrderDocument purchaseOrderDocument)
           
 void performPrintPurchaseOrderPDFOnly(String documentNumber, ByteArrayOutputStream baosPDF)
          Generates and displays the purchase order pdf by invoking the generatePurchaseOrderPdf method of the PrintService.
 void performPurchaseOrderFirstTransmitViaPrinting(String documentNumber, ByteArrayOutputStream baosPDF)
          Creates and displays the pdf document for the purchase order, sets the transmit dates, calls the takeAllActionsForGivenCriteria method in PurApWorkflowIntegrationService to perform all the workflow related steps that are necessary as part of the document initial print transmission and then performs the setup of initial of open document of the purchase order.
 void performPurchaseOrderPreviewPrinting(String documentNumber, ByteArrayOutputStream baosPDF)
          Creates and displays the pdf document for the purchase order with a draft watermark
protected  PurchaseOrderVendorQuote populateAddressForPOVendorQuote(VendorDetail newVendor, String documentNumber)
          Creates the new PurchaseOrderVendorQuote and populate the address fields for it.
 PurchaseOrderVendorQuote populateQuoteWithVendor(Integer headerId, Integer detailId, String documentNumber)
          Creates a PurchaseOrderVendorQuote based on the data on the selected vendor and the document number.
 boolean printPurchaseOrderQuotePDF(PurchaseOrderDocument po, PurchaseOrderVendorQuote povq, ByteArrayOutputStream baosPDF)
          TODO RELEASE 3 - QUOTE
 boolean printPurchaseOrderQuoteRequestsListPDF(String documentNumber, ByteArrayOutputStream baosPDF)
          TODO RELEASE 3 - QUOTE
 void processACMReq(ContractManagerAssignmentDocument acmDoc)
          This method takes care of creating PurchaseOrderDocuments from a list of Requisitions on an ACM
protected  void resetAutoCloseRecurringOrderDateParameter()
          Resets the AUTO_CLOSE_RECURRING_ORDER_DT system parameter to "mm/dd/yyyy".
 void retransmitB2BPurchaseOrder(PurchaseOrderDocument po)
           
 void retransmitPurchaseOrderPDF(PurchaseOrderDocument po, ByteArrayOutputStream baosPDF)
          Generates and displays the purchase order retransmit pdf by invoking the generatePurchaseOrderPdfForRetransmission method of the PrintService.
 List<PurchasingCapitalAssetItem> retrieveCapitalAssetItemsForIndividual(Integer poId)
          Return a list of PurchasingCapitalAssetItems where each item would have a CapitalAssetSystem.
 CapitalAssetSystem retrieveCapitalAssetSystemForOneSystem(Integer poId)
          Return a CapitalAssetSystem which provides the capital asset information such as asset numbers and asset type.
 List<CapitalAssetSystem> retrieveCapitalAssetSystemsForMultipleSystem(Integer poId)
          Return a list of CapitalAssetSystems which provide the capital asset information such as asset numbers and asset type.
protected  void saveDocumentNoValidationUsingClearErrorMap(PurchaseOrderDocument document)
          Sets the error map to a new, empty error map before calling saveDocumentNoValidation to save the document.
protected  void saveDocumentStandardSave(PurchaseOrderDocument document)
          Calls the saveDocument method of documentService to save the document.
protected  void sendFyiForNewUnorderedItems(PurchaseOrderDocument po)
          Sends an FYI to fiscal officers for new unordered items.
protected  void sendMessage(org.kuali.rice.kns.mail.MailMessage message, String emailBody)
          Sends the email by calling the sendMessage method in mailService and log error if exception occurs during the attempt to send the message.
 void setB2bPurchaseOrderService(B2BPurchaseOrderService purchaseOrderService)
           
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService boService)
           
 void setCurrentAndPendingIndicatorsForApprovedPODocuments(PurchaseOrderDocument newPO)
          Sets the current and pending indicators of the new purchase order and the old purchase order as well as its status, then save the purchase order.
 void setCurrentAndPendingIndicatorsForCancelledChangePODocuments(PurchaseOrderDocument newPO)
          Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order.
 void setCurrentAndPendingIndicatorsForCancelledRemoveHoldPODocuments(PurchaseOrderDocument newPO)
          Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order
 void setCurrentAndPendingIndicatorsForCancelledReopenPODocuments(PurchaseOrderDocument newPO)
          Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order.
 void setCurrentAndPendingIndicatorsForDisapprovedChangePODocuments(PurchaseOrderDocument newPO)
          Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order.
 void setCurrentAndPendingIndicatorsForDisapprovedRemoveHoldPODocuments(PurchaseOrderDocument newPO)
          Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order.
 void setCurrentAndPendingIndicatorsForDisapprovedReopenPODocuments(PurchaseOrderDocument newPO)
          Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order.
 void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
           
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
           
 void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
           
 void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService)
           
 void setKualiRuleService(org.kuali.rice.kns.service.KualiRuleService kualiRuleService)
           
 void setMailService(org.kuali.rice.kns.service.MailService mailService)
           
 void setMaintenanceDocumentService(org.kuali.rice.kns.service.MaintenanceDocumentService maintenanceDocumentService)
           
protected  org.kuali.rice.kns.mail.MailMessage setMessageAddressesAndSubject(org.kuali.rice.kns.mail.MailMessage message, String parameterEmail)
          Sets the to addresses, from address and the subject of the email.
 void setNoteService(org.kuali.rice.kns.service.NoteService noteService)
           
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
           
 void setPrintService(PrintService printService)
           
 void setPurapService(PurapService purapService)
           
 void setPurapWorkflowIntegrationService(PurApWorkflowIntegrationService purapWorkflowIntegrationService)
           
 void setPurchaseOrderDao(PurchaseOrderDao purchaseOrderDao)
           
 void setReceivingRequiredIndicatorForPurchaseOrder(PurchaseOrderDocument po)
          Performs a threshold check on the purchase order to determine if any attribute on the purchase order falls within a defined threshold.
 void setRequisitionService(RequisitionService requisitionService)
           
protected  void setupDocumentForPendingFirstTransmission(PurchaseOrderDocument po)
          Update the purchase order document with the appropriate status for pending first transmission based on the transmission type.
 void setVendorService(VendorService vendorService)
           
 void setWorkflowDocumentService(org.kuali.rice.kns.workflow.service.WorkflowDocumentService workflowDocumentService)
           
 void setWorkflowInfoService(org.kuali.rice.kns.workflow.service.KualiWorkflowInfo workflowInfoService)
           
protected  void updateCapitalAssetRelatedCollections(PurchaseOrderDocument newDocument)
           
protected  void updateCurrentDocumentForNoPendingAction(PurchaseOrderDocument newPO, String newPOStatus, String oldPOStatus)
          Update the statuses of both the old purchase order and the new purchase orders, then save the old and the new purchase orders.
protected  void updateDefaultVendorAddress(VendorDetail vendor)
          Obtains the defaultAddress of the vendor and setting the default address fields on the vendor.
protected  void updateNotes(PurchaseOrderDocument po, PurchaseOrderDocument documentBusinessObject)
          If the purchase order's object id is not null (I think this means if it's an existing purchase order that had already been saved to the db previously), get the notes of the purchase order from the database, fix the notes' fields by calling the fixDbNoteFields, then set the notes to the purchase order.
 void updateVendorCommodityCode(PurchaseOrderDocument po)
          If there are commodity codes on the items on the PurchaseOrderDocument that haven't existed yet on the vendor that the PurchaseOrderDocument is using, then we will spawn a new VendorDetailMaintenanceDocument automatically to update the vendor with the commodity codes that aren't already existing on the vendor.
 VendorDetail updateVendorWithMissingCommodityCodesIfNecessary(PurchaseOrderDocument po)
          Check whether each of the items contain commodity code, if so then loop through the vendor commodity codes on the vendor to find out whether the commodity code on the item has existed on the vendor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dateTimeService

protected org.kuali.rice.kns.service.DateTimeService dateTimeService

purapService

protected PurapService purapService
Constructor Detail

PurchaseOrderServiceImpl

public PurchaseOrderServiceImpl()
Method Detail

setB2bPurchaseOrderService

public void setB2bPurchaseOrderService(B2BPurchaseOrderService purchaseOrderService)

setBusinessObjectService

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

setDateTimeService

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

setDocumentService

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

setNoteService

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

setPurapService

public void setPurapService(PurapService purapService)

setPrintService

public void setPrintService(PrintService printService)

setPurchaseOrderDao

public void setPurchaseOrderDao(PurchaseOrderDao purchaseOrderDao)

setWorkflowDocumentService

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

setKualiConfigurationService

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

setKualiRuleService

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

setVendorService

public void setVendorService(VendorService vendorService)

setRequisitionService

public void setRequisitionService(RequisitionService requisitionService)

setPurapWorkflowIntegrationService

public void setPurapWorkflowIntegrationService(PurApWorkflowIntegrationService purapWorkflowIntegrationService)

setWorkflowInfoService

public void setWorkflowInfoService(org.kuali.rice.kns.workflow.service.KualiWorkflowInfo workflowInfoService)

setMaintenanceDocumentService

public void setMaintenanceDocumentService(org.kuali.rice.kns.service.MaintenanceDocumentService maintenanceDocumentService)

setParameterService

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

setMailService

public void setMailService(org.kuali.rice.kns.service.MailService mailService)

isPurchaseOrderOpenForProcessing

public boolean isPurchaseOrderOpenForProcessing(Integer poId)
Specified by:
isPurchaseOrderOpenForProcessing in interface PurchaseOrderService

isPurchaseOrderOpenForProcessing

public boolean isPurchaseOrderOpenForProcessing(PurchaseOrderDocument purchaseOrderDocument)
Specified by:
isPurchaseOrderOpenForProcessing in interface PurchaseOrderService

saveDocumentNoValidationUsingClearErrorMap

protected void saveDocumentNoValidationUsingClearErrorMap(PurchaseOrderDocument document)
Sets the error map to a new, empty error map before calling saveDocumentNoValidation to save the document.

Parameters:
document - The purchase order document to be saved.

saveDocumentStandardSave

protected void saveDocumentStandardSave(PurchaseOrderDocument document)
Calls the saveDocument method of documentService to save the document.

Parameters:
document - The document to be saved.

createCamsItem

public PurchasingCapitalAssetItem createCamsItem(PurchasingDocument purDoc,
                                                 PurApItem purapItem)
Specified by:
createCamsItem in interface PurchasingDocumentSpecificService

createCapitalAssetSystem

public CapitalAssetSystem createCapitalAssetSystem()
Specified by:
createCapitalAssetSystem in interface PurchasingDocumentSpecificService

createAutomaticPurchaseOrderDocument

public void createAutomaticPurchaseOrderDocument(RequisitionDocument reqDocument)
Description copied from interface: PurchaseOrderService
Creates an automatic purchase order document using the given requisition document

Specified by:
createAutomaticPurchaseOrderDocument in interface PurchaseOrderService
Parameters:
reqDocument - The requisition document that this method will use to create the Automated Purchase Order (APO).
See Also:
PurchaseOrderService.createAutomaticPurchaseOrderDocument(org.kuali.kfs.module.purap.document.RequisitionDocument)

createPurchaseOrderDocument

public PurchaseOrderDocument createPurchaseOrderDocument(RequisitionDocument reqDocument,
                                                         String newSessionUserId,
                                                         Integer contractManagerCode)
Description copied from interface: PurchaseOrderService
Creates a PurchaseOrderDocument from given RequisitionDocument. Both documents need to be saved after this method is called.

Specified by:
createPurchaseOrderDocument in interface PurchaseOrderService
Parameters:
reqDocument - The requisition document that this method will use to create the purchase order.
newSessionUserId - The session user id that we'll use to invoke the performLogicWithFakedUserSession method of PurapService.
contractManagerCode - The contract manager code that we'll need to set on the purchase order.
Returns:
The purchase order document object that is created by this method.
See Also:
PurchaseOrderService.createPurchaseOrderDocument(org.kuali.kfs.module.purap.document.RequisitionDocument, java.lang.String, java.lang.Integer)

generatePurchaseOrderFromRequisition

protected PurchaseOrderDocument generatePurchaseOrderFromRequisition(RequisitionDocument reqDocument)
                                                              throws org.kuali.rice.kew.exception.WorkflowException
Create Purchase Order and populate with data from Requisition and other default data

Parameters:
reqDocument - The requisition document from which we create the purchase order document.
Returns:
The purchase order document created by this method.
Throws:
org.kuali.rice.kew.exception.WorkflowException

getInternalPurchasingDollarLimit

public org.kuali.rice.kns.util.KualiDecimal getInternalPurchasingDollarLimit(PurchaseOrderDocument document)
Description copied from interface: PurchaseOrderService
Obtains the internal purchasing dollar limit amount for a purchase order document.

Specified by:
getInternalPurchasingDollarLimit in interface PurchaseOrderService
Parameters:
document - The purchase order document for which this method is obtaining the internal purchasing dollar limit.
Returns:
The internal purchasing dollar limit for the given purchase order document.
See Also:
PurchaseOrderService.getInternalPurchasingDollarLimit(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

addStringErrorMessagesToErrorMap

protected void addStringErrorMessagesToErrorMap(String errorKey,
                                                Collection<String> errors)
Loops through the collection of error messages and adding each of them to the error map.

Parameters:
errorKey - The resource key used to retrieve the error text from the error message resource bundle.
errors - The collection of error messages.

printPurchaseOrderQuoteRequestsListPDF

public boolean printPurchaseOrderQuoteRequestsListPDF(String documentNumber,
                                                      ByteArrayOutputStream baosPDF)
TODO RELEASE 3 - QUOTE

Specified by:
printPurchaseOrderQuoteRequestsListPDF in interface PurchaseOrderService
See Also:
org.kuali.kfs.module.purap.document.service.PurchaseOrderService#printPurchaseOrderQuoteRequestsListPDF(org.kuali.kfs.module.purap.document.PurchaseOrderDocument, java.io.ByteArrayOutputStream)

printPurchaseOrderQuotePDF

public boolean printPurchaseOrderQuotePDF(PurchaseOrderDocument po,
                                          PurchaseOrderVendorQuote povq,
                                          ByteArrayOutputStream baosPDF)
TODO RELEASE 3 - QUOTE

Specified by:
printPurchaseOrderQuotePDF in interface PurchaseOrderService
See Also:
PurchaseOrderService.printPurchaseOrderQuotePDF(org.kuali.kfs.module.purap.document.PurchaseOrderDocument, org.kuali.kfs.module.purap.businessobject.PurchaseOrderVendorQuote, java.io.ByteArrayOutputStream)

performPurchaseOrderFirstTransmitViaPrinting

public void performPurchaseOrderFirstTransmitViaPrinting(String documentNumber,
                                                         ByteArrayOutputStream baosPDF)
Description copied from interface: PurchaseOrderService
Creates and displays the pdf document for the purchase order, sets the transmit dates, calls the takeAllActionsForGivenCriteria method in PurApWorkflowIntegrationService to perform all the workflow related steps that are necessary as part of the document initial print transmission and then performs the setup of initial of open document of the purchase order.

Specified by:
performPurchaseOrderFirstTransmitViaPrinting in interface PurchaseOrderService
Parameters:
documentNumber - The document number of the purchase order document that we want to perform the first transmit.
baosPDF - The ByteArrayOutputStream object that was passed in from the struts action so that we could display the pdf on the browser.
See Also:
PurchaseOrderService.performPurchaseOrderFirstTransmitViaPrinting(java.lang.String, java.io.ByteArrayOutputStream)

performPurchaseOrderPreviewPrinting

public void performPurchaseOrderPreviewPrinting(String documentNumber,
                                                ByteArrayOutputStream baosPDF)
Description copied from interface: PurchaseOrderService
Creates and displays the pdf document for the purchase order with a draft watermark

Specified by:
performPurchaseOrderPreviewPrinting in interface PurchaseOrderService
Parameters:
documentNumber - The document number of the purchase order document that we want to perform the first transmit.
baosPDF - The ByteArrayOutputStream object that was passed in from the struts action so that we could display the pdf on the browser.
See Also:
PurchaseOrderService.performPurchaseOrderPreviewPrinting(java.lang.String, java.io.ByteArrayOutputStream)

performPrintPurchaseOrderPDFOnly

public void performPrintPurchaseOrderPDFOnly(String documentNumber,
                                             ByteArrayOutputStream baosPDF)
Description copied from interface: PurchaseOrderService
Generates and displays the purchase order pdf by invoking the generatePurchaseOrderPdf method of the PrintService.

Specified by:
performPrintPurchaseOrderPDFOnly in interface PurchaseOrderService
Parameters:
documentNumber - The document number of the purchase order document that we want to print the pdf.
baosPDF - The ByteArrayOutputStream object that we'll use to display the pdf on the browser.
See Also:
PurchaseOrderService.performPrintPurchaseOrderPDFOnly(java.lang.String, java.io.ByteArrayOutputStream)

retransmitPurchaseOrderPDF

public void retransmitPurchaseOrderPDF(PurchaseOrderDocument po,
                                       ByteArrayOutputStream baosPDF)
Description copied from interface: PurchaseOrderService
Generates and displays the purchase order retransmit pdf by invoking the generatePurchaseOrderPdfForRetransmission method of the PrintService.

Specified by:
retransmitPurchaseOrderPDF in interface PurchaseOrderService
Parameters:
po - The purchase order document to be retransmitted.
baosPDF - The ByteArrayOutputStream object that we'll use to display the pdf on the browser.
See Also:
PurchaseOrderService.retransmitPurchaseOrderPDF(org.kuali.kfs.module.purap.document.PurchaseOrderDocument, java.io.ByteArrayOutputStream)

createPurchaseOrderDocumentFromSourceDocument

protected PurchaseOrderDocument createPurchaseOrderDocumentFromSourceDocument(PurchaseOrderDocument sourceDocument,
                                                                              String docType)
                                                                       throws org.kuali.rice.kew.exception.WorkflowException
This method creates a new Purchase Order Document using the given document type based off the given source document. This method will return null if the source document given is null.

** THIS METHOD DOES NOT SAVE EITHER THE GIVEN SOURCE DOCUMENT OR THE NEW DOCUMENT CREATED

Parameters:
sourceDocument - - document the new Purchase Order Document should be based off of in terms of data
docType - - document type of the potential new Purchase Order Document
Returns:
the new Purchase Order Document of the given document type or null if the given source document is null
Throws:
org.kuali.rice.kew.exception.WorkflowException - if a new document cannot be created using the given type

updateCapitalAssetRelatedCollections

protected void updateCapitalAssetRelatedCollections(PurchaseOrderDocument newDocument)

createAndSavePotentialChangeDocument

public PurchaseOrderDocument createAndSavePotentialChangeDocument(String documentNumber,
                                                                  String docType,
                                                                  String currentDocumentStatusCode)
Description copied from interface: PurchaseOrderService
Creates and saves the purchase order change document (for example, PurchaseOrderAmendmentDocument) based on an existing purchase order document.

Specified by:
createAndSavePotentialChangeDocument in interface PurchaseOrderService
Parameters:
documentNumber - The document number of the existing purchase order document from which we try to create a new change document.
docType - The document type of the new change document.
currentDocumentStatusCode - The status code that we want to set on the existing purchase order document after the new change document is created.
Returns:
The resulting new purchase order change document created by this method.
See Also:
PurchaseOrderService.createAndSavePotentialChangeDocument(java.lang.String, java.lang.String, java.lang.String)

createAndRoutePotentialChangeDocument

public PurchaseOrderDocument createAndRoutePotentialChangeDocument(String documentNumber,
                                                                   String docType,
                                                                   String annotation,
                                                                   List adhocRoutingRecipients,
                                                                   String currentDocumentStatusCode)
Description copied from interface: PurchaseOrderService
Creates and routes the purchase order change document (for example, PurchaseOrderCloseDocument) based on an existing purchase order document.

Specified by:
createAndRoutePotentialChangeDocument in interface PurchaseOrderService
Parameters:
documentNumber - The document number of the existing purchase order document from which we try to create a new change document.
docType - The document type of the new change document.
annotation - The annotation that we'll use to invoke the routeDocument method of DocumentService.
adhocRoutingRecipients - The adhocRoutingRecipients that we'll use to invoke the routeDocument method of DocumentService.
currentDocumentStatusCode - The status code that we want to set on the existing purchase order document after the new change document is created.
Returns:
The resulting new purchase order change document created by this method.
See Also:
PurchaseOrderService.createAndRoutePotentialChangeDocument(java.lang.String, java.lang.String, java.lang.String, java.util.List, java.lang.String)

createAndSavePurchaseOrderSplitDocument

public PurchaseOrderSplitDocument createAndSavePurchaseOrderSplitDocument(List<PurchaseOrderItem> newPOItems,
                                                                          PurchaseOrderDocument currentDocument,
                                                                          boolean copyNotes,
                                                                          String splitNoteText)
Description copied from interface: PurchaseOrderService
Creates and saves a Purchase Order Split document based on the old PO document, and the items from that PO that the new Split PO is to contain.

Specified by:
createAndSavePurchaseOrderSplitDocument in interface PurchaseOrderService
Parameters:
newPOItems - The List of the items that the new Split PO is to contain
currentDocument - The original PurchaseOrderDocument
copyNotes - A boolean. True if notes are to be copied from the old document to the new.
splitNoteText - A String containing the text of the note to be added to the old document.
Returns:
A PurchaseOrderSplitDocument containing the given list of items
See Also:
org.kuali.kfs.module.purap.document.service.PurchaseOrderService#createAndSavePurchaseOrderSplitDocument(java.util.List, java.lang.String, boolean)

getClassesToExcludeFromCopy

protected Set<Class> getClassesToExcludeFromCopy()
Gets a set of classes to exclude from those whose fields will be copied during a copy operation from one Document to another.

Returns:
A Set

getCurrentRouteNodeName

protected String getCurrentRouteNodeName(org.kuali.rice.kns.workflow.service.KualiWorkflowDocument wd)
                                  throws org.kuali.rice.kew.exception.WorkflowException
Returns the current route node name.

Parameters:
wd - The KualiWorkflowDocument object whose current route node we're trying to get.
Returns:
The current route node name.
Throws:
org.kuali.rice.kew.exception.WorkflowException

completePurchaseOrder

public void completePurchaseOrder(PurchaseOrderDocument po)
Description copied from interface: PurchaseOrderService
Performs the steps needed to complete the newly approved purchase order document, which consists of setting the current and pending indicators for the purchase order document and if the status is not pending transmission, then calls the attemptsSetupOfInitialOpenOfDocument to set the statuses, the initial open date and save the document.

Specified by:
completePurchaseOrder in interface PurchaseOrderService
Parameters:
po - The newly approved purchase order document that we want to complete.
See Also:
PurchaseOrderService.completePurchaseOrder(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

completeB2BPurchaseOrder

protected boolean completeB2BPurchaseOrder(PurchaseOrderDocument po)

retransmitB2BPurchaseOrder

public void retransmitB2BPurchaseOrder(PurchaseOrderDocument po)
Specified by:
retransmitB2BPurchaseOrder in interface PurchaseOrderService

canHoldPayment

public boolean canHoldPayment(PurchaseOrderDocument purchaseOrder)
Description copied from interface: PurchaseOrderService
Determines whether to display the amend and payment hold buttons for the purchase order document. The document status must be open, the purchase order must be current and not pending and the user must be in purchasing group.

Specified by:
canHoldPayment in interface PurchaseOrderService
Returns:
boolean true if the payment hold is possible for the purchase order document.

canAmendPurchaseOrder

public boolean canAmendPurchaseOrder(PurchaseOrderDocument purchaseOrder)
Description copied from interface: PurchaseOrderService
Determines whether to display the amend button for the purchase order document. The document status must be open, the purchase order must be current and not pending and the user must be in purchasing group. These are the conditions for displaying the payment hold button. In addition to these conditions, we also have to check that there is no In Process Payment Requests nor Credit Memos associated with the PO.

Specified by:
canAmendPurchaseOrder in interface PurchaseOrderService
Returns:
boolean true if the amendment possible for the purchase order.

completePurchaseOrderAmendment

public void completePurchaseOrderAmendment(PurchaseOrderDocument poa)
Specified by:
completePurchaseOrderAmendment in interface PurchaseOrderService

updateVendorCommodityCode

public void updateVendorCommodityCode(PurchaseOrderDocument po)
If there are commodity codes on the items on the PurchaseOrderDocument that haven't existed yet on the vendor that the PurchaseOrderDocument is using, then we will spawn a new VendorDetailMaintenanceDocument automatically to update the vendor with the commodity codes that aren't already existing on the vendor.

Specified by:
updateVendorCommodityCode in interface PurchaseOrderService
Parameters:
po - The PurchaseOrderDocument containing the vendor that we want to update.

addNoteForCommodityCodeToVendor

protected void addNoteForCommodityCodeToVendor(org.kuali.rice.kns.maintenance.Maintainable maintainable,
                                               String documentNumber,
                                               Integer poID)
Creates a note to be added to the Vendor Maintenance Document which is spawned from the PurchaseOrderDocument.

Parameters:
maintainable -
documentNumber -
poID -

checkForLockingDocument

protected boolean checkForLockingDocument(org.kuali.rice.kns.document.MaintenanceDocument document)
Checks whether the vendor is currently locked.

Parameters:
document - The MaintenanceDocument containing the vendor.
Returns:
boolean true if the vendor is currently locked and false otherwise.

updateVendorWithMissingCommodityCodesIfNecessary

public VendorDetail updateVendorWithMissingCommodityCodesIfNecessary(PurchaseOrderDocument po)
Description copied from interface: PurchaseOrderService
Check whether each of the items contain commodity code, if so then loop through the vendor commodity codes on the vendor to find out whether the commodity code on the item has existed on the vendor. While doing that, also check whether there exists a default commodity code on the vendor, although we only need to check this until we find a vendor commodity code with default indicator set to true. If we didn't find any matching commodity code in the existing vendor commodity codes, then add the new commodity code to a List of commodity code, create a new vendor commodity code and set all of its attributes appropriately, including setting the default indicator to true if we had not found any existing default commodity code on the vendor, then add the newly created vendor commodity code to the vendor (which is a deep copy of the original vendor on the PO). After we're done with all of the items, if the List that contains the commodity code that were being added to the vendor is not empty, then for each entry on that list, we should create an empty VendorCommodityCode to be added to the old vendor (the original vendor that is on the PO document). The reason we're combining all of these processing here is so that we don't need to loop through items and vendor commodity codes too many times.

Specified by:
updateVendorWithMissingCommodityCodesIfNecessary in interface PurchaseOrderService
Parameters:
po - The PurchaseOrderDocument containing the vendor that we want to update.
Returns:
VendorDetail the vendorDetail object which is a deep copy of the original vendorDetail on the PurchaseOrderDocument, whose commodity codes have already been updated based on our findings on the items' commodity codes.
See Also:
PurchaseOrderService.updateVendorWithMissingCommodityCodesIfNecessary(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

setupDocumentForPendingFirstTransmission

protected void setupDocumentForPendingFirstTransmission(PurchaseOrderDocument po)
Update the purchase order document with the appropriate status for pending first transmission based on the transmission type.

Parameters:
po - The purchase order document whose status to be updated.

attemptSetupOfInitialOpenOfDocument

protected void attemptSetupOfInitialOpenOfDocument(PurchaseOrderDocument po)
If the status of the purchase order is not OPEN and the initial open date is null, sets the initial open date to current date and update the status to OPEN, then save the purchase order.

Parameters:
po - The purchase order document whose initial open date and status we want to update.

getCurrentPurchaseOrder

public PurchaseOrderDocument getCurrentPurchaseOrder(Integer id)
Description copied from interface: PurchaseOrderService
Obtains the purchase order document whose current indicator is true, given a purchase order id which is the purapDocumentIdentifier.

Specified by:
getCurrentPurchaseOrder in interface PurchaseOrderService
Parameters:
id - The po id (purapDocumentIdentifier) that we'll use to retrieve the current purchase order document.
Returns:
The current purchase order document (the po whose current indicator is true).
See Also:
PurchaseOrderService.getCurrentPurchaseOrder(java.lang.Integer)

getPurchaseOrderByDocumentNumber

public PurchaseOrderDocument getPurchaseOrderByDocumentNumber(String documentNumber)
Description copied from interface: PurchaseOrderService
Obtains the purchase order document given the document number.

Specified by:
getPurchaseOrderByDocumentNumber in interface PurchaseOrderService
Parameters:
documentNumber - The document number of the purchase order that we want to retrieve.
Returns:
The purchase order document whose document number is the given document number.
See Also:
PurchaseOrderService.getPurchaseOrderByDocumentNumber(java.lang.String)

getOldestPurchaseOrder

public PurchaseOrderDocument getOldestPurchaseOrder(PurchaseOrderDocument po,
                                                    PurchaseOrderDocument documentBusinessObject)
Description copied from interface: PurchaseOrderService
Obtains the oldest purchase order given the purchase order object to be used to search, then calls the updateNotes method to set the notes on the oldest purchase order and finally return the oldest purchase order.

Specified by:
getOldestPurchaseOrder in interface PurchaseOrderService
Parameters:
po - The current purchase order object from which we want to obtain the oldest purchase order.
documentBusinessObject - The documentBusinessObject of the current purchase order object.
Returns:
The oldest purchase order whose purchase order id is the same as the current purchase order's id.
See Also:
PurchaseOrderService.getOldestPurchaseOrder(org.kuali.kfs.module.purap.document.PurchaseOrderDocument, org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

updateNotes

protected void updateNotes(PurchaseOrderDocument po,
                           PurchaseOrderDocument documentBusinessObject)
If the purchase order's object id is not null (I think this means if it's an existing purchase order that had already been saved to the db previously), get the notes of the purchase order from the database, fix the notes' fields by calling the fixDbNoteFields, then set the notes to the purchase order. Otherwise (I think this means if it's a new purchase order), set the notes of this purchase order to be the notes of the documentBusinessObject.

Parameters:
po - The current purchase order.
documentBusinessObject - The oldest purchase order whose purapDocumentIdentifier is the same as the po's purapDocumentIdentifier.

fixDbNoteFields

protected void fixDbNoteFields(PurchaseOrderDocument documentBusinessObject,
                               List<org.kuali.rice.kns.bo.Note> dbNotes)
This method fixes non ojb managed missing fields from the db

Parameters:
documentBusinessObject - The oldest purchase order whose purapDocumentIdentifier is the same as the po's purapDocumentIdentifier.
dbNotes - The notes of the purchase order obtained from the database.

getPurchaseOrderNotes

public ArrayList<org.kuali.rice.kns.bo.Note> getPurchaseOrderNotes(Integer id)
Description copied from interface: PurchaseOrderService
Obtains all the notes that belong to this purchase order given the purchase order id.

Specified by:
getPurchaseOrderNotes in interface PurchaseOrderService
Parameters:
id - The purchase order id (purapDocumentIdentifier).
Returns:
The list of notes that belong to this purchase order.
See Also:
PurchaseOrderService.getPurchaseOrderNotes(java.lang.Integer)

setCurrentAndPendingIndicatorsForApprovedPODocuments

public void setCurrentAndPendingIndicatorsForApprovedPODocuments(PurchaseOrderDocument newPO)
Description copied from interface: PurchaseOrderService
Sets the current and pending indicators of the new purchase order and the old purchase order as well as its status, then save the purchase order.

Specified by:
setCurrentAndPendingIndicatorsForApprovedPODocuments in interface PurchaseOrderService
Parameters:
newPO - The new purchase order document that has been approved.
See Also:
PurchaseOrderService.setCurrentAndPendingIndicatorsForApprovedPODocuments(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

setCurrentAndPendingIndicatorsForDisapprovedChangePODocuments

public void setCurrentAndPendingIndicatorsForDisapprovedChangePODocuments(PurchaseOrderDocument newPO)
Description copied from interface: PurchaseOrderService
Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order.

Specified by:
setCurrentAndPendingIndicatorsForDisapprovedChangePODocuments in interface PurchaseOrderService
Parameters:
newPO - The new purchase order document that has been disapproved.
See Also:
PurchaseOrderService.setCurrentAndPendingIndicatorsForDisapprovedChangePODocuments(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

setCurrentAndPendingIndicatorsForCancelledChangePODocuments

public void setCurrentAndPendingIndicatorsForCancelledChangePODocuments(PurchaseOrderDocument newPO)
Description copied from interface: PurchaseOrderService
Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order.

Specified by:
setCurrentAndPendingIndicatorsForCancelledChangePODocuments in interface PurchaseOrderService
Parameters:
newPO - The new purchase order document that has been canceled.
See Also:
PurchaseOrderService.setCurrentAndPendingIndicatorsForCancelledChangePODocuments(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

setCurrentAndPendingIndicatorsForCancelledReopenPODocuments

public void setCurrentAndPendingIndicatorsForCancelledReopenPODocuments(PurchaseOrderDocument newPO)
Description copied from interface: PurchaseOrderService
Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order.

Specified by:
setCurrentAndPendingIndicatorsForCancelledReopenPODocuments in interface PurchaseOrderService
Parameters:
newPO - The new purchase order reopen document that has been canceled.
See Also:
PurchaseOrderService.setCurrentAndPendingIndicatorsForCancelledReopenPODocuments(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

setCurrentAndPendingIndicatorsForDisapprovedReopenPODocuments

public void setCurrentAndPendingIndicatorsForDisapprovedReopenPODocuments(PurchaseOrderDocument newPO)
Description copied from interface: PurchaseOrderService
Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order.

Specified by:
setCurrentAndPendingIndicatorsForDisapprovedReopenPODocuments in interface PurchaseOrderService
Parameters:
newPO - The new purchase order reopen document that has been disapproved.
See Also:
PurchaseOrderService.setCurrentAndPendingIndicatorsForDisapprovedReopenPODocuments(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

setCurrentAndPendingIndicatorsForCancelledRemoveHoldPODocuments

public void setCurrentAndPendingIndicatorsForCancelledRemoveHoldPODocuments(PurchaseOrderDocument newPO)
Description copied from interface: PurchaseOrderService
Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order

Specified by:
setCurrentAndPendingIndicatorsForCancelledRemoveHoldPODocuments in interface PurchaseOrderService
Parameters:
newPO - The new purchase order remove hold document that has been canceled.
See Also:
PurchaseOrderService.setCurrentAndPendingIndicatorsForCancelledRemoveHoldPODocuments(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

setCurrentAndPendingIndicatorsForDisapprovedRemoveHoldPODocuments

public void setCurrentAndPendingIndicatorsForDisapprovedRemoveHoldPODocuments(PurchaseOrderDocument newPO)
Description copied from interface: PurchaseOrderService
Sets the current and pending indicators of the new purchase order and the old purchase order as well as their statuses, then save the purchase order.

Specified by:
setCurrentAndPendingIndicatorsForDisapprovedRemoveHoldPODocuments in interface PurchaseOrderService
Parameters:
newPO - The new purchase order remove hold document that has been disapproved.
See Also:
PurchaseOrderService.setCurrentAndPendingIndicatorsForDisapprovedRemoveHoldPODocuments(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

updateCurrentDocumentForNoPendingAction

protected void updateCurrentDocumentForNoPendingAction(PurchaseOrderDocument newPO,
                                                       String newPOStatus,
                                                       String oldPOStatus)
Update the statuses of both the old purchase order and the new purchase orders, then save the old and the new purchase orders.

Parameters:
newPO - The new change purchase order document (e.g. the PurchaseOrderAmendmentDocument that was resulted from the user clicking on the amend button).
newPOStatus - The status to be set on the new change purchase order document.
oldPOStatus - The status to be set on the existing (old) purchase order document.

getPurchaseOrderQuoteStatusCodes

public ArrayList<PurchaseOrderQuoteStatus> getPurchaseOrderQuoteStatusCodes()
Specified by:
getPurchaseOrderQuoteStatusCodes in interface PurchaseOrderService

setReceivingRequiredIndicatorForPurchaseOrder

public void setReceivingRequiredIndicatorForPurchaseOrder(PurchaseOrderDocument po)
Description copied from interface: PurchaseOrderService
Performs a threshold check on the purchase order to determine if any attribute on the purchase order falls within a defined threshold. This check is only perfromed if the receiving required flag is set to N.

Specified by:
setReceivingRequiredIndicatorForPurchaseOrder in interface PurchaseOrderService

hasNewUnorderedItem

public boolean hasNewUnorderedItem(PurchaseOrderDocument po)
Description copied from interface: PurchaseOrderService
Checks the item list for newly added unordered items.

Specified by:
hasNewUnorderedItem in interface PurchaseOrderService
Returns:
See Also:
PurchaseOrderService.hasNewUnorderedItem(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)

isNewUnorderedItem

public boolean isNewUnorderedItem(PurchaseOrderItem poItem)
Description copied from interface: PurchaseOrderService
Determines if a purchase order item is new unordered item.

Specified by:
isNewUnorderedItem in interface PurchaseOrderService
Returns:

isNewItemForAmendment

public boolean isNewItemForAmendment(PurchaseOrderItem poItem)
Description copied from interface: PurchaseOrderService
Determines if a purchase order item is newly added on the Purchase Order Amendment Document.

Specified by:
isNewItemForAmendment in interface PurchaseOrderService
Returns:

sendFyiForNewUnorderedItems

protected void sendFyiForNewUnorderedItems(PurchaseOrderDocument po)
Sends an FYI to fiscal officers for new unordered items.

Parameters:
po -

createFyiFiscalOfficerListForNewUnorderedItems

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

Parameters:
po -
Returns:

categorizeItemsForSplit

public HashMap<String,List<PurchaseOrderItem>> categorizeItemsForSplit(List<PurchaseOrderItem> items)
Description copied from interface: PurchaseOrderService
Used to provide sublists of the list of the original PO's items according to whether they are marked to be moved or not. Retrieving the item from the hash with the key of 'movingPOItems' will retrieve those Items which should move, using 'remainingPOItems'.

Specified by:
categorizeItemsForSplit in interface PurchaseOrderService
Parameters:
items - A List from the original PO of a Split.
Returns:
A HashMap> of categorized lists of items
See Also:
PurchaseOrderService.categorizeItemsForSplit(java.util.List)

populateQuoteWithVendor

public PurchaseOrderVendorQuote populateQuoteWithVendor(Integer headerId,
                                                        Integer detailId,
                                                        String documentNumber)
Description copied from interface: PurchaseOrderService
Creates a PurchaseOrderVendorQuote based on the data on the selected vendor and the document number.

Specified by:
populateQuoteWithVendor in interface PurchaseOrderService
Parameters:
headerId - The vendorHeaderGeneratedIdentifier of the selected vendor.
detailId - The vendorDetailAssignedIdentifier of the selected vendor.
documentNumber - The documentNumber of the PurchaseOrderDocument containing this quote.
Returns:
The resulting PurchaseOrderVendorQuote object.
See Also:
org.kuali.module.purap.service.PurchaseOrderService#populateQuoteWithVendor(java.lang.Integer, java.lang.Integer, java.lang.String)

populateAddressForPOVendorQuote

protected PurchaseOrderVendorQuote populateAddressForPOVendorQuote(VendorDetail newVendor,
                                                                   String documentNumber)
Creates the new PurchaseOrderVendorQuote and populate the address fields for it.

Parameters:
newVendor - The VendorDetail object from which we obtain the values for the address fields.
documentNumber - The documentNumber of the PurchaseOrderDocument containing the PurchaseOrderVendorQuote.
Returns:

updateDefaultVendorAddress

protected void updateDefaultVendorAddress(VendorDetail vendor)
Obtains the defaultAddress of the vendor and setting the default address fields on the vendor.

Parameters:
vendor - The VendorDetail object whose default address we'll obtain and set the fields.

processACMReq

public void processACMReq(ContractManagerAssignmentDocument acmDoc)
Description copied from interface: PurchaseOrderService
This method takes care of creating PurchaseOrderDocuments from a list of Requisitions on an ACM

Specified by:
processACMReq in interface PurchaseOrderService
Parameters:
acmDoc - An assign a contract manager document
See Also:
PurchaseOrderService.processACMReq(org.kuali.kfs.module.purap.document.ContractManagerAssignmentDocument)

autoCloseFullyDisencumberedOrders

public boolean autoCloseFullyDisencumberedOrders()
Description copied from interface: PurchaseOrderService
This gets a list of Purchase Orders in Open status and checks to see if their line item encumbrances are all fully disencumbered and if so then the Purchase Order is closed and notes added to indicate the change occurred in batch

Specified by:
autoCloseFullyDisencumberedOrders in interface PurchaseOrderService
Returns:
boolean true if the job is completed successfully and false otherwise.
See Also:
PurchaseOrderService.autoCloseFullyDisencumberedOrders()

autoCloseRecurringOrders

public boolean autoCloseRecurringOrders()
Description copied from interface: PurchaseOrderService
- PO status is OPEN - Recurring payment type code is not null - Vendor Choice is not Sub-Contract - PO End Date <= parm date (comes from system parameter) - Verify that the system parameter date entered is not greater than the current date minus three months. If the date entered is invalid, the batch process will halt and an error will be generated. - Close and disencumber all recurring PO's that have end dates less than the system parameter date. - Set the system parameter date to mm/dd/yyyy after processing. - Send email indicating that the job ran and which orders were closed. Mail it to the AUTO_CLOSE_RECURRING_PO_EMAIL_ADDRESSES in system parameter.

Specified by:
autoCloseRecurringOrders in interface PurchaseOrderService
Returns:
boolean true if the job is completed successfully and false otherwise.
See Also:
PurchaseOrderService.autoCloseRecurringOrders()

getTodayMinusThreeMonths

protected Calendar getTodayMinusThreeMonths()
Creates and returns a Calendar object of today minus three months.

Returns:
Calendar object of today minus three months.

setMessageAddressesAndSubject

protected org.kuali.rice.kns.mail.MailMessage setMessageAddressesAndSubject(org.kuali.rice.kns.mail.MailMessage message,
                                                                            String parameterEmail)
Sets the to addresses, from address and the subject of the email.

Parameters:
message - The MailMessage object of the email to be sent.
parameterEmail - The String of email addresses with delimiters of ";" obtained from the system parameter.
Returns:
The MailMessage object after the to addresses, from address and the subject have been set.

sendMessage

protected void sendMessage(org.kuali.rice.kns.mail.MailMessage message,
                           String emailBody)
Sends the email by calling the sendMessage method in mailService and log error if exception occurs during the attempt to send the message.

Parameters:
message - The MailMessage object containing information to be sent.
emailBody - The String containing the body of the email to be sent.

resetAutoCloseRecurringOrderDateParameter

protected void resetAutoCloseRecurringOrderDateParameter()
Resets the AUTO_CLOSE_RECURRING_ORDER_DT system parameter to "mm/dd/yyyy".


getExcludedVendorChoiceCodes

protected List<String> getExcludedVendorChoiceCodes()
Gets a List of excluded vendor choice codes from PurapConstants.

Returns:
a List of excluded vendor choice codes

createNoteForAutoCloseOrders

protected void createNoteForAutoCloseOrders(PurchaseOrderDocument purchaseOrderDocument,
                                            String annotation)
Creates and add a note to the purchase order document using the annotation String in the input parameter. This method is used by the autoCloseRecurringOrders() and autoCloseFullyDisencumberedOrders to add a note to the purchase order to indicate that the purchase order was closed by the batch job.

Parameters:
purchaseOrderDocument - The purchase order document that is being closed by the batch job.
annotation - The string to appear on the note to be attached to the purchase order.

retrieveCapitalAssetItemsForIndividual

public List<PurchasingCapitalAssetItem> retrieveCapitalAssetItemsForIndividual(Integer poId)
Description copied from interface: PurchaseOrderService
Return a list of PurchasingCapitalAssetItems where each item would have a CapitalAssetSystem. The CapitalAssetSystem provides the capital asset information such as asset numbers and asset type.

Specified by:
retrieveCapitalAssetItemsForIndividual in interface PurchaseOrderService
Parameters:
poId - Purchase Order ID used to retrieve the asset information for the current PO
Returns:
List of PurchasingCapitalAssetItems (each of which contain a CapitalAssetSystem)
See Also:
PurchaseOrderService.retrieveCapitalAssetItemsForIndividual(java.lang.Integer)

retrieveCapitalAssetSystemForOneSystem

public CapitalAssetSystem retrieveCapitalAssetSystemForOneSystem(Integer poId)
Description copied from interface: PurchaseOrderService
Return a CapitalAssetSystem which provides the capital asset information such as asset numbers and asset type.

Specified by:
retrieveCapitalAssetSystemForOneSystem in interface PurchaseOrderService
Parameters:
poId - Purchase Order ID used to retrieve the asset information for the current PO
Returns:
CapitalAssetSystem
See Also:
PurchaseOrderService.retrieveCapitalAssetSystemForOneSystem(java.lang.Integer)

retrieveCapitalAssetSystemsForMultipleSystem

public List<CapitalAssetSystem> retrieveCapitalAssetSystemsForMultipleSystem(Integer poId)
Description copied from interface: PurchaseOrderService
Return a list of CapitalAssetSystems which provide the capital asset information such as asset numbers and asset type.

Specified by:
retrieveCapitalAssetSystemsForMultipleSystem in interface PurchaseOrderService
Parameters:
poId - Purchase Order ID used to retrieve the asset information for the current PO
Returns:
List of CapitalAssetSystems
See Also:
PurchaseOrderService.retrieveCapitalAssetSystemsForMultipleSystem(java.lang.Integer)

fixItemReferences

protected void fixItemReferences(PurchaseOrderDocument po)
This method fixes the item references in this document


getPendingPurchaseOrderFaxes

public List getPendingPurchaseOrderFaxes()
Description copied from interface: PurchaseOrderService
This method gets all the Purchase orders that are waiting for faxing

Specified by:
getPendingPurchaseOrderFaxes in interface PurchaseOrderService
Returns:
List of POs

getPersonService

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

setDataDictionaryService

public void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)


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