org.kuali.kfs.fp.document.web.struts
Class JournalVoucherAction

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.rice.kns.web.struts.action.KualiDocumentActionBase
                  extended by org.kuali.rice.kns.web.struts.action.KualiTransactionalDocumentActionBase
                      extended by org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentActionBase
                          extended by org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase
                              extended by org.kuali.kfs.fp.document.web.struts.VoucherAction
                                  extended by org.kuali.kfs.fp.document.web.struts.JournalVoucherAction
Direct Known Subclasses:
JournalVoucherAction

public class JournalVoucherAction
extends VoucherAction

This class piggy backs on all of the functionality in the FinancialSystemTransactionalDocumentActionBase but is necessary for this document type. The Journal Voucher is unique in that it defines several fields that aren't typically used by the other financial transaction processing eDocs (i.e. external system fields, object type override, credit and debit amounts).


Field Summary
protected static int CREDIT_DEBIT_TO_SINGLE_AMT_MODE
           
protected static int EXT_ENCUMB_TO_NON_EXT_ENCUMB
           
protected static int NO_MODE_CHANGE
           
protected static int NON_EXT_ENCUMB_TO_EXT_ENCUMB
           
protected static int SINGLE_AMT_TO_CREDIT_DEBIT_MODE
           
 
Fields inherited from class org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase
LOG, UPDATE_EVENT_ACTIONS
 
