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

java.lang.Object
  extended by org.apache.struts.action.ActionForm
      extended by org.kuali.rice.kns.web.struts.pojo.PojoFormBase
          extended by org.kuali.rice.kns.web.struts.form.KualiForm
              extended by org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase
                  extended by org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase
                      extended by org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentFormBase
                          extended by org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase
                              extended by org.kuali.kfs.fp.document.web.struts.VoucherForm
                                  extended by org.kuali.kfs.fp.document.web.struts.JournalVoucherForm
All Implemented Interfaces:
Serializable, org.kuali.rice.kns.web.struts.pojo.PojoForm
Direct Known Subclasses:
LaborJournalVoucherForm

public class JournalVoucherForm
extends VoucherForm

This class is the Struts specific form object that works in conjunction with the pojo utilities to build the UI for the Journal Voucher Document. This class is unique in that it leverages a helper data structure called the VoucherAccountingLineHelper because the Journal Voucher, under certain conditions, presents the user with a debit and credit column for amount entry. In addition, this form class must keep track of the changes between the old and new balance type selection so that the corresponding action class and make decisions based upon the differences. New accounting lines use specific credit and debit amount fields b/c the new line is explicitly known; however, already existing accounting lines need to exist within a list with ordering that matches the accounting lines source list.

See Also:
Serialized Form

Field Summary
protected  List balanceTypes
           
protected  String originalBalanceType
           
protected  BalanceType selectedBalanceType
           
 
Fields inherited from class org.kuali.kfs.fp.document.web.struts.VoucherForm
accountingPeriods, newSourceLineCredit, newSourceLineDebit, selectedAccountingPeriod, voucherLineHelpers
 
Fields inherited from class org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase
editableAccounts, forcedLookupOptionalFields, hideDetails, LOG, newSourceLine, newTargetLine, sourceFile, targetFile
 
Fields inherited from class org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase
forcedReadOnlyFields
 
Fields inherited from class org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase
adHocActionRequestCodes, attachmentFile, documentActions, editingMode, suppressAllButtons
 
Fields inherited from class org.kuali.rice.kns.web.struts.form.KualiForm
extraButtons
 
Fields inherited from class org.kuali.rice.kns.web.struts.pojo.PojoFormBase
requiredNonEditableProperties
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
JournalVoucherForm()
          Constructs a JournalVoucherForm instance.
 
Method Summary
 List getBalanceTypes()
          This method retrieves the list of valid balance types to display.
protected  String getDefaultDocumentTypeName()
           
 JournalVoucherDocument getJournalVoucherDocument()
          This method returns the journal voucher document associated with this form.
 String getOriginalBalanceType()
          This method retrieves the originalBalanceType attribute.
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.
 BalanceType getSelectedBalanceType()
          This method sets the selected balance type.
protected  boolean isSelectedBalanceTypeFinancialOffsetGenerationIndicator()
          This is a convenience helper method that is used several times throughout this action class to determine if the selected balance type contained within the form instance is a financial offset generation balance type or not.
 void populate(javax.servlet.http.HttpServletRequest request)
          Overrides the parent to call super.populate and then to call the two methods that are specific to loading the two select lists on the page.
protected  void populateBalanceTypeListForRendering()
          This method retrieves all of the balance types in the system and prepares them to be rendered in a dropdown UI component.
protected  void populateCreditAndDebitAmounts()
          If the balance type is an offset generation balance type, then the user is able to enter the amount as either a debit or a credit, otherwise, they only need to deal with the amount field in this case we always need to update the underlying bo so that the debit/credit code along with the amount, is properly set.
 void populateSourceAccountingLine(SourceAccountingLine sourceLine, String accountingLinePropertyName, Map parameterMap)
          Override the parent, to push the chosen accounting period and balance type down into the source accounting line object.
protected  void populateSourceAccountingLineEncumbranceCode(SourceAccountingLine sourceLine)
          Sets the encumbrance code of the line based on the balance type.
 void setBalanceTypes(List balanceTypes)
          This method sets the list of valid balance types to display.
 void setJournalVoucherDocument(JournalVoucherDocument journalVoucherDocument)
          This method sets the journal voucher document associated with this form.
 void setOriginalBalanceType(String changedBalanceType)
          This method sets the originalBalanceType attribute.
 void setSelectedBalanceType(BalanceType selectedBalanceType)
          This method retrieves the selected balance type.
 
Methods inherited from class org.kuali.kfs.fp.document.web.struts.VoucherForm
getAccountingPeriod, getAccountingPeriods, getCurrencyFormattedCreditTotal, getCurrencyFormattedDebitTotal, getCurrencyFormattedTotal, getFormattedReversalDate, getNewSourceLineCredit, getNewSourceLineDebit, getSelectedAccountingPeriod, getSelectedPostingPeriodCode, getSelectedPostingYear, getVoucherDocument, getVoucherLineHelper, getVoucherLineHelpers, populateAccountingPeriodListForRendering, populateDefaultSelectedAccountingPeriod, populateSelectedVoucherAccountingPeriod, processDebitAndCreditForAllSourceLines, processDebitAndCreditForNewSourceLine, processDebitAndCreditForSourceLine, setAccountingPeriods, setNewSourceLineCredit, setNewSourceLineDebit, setSelectedAccountingPeriod, setVoucherLineHelpers, validateCreditAndDebitAmounts
 
