|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts.action.ActionForm
org.kuali.rice.kns.web.struts.pojo.PojoFormBase
org.kuali.rice.kns.web.struts.form.KualiForm
org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase
org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase
org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentFormBase
org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase
org.kuali.kfs.fp.document.web.struts.VoucherForm
public class VoucherForm
This class is the Struts specific form object that works in conjunction with the pojo utilities to build the UI for Voucher
Document instances. This class is unique in that it leverages a helper data structure called the
because Voucher documents, under some/none conditions, presents the user with
a debit and credit column for amount entry. 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.
VoucherAccountingLineHelper
Field Summary | |
---|---|
protected List |
accountingPeriods
|
protected org.kuali.rice.kns.util.KualiDecimal |
newSourceLineCredit
|
protected org.kuali.rice.kns.util.KualiDecimal |
newSourceLineDebit
|
protected String |
selectedAccountingPeriod
|
protected List |
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 | |
---|---|
VoucherForm()
Supplements a constructor for this voucher class |
Method Summary | |
---|---|
AccountingPeriod |
getAccountingPeriod()
|
List |
getAccountingPeriods()
This method retrieves the list of valid accounting periods to display. |
String |
getCurrencyFormattedCreditTotal()
This method retrieves the voucher's credit total formatted as currency. |
String |
getCurrencyFormattedDebitTotal()
This method retrieves the voucher's debit total formatted as currency. |
String |
getCurrencyFormattedTotal()
This method retrieves the voucher's total formatted as currency. |
String |
getFormattedReversalDate()
This method returns the reversal date in the format MMM d, yyyy. |
org.kuali.rice.kns.util.KualiDecimal |
getNewSourceLineCredit()
This method retrieves the credit amount of the new accounting line that was added. |
org.kuali.rice.kns.util.KualiDecimal |
getNewSourceLineDebit()
This method retrieves the debit amount of the new accounting line that was added. |
String |
getSelectedAccountingPeriod()
This method retrieves the selectedAccountingPeriod. |
protected String |
getSelectedPostingPeriodCode()
util method to get posting period code out of selectedAccountingPeriod |
protected Integer |
getSelectedPostingYear()
util method to get postingYear out of selectedAccountingPeriod |
VoucherDocument |
getVoucherDocument()
Helper method to make casting easier |
VoucherAccountingLineHelper |
getVoucherLineHelper(int index)
This method retrieves the proper voucher helper line data structure at the passed in list index so that it matches up with the correct accounting line at that index. |
List |
getVoucherLineHelpers()
Accessor to the list of instances. |
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. |
void |
populateAccountingPeriodListForRendering()
This method retrieves all of the "open for posting" accounting periods 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 |
populateDefaultSelectedAccountingPeriod()
sets initial selected accounting period to current period |
protected void |
populateSelectedVoucherAccountingPeriod()
This method parses the accounting period value from the form and builds a basic AccountingPeriod object so that the voucher is properly persisted with the accounting period set for it. |
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 boolean |
processDebitAndCreditForAllSourceLines()
This method iterates through all of the source accounting lines associated with the voucher doc and accounts for any changes to the credit and debit amounts, populate the source lines' amount and debit/credit code fields appropriately, so that they can be persisted accurately. |
protected boolean |
processDebitAndCreditForNewSourceLine()
This method uses the newly entered debit and credit amounts to populate the new source line that is to be added to the voucher document. |
protected boolean |
processDebitAndCreditForSourceLine(SourceAccountingLine sourceLine,
org.kuali.rice.kns.util.KualiDecimal debitAmount,
org.kuali.rice.kns.util.KualiDecimal creditAmount,
int index)
This method checks the debit and credit attributes passed in, figures out which one has a value, and sets the source accounting line's amount and debit/credit attribute appropriately. |
void |
setAccountingPeriods(List accountingPeriods)
This method sets the list of valid accounting periods to display. |
void |
setNewSourceLineCredit(org.kuali.rice.kns.util.KualiDecimal newSourceLineCredit)
This method sets the credit amount of the new accounting line that was added. |
void |
setNewSourceLineDebit(org.kuali.rice.kns.util.KualiDecimal newSourceLineDebit)
This method sets the debit amount of the new accounting line that was added. |
void |
setSelectedAccountingPeriod(String selectedAccountingPeriod)
This method sets the selectedAccountingPeriod. |
void |
setVoucherLineHelpers(List voucherLineHelpers)
This method sets the list of helper lines for the form. |
protected boolean |
validateCreditAndDebitAmounts(org.kuali.rice.kns.util.KualiDecimal debitAmount,
org.kuali.rice.kns.util.KualiDecimal creditAmount,
int index)
This method checks to make sure that there isn't a value in both the credit and debit columns for a given accounting line. |
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, getDefaultDocumentTypeName, 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 |
---|
protected List accountingPeriods
protected org.kuali.rice.kns.util.KualiDecimal newSourceLineDebit
protected org.kuali.rice.kns.util.KualiDecimal newSourceLineCredit
protected List voucherLineHelpers
protected String selectedAccountingPeriod
Constructor Detail |
---|
public VoucherForm()
Method Detail |
---|
public void populateDefaultSelectedAccountingPeriod()
public void populate(javax.servlet.http.HttpServletRequest request)
populate
in interface org.kuali.rice.kns.web.struts.pojo.PojoForm
populate
in class KualiAccountingDocumentFormBase
PojoForm.populate(javax.servlet.http.HttpServletRequest)
protected Integer getSelectedPostingYear()
protected String getSelectedPostingPeriodCode()
public VoucherDocument getVoucherDocument()
public void populateSourceAccountingLine(SourceAccountingLine sourceLine, String accountingLinePropertyName, Map parameterMap)
populateSourceAccountingLine
in class KualiAccountingDocumentFormBase
accountingLinePropertyName
- the property path from the form to the accounting lineparameterMap
- the map of parameters that were sent in with the requestorg.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase#populateSourceAccountingLine(org.kuali.rice.kns.bo.SourceAccountingLine)
public List getAccountingPeriods()
public void setAccountingPeriods(List accountingPeriods)
accountingPeriods
- public String getFormattedReversalDate()
public String getSelectedAccountingPeriod()
public AccountingPeriod getAccountingPeriod()
public void setSelectedAccountingPeriod(String selectedAccountingPeriod)
selectedAccountingPeriod
- public List getVoucherLineHelpers()
VoucherAccountingLineHelper
instances. This method retrieves the list of
helper line objects for the form.
public VoucherAccountingLineHelper getVoucherLineHelper(int index)
index
-
public void setVoucherLineHelpers(List voucherLineHelpers)
voucherLineHelpers
- public org.kuali.rice.kns.util.KualiDecimal getNewSourceLineCredit()
public void setNewSourceLineCredit(org.kuali.rice.kns.util.KualiDecimal newSourceLineCredit)
newSourceLineCredit
- public org.kuali.rice.kns.util.KualiDecimal getNewSourceLineDebit()
public void setNewSourceLineDebit(org.kuali.rice.kns.util.KualiDecimal newSourceLineDebit)
newSourceLineDebit
- public String getCurrencyFormattedDebitTotal()
public String getCurrencyFormattedCreditTotal()
public String getCurrencyFormattedTotal()
public void populateAccountingPeriodListForRendering()
protected void populateSelectedVoucherAccountingPeriod()
protected void populateCreditAndDebitAmounts()
protected boolean processDebitAndCreditForNewSourceLine()
protected boolean processDebitAndCreditForAllSourceLines()
protected boolean processDebitAndCreditForSourceLine(SourceAccountingLine sourceLine, org.kuali.rice.kns.util.KualiDecimal debitAmount, org.kuali.rice.kns.util.KualiDecimal creditAmount, int index)
sourceLine
- debitAmount
- creditAmount
- index
- if -1, then its a new line, if not -1 then it's an existing line
protected boolean validateCreditAndDebitAmounts(org.kuali.rice.kns.util.KualiDecimal debitAmount, org.kuali.rice.kns.util.KualiDecimal creditAmount, int index)
creditAmount
- debitAmount
- index
- if -1, it's a new line, if not -1, then its an existing line
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |