org.kuali.kfs.sys.web.struts
Class KualiAccountingDocumentActionBase

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
Direct Known Subclasses:
AdvanceDepositAction, AssetPaymentAction, BudgetAdjustmentAction, CashReceiptAction, CreditCardReceiptAction, CustomerInvoiceDocumentAction, DisbursementVoucherAction, DistributionOfIncomeAndExpenseAction, ExpenseTransferDocumentActionBase, GeneralErrorCorrectionAction, IndirectCostAdjustmentAction, InternalBillingAction, NonCheckDisbursementAction, PreEncumbranceAction, ProcurementCardAction, PurchasingAccountsPayableActionBase, TransferOfFundsAction, VoucherAction

public class KualiAccountingDocumentActionBase
extends FinancialSystemTransactionalDocumentActionBase

This class handles UI actions for all shared methods of financial documents.


Field Summary
protected static org.apache.log4j.Logger LOG
           
protected static Set 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
KualiAccountingDocumentActionBase()
           
 
Method Summary
 org.apache.struts.action.ActionForward addCapitalAssetInfo(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          add the capital asset information
protected  void addCapitalAssetInfoDetailLines(CapitalAssetInformation capitalAssetInformation)
          add detail lines into the given capital asset information
protected  void applyCapitalAssetInformation(KualiAccountingDocumentFormBase kualiAccountingDocumentFormBase)
           
 org.apache.struts.action.ActionForward approve(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 org.apache.struts.action.ActionForward blanketApprove(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  boolean checkSalesTax(AccountingDocument document, AccountingLine line, boolean source, boolean newLine, int index)
          Encapsulate the rule check so we can call it from multiple places
protected  boolean checkSalesTaxRequiredAllLines(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase kualiDocumentFormBase, List<AccountingLine> baselineAcctingLines)
           
protected  void checkUploadFile(org.apache.struts.upload.FormFile file)
           
 org.apache.struts.action.ActionForward clearCapitalAssetInfo(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          clear up the capital asset information
protected  void clearOverridesThatBecameUnneeded(AccountingLine formLine)
          Automatically clears any overrides that have become unneeded.
 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 guarantee that form of copied document is set to whatever the entry mode of the document is
protected  List deepCopyAccountingLinesList(List originals)
          TODO: remove this method once baseline accounting lines has been removed
protected  void deleteAccountingLine(boolean isSource, KualiAccountingDocumentFormBase financialDocumentForm, int deleteIndex)
          Deletes the source or target accountingLine with the given index from the given form.
 org.apache.struts.action.ActionForward deleteCapitalAssetInfoDetailLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          delete a detail line from the capital asset information
 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)
          This method will remove a SourceAccountingLine from a FinancialDocument.
 org.apache.struts.action.ActionForward deleteTargetLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method will remove a TargetAccountingLine from a FinancialDocument.
 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)
          Adds check for accountingLine updates, generates and dispatches any events caused by such updates
protected  CapitalAssetInformation getCurrentCapitalAssetInformationObject(KualiAccountingDocumentFormBase kualiAccountingDocumentFormBase)
          get the capital asset information object currently associated with the document
protected  int getMaxItemLineNumber(CapitalAssetInformation capitalAssetInformation)
          Get the maximum item line number from DB.
protected  Integer getNextItemLineNumberAndIncremented(CapitalAssetInformation capitalAssetInformation)
          Get next available item line number.
protected  String getObjectTypeCodeFromLine(AccountingLine line)
          A hook so that most accounting lines - which don't have object types - can have their object type codes used in balance inquiries
protected  SourceAccountingLine getSourceAccountingLine(org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request)
          This method is a helper method that will return a source accounting line.
protected  TargetAccountingLine getTargetAccountingLine(org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request)
           
protected  void handleSalesTaxRequired(AccountingDocument transDoc, AccountingLine formLine, boolean source, boolean newLine, int index)
          This method checks to see if the given accounting needs sales tax and if it does it sets the salesTaxRequired variable on the line If it doesn't and it has it then it removes the sales tax information from the line This method is called from the execute() on all accounting lines that have been edited or lines that have already been added to the document, not on new lines
protected  void handleSalesTaxRequiredAllLines(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase kualiDocumentFormBase, List<AccountingLine> baselineAcctingLines)
          This method is called from the createDocument and processes through all the accouting lines and checks to see if they need sales tax fields
protected  boolean hasSalesTaxBeenEntered(AccountingLine accountingLine, boolean source, boolean newLine, int index)
           
 org.apache.struts.action.ActionForward hideDetails(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method is triggered when the user toggles the show/hide button to "hide" thus making the UI render without any of the accounting line labels/descriptions showing up underneath the values in the UI.
protected  void insertAccountingLine(boolean isSource, KualiAccountingDocumentFormBase financialDocumentForm, AccountingLine line)
          Adds the given accountingLine to the appropriate form-related datastructures.
 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)
          This action executes an insert of a SourceAccountingLine into a document only after validating the accounting line and checking any appropriate business rules.
 org.apache.struts.action.ActionForward insertTargetLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method will add a TargetAccountingLine to a FinancialDocument.
protected  boolean isSalesTaxRequired(AccountingDocument financialDocument, AccountingLine accountingLine)
          This method checks to see if this doctype needs sales tax If it does then it checks to see if the account and object code require sales tax If it does then it returns true.
protected  boolean isValidSalesTaxEntered(AccountingLine accountingLine, boolean source, boolean newLine, int index)
          This method checks to see if the sales tax information was put into the accounting line
protected  void loadDocument(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase kualiDocumentFormBase)
          All document-load operations get routed through here
protected  org.apache.struts.action.ActionForward performBalanceInquiryForAccountingLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, AccountingLine line)
          This method handles preparing all of the accounting line data so that it can be pushed up to the balance inquiries for populating the search criteria of each.
 org.apache.struts.action.ActionForward performBalanceInquiryForSourceLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Takes care of storing the action form in the User session and forwarding to the balance inquiry report menu action for a source accounting line.
 org.apache.struts.action.ActionForward performBalanceInquiryForTargetLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Takes care of storing the action form in the User session and forwarding to the balance inquiry report menu action for a target accounting line.
 org.apache.struts.action.ActionForward performLookup(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void populateSalesTax(AccountingLine line)
          This method populates the sales tax for a given accounting line with the appropriate primary key fields from the accounting line since OJB won't do it automatically for us
protected  void processAccountingLineOverrides(AccountingLine line)
           
protected  void processAccountingLineOverrides(KualiAccountingDocumentFormBase transForm)
           
protected  void processAccountingLineOverrides(List accountingLines)
           
protected  void processAccountingLines(AccountingDocument transDoc, KualiAccountingDocumentFormBase transForm, String lineSet)
           
 org.apache.struts.action.ActionForward refresh(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Needed to override this to keep from losing Sales Tax information
protected  void refreshSalesTaxInfo(org.apache.struts.action.ActionForm form)
          This method refreshes the sales tax fields on a refresh or tab toggle so that all the information that was there before is still there after a state change
protected  void removeSalesTax(AccountingLine accountingLine)
          This method removes the sales tax information from a line that no longer requires it
protected  void resetCapitalAssetInfo(CapitalAssetInformation capitalAssetInformation)
          reset the nonkey fields of the given capital asset information
 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)
           
 org.apache.struts.action.ActionForward save(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 org.apache.struts.action.ActionForward showDetails(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This action changes the value of the hide field in the user interface so that when the page is rendered, the UI knows to show all of the labels for each of the accounting line values.
 org.apache.struts.action.ActionForward toggleTab(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Needed to override this to keep from losing Sales Tax information
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.
 org.apache.struts.action.ActionForward uploadTargetLines(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 TargetAccountingLines for a given transactional document.
 
Methods inherited from class org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentActionBase
correct
 
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

LOG

protected static org.apache.log4j.Logger LOG

UPDATE_EVENT_ACTIONS

protected static final Set UPDATE_EVENT_ACTIONS
Constructor Detail

KualiAccountingDocumentActionBase

public KualiAccountingDocumentActionBase()
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
Adds check for accountingLine updates, generates and dispatches any events caused by such updates

Overrides:
execute in class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
Throws:
Exception
See Also:
Action.execute(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
All document-load operations get routed through here

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

refresh

public org.apache.struts.action.ActionForward refresh(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws Exception
Needed to override this to keep from losing Sales Tax information

Overrides:
refresh in class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
Throws:
Exception
See Also:
KualiAction.refresh(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

toggleTab

public org.apache.struts.action.ActionForward toggleTab(org.apache.struts.action.ActionMapping mapping,
                                                        org.apache.struts.action.ActionForm form,
                                                        javax.servlet.http.HttpServletRequest request,
                                                        javax.servlet.http.HttpServletResponse response)
                                                 throws Exception
Needed to override this to keep from losing Sales Tax information

Overrides:
toggleTab in class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
Throws:
Exception
See Also:
KualiAction.toggleTab(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

processAccountingLineOverrides

protected void processAccountingLineOverrides(KualiAccountingDocumentFormBase transForm)
Parameters:
transForm -

processAccountingLineOverrides

protected void processAccountingLineOverrides(AccountingLine line)
Parameters:
line -

processAccountingLineOverrides

protected void processAccountingLineOverrides(List accountingLines)
Parameters:
accountingLines -

processAccountingLines

protected void processAccountingLines(AccountingDocument transDoc,
                                      KualiAccountingDocumentFormBase transForm,
                                      String lineSet)
Parameters:
transDoc -
transForm -
lineSet -

clearOverridesThatBecameUnneeded

protected void clearOverridesThatBecameUnneeded(AccountingLine formLine)
Automatically clears any overrides that have become unneeded. This is for accounting lines that were changed right before final actions like route. Normally the unneeded overrides are cleared in accountingLineOverrideField.tag instead, but that requires another form submit. This method shouldn't be called on lines that haven't changed, to avoid automatically changing read-only lines. This cannot be done in the Rule because Rules cannot change the AccountingLines; they only get a deepCopy.

Parameters:
formLine -

deleteTargetLine

public org.apache.struts.action.ActionForward deleteTargetLine(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 will remove a TargetAccountingLine from a FinancialDocument. This assumes that the user presses the delete button for a specific accounting line on the document and that the document is represented by a FinancialDocumentFormBase.

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

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
This method will remove a SourceAccountingLine from a FinancialDocument. This assumes that the user presses the delete button for a specific accounting line on the document and that the document is represented by a FinancialDocumentFormBase.

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

deleteAccountingLine

protected void deleteAccountingLine(boolean isSource,
                                    KualiAccountingDocumentFormBase financialDocumentForm,
                                    int deleteIndex)
Deletes the source or target accountingLine with the given index from the given form. Assumes that the rule- and form- validation have already occurred.

Parameters:
isSource -
financialDocumentForm -
deleteIndex -

uploadTargetLines

public org.apache.struts.action.ActionForward uploadTargetLines(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 action executes a call to upload CSV accounting line values as TargetAccountingLines for a given transactional document. The "uploadAccountingLines()" method handles the multi-part request.

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.

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.

Parameters:
isSource -
form -
Throws:
FileNotFoundException
IOException

checkUploadFile

protected void checkUploadFile(org.apache.struts.upload.FormFile file)

insertTargetLine

public org.apache.struts.action.ActionForward insertTargetLine(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 will add a TargetAccountingLine to a FinancialDocument. This assumes that the user presses the add button for a specific accounting line on the document and that the document is represented by a FinancialDocumentFormBase. It first validates the line for data integrity and then checks appropriate business rules.

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

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
This action executes an insert of a SourceAccountingLine into a document only after validating the accounting line and checking any appropriate business rules.

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

insertAccountingLine

protected void insertAccountingLine(boolean isSource,
                                    KualiAccountingDocumentFormBase financialDocumentForm,
                                    AccountingLine line)
Adds the given accountingLine to the appropriate form-related datastructures.

Parameters:
isSource -
financialDocumentForm -
line -

deepCopyAccountingLinesList

protected List deepCopyAccountingLinesList(List originals)
TODO: remove this method once baseline accounting lines has been removed


showDetails

public org.apache.struts.action.ActionForward showDetails(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 action changes the value of the hide field in the user interface so that when the page is rendered, the UI knows to show all of the labels for each of the accounting line values.

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

hideDetails

public org.apache.struts.action.ActionForward hideDetails(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 is triggered when the user toggles the show/hide button to "hide" thus making the UI render without any of the accounting line labels/descriptions showing up underneath the values in the UI.

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

performBalanceInquiryForSourceLine

public org.apache.struts.action.ActionForward performBalanceInquiryForSourceLine(org.apache.struts.action.ActionMapping mapping,
                                                                                 org.apache.struts.action.ActionForm form,
                                                                                 javax.servlet.http.HttpServletRequest request,
                                                                                 javax.servlet.http.HttpServletResponse response)
                                                                          throws Exception
Takes care of storing the action form in the User session and forwarding to the balance inquiry report menu action for a source accounting line.

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

performBalanceInquiryForTargetLine

public org.apache.struts.action.ActionForward performBalanceInquiryForTargetLine(org.apache.struts.action.ActionMapping mapping,
                                                                                 org.apache.struts.action.ActionForm form,
                                                                                 javax.servlet.http.HttpServletRequest request,
                                                                                 javax.servlet.http.HttpServletResponse response)
                                                                          throws Exception
Takes care of storing the action form in the User session and forwarding to the balance inquiry report menu action for a target accounting line.

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

getSourceAccountingLine

protected SourceAccountingLine getSourceAccountingLine(org.apache.struts.action.ActionForm form,
                                                       javax.servlet.http.HttpServletRequest request)
This method is a helper method that will return a source accounting line. The reason we're making it protected in here is so that we can override this method in some of the modules. PurchasingActionBase is one of the subclasses that will be overriding this, because in PurchasingActionBase, we'll need to get the source accounting line using both an item index and an account index.

Parameters:
form -
request -
isSource -
Returns:

getTargetAccountingLine

protected TargetAccountingLine getTargetAccountingLine(org.apache.struts.action.ActionForm form,
                                                       javax.servlet.http.HttpServletRequest request)

performBalanceInquiryForAccountingLine

protected org.apache.struts.action.ActionForward performBalanceInquiryForAccountingLine(org.apache.struts.action.ActionMapping mapping,
                                                                                        org.apache.struts.action.ActionForm form,
                                                                                        javax.servlet.http.HttpServletRequest request,
                                                                                        AccountingLine line)
This method handles preparing all of the accounting line data so that it can be pushed up to the balance inquiries for populating the search criteria of each.

Parameters:
mapping -
form -
request -
line -
Returns:
ActionForward

getObjectTypeCodeFromLine

protected String getObjectTypeCodeFromLine(AccountingLine line)
A hook so that most accounting lines - which don't have object types - can have their object type codes used in balance inquiries

Parameters:
line - the line to get the object type code from
Returns:
the object type code the line would use

save

public org.apache.struts.action.ActionForward save(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:
save in class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
Throws:
Exception

approve

public org.apache.struts.action.ActionForward approve(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:
approve in class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
Throws:
Exception

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:
route in class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
Throws:
Exception

blanketApprove

public org.apache.struts.action.ActionForward blanketApprove(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:
blanketApprove in class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
Throws:
Exception

checkSalesTax

protected boolean checkSalesTax(AccountingDocument document,
                                AccountingLine line,
                                boolean source,
                                boolean newLine,
                                int index)
Encapsulate the rule check so we can call it from multiple places

Parameters:
document -
line -
Returns:
true if sales is either not required or it contains sales tax

isSalesTaxRequired

protected boolean isSalesTaxRequired(AccountingDocument financialDocument,
                                     AccountingLine accountingLine)
This method checks to see if this doctype needs sales tax If it does then it checks to see if the account and object code require sales tax If it does then it returns true. Note - this is hackish as we shouldn't have to call rules directly from the action class But we need to in this instance because we are copying the lines before calling rules and need a way to modify them before they go on

Parameters:
accountingLine -
Returns:
true if sales tax check is needed, false otherwise

isValidSalesTaxEntered

protected boolean isValidSalesTaxEntered(AccountingLine accountingLine,
                                         boolean source,
                                         boolean newLine,
                                         int index)
This method checks to see if the sales tax information was put into the accounting line

Parameters:
accountingLine -
Returns:
true if entered correctly, false otherwise

removeSalesTax

protected void removeSalesTax(AccountingLine accountingLine)
This method removes the sales tax information from a line that no longer requires it

Parameters:
accountingLine -

handleSalesTaxRequired

protected void handleSalesTaxRequired(AccountingDocument transDoc,
                                      AccountingLine formLine,
                                      boolean source,
                                      boolean newLine,
                                      int index)
This method checks to see if the given accounting needs sales tax and if it does it sets the salesTaxRequired variable on the line If it doesn't and it has it then it removes the sales tax information from the line This method is called from the execute() on all accounting lines that have been edited or lines that have already been added to the document, not on new lines

Parameters:
transDoc -
formLine -
baseLine -

hasSalesTaxBeenEntered

protected boolean hasSalesTaxBeenEntered(AccountingLine accountingLine,
                                         boolean source,
                                         boolean newLine,
                                         int index)

handleSalesTaxRequiredAllLines

protected void handleSalesTaxRequiredAllLines(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase kualiDocumentFormBase,
                                              List<AccountingLine> baselineAcctingLines)
This method is called from the createDocument and processes through all the accouting lines and checks to see if they need sales tax fields

Parameters:
kualiDocumentFormBase -
baselineSourceLines -

checkSalesTaxRequiredAllLines

protected boolean checkSalesTaxRequiredAllLines(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase kualiDocumentFormBase,
                                                List<AccountingLine> baselineAcctingLines)

refreshSalesTaxInfo

protected void refreshSalesTaxInfo(org.apache.struts.action.ActionForm form)
This method refreshes the sales tax fields on a refresh or tab toggle so that all the information that was there before is still there after a state change

Parameters:
form -

populateSalesTax

protected void populateSalesTax(AccountingLine line)
This method populates the sales tax for a given accounting line with the appropriate primary key fields from the accounting line since OJB won't do it automatically for us

Parameters:
line -

performLookup

public org.apache.struts.action.ActionForward performLookup(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:
performLookup in class org.kuali.rice.kns.web.struts.action.KualiAction
Throws:
Exception

clearCapitalAssetInfo

public org.apache.struts.action.ActionForward clearCapitalAssetInfo(org.apache.struts.action.ActionMapping mapping,
                                                                    org.apache.struts.action.ActionForm form,
                                                                    javax.servlet.http.HttpServletRequest request,
                                                                    javax.servlet.http.HttpServletResponse response)
                                                             throws Exception
clear up the capital asset information

Throws:
Exception

addCapitalAssetInfo

public org.apache.struts.action.ActionForward addCapitalAssetInfo(org.apache.struts.action.ActionMapping mapping,
                                                                  org.apache.struts.action.ActionForm form,
                                                                  javax.servlet.http.HttpServletRequest request,
                                                                  javax.servlet.http.HttpServletResponse response)
                                                           throws Exception
add the capital asset information

Throws:
Exception

deleteCapitalAssetInfoDetailLine

public org.apache.struts.action.ActionForward deleteCapitalAssetInfoDetailLine(org.apache.struts.action.ActionMapping mapping,
                                                                               org.apache.struts.action.ActionForm form,
                                                                               javax.servlet.http.HttpServletRequest request,
                                                                               javax.servlet.http.HttpServletResponse response)
                                                                        throws Exception
delete a detail line from the capital asset information

Throws:
Exception

getCurrentCapitalAssetInformationObject

protected CapitalAssetInformation getCurrentCapitalAssetInformationObject(KualiAccountingDocumentFormBase kualiAccountingDocumentFormBase)
get the capital asset information object currently associated with the document


addCapitalAssetInfoDetailLines

protected void addCapitalAssetInfoDetailLines(CapitalAssetInformation capitalAssetInformation)
add detail lines into the given capital asset information

Parameters:
capitalAssetInformation - the given capital asset information

getNextItemLineNumberAndIncremented

protected Integer getNextItemLineNumberAndIncremented(CapitalAssetInformation capitalAssetInformation)
Get next available item line number. If it's already stored in the session, pick it up and increment by 1. Otherwise get it from the DB and save it to session.

Parameters:
capitalAssetInformation -
Returns:

getMaxItemLineNumber

protected int getMaxItemLineNumber(CapitalAssetInformation capitalAssetInformation)
Get the maximum item line number from DB.

Parameters:
capitalAssetInformation -
Returns:

resetCapitalAssetInfo

protected void resetCapitalAssetInfo(CapitalAssetInformation capitalAssetInformation)
reset the nonkey fields of the given capital asset information

Parameters:
capitalAssetInformation - the given capital asset information

applyCapitalAssetInformation

protected void applyCapitalAssetInformation(KualiAccountingDocumentFormBase kualiAccountingDocumentFormBase)

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 guarantee that form of copied document is set to whatever the entry mode of the document is

Overrides:
copy in class org.kuali.rice.kns.web.struts.action.KualiTransactionalDocumentActionBase
Throws:
Exception
See Also:
KualiTransactionalDocumentActionBase.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.