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.util.LinkedHashMap;
20  
21  import org.apache.commons.lang.builder.EqualsBuilder;
22  import org.kuali.ole.coa.businessobject.Chart;
23  import org.kuali.ole.coa.businessobject.Organization;
24  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
25  import org.kuali.rice.core.api.util.type.KualiDecimal;
26  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
27  import org.kuali.rice.krad.util.ObjectUtils;
28  
29  /**
30   * A relation between a particular <code>Org</code> and a <code>VendorContract</code> indicating that the Org uses this Vendor
31   * Contract.
32   * 
33   * @see org.kuali.ole.vnd.businessobject.VendorContract
34   * @see org.kuali.ole.coa.businessobject.Org
35   */
36  public class VendorContractOrganization extends PersistableBusinessObjectBase implements VendorRoutingComparable, MutableInactivatable {
37  
38      private Integer vendorContractGeneratedIdentifier;
39      private String chartOfAccountsCode;
40      private String organizationCode;
41      private KualiDecimal vendorContractPurchaseOrderLimitAmount;
42      private boolean vendorContractExcludeIndicator;
43      private boolean active;
44  
45      private VendorContract vendorContract;
46      private Organization organization;
47      private Chart chartOfAccounts;
48  
49      /**
50       * Default constructor.
51       */
52      public VendorContractOrganization() {
53  
54      }
55  
56      public Integer getVendorContractGeneratedIdentifier() {
57  
58          return vendorContractGeneratedIdentifier;
59      }
60  
61      public void setVendorContractGeneratedIdentifier(Integer vendorContractGeneratedIdentifier) {
62          this.vendorContractGeneratedIdentifier = vendorContractGeneratedIdentifier;
63      }
64  
65      public String getChartOfAccountsCode() {
66  
67          return chartOfAccountsCode;
68      }
69  
70      public void setChartOfAccountsCode(String chartOfAccountsCode) {
71          this.chartOfAccountsCode = chartOfAccountsCode;
72      }
73  
74      public String getOrganizationCode() {
75  
76          return organizationCode;
77      }
78  
79      public void setOrganizationCode(String organizationCode) {
80          this.organizationCode = organizationCode;
81      }
82  
83      public KualiDecimal getVendorContractPurchaseOrderLimitAmount() {
84  
85          return vendorContractPurchaseOrderLimitAmount;
86      }
87  
88      public void setVendorContractPurchaseOrderLimitAmount(KualiDecimal vendorContractPurchaseOrderLimitAmount) {
89          this.vendorContractPurchaseOrderLimitAmount = vendorContractPurchaseOrderLimitAmount;
90      }
91  
92      public boolean isVendorContractExcludeIndicator() {
93  
94          return vendorContractExcludeIndicator;
95      }
96  
97      public void setVendorContractExcludeIndicator(boolean vendorContractExcludeIndicator) {
98          this.vendorContractExcludeIndicator = vendorContractExcludeIndicator;
99      }
100 
101     public boolean isActive() {
102 
103         return active;
104     }
105 
106     public void setActive(boolean active) {
107         this.active = active;
108     }
109 
110     public Organization getOrganization() {
111 
112         return organization;
113     }
114 
115     /**
116      * Sets the organization attribute.
117      * 
118      * @param organization The organization to set.
119      * @deprecated
120      */
121     public void setOrganization(Organization organization) {
122         this.organization = organization;
123     }
124 
125     public Chart getChartOfAccounts() {
126 
127         return chartOfAccounts;
128     }
129 
130     /**
131      * Sets the chartOfAccounts attribute.
132      * 
133      * @param chartOfAccounts The chartOfAccounts to set.
134      * @deprecated
135      */
136     public void setChartOfAccounts(Chart chartOfAccounts) {
137         this.chartOfAccounts = chartOfAccounts;
138     }
139 
140     public VendorContract getVendorContract() {
141 
142         return vendorContract;
143     }
144 
145     /**
146      * Sets the vendorContract attribute value.
147      * 
148      * @param vendorContract The vendorContract to set.
149      * @deprecated
150      */
151     public void setVendorContract(VendorContract vendorContract) {
152         this.vendorContract = vendorContract;
153     }
154 
155     /**
156      * @see org.kuali.ole.vnd.document.routing.VendorRoutingComparable#isEqualForRouting(java.lang.Object)
157      */
158     public boolean isEqualForRouting(Object toCompare) {
159         if ((ObjectUtils.isNull(toCompare)) || !(toCompare instanceof VendorContractOrganization)) {
160 
161             return false;
162         }
163         else {
164             VendorContractOrganization vco = (VendorContractOrganization) toCompare;
165 
166             return new EqualsBuilder().append(this.getVendorContractGeneratedIdentifier(), vco.getVendorContractGeneratedIdentifier()).append(this.getChartOfAccountsCode(), vco.getChartOfAccountsCode()).append(this.getOrganizationCode(), vco.getOrganizationCode()).append(this.getVendorContractPurchaseOrderLimitAmount(), vco.getVendorContractPurchaseOrderLimitAmount()).append(this.isVendorContractExcludeIndicator(), vco.isVendorContractExcludeIndicator()).isEquals();
167         }
168     }
169 
170     /**
171      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
172      */
173     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
174         LinkedHashMap m = new LinkedHashMap();
175         if (this.vendorContractGeneratedIdentifier != null) {
176             m.put("vendorContractGeneratedIdentifier", this.vendorContractGeneratedIdentifier.toString());
177         }
178         m.put("chartOfAccountsCode", this.chartOfAccountsCode);
179         m.put("organizationCode", this.organizationCode);
180 
181         return m;
182     }
183 
184 }