001: /*
002: * Copyright 2006-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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: */
016: package org.kuali.module.financial.web.struts.form;
017:
018: import java.util.ArrayList;
019: import java.util.List;
020:
021: import org.kuali.core.web.struts.form.KualiForm;
022: import org.kuali.kfs.KFSConstants;
023: import org.kuali.module.financial.bo.Bank;
024: import org.kuali.module.financial.bo.BankAccount;
025: import org.kuali.module.financial.bo.Check;
026: import org.kuali.module.financial.bo.CheckBase;
027: import org.kuali.module.financial.bo.CoinDetail;
028: import org.kuali.module.financial.bo.CurrencyDetail;
029: import org.kuali.module.financial.bo.DepositWizardCashieringCheckHelper;
030: import org.kuali.module.financial.bo.DepositWizardHelper;
031: import org.kuali.module.financial.document.CashReceiptDocument;
032:
033: /**
034: * This class is the action form for the deposit document wizard.
035: */
036: public class DepositWizardForm extends KualiForm {
037: private String cashDrawerVerificationUnit;
038: private String cashManagementDocId;
039:
040: private List depositableCashReceipts;
041: private List depositWizardHelpers;
042: private List<Check> depositableCashieringChecks;
043: private List<DepositWizardCashieringCheckHelper> depositWizardCashieringCheckHelpers;
044: private List<CashReceiptDocument> checkFreeCashReceipts;
045:
046: // Deposit fields
047: private Bank bank;
048: private String bankCode;
049: private BankAccount bankAccount;
050: private String bankAccountNumber;
051:
052: private String depositTypeCode;
053: private String depositTicketNumber;
054:
055: private CurrencyDetail currencyDetail;
056: private CoinDetail coinDetail;
057:
058: /**
059: * Constructs a DepositWizardForm class instance.
060: */
061: public DepositWizardForm() {
062: depositableCashReceipts = new ArrayList();
063: depositableCashieringChecks = new ArrayList<Check>();
064: depositWizardHelpers = new ArrayList();
065: depositWizardCashieringCheckHelpers = new ArrayList<DepositWizardCashieringCheckHelper>();
066:
067: setFormatterType("depositTypeCode",
068: CashReceiptDepositTypeFormatter.class);
069: }
070:
071: /**
072: * @return current value of cashManagementDocId.
073: */
074: public String getCashManagementDocId() {
075: return cashManagementDocId;
076: }
077:
078: /**
079: * Sets the cashManagementDocId attribute value.
080: *
081: * @param cashManagementDocId The cashManagementDocId to set.
082: */
083: public void setCashManagementDocId(String cashManagementDocId) {
084: this .cashManagementDocId = cashManagementDocId;
085: }
086:
087: /**
088: * @param depositTypeCode
089: */
090: public void setDepositTypeCode(String depositTypeCode) {
091: this .depositTypeCode = depositTypeCode;
092: }
093:
094: /**
095: * @return depositTypeCode
096: */
097: public String getDepositTypeCode() {
098: return depositTypeCode;
099: }
100:
101: /**
102: * Hack to make the translated depositTypeCode more readily available to the JSP
103: *
104: * @return translated depositTypeCode
105: */
106: public String getDepositTypeString() {
107: CashReceiptDepositTypeFormatter f = new CashReceiptDepositTypeFormatter();
108: return (String) f.format(getDepositTypeCode());
109: }
110:
111: /**
112: * @return List
113: */
114: public List getDepositableCashReceipts() {
115: return depositableCashReceipts;
116: }
117:
118: /**
119: * @param cashReceiptsReadyForDeposit
120: */
121: public void setDepositableCashReceipts(
122: List cashReceiptsReadyForDeposit) {
123: this .depositableCashReceipts = cashReceiptsReadyForDeposit;
124: }
125:
126: public CashReceiptDocument getDepositableCashReceipt(int i) {
127: while (depositableCashReceipts.size() <= i) {
128: depositableCashReceipts.add(new CashReceiptDocument());
129: }
130:
131: return (CashReceiptDocument) depositableCashReceipts.get(i);
132: }
133:
134: /**
135: * @return ArrayList
136: */
137: public List getDepositWizardHelpers() {
138: return depositWizardHelpers;
139: }
140:
141: /**
142: * @param depositWizardHelpers
143: */
144: public void setDepositWizardHelpers(List depositWizardHelpers) {
145: this .depositWizardHelpers = depositWizardHelpers;
146: }
147:
148: /**
149: * This method retrieves whether the cash receipt ID at the specified index will be selected or not.
150: *
151: * @param index
152: * @return DepositWizarHelper
153: */
154: public DepositWizardHelper getDepositWizardHelper(int index) {
155: while (this .depositWizardHelpers.size() <= index) {
156: this .depositWizardHelpers.add(new DepositWizardHelper());
157: // default to no check
158: }
159: return (DepositWizardHelper) this .depositWizardHelpers
160: .get(index);
161: }
162:
163: /**
164: * @return current value of cashDrawerVerificationUnit.
165: */
166: public String getCashDrawerVerificationUnit() {
167: return cashDrawerVerificationUnit;
168: }
169:
170: /**
171: * Sets the cashDrawerVerificationUnit attribute value.
172: *
173: * @param cashDrawerVerificationUnit The cashDrawerVerificationUnit to set.
174: */
175: public void setCashDrawerVerificationUnit(
176: String cashDrawerVerificationUnit) {
177: this .cashDrawerVerificationUnit = cashDrawerVerificationUnit;
178: }
179:
180: /**
181: * @return current value of bankCode.
182: */
183: public String getBankCode() {
184: return bankCode;
185: }
186:
187: /**
188: * Sets the bankCode attribute value.
189: *
190: * @param bankCode The bankCode to set.
191: */
192: public void setBankCode(String bankCode) {
193: this .bankCode = bankCode;
194: }
195:
196: /**
197: * @return current value of bankAccountNumber.
198: */
199: public String getBankAccountNumber() {
200: return bankAccountNumber;
201: }
202:
203: /**
204: * Sets the bankAccountNumber attribute value.
205: *
206: * @param bankAccountNumber The bankAccountNumber to set.
207: */
208: public void setBankAccountNumber(String bankAccountNumber) {
209: this .bankAccountNumber = bankAccountNumber;
210: }
211:
212: /**
213: * @return current value of depositTicketNumber.
214: */
215: public String getDepositTicketNumber() {
216: return depositTicketNumber;
217: }
218:
219: /**
220: * Sets the depositTicketNumber attribute value.
221: *
222: * @param depositTicketNumber The depositTicketNumber to set.
223: */
224: public void setDepositTicketNumber(String depositTicketNumber) {
225: this .depositTicketNumber = depositTicketNumber;
226: }
227:
228: /**
229: * @return current value of bank.
230: */
231: public Bank getBank() {
232: return bank;
233: }
234:
235: /**
236: * Sets the bank attribute value.
237: *
238: * @param bank The bank to set.
239: */
240: public void setBank(Bank bank) {
241: this .bank = bank;
242: }
243:
244: /**
245: * @return current value of bankAccount.
246: */
247: public BankAccount getBankAccount() {
248: return bankAccount;
249: }
250:
251: /**
252: * Sets the bankAccount attribute value.
253: *
254: * @param bankAccount The bankAccount to set.
255: */
256: public void setBankAccount(BankAccount bankAccount) {
257: this .bankAccount = bankAccount;
258: }
259:
260: /**
261: * Gets the coinDetail attribute.
262: *
263: * @return Returns the coinDetail.
264: */
265: public CoinDetail getCoinDetail() {
266: return coinDetail;
267: }
268:
269: /**
270: * Sets the coinDetail attribute value.
271: *
272: * @param coinDetail The coinDetail to set.
273: */
274: public void setCoinDetail(CoinDetail coinDetail) {
275: this .coinDetail = coinDetail;
276: }
277:
278: /**
279: * Gets the currencyDetail attribute.
280: *
281: * @return Returns the currencyDetail.
282: */
283: public CurrencyDetail getCurrencyDetail() {
284: return currencyDetail;
285: }
286:
287: /**
288: * Sets the currencyDetail attribute value.
289: *
290: * @param currencyDetail The currencyDetail to set.
291: */
292: public void setCurrencyDetail(CurrencyDetail currencyDetail) {
293: this .currencyDetail = currencyDetail;
294: }
295:
296: /**
297: * Explains if this deposit form is for creating a final deposit or not
298: *
299: * @return true if this deposit form will create a final deposit, false if it will create an interim
300: */
301: public boolean isDepositFinal() {
302: return (depositTypeCode
303: .equals(KFSConstants.DepositConstants.DEPOSIT_TYPE_FINAL));
304: }
305:
306: /**
307: * Gets the depositableCashieringChecks attribute.
308: *
309: * @return Returns the depositableCashieringChecks.
310: */
311: public List<Check> getDepositableCashieringChecks() {
312: return depositableCashieringChecks;
313: }
314:
315: /**
316: * Sets the depositableCashieringChecks attribute value.
317: *
318: * @param depositableCashieringChecks The depositableCashieringChecks to set.
319: */
320: public void setDepositableCashieringChecks(
321: List<Check> depositableCashieringChecks) {
322: this .depositableCashieringChecks = depositableCashieringChecks;
323: }
324:
325: /**
326: * Return the deposit cashiering check at the given index
327: *
328: * @param index index of check to retrieve
329: * @return a check
330: */
331: public Check getDepositableCashieringCheck(int index) {
332: while (this .depositableCashieringChecks.size() <= index) {
333: this .depositableCashieringChecks.add(new CheckBase());
334: }
335: return this .depositableCashieringChecks.get(index);
336: }
337:
338: /**
339: * Gets the depositWizardCashieringCheckHelpers attribute.
340: *
341: * @return Returns the depositWizardCashieringCheckHelpers.
342: */
343: public List<DepositWizardCashieringCheckHelper> getDepositWizardCashieringCheckHelpers() {
344: return depositWizardCashieringCheckHelpers;
345: }
346:
347: /**
348: * Gets the checkFreeCashReceipts attribute.
349: *
350: * @return Returns the checkFreeCashReceipts.
351: */
352: public List<CashReceiptDocument> getCheckFreeCashReceipts() {
353: return checkFreeCashReceipts;
354: }
355:
356: /**
357: * Sets the checkFreeCashReceipts attribute value.
358: *
359: * @param checkFreeCashReceipts The checkFreeCashReceipts to set.
360: */
361: public void setCheckFreeCashReceipts(
362: List<CashReceiptDocument> checkFreeCashReceipts) {
363: this .checkFreeCashReceipts = checkFreeCashReceipts;
364: }
365:
366: /**
367: * Retreive a single check free cash receipt
368: *
369: * @param index the index of the cash receipt
370: * @return a cash receipt document
371: */
372: public CashReceiptDocument getCheckFreeCashReceipt(int index) {
373: while (this .checkFreeCashReceipts.size() <= index) {
374: this .checkFreeCashReceipts.add(new CashReceiptDocument());
375: }
376: return this .checkFreeCashReceipts.get(index);
377: }
378:
379: /**
380: * Sets the depositWizardCashieringCheckHelpers attribute value.
381: *
382: * @param depositWizardCashieringCheckHelpers The depositWizardCashieringCheckHelpers to set.
383: */
384: public void setDepositWizardCashieringCheckHelpers(
385: List<DepositWizardCashieringCheckHelper> depositWizardCashieringCheckHelpers) {
386: this .depositWizardCashieringCheckHelpers = depositWizardCashieringCheckHelpers;
387: }
388:
389: public DepositWizardCashieringCheckHelper getDepositWizardCashieringCheckHelper(
390: int index) {
391: while (this .depositWizardCashieringCheckHelpers.size() <= index) {
392: this .depositWizardCashieringCheckHelpers
393: .add(new DepositWizardCashieringCheckHelper());
394: }
395: return this.depositWizardCashieringCheckHelpers.get(index);
396: }
397: }
|