001 /* 002 * Copyright 2011 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 package org.kuali.kfs.module.ar.batch.vo; 017 018 import java.util.List; 019 020 import org.apache.commons.lang.StringUtils; 021 import org.kuali.rice.kns.util.TypedArrayList; 022 023 public class CustomerDigesterVO { 024 025 private String customerNumber; 026 private String customerName; 027 private String customerParentCompanyNumber; 028 private String customerTypeCode; 029 private String customerLastActivityDate; 030 private String customerTaxTypeCode; 031 private String customerTaxNbr; 032 private String customerActiveIndicator; 033 private String customerPhoneNumber; 034 private String customer800PhoneNumber; 035 private String customerContactName; 036 private String customerContactPhoneNumber; 037 private String customerFaxNumber; 038 private String customerBirthDate; 039 private String customerTaxExemptIndicator; 040 private String customerCreditLimitAmount; 041 private String customerCreditApprovedByName; 042 private String customerEmailAddress; 043 044 private List<CustomerAddressDigesterVO> customerAddresses; 045 046 public CustomerDigesterVO() { 047 customerAddresses = new TypedArrayList(CustomerAddressDigesterVO.class); 048 } 049 050 public String getCustomerNumber() { 051 return customerNumber; 052 } 053 054 public void setCustomerNumber(String customerNumber) { 055 this.customerNumber = customerNumber; 056 } 057 058 public String getCustomerName() { 059 return customerName; 060 } 061 062 public void setCustomerName(String customerName) { 063 this.customerName = customerName; 064 } 065 066 public String getCustomerParentCompanyNumber() { 067 return customerParentCompanyNumber; 068 } 069 070 public void setCustomerParentCompanyNumber(String customerParentCompanyNumber) { 071 this.customerParentCompanyNumber = customerParentCompanyNumber; 072 } 073 074 public String getCustomerTypeCode() { 075 return customerTypeCode; 076 } 077 078 public void setCustomerTypeCode(String customerTypeCode) { 079 this.customerTypeCode = customerTypeCode; 080 } 081 082 public String getCustomerLastActivityDate() { 083 return customerLastActivityDate; 084 } 085 086 public void setCustomerLastActivityDate(String customerLastActivityDate) { 087 this.customerLastActivityDate = customerLastActivityDate; 088 } 089 090 public String getCustomerTaxTypeCode() { 091 return customerTaxTypeCode; 092 } 093 094 public void setCustomerTaxTypeCode(String customerTaxTypeCode) { 095 this.customerTaxTypeCode = customerTaxTypeCode; 096 } 097 098 public String getCustomerTaxNbr() { 099 return customerTaxNbr; 100 } 101 102 public void setCustomerTaxNbr(String customerTaxNbr) { 103 this.customerTaxNbr = customerTaxNbr; 104 } 105 106 public String getCustomerActiveIndicator() { 107 return customerActiveIndicator; 108 } 109 110 public void setCustomerActiveIndicator(String customerActiveIndicator) { 111 this.customerActiveIndicator = customerActiveIndicator; 112 } 113 114 public String getCustomerPhoneNumber() { 115 return customerPhoneNumber; 116 } 117 118 public void setCustomerPhoneNumber(String customerPhoneNumber) { 119 this.customerPhoneNumber = customerPhoneNumber; 120 } 121 122 public String getCustomer800PhoneNumber() { 123 return customer800PhoneNumber; 124 } 125 126 public void setCustomer800PhoneNumber(String customer800PhoneNumber) { 127 this.customer800PhoneNumber = customer800PhoneNumber; 128 } 129 130 public String getCustomerContactName() { 131 return customerContactName; 132 } 133 134 public void setCustomerContactName(String customerContactName) { 135 this.customerContactName = customerContactName; 136 } 137 138 public String getCustomerContactPhoneNumber() { 139 return customerContactPhoneNumber; 140 } 141 142 public void setCustomerContactPhoneNumber(String customerContactPhoneNumber) { 143 this.customerContactPhoneNumber = customerContactPhoneNumber; 144 } 145 146 public String getCustomerFaxNumber() { 147 return customerFaxNumber; 148 } 149 150 public void setCustomerFaxNumber(String customerFaxNumber) { 151 this.customerFaxNumber = customerFaxNumber; 152 } 153 154 public String getCustomerBirthDate() { 155 return customerBirthDate; 156 } 157 158 public void setCustomerBirthDate(String customerBirthDate) { 159 this.customerBirthDate = customerBirthDate; 160 } 161 162 public String getCustomerTaxExemptIndicator() { 163 return customerTaxExemptIndicator; 164 } 165 166 public void setCustomerTaxExemptIndicator(String customerTaxExemptIndicator) { 167 this.customerTaxExemptIndicator = customerTaxExemptIndicator; 168 } 169 170 public String getCustomerCreditLimitAmount() { 171 return customerCreditLimitAmount; 172 } 173 174 public void setCustomerCreditLimitAmount(String customerCreditLimitAmount) { 175 this.customerCreditLimitAmount = customerCreditLimitAmount; 176 } 177 178 public String getCustomerCreditApprovedByName() { 179 return customerCreditApprovedByName; 180 } 181 182 public void setCustomerCreditApprovedByName(String customerCreditApprovedByName) { 183 this.customerCreditApprovedByName = customerCreditApprovedByName; 184 } 185 186 public String getCustomerEmailAddress() { 187 return customerEmailAddress; 188 } 189 190 public void setCustomerEmailAddress(String customerEmailAddress) { 191 this.customerEmailAddress = customerEmailAddress; 192 } 193 194 public List<CustomerAddressDigesterVO> getCustomerAddresses() { 195 return customerAddresses; 196 } 197 198 public void setCustomerAddresses(List<CustomerAddressDigesterVO> customerAddresses) { 199 this.customerAddresses = customerAddresses; 200 } 201 202 /** 203 * This is a convenience method that adds a populated CustomerAddress object directly 204 * to the contained TypedArrayList. 205 * 206 * It's primarily used by the Customer Load batch process, for each of XML batch file 207 * digesting, though it can be used generally. 208 * 209 * NOTE that it will attempt to wire the parent/child relationship by setting the 210 * customerAddress.customerNumber to the customerNumber of 'this', if the number isnt 211 * already set. 212 * 213 * @param customerAddress 214 */ 215 public void addCustomerAddress(CustomerAddressDigesterVO customerAddress) { 216 // do nothing if passed-in customerAddress is null 217 if (customerAddress == null) { 218 return; 219 } 220 // wire the CustomerNumber to ensure a valid parent/child relationship 221 if (StringUtils.isBlank(customerAddress.getCustomerNumber())) { 222 if (StringUtils.isNotBlank(this.customerNumber)) { 223 customerAddress.setCustomerNumber(this.customerNumber); 224 } 225 } 226 this.customerAddresses.add(customerAddress); 227 } 228 229 }