001/* 002 * Copyright 2007 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.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/ecl2.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 017package org.kuali.ole.vnd.businessobject; 018 019import java.sql.Timestamp; 020import java.util.LinkedHashMap; 021 022import org.kuali.ole.sys.context.SpringContext; 023import org.kuali.rice.kim.api.identity.Person; 024import org.kuali.rice.krad.bo.PersistableBusinessObjectBase; 025 026/** 027 * Records any changes to a Vendor's Tax Number or Type. Not shown on the screen. 028 */ 029public class VendorTaxChange extends PersistableBusinessObjectBase { 030 031 private Integer vendorTaxChangeGeneratedIdentifier; 032 private Integer vendorHeaderGeneratedIdentifier; 033 private Timestamp vendorTaxChangeTimestamp; 034 private String vendorPreviousTaxNumber; 035 private String vendorPreviousTaxTypeCode; 036 private String vendorTaxChangePersonIdentifier; 037 038 private Person vendorTaxChangePerson; 039 private VendorHeader vendorHeader; 040 041 /** 042 * Default constructor. 043 */ 044 public VendorTaxChange() { 045 } 046 047 /** 048 * Constructs a VendorTaxChange. 049 * 050 * @param vndrHdrGenId The generated Id of the Vendor Header 051 * @param taxChangeDate The date of this change 052 * @param prevTaxNum The tax number previously 053 * @param prevTaxTypeCode The tax type previously 054 * @param taxChangePersonId The Id of the user who is making this change 055 */ 056 public VendorTaxChange(Integer vndrHdrGenId, Timestamp taxChangeTimestamp, String prevTaxNum, String prevTaxTypeCode, String taxChangePersonId) { 057 this.vendorHeaderGeneratedIdentifier = vndrHdrGenId; 058 this.vendorTaxChangeTimestamp = taxChangeTimestamp; 059 this.vendorPreviousTaxNumber = prevTaxNum; 060 this.vendorPreviousTaxTypeCode = prevTaxTypeCode; 061 this.vendorTaxChangePersonIdentifier = taxChangePersonId; 062 } 063 064 public Integer getVendorTaxChangeGeneratedIdentifier() { 065 return vendorTaxChangeGeneratedIdentifier; 066 } 067 068 public void setVendorTaxChangeGeneratedIdentifier(Integer vendorTaxChangeGeneratedIdentifier) { 069 this.vendorTaxChangeGeneratedIdentifier = vendorTaxChangeGeneratedIdentifier; 070 } 071 072 public Integer getVendorHeaderGeneratedIdentifier() { 073 return vendorHeaderGeneratedIdentifier; 074 } 075 076 public void setVendorHeaderGeneratedIdentifier(Integer vendorHeaderGeneratedIdentifier) { 077 this.vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier; 078 } 079 080 public Timestamp getVendorTaxChangeTimestamp() { 081 return vendorTaxChangeTimestamp; 082 } 083 084 public void setVendorTaxChangeTimestamp(Timestamp vendorTaxChangeTimestamp) { 085 this.vendorTaxChangeTimestamp = vendorTaxChangeTimestamp; 086 } 087 088 public String getVendorPreviousTaxNumber() { 089 return vendorPreviousTaxNumber; 090 } 091 092 public void setVendorPreviousTaxNumber(String vendorPreviousTaxNumber) { 093 this.vendorPreviousTaxNumber = vendorPreviousTaxNumber; 094 } 095 096 public String getVendorPreviousTaxTypeCode() { 097 return vendorPreviousTaxTypeCode; 098 } 099 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