001/*
002 * Copyright 2007 The Kuali Foundation
003 * 
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * 
008 * http://www.opensource.org/licenses/ecl2.php
009 * 
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.ole.sys.web.struts;
017
018import org.apache.commons.lang.StringUtils;
019import org.kuali.rice.kns.web.struts.form.KualiForm;
020
021/**
022 * This class is the action form for balance inquiries.
023 */
024public class KualiBalanceInquiryReportMenuForm extends KualiForm {
025    private static final long serialVersionUID = 1L;
026
027    // parameter fields
028    private String referenceOriginCode;
029    private String referenceNumber;
030    private String referenceTypeCode;
031    private String debitCreditCode;
032    private String chartOfAccountsCode;
033    private String accountNumber;
034    private String financialObjectCode;
035    private String subAccountNumber;
036    private String financialSubObjectCode;
037    private String projectCode;
038    private String objectTypeCode;
039    private String universityFiscalYear;
040
041    private String docFormKey;
042    // need this next attribute b/c the lookup overwrites the docFormKey
043    // improperly when it cancels back to the report menu (this)
044    // this holds the official docFormKey for the calling TP eDoc
045    private String balanceInquiryReportMenuCallerDocFormKey;
046    private String backLocation;
047
048    /**
049     * @return String
050     */
051    public String getBackLocation() {
052        return backLocation;
053    }
054
055    /**
056     * @param backLocation
057     */
058    public void setBackLocation(String backLocation) {
059        this.backLocation = backLocation;
060    }
061
062    /**
063     * @return String
064     */
065    public String getDocFormKey() {
066        return docFormKey;
067    }
068
069    /**
070     * @param docFormKey
071     */
072    public void setDocFormKey(String docFormKey) {
073        this.docFormKey = docFormKey;
074    }
075
076    /**
077     * Builds out the lookupParameters for the GLPE balance inquiry.
078     * 
079     * @return String
080     */
081    public String getGeneralLedgerPendingEntryBalanceInquiryLookupParameters() {
082        return buildGenericBalanceInquiryLookupParameters();
083    }
084
085    /**
086     * This method builds out the common balance inquiry lookup parameters based upon what was entered in the calling accounting
087     * line.
088     * 
089     * @return String
090     */
091    private String buildGenericBalanceInquiryLookupParameters() {
092        String lookupParameters = "";
093
094        if (StringUtils.isNotBlank(chartOfAccountsCode)) {
095            lookupParameters += "chartOfAccountsCode:chartOfAccountsCode";
096        }
097        if (StringUtils.isNotBlank(accountNumber)) {
098            lookupParameters += ",accountNumber:accountNumber";
099        }
100        if (StringUtils.isNotBlank(subAccountNumber)) {
101            lookupParameters += ",subAccountNumber:subAccountNumber";
102        }
103        if (StringUtils.isNotBlank(financialObjectCode)) {
104            lookupParameters += ",financialObjectCode:financialObjectCode";
105        }
106        if (StringUtils.isNotBlank(financialSubObjectCode)) {
107            lookupParameters += ",financialSubObjectCode:financialSubObjectCode";
108        }
109        if (StringUtils.isNotBlank(objectTypeCode)) {
110            lookupParameters += ",objectTypeCode:financialObjectTypeCode";
111        }
112        if (StringUtils.isNotBlank(debitCreditCode)) {
113            lookupParameters += ",debitCreditCode:transactionDebitCreditCode";
114        }
115        if (StringUtils.isNotBlank(referenceOriginCode)) {
116            lookupParameters += ",referenceOriginCode:referenceFinancialSystemOriginationCode";
117        }
118        if (StringUtils.isNotBlank(referenceTypeCode)) {
119            lookupParameters += ",referenceTypeCode:referenceFinancialDocumentTypeCode";
120        }
121        if (StringUtils.isNotBlank(referenceNumber)) {
122            lookupParameters += ",referenceNumber:referenceFinancialDocumentNumber";
123        }
124        if (StringUtils.isNotBlank(projectCode)) {
125            lookupParameters += ",projectCode:projectCode";
126        }
127        if (StringUtils.isNotBlank(universityFiscalYear)) {
128            lookupParameters += ",universityFiscalYear:universityFiscalYear";
129        }
130
131        return lookupParameters;
132    }
133
134    /**
135     * @return String
136     */
137    public String getGeneralLedgerBalanceBalanceInquiryLookupParameters() {
138        return buildGenericBalanceInquiryLookupParameters();
139    }
140
141    /**
142     * @return String
143     */
144    public String getGeneralLedgerEntryBalanceInquiryLookupParameters() {
145        return buildGenericBalanceInquiryLookupParameters();
146    }
147
148    /**
149     * @return String
150     */
151    public String getBalancesByConsolidationBalanceInquiryLookupParameters() {
152        return buildGenericBalanceInquiryLookupParameters();
153    }
154
155    /**
156     * @return String
157     */
158    public String getAvailableBalancesBalanceInquiryLookupParameters() {
159        return buildGenericBalanceInquiryLookupParameters();
160    }
161
162    /**
163     * @return String
164     */
165    public String getOpenEncumbrancesBalanceInquiryLookupParameters() {
166        return buildGenericBalanceInquiryLookupParameters();
167    }
168
169    /**
170     * @return String
171     */
172    public String getCashBalancesBalanceInquiryLookupParameters() {
173        return buildGenericBalanceInquiryLookupParameters();
174    }
175
176    /**
177     * @return String
178     */
179    public String getAccountNumber() {
180        return accountNumber;
181    }
182
183    /**
184     * @param accountNumber
185     */
186    public void setAccountNumber(String accountNumber) {
187        this.accountNumber = accountNumber;
188    }
189
190    /**
191     * @return String
192     */
193    public String getChartOfAccountsCode() {
194        return chartOfAccountsCode;
195    }
196
197    /**
198     * @param chartOfAccountsCode
199     */
200    public void setChartOfAccountsCode(String chartOfAccountsCode) {
201        this.chartOfAccountsCode = chartOfAccountsCode;
202    }
203
204    /**
205     * @return String
206     */
207    public String getDebitCreditCode() {
208        return debitCreditCode;
209    }
210
211    /**
212     * @param debitCreditCode
213     */
214    public void setDebitCreditCode(String debitCreditCode) {
215        this.debitCreditCode = debitCreditCode;
216    }
217
218    /**
219     * @return String
220     */
221    public String getFinancialObjectCode() {
222        return financialObjectCode;
223    }
224
225    /**
226     * @param financialObjectCode
227     */
228    public void setFinancialObjectCode(String financialObjectCode) {
229        this.financialObjectCode = financialObjectCode;
230    }
231
232    /**
233     * @return String
234     */
235    public String getFinancialSubObjectCode() {
236        return financialSubObjectCode;
237    }
238
239    /**
240     * @param financialSubObjectCode
241     */
242    public void setFinancialSubObjectCode(String financialSubObjectCode) {
243        this.financialSubObjectCode = financialSubObjectCode;
244    }
245
246    /**
247     * @return String
248     */
249    public String getObjectTypeCode() {
250        return objectTypeCode;
251    }
252
253    /**
254     * @param objectTypeCode
255     */
256    public void setObjectTypeCode(String objectTypeCode) {
257        this.objectTypeCode = objectTypeCode;
258    }
259
260    /**
261     * @return String
262     */
263    public String getProjectCode() {
264        return projectCode;
265    }
266
267    /**
268     * @param projectCode
269     */
270    public void setProjectCode(String projectCode) {
271        this.projectCode = projectCode;
272    }
273
274    /**
275     * @return String
276     */
277    public String getReferenceNumber() {
278        return referenceNumber;
279    }
280
281    /**
282     * @param referenceNumber
283     */
284    public void setReferenceNumber(String referenceNumber) {
285        this.referenceNumber = referenceNumber;
286    }
287
288    /**
289     * @return String
290     */
291    public String getReferenceOriginCode() {
292        return referenceOriginCode;
293    }
294
295    /**
296     * @param referenceOriginCode
297     */
298    public void setReferenceOriginCode(String referenceOriginCode) {
299        this.referenceOriginCode = referenceOriginCode;
300    }
301
302    /**
303     * @return String
304     */
305    public String getReferenceTypeCode() {
306        return referenceTypeCode;
307    }
308
309    /**
310     * @param referenceTypeCode
311     */
312    public void setReferenceTypeCode(String referenceTypeCode) {
313        this.referenceTypeCode = referenceTypeCode;
314    }
315
316    /**
317     * @return String
318     */
319    public String getSubAccountNumber() {
320        return subAccountNumber;
321    }
322
323    /**
324     * @param subAccountNumber
325     */
326    public void setSubAccountNumber(String subAccountNumber) {
327        this.subAccountNumber = subAccountNumber;
328    }
329
330    /**
331     * @return String
332     */
333    public String getBalanceInquiryReportMenuCallerDocFormKey() {
334        return balanceInquiryReportMenuCallerDocFormKey;
335    }
336
337    /**
338     * @param balanceInquiryReportMenuCallerDocFormKey
339     */
340    public void setBalanceInquiryReportMenuCallerDocFormKey(String balanceInquiryReportMenuCallerDocFormKey) {
341        this.balanceInquiryReportMenuCallerDocFormKey = balanceInquiryReportMenuCallerDocFormKey;
342    }
343
344    /**
345     * Gets the universityFiscalYear attribute. 
346     * @return Returns the universityFiscalYear.
347     */
348    public String getUniversityFiscalYear() {
349        return universityFiscalYear;
350    }
351
352    /**
353     * Sets the universityFiscalYear attribute value.
354     * @param universityFiscalYear The universityFiscalYear to set.
355     */
356    public void setUniversityFiscalYear(String universityFiscalYear) {
357        this.universityFiscalYear = universityFiscalYear;
358    }
359}