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.vendor.bo;
018:
019: import java.sql.Date;
020: import java.util.LinkedHashMap;
021:
022: import org.kuali.core.bo.PersistableBusinessObjectBase;
023: import org.kuali.core.bo.user.UniversalUser;
024: import org.kuali.core.service.UniversalUserService;
025: import org.kuali.kfs.context.SpringContext;
026:
027: /**
028: * Records any changes to a Vendor's Tax Number or Type. Not shown on the screen.
029: */
030: public class VendorTaxChange extends PersistableBusinessObjectBase {
031:
032: private Integer vendorTaxChangeGeneratedIdentifier;
033: private Integer vendorHeaderGeneratedIdentifier;
034: private Date vendorTaxChangeDate;
035: private String vendorPreviousTaxNumber;
036: private String vendorPreviousTaxTypeCode;
037: private String vendorTaxChangePersonIdentifier;
038:
039: private UniversalUser vendorTaxChangePerson;
040: private VendorHeader vendorHeader;
041:
042: /**
043: * Default constructor.
044: */
045: public VendorTaxChange() {
046: }
047:
048: /**
049: * Constructs a VendorTaxChange.
050: *
051: * @param vndrHdrGenId The generated Id of the Vendor Header
052: * @param taxChangeDate The date of this change
053: * @param prevTaxNum The tax number previously
054: * @param prevTaxTypeCode The tax type previously
055: * @param taxChangePersonId The Id of the user who is making this change
056: */
057: public VendorTaxChange(Integer vndrHdrGenId, Date taxChangeDate,
058: String prevTaxNum, String prevTaxTypeCode,
059: String taxChangePersonId) {
060: this .vendorHeaderGeneratedIdentifier = vndrHdrGenId;
061: this .vendorTaxChangeDate = taxChangeDate;
062: this .vendorPreviousTaxNumber = prevTaxNum;
063: this .vendorPreviousTaxTypeCode = prevTaxTypeCode;
064: this .vendorTaxChangePersonIdentifier = taxChangePersonId;
065: }
066:
067: public Integer getVendorTaxChangeGeneratedIdentifier() {
068: return vendorTaxChangeGeneratedIdentifier;
069: }
070:
071: public void setVendorTaxChangeGeneratedIdentifier(
072: Integer vendorTaxChangeGeneratedIdentifier) {
073: this .vendorTaxChangeGeneratedIdentifier = vendorTaxChangeGeneratedIdentifier;
074: }
075:
076: public Integer getVendorHeaderGeneratedIdentifier() {
077: return vendorHeaderGeneratedIdentifier;
078: }
079:
080: public void setVendorHeaderGeneratedIdentifier(
081: Integer vendorHeaderGeneratedIdentifier) {
082: this .vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier;
083: }
084:
085: public Date getVendorTaxChangeDate() {
086: return vendorTaxChangeDate;
087: }
088:
089: public void setVendorTaxChangeDate(Date vendorTaxChangeDate) {
090: this .vendorTaxChangeDate = vendorTaxChangeDate;
091: }
092:
093: public String getVendorPreviousTaxNumber() {
094: return vendorPreviousTaxNumber;
095: }
096:
097: public void setVendorPreviousTaxNumber(
098: String vendorPreviousTaxNumber) {
099: this .vendorPreviousTaxNumber = vendorPreviousTaxNumber;
100: }
101:
102: public String getVendorPreviousTaxTypeCode() {
103: return vendorPreviousTaxTypeCode;
104: }
105:
106: public void setVendorPreviousTaxTypeCode(
107: String vendorPreviousTaxTypeCode) {
108: this .vendorPreviousTaxTypeCode = vendorPreviousTaxTypeCode;
109: }
110:
111: public String getVendorTaxChangePersonIdentifier() {
112: return vendorTaxChangePersonIdentifier;
113: }
114:
115: public void setVendorTaxChangePersonIdentifier(
116: String vendorTaxChangePersonIdentifier) {
117: this .vendorTaxChangePersonIdentifier = vendorTaxChangePersonIdentifier;
118: }
119:
120: public UniversalUser getVendorTaxChangePerson() {
121: vendorTaxChangePerson = SpringContext.getBean(
122: UniversalUserService.class)
123: .updateUniversalUserIfNecessary(
124: vendorTaxChangePersonIdentifier,
125: vendorTaxChangePerson);
126: return vendorTaxChangePerson;
127: }
128:
129: /**
130: * Sets the vendorTaxChangePerson attribute.
131: *
132: * @param vendorTaxChangePerson The vendorTaxChangePerson to set.
133: * @deprecated
134: */
135: public void setVendorTaxChangePerson(
136: UniversalUser vendorTaxChangePerson) {
137: this .vendorTaxChangePerson = vendorTaxChangePerson;
138: }
139:
140: public VendorHeader getVendorHeader() {
141: return vendorHeader;
142: }
143:
144: /**
145: * Sets the vendorHeader attribute value.
146: *
147: * @param vendorHeader The vendorHeader to set.
148: * @deprecated
149: */
150: public void setVendorHeader(VendorHeader vendorHeader) {
151: this .vendorHeader = vendorHeader;
152: }
153:
154: /**
155: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
156: */
157: protected LinkedHashMap toStringMapper() {
158: LinkedHashMap m = new LinkedHashMap();
159: if (this .vendorTaxChangeGeneratedIdentifier != null) {
160: m.put("vendorTaxChangeGeneratedIdentifier",
161: this.vendorTaxChangeGeneratedIdentifier.toString());
162: }
163: return m;
164: }
165:
166: }
|