public class VoucherForm extends KualiAccountingDocumentFormBase
VoucherAccountingLineHelper
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.Modifier and Type | Field and Description |
---|---|
protected List |
accountingPeriods |
protected org.kuali.rice.core.api.util.type.KualiDecimal |
newSourceLineCredit |
protected org.kuali.rice.core.api.util.type.KualiDecimal |
newSourceLineDebit |
protected String |
selectedAccountingPeriod |
protected List |
voucherLineHelpers |
editableAccounts, forcedLookupOptionalFields, hideDetails, newSourceLine, newTargetLine, sourceFile, targetFile
forcedReadOnlyFields
adHocActionRequestCodes, attachmentFile, documentActions, editingMode, suppressAllButtons
Constructor and Description |
---|
VoucherForm()
Supplements a constructor for this voucher class
|
Modifier and Type | Method and Description |
---|---|
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.core.api.util.type.KualiDecimal |
getNewSourceLineCredit()
This method retrieves the credit amount of the new accounting line that was added.
|
org.kuali.rice.core.api.util.type.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.core.api.util.type.KualiDecimal debitAmount,
org.kuali.rice.core.api.util.type.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.core.api.util.type.KualiDecimal newSourceLineCredit)
This method sets the credit amount of the new accounting line that was added.
|
void |
setNewSourceLineDebit(org.kuali.rice.core.api.util.type.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.core.api.util.type.KualiDecimal debitAmount,
org.kuali.rice.core.api.util.type.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.
|
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
extendDocInfoToThreeColumns, generateErrorCorrectionButton, getExtraButtons, populateHeaderFields
discoverDocumentTypeName, formatReversalDate, getForcedReadOnlyFields, getTransactionalDocument, instantiateTransactionalDocumentByDocumentTypeName, populateEmptyMultiSelect, populateFalseCheckboxes, populationSpecialEmptyFields, setForcedReadOnlyFields
addRequiredNonEditableProperties, buildHtmlLink, getActionRequests, getActionRequestsRequiringApproval, getAdditionalScriptFile, getAdditionalScriptFiles, getAdHocActionRequestCodes, getAdHocRoutePerson, getAdHocRoutePersons, getAdHocRouteWorkgroup, getAdHocRouteWorkgroups, getAnnotation, getAttachmentFile, getBoNotes, getCommand, getDefaultDocumentTypeName, getDocId, getDocNum, getDocTypeName, getDocument, getDocumentActions, getDocumentHandlerUrl, getEditingMode, getFormKey, getInitiator, getInitiatorNetworkId, getMessageMapFromPreviousRequest, getNewAdHocRoutePerson, getNewAdHocRouteWorkgroup, getNewNote, getPersonInquiryUrlLink, getSelectedActionRequests, getStandardHeaderFields, getSuperUserAnnotation, getWorkflowDocument, hasDocumentId, initializeHeaderNavigationTabs, instantiateDocument, isDocumentEnRoute, isFormDocumentInitialized, isHasWorkflowDocument, isReturnToActionList, isStateAllowsApproveOrDisapprove, isStateAllowsApproveSingleActionRequest, isStateInitiatedFinalCancelled, isStateProcessedOrDisapproved, isSuperUserActionAvaliable, isSuperUserApproveDocumentAuthorized, isSuperUserApproveSingleActionRequestAuthorized, isSuperUserAuthorized, isSuperUserDisapproveDocumentAuthorized, isSuppressAllButtons, isUserDocumentInitiator, reset, setActionRequests, setAdditionalScriptFile, setAdditionalScriptFiles, setAdHocActionRequestCodes, setAdHocRoutePersons, setAdHocRouteWorkgroups, setAnnotation, setAttachmentFile, setBoNotes, setCommand, setDerivedValuesOnForm, setDocId, setDocNum, setDocTypeName, setDocument, setDocumentActions, setEditingMode, setFormKey, setMessageMapFromPreviousRequest, setNewAdHocRoutePerson, setNewAdHocRouteWorkgroup, setNewNote, setReturnToActionList, setSelectedActionRequests, setSuperUserAnnotation, setSuppressAllButtons, shouldPropertyBePopulatedInForm, validate
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
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
protected List accountingPeriods
protected org.kuali.rice.core.api.util.type.KualiDecimal newSourceLineDebit
protected org.kuali.rice.core.api.util.type.KualiDecimal newSourceLineCredit
protected List voucherLineHelpers
protected String selectedAccountingPeriod
public VoucherForm()
public void populateDefaultSelectedAccountingPeriod()
public void populate(javax.servlet.http.HttpServletRequest request)
populate
in interface org.kuali.rice.kns.web.struts.form.pojo.PojoForm
populate
in class KualiAccountingDocumentFormBase
org.kuali.rice.kns.web.struts.pojo.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.krad.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.core.api.util.type.KualiDecimal getNewSourceLineCredit()
public void setNewSourceLineCredit(org.kuali.rice.core.api.util.type.KualiDecimal newSourceLineCredit)
newSourceLineCredit
- public org.kuali.rice.core.api.util.type.KualiDecimal getNewSourceLineDebit()
public void setNewSourceLineDebit(org.kuali.rice.core.api.util.type.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.core.api.util.type.KualiDecimal debitAmount, org.kuali.rice.core.api.util.type.KualiDecimal creditAmount, int index)
sourceLine
- debitAmount
- creditAmount
- index
- if -1, then its a new line, if not -1 then it's an existing lineprotected boolean validateCreditAndDebitAmounts(org.kuali.rice.core.api.util.type.KualiDecimal debitAmount, org.kuali.rice.core.api.util.type.KualiDecimal creditAmount, int index)
creditAmount
- debitAmount
- index
- if -1, it's a new line, if not -1, then its an existing lineCopyright © 2004–2015 The Kuali Foundation. All rights reserved.