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

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
Direct Known Subclasses:
AuxiliaryVoucherAction, JournalVoucherAction

public class VoucherAction
extends KualiAccountingDocumentActionBase

This class piggy backs on all of the functionality in the FinancialSystemTransactionalDocumentActionBase but is necessary for this document type. Vouchers are unique in that they define 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
 
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
VoucherAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward copy(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Overridden to reset the available and selected accounting periods on the form, so that copies are moved forward to the current accounting period correctly
 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 voucher error correction.
 org.apache.struts.action.ActionForward deleteSourceLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Overrides parent to remove the associated helper line also, and then it call the parent's implementation.
 org.apache.struts.action.ActionForward insertSourceLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Overrides parent to first populate the new source line with the correct debit or credit value, then it calls the parent's implementation.
protected  void loadDocument(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase kualiDocumentFormBase)
          Overrides the parent to make sure that the AV specific accounting line helper forms are properly populated when the document is first loaded.
protected  void populateAllVoucherAccountingLineHelpers(VoucherForm voucherForm)
          This method builds the corresponding list of voucher acounting line helper objects so that a user can differentiate between credit and debit fields.
protected  VoucherAccountingLineHelper populateNewVoucherAccountingLineHelper(VoucherForm voucherForm)
          This populates a new helperLine instance with the one that was just added so that the new instance can be added to the helperLines list.
protected  void populateSelectedAccountingPeriod(VoucherDocument voucherDocument, VoucherForm voucherForm)
          This method parses the accounting period value from the bo and builds the right string to pass to the form object as the selected value.
protected  VoucherAccountingLineHelper populateVoucherAccountingLineHelper(VoucherForm voucherForm)
          This populates a new helperLine instance with the one that was just added so that the new instance can be added to the helperLines list.
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.
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.sys.web.struts.KualiAccountingDocumentActionBase
addCapitalAssetInfo, addCapitalAssetInfoDetailLines, applyCapitalAssetInformation, approve, blanketApprove, checkSalesTax, checkSalesTaxRequiredAllLines, checkUploadFile, clearCapitalAssetInfo, clearOverridesThatBecameUnneeded, deepCopyAccountingLinesList, deleteAccountingLine, deleteCapitalAssetInfoDetailLine, deleteTargetLine, execute, 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, route, 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
 

Constructor Detail

VoucherAction

public VoucherAction()
Method Detail

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 voucher error correction.

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

insertSourceLine

public org.apache.struts.action.ActionForward insertSourceLine(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 parent to first populate the new source line with the correct debit or credit value, then it calls the parent's implementation.

Overrides:
insertSourceLine in class KualiAccountingDocumentActionBase
Returns:
ActionForward
Throws:
Exception
See Also:
org.kuali.module.financial.web.struts.action.KualiFinancialDocumentActionBase#insertSourceLine(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

deleteSourceLine

public org.apache.struts.action.ActionForward deleteSourceLine(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 parent to remove the associated helper line also, and then it call the parent's implementation.

Overrides:
deleteSourceLine in class KualiAccountingDocumentActionBase
Returns:
ActionForward
Throws:
Exception
See Also:
org.kuali.module.financial.web.struts.action.KualiFinancialDocumentActionBase#deleteSourceLine(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

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 AV 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 KualiAccountingDocumentActionBase
Throws:
org.kuali.rice.kew.exception.WorkflowException
See Also:
KualiDocumentActionBase.loadDocument(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase)

populateSelectedAccountingPeriod

protected void populateSelectedAccountingPeriod(VoucherDocument voucherDocument,
                                                VoucherForm voucherForm)
This method parses the accounting period value from the bo and builds the right string to pass to the form object as the selected value.

Parameters:
voucherDocument -
voucherForm -

populateVoucherAccountingLineHelper

protected VoucherAccountingLineHelper populateVoucherAccountingLineHelper(VoucherForm voucherForm)
This populates a new helperLine instance with the one that was just added so that the new instance can be added to the helperLines list.

Parameters:
voucherForm -
Returns:
VoucherAccountingLineHelper

populateAllVoucherAccountingLineHelpers

protected void populateAllVoucherAccountingLineHelpers(VoucherForm voucherForm)
This method builds the corresponding list of voucher acounting line helper objects so that a user can differentiate between credit and debit fields. It does this by iterating over each source accounting line (what the voucher uses) looking at the debit/credit code and then populateingLineHelpers a corresponding helper form instance with the amount in the appropriate amount field - credit or debit.

Parameters:
voucherForm -

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."

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

populateNewVoucherAccountingLineHelper

protected VoucherAccountingLineHelper populateNewVoucherAccountingLineHelper(VoucherForm voucherForm)
This populates a new helperLine instance with the one that was just added so that the new instance can be added to the helperLines list.

Parameters:
voucherForm -
Returns:
voucherAccountingLineHelper

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 KualiAccountingDocumentActionBase
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 KualiAccountingDocumentActionBase
Parameters:
isSource -
form -
Throws:
FileNotFoundException
IOException

copy

public org.apache.struts.action.ActionForward copy(org.apache.struts.action.ActionMapping mapping,
                                                   org.apache.struts.action.ActionForm form,
                                                   javax.servlet.http.HttpServletRequest request,
                                                   javax.servlet.http.HttpServletResponse response)
                                            throws Exception
Overridden to reset the available and selected accounting periods on the form, so that copies are moved forward to the current accounting period correctly

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


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