Fields inherited from class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
DOCUMENT_LOAD_COMMANDS
 
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
JournalVoucherAction()
           
 
Method Summary
protected  String buildBalanceTypeChangeConfirmationMessage(JournalVoucherForm jvForm, org.kuali.rice.kns.service.KualiConfigurationService kualiConfiguration)
          This method will setup the message that will get displayed to the user when they are asked to confirm the balance type change.
 org.apache.struts.action.ActionForward changeBalanceType(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method processes a change in the balance type for a Journal Voucher document - from either a offset generation balance type to a non-offset generation balance type or visa-versa.
 org.apache.struts.action.ActionForward correct(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Overrides to call super, and then to repopulate the credit/debit amounts b/c the credit/debit code might change during a JV error correction.
protected  int determineBalanceTypeAmountChangeMode(JournalVoucherForm journalVoucherForm)
          This method will determine which balance type amount mode to switch to.
protected  int determineBalanceTypeEncumbranceChangeMode(JournalVoucherForm journalVoucherForm)
          This method will determine which balance type encumbrance mode to switch to.
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Overrides the parent and then calls the super method after building the array lists for valid accounting periods and balance types.
protected  BalanceType getPopulatedBalanceTypeInstance(String balanceTypeCode)
          This method will fully populate a balance type given the passed in code, by calling the business object service that retrieves the rest of the instances' information.
protected  void loadDocument(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase kualiDocumentFormBase)
          Overrides the parent to make sure that the JV specific accounting line helper forms are properly populated when the document is first loaded.
protected  void populateBalanceTypeOneDocument(JournalVoucherForm journalVoucherForm)
          This method handles grabbing the values from the form and pushing them into the document appropriately.
protected  void populateSelectedJournalBalanceType(JournalVoucherDocument journalVoucherDocument, JournalVoucherForm journalVoucherForm)
          This method grabs the value from the document bo and sets the selected balance type appropriately.
protected  org.apache.struts.action.ActionForward processChangeBalanceTypeConfirmationQuestion(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method takes control from the changeBalanceType action method in order to present a question prompt to the user so that they can confirm the change in balance type.
protected  org.apache.struts.action.ActionForward processRouteOutOfBalanceDocumentConfirmationQuestion(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This helper method determines from the request object instance whether or not the user has been prompted about the journal being out of balance.
 org.apache.struts.action.ActionForward route(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Overrides the parent to first prompt the user appropriately to make sure that they want to submit and out of balance document, then calls super's route method.
protected  void switchFromCreditDebitModeToSingleAmountMode(JournalVoucherForm journalVoucherForm)
          This method will clear out the source line values that aren't needed for the "Credit/Debit" mode.
protected  void switchFromExternalEncumbranceModeToNonExternalEncumbrance(JournalVoucherForm journalVoucherForm)
          This method will clear out the extra "reference" fields that the external encumbrance balance type uses, but will leave the amounts since we aren't changing the offset generation code stuff.
protected  void switchFromSingleAmountModeToCreditDebitMode(JournalVoucherForm journalVoucherForm)
          This method will clear out the source line values that aren't needed for the "Single Amount" mode.
protected  void uploadAccountingLines(boolean isSource, org.apache.struts.action.ActionForm form)
          This method determines whether we are uploading source or target lines, and then calls uploadAccountingLines directly on the document object.
 org.apache.struts.action.ActionForward uploadSourceLines(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This action executes a call to upload CSV accounting line values as SourceAccountingLines for a given transactional document.
 
Methods inherited from class org.kuali.kfs.fp.document.web.struts.VoucherAction
copy, deleteSourceLine, insertSourceLine, populateAllVoucherAccountingLineHelpers, populateNewVoucherAccountingLineHelper, populateSelectedAccountingPeriod, populateVoucherAccountingLineHelper
 
Methods inherited from class org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase
addCapitalAssetInfo, addCapitalAssetInfoDetailLines, applyCapitalAssetInformation, approve, blanketApprove, checkSalesTax, checkSalesTaxRequiredAllLines, checkUploadFile, clearCapitalAssetInfo, clearOverridesThatBecameUnneeded, deepCopyAccountingLinesList, deleteAccountingLine, deleteCapitalAssetInfoDetailLine, deleteTargetLine, getCurrentCapitalAssetInformationObject, getMaxItemLineNumber, getNextItemLineNumberAndIncremented, getObjectTypeCodeFromLine, getSourceAccountingLine, getTargetAccountingLine, handleSalesTaxRequired, handleSalesTaxRequiredAllLines, hasSalesTaxBeenEntered, hideDetails, insertAccountingLine, insertTargetLine, isSalesTaxRequired, isValidSalesTaxEntered, performBalanceInquiryForAccountingLine, performBalanceInquiryForSourceLine, performBalanceInquiryForTargetLine, performLookup, populateSalesTax, processAccountingLineOverrides, processAccountingLineOverrides, processAccountingLineOverrides, processAccountingLines, refresh, refreshSalesTaxInfo, removeSalesTax, resetCapitalAssetInfo, save, showDetails, toggleTab, uploadTargetLines
 
Methods inherited from class org.kuali.rice.kns.web.struts.action.KualiTransactionalDocumentActionBase
populateAuthorizationFields
 
Methods inherited from class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
acknowledge, attemptLockRelease, buildAuthorizationException, cancel, cancelBOAttachment, canSave, checkAndWarnAboutSensitiveData, checkAuthorization, close, combineAdHocRecipients, convertSetToMap, createDocument, delete, deleteAdHocRoutePerson, deleteAdHocRouteWorkgroup, deleteBONote, determineNoteWorkflowNotificationAction, disapprove, docHandler, doProcessingAfterPost, downloadBOAttachment, exitingDocument, fyi, generatePessimisticLockMessage, getAttachmentService, getBusinessObjectAuthorizationService, getBusinessObjectMetaDataService, getBusinessObjectService, getDataDictionaryService, getDocumentHelperService, getDocumentService, getEntityManagerFactory, getIdentityManagementService, getKualiConfigurationService, getKualiRuleService, getNoteService, getParameterService, getPessimisticLockService, getQuestion, hideAllTabs, insertAdHocRoutePerson, insertAdHocRouteWorkgroup, insertBONote, isFormRepresentingLockObject, performRouteReport, populateAdHocActionRequestCodes, promptBeforeValidation, promptBeforeValidation, refreshAdHocRoutingWorkgroupLookups, releaseLocks, reload, returnToSender, selectedAttachmentIndex, sendAdHocRequests, sendNoteWorkflowNotification, setupDocumentExit, setupPessimisticLockMessages, showAllTabs, streamToResponse, supervisorFunctions
 
Methods inherited from class org.kuali.rice.kns.web.struts.action.KualiAction
addMethodToCallToUncheckedList, defaultDispatch, dispatchMethod, findMethodToCall, getApplicationBaseUrl, getBasePath, getEncryptionService, getHeaderTabDispatch, getHeaderTabNavigateTo, getImageContext, getKualiModuleService, getLineToDelete, getReturnLocation, getRoleQualification, getSelectedLine, getTabToToggle, headerTab, performInquiry, performQuestionWithInput, performQuestionWithInputAgainBecauseOfErrors, performQuestionWithoutInput, performWorkgroupLookup, postTextAreaToParent, retrieveLookupParameterValue, 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
 

Field Detail

CREDIT_DEBIT_TO_SINGLE_AMT_MODE

protected static final int CREDIT_DEBIT_TO_SINGLE_AMT_MODE
See Also:
Constant Field Values

SINGLE_AMT_TO_CREDIT_DEBIT_MODE

protected static final int SINGLE_AMT_TO_CREDIT_DEBIT_MODE
See Also:
Constant Field Values

EXT_ENCUMB_TO_NON_EXT_ENCUMB

protected static final int EXT_ENCUMB_TO_NON_EXT_ENCUMB
See Also:
Constant Field Values

NON_EXT_ENCUMB_TO_EXT_ENCUMB

protected static final int NON_EXT_ENCUMB_TO_EXT_ENCUMB
See Also:
Constant Field Values

NO_MODE_CHANGE

protected static final int NO_MODE_CHANGE
See Also:
Constant Field Values
Constructor Detail

JournalVoucherAction

public JournalVoucherAction()
Method Detail

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws Exception
Overrides the parent and then calls the super method after building the array lists for valid accounting periods and balance types.

Overrides:
execute in class KualiAccountingDocumentActionBase
Throws:
Exception
See Also:
KualiAction.execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)

route

public org.apache.struts.action.ActionForward route(org.apache.struts.action.ActionMapping mapping,
                                                    org.apache.struts.action.ActionForm form,
                                                    javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.http.HttpServletResponse response)
                                             throws Exception
Overrides the parent to first prompt the user appropriately to make sure that they want to submit and out of balance document, then calls super's route method.

Overrides:
route in class KualiAccountingDocumentActionBase
Throws:
Exception
See Also:
KualiDocumentActionBase.route(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

populateBalanceTypeOneDocument

protected void populateBalanceTypeOneDocument(JournalVoucherForm journalVoucherForm)
This method handles grabbing the values from the form and pushing them into the document appropriately.

Parameters:
journalVoucherForm -

correct

public org.apache.struts.action.ActionForward correct(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws Exception
Overrides to call super, and then to repopulate the credit/debit amounts b/c the credit/debit code might change during a JV error correction.

Overrides:
correct in class VoucherAction
Returns:
ActionForward
Throws:
Exception
See Also:
VoucherAction.correct(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

changeBalanceType

public org.apache.struts.action.ActionForward changeBalanceType(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 processes a change in the balance type for a Journal Voucher document - from either a offset generation balance type to a non-offset generation balance type or visa-versa.

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

determineBalanceTypeAmountChangeMode

protected int determineBalanceTypeAmountChangeMode(JournalVoucherForm journalVoucherForm)
                                            throws Exception
This method will determine which balance type amount mode to switch to. A change in the balance type selection will eventually invoke this mechanism, which looks at the old balance type value, and the new balance type value to determine what the next mode is.

Parameters:
journalVoucherForm -
Throws:
Exception

determineBalanceTypeEncumbranceChangeMode

protected int determineBalanceTypeEncumbranceChangeMode(JournalVoucherForm journalVoucherForm)
                                                 throws Exception
This method will determine which balance type encumbrance mode to switch to. A change in the balance type selection will eventually invoke this mechanism, which looks at the old balance type value, and the new balance type value to determine what the next mode is.

Parameters:
journalVoucherForm -
Throws:
Exception

processChangeBalanceTypeConfirmationQuestion

protected org.apache.struts.action.ActionForward processChangeBalanceTypeConfirmationQuestion(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 takes control from the changeBalanceType action method in order to present a question prompt to the user so that they can confirm the change in balance type.

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

buildBalanceTypeChangeConfirmationMessage

protected String buildBalanceTypeChangeConfirmationMessage(JournalVoucherForm jvForm,
                                                           org.kuali.rice.kns.service.KualiConfigurationService kualiConfiguration)
                                                    throws Exception
This method will setup the message that will get displayed to the user when they are asked to confirm the balance type change. The message is tuned to the particular context, the value chosen, and also the previous value. It also combines with the core part of the message which is part of the ApplicationResources.properties file.

Parameters:
jvForm -
kualiConfiguration -
Returns:
The message to display to the user in the question prompt window.
Throws:
Exception

getPopulatedBalanceTypeInstance

protected BalanceType getPopulatedBalanceTypeInstance(String balanceTypeCode)
This method will fully populate a balance type given the passed in code, by calling the business object service that retrieves the rest of the instances' information.

Parameters:
balanceTypeCode -
Returns:
BalanceTyp

switchFromSingleAmountModeToCreditDebitMode

protected void switchFromSingleAmountModeToCreditDebitMode(JournalVoucherForm journalVoucherForm)
This method will clear out the source line values that aren't needed for the "Single Amount" mode.

Parameters:
journalVoucherForm -

switchFromExternalEncumbranceModeToNonExternalEncumbrance

protected void switchFromExternalEncumbranceModeToNonExternalEncumbrance(JournalVoucherForm journalVoucherForm)
This method will clear out the extra "reference" fields that the external encumbrance balance type uses, but will leave the amounts since we aren't changing the offset generation code stuff.

Parameters:
journalVoucherForm -

switchFromCreditDebitModeToSingleAmountMode

protected void switchFromCreditDebitModeToSingleAmountMode(JournalVoucherForm journalVoucherForm)
This method will clear out the source line values that aren't needed for the "Credit/Debit" mode.

Parameters:
journalVoucherForm -

loadDocument

protected void loadDocument(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase kualiDocumentFormBase)
                     throws org.kuali.rice.kew.exception.WorkflowException
Overrides the parent to make sure that the JV specific accounting line helper forms are properly populated when the document is first loaded. This first calls super, then populates the helper objects.

Overrides:
loadDocument in class VoucherAction
Throws:
org.kuali.rice.kew.exception.WorkflowException
See Also:
KualiDocumentActionBase.loadDocument(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase)

populateSelectedJournalBalanceType

protected void populateSelectedJournalBalanceType(JournalVoucherDocument journalVoucherDocument,
                                                  JournalVoucherForm journalVoucherForm)
This method grabs the value from the document bo and sets the selected balance type appropriately.

Parameters:
journalVoucherDocument -
journalVoucherForm -

processRouteOutOfBalanceDocumentConfirmationQuestion

protected org.apache.struts.action.ActionForward processRouteOutOfBalanceDocumentConfirmationQuestion(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 helper method determines from the request object instance whether or not the user has been prompted about the journal being out of balance. If they haven't, then the method will build the appropriate message given the state of the document and return control to the question component so that the user receives the "yes"/"no" prompt. If the question has been asked, the we evaluate the user's answer and direct the flow appropriately. If they answer with a "No", then we build out a message stating that they chose that value and return an ActionForward of a MAPPING_BASIC which keeps them at the same page that they were on. If they choose "Yes", then we return a null ActionForward, which the calling action method recognizes as a "Yes" and continues on processing the "Route."

Overrides:
processRouteOutOfBalanceDocumentConfirmationQuestion in class VoucherAction
Parameters:
mapping -
form -
request -
response -
Returns:
ActionForward
Throws:
Exception

uploadSourceLines

public org.apache.struts.action.ActionForward uploadSourceLines(org.apache.struts.action.ActionMapping mapping,
                                                                org.apache.struts.action.ActionForm form,
                                                                javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response)
                                                         throws FileNotFoundException,
                                                                IOException
This action executes a call to upload CSV accounting line values as SourceAccountingLines for a given transactional document. The "uploadAccountingLines()" method handles the multi-part request.

Overrides:
uploadSourceLines in class VoucherAction
Parameters:
mapping -
form -
request -
response -
Returns:
ActionForward
Throws:
FileNotFoundException
IOException

uploadAccountingLines

protected void uploadAccountingLines(boolean isSource,
                                     org.apache.struts.action.ActionForm form)
                              throws FileNotFoundException,
                                     IOException
This method determines whether we are uploading source or target lines, and then calls uploadAccountingLines directly on the document object. This method handles retrieving the actual upload file as an input stream into the document.

Overrides:
uploadAccountingLines in class VoucherAction
Parameters:
isSource -
form -
Throws:
FileNotFoundException
IOException


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