Methods inherited from class org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase
createNewSourceAccountingLine, createNewTargetAccountingLine, customInitMaxUploadSizes, getAccountingLineImportInstructionsUrl, getCurrencyFormattedSourceTotal, getCurrencyFormattedTargetTotal, getEditableAccounts, getExcludedmethodToCall, getFinancialDocument, getForcedLookupOptionalFields, getHideDetails, getNewSourceLine, getNewTargetLine, getSourceFile, getTargetFile, harvestAccountingLines, isHideDetails, populateAccountingLine, populateAccountingLines, populateAccountingLinesForResponse, populateTargetAccountingLine, repopulateOverrides, setEditableAccounts, setForcedLookupOptionalFields, setHideDetails, setNewSourceLine, setNewTargetLine, setSourceFile, setTargetFile, shouldMethodToCallParameterBeUsed
 
Methods inherited from class org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentFormBase
extendDocInfoToThreeColumns, generateErrorCorrectionButton, getExtraButtons, populateHeaderFields
 
Methods inherited from class org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase
discoverDocumentTypeName, formatReversalDate, getForcedReadOnlyFields, getTransactionalDocument, instantiateTransactionalDocumentByDocumentTypeName, populateEmptyMultiSelect, populateFalseCheckboxes, populationSpecialEmptyFields, setForcedReadOnlyFields
 
Methods inherited from class org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase
addRequiredNonEditableProperties, buildHtmlLink, getAdditionalScriptFile, getAdditionalScriptFiles, getAdHocActionRequestCodes, getAdHocRoutePerson, getAdHocRoutePersons, getAdHocRouteWorkgroup, getAdHocRouteWorkgroups, getAnnotation, getAttachmentFile, getBoNotes, getCommand, getDocId, getDocNum, getDocTypeName, getDocument, getDocumentActions, getDocumentHandlerUrl, getEditingMode, getErrorMapFromPreviousRequest, getFormKey, getInitiator, getInitiatorNetworkId, getMessageMapFromPreviousRequest, getNewAdHocRoutePerson, getNewAdHocRouteWorkgroup, getNewNote, getPersonInquiryUrlLink, getStandardHeaderFields, getWorkflowDocument, hasDocumentId, initializeHeaderNavigationTabs, instantiateDocument, isDocumentEnRoute, isFormDocumentInitialized, isHasWorkflowDocument, isReturnToActionList, isSuppressAllButtons, isUserDocumentInitiator, reset, setAdditionalScriptFile, setAdditionalScriptFiles, setAdHocActionRequestCodes, setAdHocRoutePersons, setAdHocRouteWorkgroups, setAnnotation, setAttachmentFile, setBoNotes, setCommand, setDerivedValuesOnForm, setDocId, setDocNum, setDocTypeName, setDocument, setDocumentActions, setEditingMode, setErrorMapFromPreviousRequest, setFormKey, setMessageMapFromPreviousRequest, setNewAdHocRoutePerson, setNewAdHocRouteWorkgroup, setNewNote, setReturnToActionList, setSuppressAllButtons, shouldPropertyBePopulatedInForm, validate
 
Methods inherited from class org.kuali.rice.kns.web.struts.form.KualiForm
clearEditablePropertyInformation, getActionFormUtilMap, getAnchor, getBackLocation, getCurrentTabIndex, getDisplayedErrors, getDisplayedInfo, getDisplayedWarnings, getDocInfo, getExtraButton, getFieldNameToFocusOnAfterSubmit, getHeaderNavigationTabs, getMethodToCall, getNavigationCss, getNextArbitrarilyHighIndex, getNumColumns, getRefreshCaller, getTabState, getTabStates, incrementTabIndex, isFieldLevelHelpEnabled, populateBackLocation, populateFieldLevelHelpEnabled, reset, retrieveFormValueForLookupInquiryParameters, setActionFormUtilMap, setAnchor, setBackLocation, setCurrentTabIndex, setDocInfo, setExtraButton, setExtraButtons, setFieldLevelHelpEnabled, setFieldNameToFocusOnAfterSubmit, setHeaderNavigationTabs, setMethodToCall, setNavigationCss, setNumColumns, setRefreshCaller, setTabStates
 
