View Javadoc
1   /*
2    * Copyright 2007 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.kuali.ole.vnd.businessobject;
18  
19  import java.sql.Timestamp;
20  import java.util.LinkedHashMap;
21  
22  import org.kuali.ole.sys.context.SpringContext;
23  import org.kuali.rice.kim.api.identity.Person;
24  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
25  
26  /**
27   * Records any changes to a Vendor's Tax Number or Type. Not shown on the screen.
28   */
29  public class VendorTaxChange extends PersistableBusinessObjectBase {
30  
31      private Integer vendorTaxChangeGeneratedIdentifier;
32      private Integer vendorHeaderGeneratedIdentifier;
33      private Timestamp vendorTaxChangeTimestamp;
34      private String vendorPreviousTaxNumber;
35      private String vendorPreviousTaxTypeCode;
36      private String vendorTaxChangePersonIdentifier;
37  
38      private Person vendorTaxChangePerson;
39      private VendorHeader vendorHeader;
40  
41      /**
42       * Default constructor.
43       */
44      public VendorTaxChange() {
45      }
46  
47      /**
48       * Constructs a VendorTaxChange.
49       * 
50       * @param vndrHdrGenId The generated Id of the Vendor Header
51       * @param taxChangeDate The date of this change
52       * @param prevTaxNum The tax number previously
53       * @param prevTaxTypeCode The tax type previously
54       * @param taxChangePersonId The Id of the user who is making this change
55       */
56      public VendorTaxChange(Integer vndrHdrGenId, Timestamp taxChangeTimestamp, String prevTaxNum, String prevTaxTypeCode, String taxChangePersonId) {
57          this.vendorHeaderGeneratedIdentifier = vndrHdrGenId;
58          this.vendorTaxChangeTimestamp = taxChangeTimestamp;
59          this.vendorPreviousTaxNumber = prevTaxNum;
60          this.vendorPreviousTaxTypeCode = prevTaxTypeCode;
61          this.vendorTaxChangePersonIdentifier = taxChangePersonId;
62      }
63  
64      public Integer getVendorTaxChangeGeneratedIdentifier() {
65          return vendorTaxChangeGeneratedIdentifier;
66      }
67  
68      public void setVendorTaxChangeGeneratedIdentifier(Integer vendorTaxChangeGeneratedIdentifier) {
69          this.vendorTaxChangeGeneratedIdentifier = vendorTaxChangeGeneratedIdentifier;
70      }
71  
72      public Integer getVendorHeaderGeneratedIdentifier() {
73          return vendorHeaderGeneratedIdentifier;
74      }
75  
76      public void setVendorHeaderGeneratedIdentifier(Integer vendorHeaderGeneratedIdentifier) {
77          this.vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier;
78      }
79  
80      public Timestamp getVendorTaxChangeTimestamp() {
81          return vendorTaxChangeTimestamp;
82      }
83  
84      public void setVendorTaxChangeTimestamp(Timestamp vendorTaxChangeTimestamp) {
85          this.vendorTaxChangeTimestamp = vendorTaxChangeTimestamp;
86      }
87  
88      public String getVendorPreviousTaxNumber() {
89          return vendorPreviousTaxNumber;
90      }
91  
92      public void setVendorPreviousTaxNumber(String vendorPreviousTaxNumber) {
93          this.vendorPreviousTaxNumber = vendorPreviousTaxNumber;
94      }
95  
96      public String getVendorPreviousTaxTypeCode() {
97          return vendorPreviousTaxTypeCode;
98      }
99  
100     public void setVendorPreviousTaxTypeCode(String vendorPreviousTaxTypeCode) {
101         this.vendorPreviousTaxTypeCode = vendorPreviousTaxTypeCode;
102     }
103 
104     public String getVendorTaxChangePersonIdentifier() {
105         return vendorTaxChangePersonIdentifier;
106     }
107 
108     public void setVendorTaxChangePersonIdentifier(String vendorTaxChangePersonIdentifier) {
109         this.vendorTaxChangePersonIdentifier = vendorTaxChangePersonIdentifier;
110     }
111 
112     public Person getVendorTaxChangePerson() {
113         vendorTaxChangePerson = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(vendorTaxChangePersonIdentifier, vendorTaxChangePerson);
114         return vendorTaxChangePerson;
115     }
116 
117     /**
118      * Sets the vendorTaxChangePerson attribute.
119      * 
120      * @param vendorTaxChangePerson The vendorTaxChangePerson to set.
121      * @deprecated
122      */
123     public void setVendorTaxChangePerson(Person vendorTaxChangePerson) {
124         this.vendorTaxChangePerson = vendorTaxChangePerson;
125     }
126 
127     public VendorHeader getVendorHeader() {
128         return vendorHeader;
129     }
130 
131     /**
132      * Sets the vendorHeader attribute value.
133      * 
134      * @param vendorHeader The vendorHeader to set.
135      * @deprecated
136      */
137     public void setVendorHeader(VendorHeader vendorHeader) {
138         this.vendorHeader = vendorHeader;
139     }
140 
141     /**
142      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
143      */
144     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
145         LinkedHashMap m = new LinkedHashMap();
146         if (this.vendorTaxChangeGeneratedIdentifier != null) {
147             m.put("vendorTaxChangeGeneratedIdentifier", this.vendorTaxChangeGeneratedIdentifier.toString());
148         }
149         return m;
150     }
151 
152 }
153