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.core.bo;
018:
019: import java.sql.Date;
020: import java.util.LinkedHashMap;
021:
022: import org.kuali.RiceConstants;
023: import org.kuali.RicePropertyConstants;
024: import org.kuali.core.util.KualiDecimal;
025: import org.kuali.core.workflow.service.KualiWorkflowDocument;
026:
027: /**
028: * Document Header Business Object
029: *
030: *
031: */
032: public class DocumentHeader extends PersistableBusinessObjectBase {
033: private static final long serialVersionUID = 8330320294549662887L;
034:
035: private String documentNumber;
036: private String financialDocumentStatusCode;
037: private String financialDocumentDescription;
038: private KualiDecimal financialDocumentTotalAmount;
039: private String organizationDocumentNumber;
040: private String financialDocumentInErrorNumber;
041: private String financialDocumentTemplateNumber;
042: // TODO: remove following field from here, OJB, and database after workflow API to retrieve this is implemented
043: private Date documentFinalDate;
044: private String explanation;
045:
046: private transient KualiWorkflowDocument workflowDocument;
047: private DocumentStatus documentStatus;
048:
049: private String correctedByDocumentId;
050:
051: /**
052: * Constructor - creates empty instances of dependent objects
053: *
054: */
055: public DocumentHeader() {
056: financialDocumentStatusCode = RiceConstants.DocumentStatusCodes.INITIATED;
057: }
058:
059: /**
060: *
061: * @return flexdoc
062: */
063: public KualiWorkflowDocument getWorkflowDocument() {
064: if (workflowDocument == null) {
065: throw new RuntimeException(
066: "transient FlexDoc is null - this should never happen");
067: }
068:
069: return workflowDocument;
070: }
071:
072: /**
073: * @return true if the workflowDocument is not null
074: */
075: public boolean hasWorkflowDocument() {
076: return (workflowDocument != null);
077: }
078:
079: /**
080: *
081: * @param workflowDocument
082: */
083: public void setWorkflowDocument(
084: KualiWorkflowDocument workflowDocument) {
085: this .workflowDocument = workflowDocument;
086: }
087:
088: /**
089: *
090: * @return documentDescription
091: */
092: public String getFinancialDocumentDescription() {
093: return financialDocumentDescription;
094: }
095:
096: /**
097: *
098: * @param documentDescription
099: */
100: public void setFinancialDocumentDescription(
101: String financialDocumentDescription) {
102: this .financialDocumentDescription = financialDocumentDescription;
103: }
104:
105: /**
106: *
107: * @return documentHeaderId
108: */
109: public String getDocumentNumber() {
110: return documentNumber;
111: }
112:
113: /**
114: *
115: * @param documentHeaderId
116: */
117: public void setDocumentNumber(String documentNumber) {
118: this .documentNumber = documentNumber;
119: }
120:
121: /**
122: *
123: * @return
124: */
125: public String getOrganizationDocumentNumber() {
126: return organizationDocumentNumber;
127: }
128:
129: /**
130: *
131: * @param organizationDocumentNumber
132: */
133: public void setOrganizationDocumentNumber(
134: String organizationDocumentNumber) {
135: this .organizationDocumentNumber = organizationDocumentNumber;
136: }
137:
138: /**
139: * @return documentHeaderId of the document from which this document was copied
140: */
141: public String getFinancialDocumentTemplateNumber() {
142: return financialDocumentTemplateNumber;
143: }
144:
145: /**
146: * @param copiedFromDocumentId
147: */
148: public void setFinancialDocumentTemplateNumber(
149: String setFinancialDocumentTemplateNumber) {
150: this .financialDocumentTemplateNumber = setFinancialDocumentTemplateNumber;
151: }
152:
153: /**
154: * @return documentHeaderId of the document which corrects this document
155: */
156: public String getCorrectedByDocumentId() {
157: return correctedByDocumentId;
158: }
159:
160: /**
161: * @param correctedByDocumentId
162: */
163: public void setCorrectedByDocumentId(String correctedByDocumentId) {
164: this .correctedByDocumentId = correctedByDocumentId;
165: }
166:
167: /**
168: * @return documentHeaderId of the document which this document corrects
169: */
170: public String getFinancialDocumentInErrorNumber() {
171: return financialDocumentInErrorNumber;
172: }
173:
174: /**
175: * @param correctedDocumentId
176: */
177: public void setFinancialDocumentInErrorNumber(
178: String financialDocumentInErrorNumber) {
179: this .financialDocumentInErrorNumber = financialDocumentInErrorNumber;
180: }
181:
182: /**
183: * @return Returns the documentStatusCode.
184: */
185: public String getFinancialDocumentStatusCode() {
186: return financialDocumentStatusCode;
187: }
188:
189: /**
190: * @param documentStatusCode The documentStatusCode to set.
191: */
192: public void setFinancialDocumentStatusCode(
193: String financialDocumentStatusCode) {
194: this .financialDocumentStatusCode = financialDocumentStatusCode;
195: }
196:
197: /**
198: * Gets the financialDocumentTotalAmount attribute.
199: *
200: * @return Returns the financialDocumentTotalAmount
201: *
202: */
203: public KualiDecimal getFinancialDocumentTotalAmount() {
204: return financialDocumentTotalAmount;
205: }
206:
207: /**
208: * Sets the financialDocumentTotalAmount attribute.
209: *
210: * @param financialDocumentTotalAmount The financialDocumentTotalAmount to set.
211: *
212: */
213: public void setFinancialDocumentTotalAmount(
214: KualiDecimal financialDocumentTotalAmount) {
215: this .financialDocumentTotalAmount = financialDocumentTotalAmount;
216: }
217:
218: /**
219: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
220: */
221: protected LinkedHashMap toStringMapper() {
222: LinkedHashMap m = new LinkedHashMap();
223:
224: m.put(RicePropertyConstants.DOCUMENT_NUMBER, documentNumber);
225:
226: return m;
227: }
228:
229: /**
230: * Gets the documentFinalDate attribute.
231: *
232: * @return Returns the documentFinalDate.
233: */
234: public Date getDocumentFinalDate() {
235: return documentFinalDate;
236: }
237:
238: /**
239: * Sets the documentFinalDate attribute value.
240: *
241: * @param documentFinalDate The documentFinalDate to set.
242: */
243: public void setDocumentFinalDate(Date documentFinalDate) {
244: this .documentFinalDate = documentFinalDate;
245: }
246:
247: /**
248: * Gets the explanation attribute.
249: * @return Returns the explanation.
250: */
251: public String getExplanation() {
252: return explanation;
253: }
254:
255: /**
256: * Sets the explanation attribute value.
257: * @param explanation The explanation to set.
258: */
259: public void setExplanation(String explanation) {
260: this .explanation = explanation;
261: }
262:
263: /**
264: * Gets the documentStatus attribute.
265: * @return Returns the documentStatus.
266: */
267: public DocumentStatus getDocumentStatus() {
268: return documentStatus;
269: }
270:
271: /**
272: * Sets the documentStatus attribute value.
273: * @param documentStatus The documentStatus to set.
274: * @deprecated
275: */
276: public void setDocumentStatus(DocumentStatus documentStatus) {
277: this.documentStatus = documentStatus;
278: }
279:
280: }
|