Methods inherited from class org.kuali.rice.kns.web.struts.pojo.PojoFormBase
addMaxUploadSize, cacheUnconvertedValue, copyPopulateEditablePropertiesToActionEditableProperties, formatterClassForKeypath, formatValue, getActionEditablePropertiesGuid, getEditableProperties, getFormatter, getFormatterTypes, getIsNewForm, getMaxUploadSizes, getMethodToCallsToBypassSessionRetrievalForGETRequests, getParameter, getParameterValues, getPopulateEditableProperties, getPopulateEditablePropertiesGuid, getPropertyType, getRequiredNonEditableProperties, getStrutsActionMappingScope, getUnconvertedValues, getUnknownKeys, initMaxUploadSizes, isPropertyEditable, isPropertyNonEditableButRequired, populateForProperty, postprocessRequestParameters, processValidationFail, registerEditableProperty, registerIsNewForm, registerRequiredNonEditableProperty, registerStrutsActionMappingScope, setActionEditablePropertiesGuid, setFormatterType, setFormatterTypes, setPopulateEditablePropertiesGuid, setUnconvertedValues
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, setMultipartRequestHandler, setServlet, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

balanceTypes

protected List balanceTypes

originalBalanceType

protected String originalBalanceType

selectedBalanceType

protected BalanceType selectedBalanceType
Constructor Detail

JournalVoucherForm

public JournalVoucherForm()
Constructs a JournalVoucherForm instance.

Method Detail

getDefaultDocumentTypeName

protected String getDefaultDocumentTypeName()
Overrides:
getDefaultDocumentTypeName in class org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase

populate

public void populate(javax.servlet.http.HttpServletRequest request)
Overrides the parent to call super.populate and then to call the two methods that are specific to loading the two select lists on the page. In addition, this also makes sure that the credit and debit amounts are filled in for situations where validation errors occur and the page reposts.

Specified by:
populate in interface org.kuali.rice.kns.web.struts.pojo.PojoForm
Overrides:
populate in class VoucherForm
See Also:
PojoForm.populate(javax.servlet.http.HttpServletRequest)

populateSourceAccountingLine

public void populateSourceAccountingLine(SourceAccountingLine sourceLine,
                                         String accountingLinePropertyName,
                                         Map parameterMap)
Override the parent, to push the chosen accounting period and balance type down into the source accounting line object. In addition, check the balance type to see if it's the "External Encumbrance" balance and alter the encumbrance update code on the accounting line appropriately.

Overrides:
populateSourceAccountingLine in class VoucherForm
accountingLinePropertyName - the property path from the form to the accounting line
parameterMap - the map of parameters that were sent in with the request
See Also:
org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase#populateSourceAccountingLine(org.kuali.rice.kns.bo.SourceAccountingLine)

populateSourceAccountingLineEncumbranceCode

protected void populateSourceAccountingLineEncumbranceCode(SourceAccountingLine sourceLine)
Sets the encumbrance code of the line based on the balance type.

Parameters:
sourceLine - - line to set code on

getBalanceTypes

public List getBalanceTypes()
This method retrieves the list of valid balance types to display.

Returns:
List

getSelectedBalanceType

public BalanceType getSelectedBalanceType()
This method sets the selected balance type.

Returns:
BalanceTyp

setSelectedBalanceType

public void setSelectedBalanceType(BalanceType selectedBalanceType)
This method retrieves the selected balance type.

Parameters:
selectedBalanceType -

setBalanceTypes

public void setBalanceTypes(List balanceTypes)
This method sets the list of valid balance types to display.

Parameters:
balanceTypes -

getJournalVoucherDocument

public JournalVoucherDocument getJournalVoucherDocument()
This method returns the journal voucher document associated with this form.

Returns:
Returns the journalVoucherDocument.

setJournalVoucherDocument

public void setJournalVoucherDocument(JournalVoucherDocument journalVoucherDocument)
This method sets the journal voucher document associated with this form.

Parameters:
journalVoucherDocument - The journalVoucherDocument to set.

getOriginalBalanceType

public String getOriginalBalanceType()
This method retrieves the originalBalanceType attribute.

Returns:
String

setOriginalBalanceType

public void setOriginalBalanceType(String changedBalanceType)
This method sets the originalBalanceType attribute.

Parameters:
changedBalanceType -

populateBalanceTypeListForRendering

protected void populateBalanceTypeListForRendering()
This method retrieves all of the balance types in the system and prepares them to be rendered in a dropdown UI component.


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

populateCreditAndDebitAmounts

protected void populateCreditAndDebitAmounts()
If the balance type is an offset generation balance type, then the user is able to enter the amount as either a debit or a credit, otherwise, they only need to deal with the amount field in this case we always need to update the underlying bo so that the debit/credit code along with the amount, is properly set.

Overrides:
populateCreditAndDebitAmounts in class VoucherForm

isSelectedBalanceTypeFinancialOffsetGenerationIndicator

protected boolean isSelectedBalanceTypeFinancialOffsetGenerationIndicator()
This is a convenience helper method that is used several times throughout this action class to determine if the selected balance type contained within the form instance is a financial offset generation balance type or not.

Returns:
boolean True if it is an offset generation balance type, false otherwise.


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