001: /*
002: * Copyright 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:
017: package org.kuali.module.labor.web.struts.form;
018:
019: import java.util.List;
020:
021: import org.kuali.core.web.ui.Column;
022: import org.kuali.kfs.context.SpringContext;
023: import org.kuali.module.gl.web.struts.form.CorrectionForm;
024: import org.kuali.module.labor.bo.LaborOriginEntry;
025: import org.kuali.module.labor.document.LaborCorrectionDocument;
026: import org.kuali.module.labor.service.LaborCorrectionDocumentService;
027:
028: /**
029: * Struts Action Form for the Labor Ledger Correction Process.
030: */
031: public class LaborCorrectionForm extends CorrectionForm {
032: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
033: .getLogger(LaborCorrectionForm.class);
034:
035: private LaborOriginEntry laborEntryForManualEdit;
036: private String laborEntryUniversityFiscalYear;
037: private String laborEntryFinancialDocumentReversalDate;
038: private String laborEntryTransactionDate;
039: private String laborEntryTransactionLedgerEntrySequenceNumber;
040: private String laborEntryTransactionLedgerEntryAmount;
041:
042: /**
043: * Constructs a LaborCorrectionForm instance.
044: */
045: public LaborCorrectionForm() {
046: super ();
047: laborEntryForManualEdit = new LaborOriginEntry();
048: laborEntryForManualEdit.setEntryId(0);
049: setDocument(new LaborCorrectionDocument());
050:
051: }
052:
053: /**
054: * @see org.kuali.module.gl.web.struts.form.CorrectionForm#clearForm()
055: */
056: public void clearForm() {
057: super .clearForm();
058:
059: }
060:
061: /**
062: * This method is for clearing Labor Origin Entry for Manual Edit
063: */
064: public void clearLaborEntryForManualEdit() {
065: LaborOriginEntry loe = new LaborOriginEntry();
066: loe.setEntryId(0);
067: loe.setSubAccountNumber("");
068: loe.setFinancialSubObjectCode("");
069: loe.setProjectCode("");
070: setLaborEntryFinancialDocumentReversalDate("");
071: setLaborEntryTransactionDate("");
072: setLaborEntryTransactionLedgerEntryAmount("");
073: setLaborEntryTransactionLedgerEntrySequenceNumber("");
074: setLaborEntryUniversityFiscalYear("");
075: setLaborEntryForManualEdit(loe);
076: }
077:
078: /**
079: * @see org.kuali.module.gl.web.struts.form.CorrectionForm#setDocType()
080: */
081: public void setDocType() {
082: setDocumentType("LLCP");
083: setDocTitle("Labor Ledger Correction Process");
084: setHtmlFormAction("laborLedgerCorrection");
085: }
086:
087: /**
088: * Gets the laborEntryForManualEdit attribute.
089: *
090: * @return Returns the laborEntryForManualEdit.
091: */
092: public LaborOriginEntry getLaborEntryForManualEdit() {
093: return laborEntryForManualEdit;
094: }
095:
096: /**
097: * Sets the laborEntryForManualEdit attribute value.
098: *
099: * @param laborEntryForManualEdit The laborEntryForManualEdit to set.
100: */
101: public void setLaborEntryForManualEdit(
102: LaborOriginEntry laborEntryForManualEdit) {
103: this .laborEntryForManualEdit = laborEntryForManualEdit;
104: }
105:
106: /**
107: * Updates labor entries for manual edit.
108: */
109: public void updateLaborEntryForManualEdit() {
110: laborEntryForManualEdit.setFieldValue("universityFiscalYear",
111: getLaborEntryUniversityFiscalYear());
112: laborEntryForManualEdit.setFieldValue(
113: "transactionLedgerEntrySequenceNumber",
114: getLaborEntryTransactionLedgerEntrySequenceNumber());
115: laborEntryForManualEdit.setFieldValue(
116: "transactionLedgerEntryAmount",
117: getLaborEntryTransactionLedgerEntryAmount());
118: laborEntryForManualEdit.setFieldValue("transactionDate",
119: getLaborEntryTransactionDate());
120: laborEntryForManualEdit.setFieldValue(
121: "financialDocumentReversalDate",
122: getLaborEntryFinancialDocumentReversalDate());
123: }
124:
125: /**
126: * Gets the laborEntryFinancialDocumentReversalDate attribute.
127: *
128: * @return Returns the laborEntryFinancialDocumentReversalDate.
129: */
130: public String getLaborEntryFinancialDocumentReversalDate() {
131: return laborEntryFinancialDocumentReversalDate;
132: }
133:
134: /**
135: * Sets the laborEntryFinancialDocumentReversalDate attribute value.
136: *
137: * @param laborEntryFinancialDocumentReversalDate The laborEntryFinancialDocumentReversalDate to set.
138: */
139: public void setLaborEntryFinancialDocumentReversalDate(
140: String laborEntryFinancialDocumentReversalDate) {
141: this .laborEntryFinancialDocumentReversalDate = laborEntryFinancialDocumentReversalDate;
142: }
143:
144: /**
145: * Gets the laborEntryTransactionDate attribute.
146: *
147: * @return Returns the laborEntryTransactionDate.
148: */
149: public String getLaborEntryTransactionDate() {
150: return laborEntryTransactionDate;
151: }
152:
153: /**
154: * Sets the laborEntryTransactionDate attribute value.
155: *
156: * @param laborEntryTransactionDate The laborEntryTransactionDate to set.
157: */
158: public void setLaborEntryTransactionDate(
159: String laborEntryTransactionDate) {
160: this .laborEntryTransactionDate = laborEntryTransactionDate;
161: }
162:
163: /**
164: * Gets the laborEntryTransactionLedgerEntryAmount attribute.
165: *
166: * @return Returns the laborEntryTransactionLedgerEntryAmount.
167: */
168: public String getLaborEntryTransactionLedgerEntryAmount() {
169: return laborEntryTransactionLedgerEntryAmount;
170: }
171:
172: /**
173: * Sets the laborEntryTransactionLedgerEntryAmount attribute value.
174: *
175: * @param laborEntryTransactionLedgerEntryAmount The laborEntryTransactionLedgerEntryAmount to set.
176: */
177: public void setLaborEntryTransactionLedgerEntryAmount(
178: String laborEntryTransactionLedgerEntryAmount) {
179: this .laborEntryTransactionLedgerEntryAmount = laborEntryTransactionLedgerEntryAmount;
180: }
181:
182: /**
183: * Gets the laborEntryTransactionLedgerEntrySequenceNumber attribute.
184: *
185: * @return Returns the laborEntryTransactionLedgerEntrySequenceNumber.
186: */
187: public String getLaborEntryTransactionLedgerEntrySequenceNumber() {
188: return laborEntryTransactionLedgerEntrySequenceNumber;
189: }
190:
191: /**
192: * Sets the laborEntryTransactionLedgerEntrySequenceNumber attribute value.
193: *
194: * @param laborEntryTransactionLedgerEntrySequenceNumber The laborEntryTransactionLedgerEntrySequenceNumber to set.
195: */
196: public void setLaborEntryTransactionLedgerEntrySequenceNumber(
197: String laborEntryTransactionLedgerEntrySequenceNumber) {
198: this .laborEntryTransactionLedgerEntrySequenceNumber = laborEntryTransactionLedgerEntrySequenceNumber;
199: }
200:
201: /**
202: * Gets the laborEntryUniversityFiscalYear attribute.
203: *
204: * @return Returns the laborEntryUniversityFiscalYear.
205: */
206: public String getLaborEntryUniversityFiscalYear() {
207: return laborEntryUniversityFiscalYear;
208: }
209:
210: /**
211: * Sets the laborEntryUniversityFiscalYear attribute value.
212: *
213: * @param laborEntryUniversityFiscalYear The laborEntryUniversityFiscalYear to set.
214: */
215: public void setLaborEntryUniversityFiscalYear(
216: String laborEntryUniversityFiscalYear) {
217: this .laborEntryUniversityFiscalYear = laborEntryUniversityFiscalYear;
218: }
219:
220: /**
221: * Gets the LaborCorrectionDocument attribute.
222: *
223: * @return Returns the LaborCorrectionDocument.
224: */
225: public LaborCorrectionDocument getLaborCorrectionDocument() {
226: return (LaborCorrectionDocument) getDocument();
227: }
228:
229: /**
230: * Gets the TableRenderColumnMetadata attribute.
231: *
232: * @return Returns the TableRenderColumnMetadata.
233: */
234: public List<Column> getTableRenderColumnMetadata() {
235: return SpringContext.getBean(
236: LaborCorrectionDocumentService.class)
237: .getTableRenderColumnMetadata(
238: getDocument().getDocumentNumber());
239: }
240: }
|