org.kuali.kfs.module.cab.document.web.struts
Class PurApLineAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.apache.struts.actions.DispatchAction
          extended by org.kuali.rice.kns.web.struts.action.KualiAction
              extended by org.kuali.kfs.module.cab.document.web.struts.CabActionBase
                  extended by org.kuali.kfs.module.cab.document.web.struts.PurApLineAction

public class PurApLineAction
extends CabActionBase


Field Summary
 
Fields inherited from class org.kuali.rice.kns.web.struts.action.KualiAction
FORM_ACTION, FORWARD_NEXT, FORWARD_TEXT_AREA_UPDATE, METHOD_TO_CALL, POST_TEXT_AREA_TO_PARENT, TEXT_AREA_FIELD_ANCHOR, TEXT_AREA_FIELD_LABEL, TEXT_AREA_FIELD_NAME, TEXT_AREA_MAX_LENGTH, TEXT_AREA_READ_ONLY
 
Fields inherited from class org.apache.struts.actions.DispatchAction
clazz, log, messages, methods, types
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
PurApLineAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward allocate(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Allocate line items including allocate additional charges functionality.
 org.apache.struts.action.ActionForward applyPayment(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handle apply payment action.
protected  void buildPurApDocList(PurApLineForm purApLineForm)
          Build PurchasingAccountsPayableDocument list in which all documents have the same PO_ID.
 org.apache.struts.action.ActionForward cancel(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Cancels the action and returns to portal main page
protected  void checkMergeAllValid(boolean tradeInAllowanceInAllLines, boolean tradeInIndicatorInSelectedLines)
          For merge all, check if exists Trade-in allowance pending for allocate.
protected  void checkMergeLinesValid(List<PurchasingAccountsPayableItemAsset> mergeLines, boolean tradeInAllowanceInAllLines, boolean tradeInIndicatorInSelectedLines)
          Check if merge lines selected are allowed to continue this action.
protected  void checkMergeRequiredFields(PurApLineForm purApForm)
          Check the required fields entered for merge.
protected  void checkPreTagValidForMerge(List<PurchasingAccountsPayableItemAsset> mergeLines, Integer purchaseOrderIdentifier)
          If to be merged items have: (1) No Pretag data: No problem; (2) 1 Pretag data entry: Associate this one with the new item created after merge;(3) 1+ Pretag data entries: Display error, user has to manually fix data
protected  void checkSplitQty(PurchasingAccountsPayableItemAsset itemAsset, String errorPath)
          Check user input splitQty.
protected  void clearForMerge(PurApLineForm purApForm)
          Clear user input after merge.
protected  void clearPurApLineSession(Integer purchaseOrderIdentifier)
           
 org.apache.struts.action.ActionForward close(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handling for screen close.
 org.apache.struts.action.ActionForward createAsset(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handle create asset action.
protected  void createPurApLineSession(Integer purchaseOrderIdentifier)
           
protected  String generateObjectSubTypeQuestion()
          Generate the question string for different object sub type codes.
protected  Map getItemLineNumberMap(List<PurchasingAccountsPayableItemAsset> itemLines)
          Build a Hashmap for itemLineNumber since itemLines could exist duplicate itemLineNumber
protected  org.kuali.rice.kns.service.KualiConfigurationService getKualiConfigurationService()
           
protected  org.kuali.rice.kns.service.ParameterService getParameterService()
           
 org.apache.struts.action.ActionForward merge(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Merge Action includes merge all functionality.
 org.apache.struts.action.ActionForward percentPayment(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Update the item quantity value from a decimal(less than 1) to 1.
protected  void performAllocate(PurApLineForm purApForm, PurchasingAccountsPayableItemAsset allocateSourceLine, List<PurchasingAccountsPayableItemAsset> allocateTargetLines)
          Allocate with service help.
protected  void performMerge(PurApLineForm purApForm, List<PurchasingAccountsPayableItemAsset> mergeLines, boolean isMergeAll)
          Merge with service help.
 org.apache.struts.action.ActionForward reload(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void retrieveUserInputForMerge(PurchasingAccountsPayableItemAsset firstItem, PurApLineForm purApForm)
          Retrieve user input merge quantity and merge description.
 org.apache.struts.action.ActionForward save(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          save the information in the current form into underlying data store
protected  void setupObjectRelationship(List<PurchasingAccountsPayableDocument> purApDocs)
          Setup relationship from account to item and item to doc.
 org.apache.struts.action.ActionForward split(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method handles split action.
 org.apache.struts.action.ActionForward start(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handle start action.
protected  void validateAllocateAction(PurchasingAccountsPayableItemAsset allocateSourceLine, List<PurchasingAccountsPayableItemAsset> allocateTargetLines, boolean targetLineHasTradeIn, boolean hasTradeInAllowance, List<PurchasingAccountsPayableDocument> purApDocs)
          Check if the line items are allowed to allocate.
protected  void validateCreateAssetAction(PurchasingAccountsPayableItemAsset selectedLine)
          Validate selected line item for asset global creation.
protected  void validateMergeAction(PurApLineForm purApForm, List<PurchasingAccountsPayableItemAsset> mergeLines, boolean isMergeAll, boolean tradeInAllowanceInAllLines, boolean tradeInIndicatorInSelectedLines)
          Check if the merge action is valid or not.
 
Methods inherited from class org.kuali.kfs.module.cab.document.web.struts.CabActionBase
execute, viewDoc
 
Methods inherited from class org.kuali.rice.kns.web.struts.action.KualiAction
addMethodToCallToUncheckedList, checkAuthorization, defaultDispatch, dispatchMethod, doProcessingAfterPost, findMethodToCall, getApplicationBaseUrl, getBasePath, getBusinessObjectAuthorizationService, getEncryptionService, getHeaderTabDispatch, getHeaderTabNavigateTo, getImageContext, getKualiModuleService, getLineToDelete, getReturnLocation, getRoleQualification, getSelectedLine, getTabToToggle, headerTab, hideAllTabs, performInquiry, performLookup, performQuestionWithInput, performQuestionWithInputAgainBecauseOfErrors, performQuestionWithoutInput, performWorkgroupLookup, postTextAreaToParent, refresh, retrieveLookupParameterValue, showAllTabs, toggleTab, updateTextArea, validateLookupInquiryFullParameter
 
Methods inherited from class org.apache.struts.actions.DispatchAction
cancelled, getMethod, getMethodName, getParameter, unspecified
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PurApLineAction

public PurApLineAction()
Method Detail

start

public org.apache.struts.action.ActionForward start(org.apache.struts.action.ActionMapping mapping,
                                                    org.apache.struts.action.ActionForm form,
                                                    javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.http.HttpServletResponse response)
                                             throws Exception
Handle start action.

Parameters:
mapping -
form -
request -
response -
Returns:
Throws:
Exception

createPurApLineSession

protected void createPurApLineSession(Integer purchaseOrderIdentifier)

clearPurApLineSession

protected void clearPurApLineSession(Integer purchaseOrderIdentifier)

reload

public org.apache.struts.action.ActionForward reload(org.apache.struts.action.ActionMapping mapping,
                                                     org.apache.struts.action.ActionForm form,
                                                     javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.http.HttpServletResponse response)
                                              throws Exception
Throws:
Exception

buildPurApDocList

protected void buildPurApDocList(PurApLineForm purApLineForm)
Build PurchasingAccountsPayableDocument list in which all documents have the same PO_ID.

Parameters:
purApLineForm -

setupObjectRelationship

protected void setupObjectRelationship(List<PurchasingAccountsPayableDocument> purApDocs)
Setup relationship from account to item and item to doc. In this way, we keep all working objects in the same view as form.

Parameters:
purApDocs -

cancel

public org.apache.struts.action.ActionForward cancel(org.apache.struts.action.ActionMapping mapping,
                                                     org.apache.struts.action.ActionForm form,
                                                     javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.http.HttpServletResponse response)
                                              throws Exception
Cancels the action and returns to portal main page

Parameters:
mapping - ActionMapping
form - ActionForm
request - HttpServletRequest
response - HttpServletResponse
Returns:
ActionForward
Throws:
Exception

save

public org.apache.struts.action.ActionForward save(org.apache.struts.action.ActionMapping mapping,
                                                   org.apache.struts.action.ActionForm form,
                                                   javax.servlet.http.HttpServletRequest request,
                                                   javax.servlet.http.HttpServletResponse response)
                                            throws Exception
save the information in the current form into underlying data store

Throws:
Exception

close

public org.apache.struts.action.ActionForward close(org.apache.struts.action.ActionMapping mapping,
                                                    org.apache.struts.action.ActionForm form,
                                                    javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.http.HttpServletResponse response)
                                             throws Exception
Handling for screen close. Default action is return to caller.

Throws:
Exception

split

public org.apache.struts.action.ActionForward split(org.apache.struts.action.ActionMapping mapping,
                                                    org.apache.struts.action.ActionForm form,
                                                    javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.http.HttpServletResponse response)
                                             throws Exception
This method handles split action. Create one item with split quantity

Parameters:
mapping -
form -
request -
response -
Returns:
Throws:
Exception

checkSplitQty

protected void checkSplitQty(PurchasingAccountsPayableItemAsset itemAsset,
                             String errorPath)
Check user input splitQty. It must be required and can't be zero or greater than current quantity.

Parameters:
itemAsset -
errorPath -

merge

public org.apache.struts.action.ActionForward merge(org.apache.struts.action.ActionMapping mapping,
                                                    org.apache.struts.action.ActionForm form,
                                                    javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.http.HttpServletResponse response)
                                             throws Exception
Merge Action includes merge all functionality.

Parameters:
mapping -
form -
request -
response -
Returns:
Throws:
Exception

generateObjectSubTypeQuestion

protected String generateObjectSubTypeQuestion()
Generate the question string for different object sub type codes.

Returns:

performMerge

protected void performMerge(PurApLineForm purApForm,
                            List<PurchasingAccountsPayableItemAsset> mergeLines,
                            boolean isMergeAll)
Merge with service help.

Parameters:
purApForm -
mergeLines -

retrieveUserInputForMerge

protected void retrieveUserInputForMerge(PurchasingAccountsPayableItemAsset firstItem,
                                         PurApLineForm purApForm)
Retrieve user input merge quantity and merge description.

Parameters:
firstItem -
purApForm -

clearForMerge

protected void clearForMerge(PurApLineForm purApForm)
Clear user input after merge.

Parameters:
purApForm -

validateMergeAction

protected void validateMergeAction(PurApLineForm purApForm,
                                   List<PurchasingAccountsPayableItemAsset> mergeLines,
                                   boolean isMergeAll,
                                   boolean tradeInAllowanceInAllLines,
                                   boolean tradeInIndicatorInSelectedLines)
Check if the merge action is valid or not.

Parameters:
purApForm -
mergeLines -

checkPreTagValidForMerge

protected void checkPreTagValidForMerge(List<PurchasingAccountsPayableItemAsset> mergeLines,
                                        Integer purchaseOrderIdentifier)
If to be merged items have: (1) No Pretag data: No problem; (2) 1 Pretag data entry: Associate this one with the new item created after merge;(3) 1+ Pretag data entries: Display error, user has to manually fix data

Parameters:
mergeLines -

getItemLineNumberMap

protected Map getItemLineNumberMap(List<PurchasingAccountsPayableItemAsset> itemLines)
Build a Hashmap for itemLineNumber since itemLines could exist duplicate itemLineNumber

Parameters:
itemLines -
Returns:

checkMergeAllValid

protected void checkMergeAllValid(boolean tradeInAllowanceInAllLines,
                                  boolean tradeInIndicatorInSelectedLines)
For merge all, check if exists Trade-in allowance pending for allocate.

Parameters:
mergeLines -
purApForm -

checkMergeLinesValid

protected void checkMergeLinesValid(List<PurchasingAccountsPayableItemAsset> mergeLines,
                                    boolean tradeInAllowanceInAllLines,
                                    boolean tradeInIndicatorInSelectedLines)
Check if merge lines selected are allowed to continue this action. Constraints include: merge lines must more than 1; no additional charges pending for allocate.

Parameters:
mergeLines -
purApForm -

checkMergeRequiredFields

protected void checkMergeRequiredFields(PurApLineForm purApForm)
Check the required fields entered for merge.


percentPayment

public org.apache.struts.action.ActionForward percentPayment(org.apache.struts.action.ActionMapping mapping,
                                                             org.apache.struts.action.ActionForm form,
                                                             javax.servlet.http.HttpServletRequest request,
                                                             javax.servlet.http.HttpServletResponse response)
                                                      throws Exception
Update the item quantity value from a decimal(less than 1) to 1.

Parameters:
mapping -
form -
request -
response -
Returns:
Throws:
Exception

allocate

public org.apache.struts.action.ActionForward allocate(org.apache.struts.action.ActionMapping mapping,
                                                       org.apache.struts.action.ActionForm form,
                                                       javax.servlet.http.HttpServletRequest request,
                                                       javax.servlet.http.HttpServletResponse response)
                                                throws Exception
Allocate line items including allocate additional charges functionality.

Parameters:
mapping -
form -
request -
response -
Returns:
Throws:
Exception

performAllocate

protected void performAllocate(PurApLineForm purApForm,
                               PurchasingAccountsPayableItemAsset allocateSourceLine,
                               List<PurchasingAccountsPayableItemAsset> allocateTargetLines)
Allocate with service help.

Parameters:
purApForm -
allocateSourceLine -
allocateTargetLines -

validateAllocateAction

protected void validateAllocateAction(PurchasingAccountsPayableItemAsset allocateSourceLine,
                                      List<PurchasingAccountsPayableItemAsset> allocateTargetLines,
                                      boolean targetLineHasTradeIn,
                                      boolean hasTradeInAllowance,
                                      List<PurchasingAccountsPayableDocument> purApDocs)
Check if the line items are allowed to allocate.

Parameters:
selectedLine -
allocateTargetLines -
purApForm -

applyPayment

public org.apache.struts.action.ActionForward applyPayment(org.apache.struts.action.ActionMapping mapping,
                                                           org.apache.struts.action.ActionForm form,
                                                           javax.servlet.http.HttpServletRequest request,
                                                           javax.servlet.http.HttpServletResponse response)
                                                    throws Exception
Handle apply payment action.

Parameters:
mapping -
form -
request -
response -
Returns:
Throws:
Exception

createAsset

public org.apache.struts.action.ActionForward createAsset(org.apache.struts.action.ActionMapping mapping,
                                                          org.apache.struts.action.ActionForm form,
                                                          javax.servlet.http.HttpServletRequest request,
                                                          javax.servlet.http.HttpServletResponse response)
                                                   throws Exception
Handle create asset action.

Parameters:
mapping -
form -
request -
response -
Returns:
Throws:
Exception

validateCreateAssetAction

protected void validateCreateAssetAction(PurchasingAccountsPayableItemAsset selectedLine)
Validate selected line item for asset global creation.

Parameters:
selectedLine -

getParameterService

protected org.kuali.rice.kns.service.ParameterService getParameterService()

getKualiConfigurationService

protected org.kuali.rice.kns.service.KualiConfigurationService getKualiConfigurationService()


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