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.businessobject; 017 018 import java.util.LinkedHashMap; 019 020 import org.kuali.kfs.coa.businessobject.Chart; 021 import org.kuali.kfs.coa.businessobject.Organization; 022 import org.kuali.kfs.sys.context.SpringContext; 023 import org.kuali.rice.kns.bo.Country; 024 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase; 025 import org.kuali.rice.kns.bo.PostalCode; 026 import org.kuali.rice.kns.bo.State; 027 import org.kuali.rice.kns.service.PostalCodeService; 028 import org.kuali.rice.kns.service.StateService; 029 import org.kuali.rice.kns.util.ObjectUtils; 030 031 /** 032 * @author Kuali Nervous System Team (kualidev@oncourse.iu.edu) 033 */ 034 public class OrganizationOptions extends PersistableBusinessObjectBase { 035 036 private String chartOfAccountsCode; 037 private String organizationCode; 038 private String processingChartOfAccountCode; 039 private String processingOrganizationCode; 040 private String printInvoiceIndicator; 041 private String organizationPaymentTermsText; 042 private String organizationMessageText; 043 private String organizationRemitToAddressName; 044 private String organizationRemitToLine1StreetAddress; 045 private String organizationRemitToLine2StreetAddress; 046 private String organizationRemitToCityName; 047 private String organizationRemitToStateCode; 048 private String organizationRemitToZipCode; 049 private String organizationPhoneNumber; 050 private String organization800PhoneNumber; 051 private String organizationFaxNumber; 052 private String universityName; 053 private String organizationCheckPayableToName; 054 private String organizationPostalZipCode; 055 private String organizationPostalCountryCode; 056 057 private Organization organization; 058 private Chart chartOfAccounts; 059 private Chart processingChartOfAccount; 060 private Organization processingOrganization; 061 private State organizationRemitToState; 062 private PrintInvoiceOptions printInvoiceOptions; 063 private PostalCode orgPostalZipCode; 064 private PostalCode orgRemitToZipCode; 065 private PostalCode orgPostalCountryCode; 066 067 068 /** 069 * Default constructor. 070 */ 071 public OrganizationOptions() { 072 073 } 074 075 /** 076 * Gets the chartOfAccountsCode attribute. 077 * 078 * @return Returns the chartOfAccountsCode 079 * 080 */ 081 public String getChartOfAccountsCode() { 082 return chartOfAccountsCode; 083 } 084 085 /** 086 * Sets the chartOfAccountsCode attribute. 087 * 088 * @param chartOfAccountsCode The chartOfAccountsCode to set. 089 * 090 */ 091 public void setChartOfAccountsCode(String chartOfAccountsCode) { 092 this.chartOfAccountsCode = chartOfAccountsCode; 093 } 094 095 096 /** 097 * Gets the organizationCode attribute. 098 * 099 * @return Returns the organizationCode 100 * 101 */ 102 public String getOrganizationCode() { 103 return organizationCode; 104 } 105 106 /** 107 * Sets the organizationCode attribute. 108 * 109 * @param organizationCode The organizationCode to set. 110 * 111 */ 112 public void setOrganizationCode(String organizationCode) { 113 this.organizationCode = organizationCode; 114 } 115 116 117 /** 118 * Gets the processingChartOfAccountCode attribute. 119 * 120 * @return Returns the processingChartOfAccountCode 121 * 122 */ 123 public String getProcessingChartOfAccountCode() { 124 return processingChartOfAccountCode; 125 } 126 127 /** 128 * Sets the processingChartOfAccountCode attribute. 129 * 130 * @param processingChartOfAccountCode The processingChartOfAccountCode to set. 131 * 132 */ 133 public void setProcessingChartOfAccountCode(String processingChartOfAccountCode) { 134 this.processingChartOfAccountCode = processingChartOfAccountCode; 135 } 136 137 138 /** 139 * Gets the processingOrganizationCode attribute. 140 * 141 * @return Returns the processingOrganizationCode 142 * 143 */ 144 public String getProcessingOrganizationCode() { 145 return processingOrganizationCode; 146 } 147 148 /** 149 * Sets the processingOrganizationCode attribute. 150 * 151 * @param processingOrganizationCode The processingOrganizationCode to set. 152 * 153 */ 154 public void setProcessingOrganizationCode(String processingOrganizationCode) { 155 this.processingOrganizationCode = processingOrganizationCode; 156 } 157 158 /** 159 * Gets the printInvoiceIndicator attribute. 160 * 161 * @return Returns the printInvoiceIndicator 162 * 163 */ 164 public String getPrintInvoiceIndicator() { 165 return printInvoiceIndicator; 166 } 167 168 /** 169 * Sets the printInvoiceIndicator attribute. 170 * 171 * @param printInvoiceIndicator The printInvoiceIndicator to set. 172 * 173 */ 174 public void setPrintInvoiceIndicator(String printInvoiceIndicator) { 175 this.printInvoiceIndicator = printInvoiceIndicator; 176 } 177 178 179 /** 180 * Gets the organizationPaymentTermsText attribute. 181 * 182 * @return Returns the organizationPaymentTermsText 183 * 184 */ 185 public String getOrganizationPaymentTermsText() { 186 return organizationPaymentTermsText; 187 } 188 189 /** 190 * Sets the organizationPaymentTermsText attribute. 191 * 192 * @param organizationPaymentTermsText The organizationPaymentTermsText to set. 193 * 194 */ 195 public void setOrganizationPaymentTermsText(String organizationPaymentTermsText) { 196 this.organizationPaymentTermsText = organizationPaymentTermsText; 197 } 198 199 200 /** 201 * Gets the organizationMessageText attribute. 202 * 203 * @return Returns the organizationMessageText 204 * 205 */ 206 public String getOrganizationMessageText() { 207 return organizationMessageText; 208 } 209 210 /** 211 * Sets the organizationMessageText attribute. 212 * 213 * @param organizationMessageText The organizationMessageText to set. 214 * 215 */ 216 public void setOrganizationMessageText(String organizationMessageText) { 217 this.organizationMessageText = organizationMessageText; 218 } 219 220 221 /** 222 * Gets the organizationRemitToAddressName attribute. 223 * 224 * @return Returns the organizationRemitToAddressName 225 * 226 */ 227 public String getOrganizationRemitToAddressName() { 228 return organizationRemitToAddressName; 229 } 230 231 /** 232 * Sets the organizationRemitToAddressName attribute. 233 * 234 * @param organizationRemitToAddressName The organizationRemitToAddressName to set. 235 * 236 */ 237 public void setOrganizationRemitToAddressName(String organizationRemitToAddressName) { 238 this.organizationRemitToAddressName = organizationRemitToAddressName; 239 } 240 241 242 /** 243 * Gets the organizationRemitToLine1StreetAddress attribute. 244 * 245 * @return Returns the organizationRemitToLine1StreetAddress 246 * 247 */ 248 public String getOrganizationRemitToLine1StreetAddress() { 249 return organizationRemitToLine1StreetAddress; 250 } 251 252 /** 253 * Sets the organizationRemitToLine1StreetAddress attribute. 254 * 255 * @param organizationRemitToLine1StreetAddress The organizationRemitToLine1StreetAddress to set. 256 * 257 */ 258 public void setOrganizationRemitToLine1StreetAddress(String organizationRemitToLine1StreetAddress) { 259 this.organizationRemitToLine1StreetAddress = organizationRemitToLine1StreetAddress; 260 } 261 262 263 /** 264 * Gets the organizationRemitToLine2StreetAddress attribute. 265 * 266 * @return Returns the organizationRemitToLine2StreetAddress 267 * 268 */ 269 public String getOrganizationRemitToLine2StreetAddress() { 270 return organizationRemitToLine2StreetAddress; 271 } 272 273 /** 274 * Sets the organizationRemitToLine2StreetAddress attribute. 275 * 276 * @param organizationRemitToLine2StreetAddress The organizationRemitToLine2StreetAddress to set. 277 * 278 */ 279 public void setOrganizationRemitToLine2StreetAddress(String organizationRemitToLine2StreetAddress) { 280 this.organizationRemitToLine2StreetAddress = organizationRemitToLine2StreetAddress; 281 } 282 283 284 /** 285 * Gets the organizationRemitToCityName attribute. 286 * 287 * @return Returns the organizationRemitToCityName 288 * 289 */ 290 public String getOrganizationRemitToCityName() { 291 return organizationRemitToCityName; 292 } 293 294 /** 295 * Sets the organizationRemitToCityName attribute. 296 * 297 * @param organizationRemitToCityName The organizationRemitToCityName to set. 298 * 299 */ 300 public void setOrganizationRemitToCityName(String organizationRemitToCityName) { 301 this.organizationRemitToCityName = organizationRemitToCityName; 302 } 303 304 305 /** 306 * Gets the organizationRemitToStateCode attribute. 307 * 308 * @return Returns the organizationRemitToStateCode 309 * 310 */ 311 public String getOrganizationRemitToStateCode() { 312 return organizationRemitToStateCode; 313 } 314 315 /** 316 * Sets the organizationRemitToStateCode attribute. 317 * 318 * @param organizationRemitToStateCode The organizationRemitToStateCode to set. 319 * 320 */ 321 public void setOrganizationRemitToStateCode(String organizationRemitToStateCode) { 322 this.organizationRemitToStateCode = organizationRemitToStateCode; 323 } 324 325 326 /** 327 * Gets the organizationRemitToZipCode attribute. 328 * 329 * @return Returns the organizationRemitToZipCode 330 * 331 */ 332 public String getOrganizationRemitToZipCode() { 333 return organizationRemitToZipCode; 334 } 335 336 /** 337 * Sets the organizationRemitToZipCode attribute. 338 * 339 * @param organizationRemitToZipCode The organizationRemitToZipCode to set. 340 * 341 */ 342 public void setOrganizationRemitToZipCode(String organizationRemitToZipCode) { 343 this.organizationRemitToZipCode = organizationRemitToZipCode; 344 } 345 346 /** 347 * Gets the organizationPhoneNumber attribute. 348 * 349 * @return Returns the organizationPhoneNumber 350 * 351 */ 352 public String getOrganizationPhoneNumber() { 353 return organizationPhoneNumber; 354 } 355 356 /** 357 * Sets the organizationPhoneNumber attribute. 358 * 359 * @param organizationPhoneNumber The organizationPhoneNumber to set. 360 * 361 */ 362 public void setOrganizationPhoneNumber(String organizationPhoneNumber) { 363 this.organizationPhoneNumber = organizationPhoneNumber; 364 } 365 366 367 /** 368 * Gets the organization800PhoneNumber attribute. 369 * 370 * @return Returns the organization800PhoneNumber 371 * 372 */ 373 public String getOrganization800PhoneNumber() { 374 return organization800PhoneNumber; 375 } 376 377 /** 378 * Sets the organization800PhoneNumber attribute. 379 * 380 * @param organization800PhoneNumber The organization800PhoneNumber to set. 381 * 382 */ 383 public void setOrganization800PhoneNumber(String organization800PhoneNumber) { 384 this.organization800PhoneNumber = organization800PhoneNumber; 385 } 386 387 388 /** 389 * Gets the organizationFaxNumber attribute. 390 * 391 * @return Returns the organizationFaxNumber 392 * 393 */ 394 public String getOrganizationFaxNumber() { 395 return organizationFaxNumber; 396 } 397 398 /** 399 * Sets the organizationFaxNumber attribute. 400 * 401 * @param organizationFaxNumber The organizationFaxNumber to set. 402 * 403 */ 404 public void setOrganizationFaxNumber(String organizationFaxNumber) { 405 this.organizationFaxNumber = organizationFaxNumber; 406 } 407 408 409 /** 410 * Gets the universityName attribute. 411 * 412 * @return Returns the universityName 413 * 414 */ 415 public String getUniversityName() { 416 return universityName; 417 } 418 419 /** 420 * Sets the universityName attribute. 421 * 422 * @param universityName The universityName to set. 423 * 424 */ 425 public void setUniversityName(String universityName) { 426 this.universityName = universityName; 427 } 428 429 430 /** 431 * Gets the organizationCheckPayableToName attribute. 432 * 433 * @return Returns the organizationCheckPayableToName 434 * 435 */ 436 public String getOrganizationCheckPayableToName() { 437 return organizationCheckPayableToName; 438 } 439 440 /** 441 * Sets the organizationCheckPayableToName attribute. 442 * 443 * @param organizationCheckPayableToName The organizationCheckPayableToName to set. 444 * 445 */ 446 public void setOrganizationCheckPayableToName(String organizationCheckPayableToName) { 447 this.organizationCheckPayableToName = organizationCheckPayableToName; 448 } 449 450 451 /** 452 * Gets the organization attribute. 453 * 454 * @return Returns the organization 455 * 456 */ 457 public Organization getOrganization() { 458 return organization; 459 } 460 461 /** 462 * Sets the organization attribute. 463 * 464 * @param organization The organization to set. 465 * @deprecated 466 */ 467 public void setOrganization(Organization organization) { 468 this.organization = organization; 469 } 470 471 /** 472 * Gets the chartOfAccounts attribute. 473 * 474 * @return Returns the chartOfAccounts 475 * 476 */ 477 public Chart getChartOfAccounts() { 478 return chartOfAccounts; 479 } 480 481 /** 482 * Sets the chartOfAccounts attribute. 483 * 484 * @param chartOfAccounts The chartOfAccounts to set. 485 * @deprecated 486 */ 487 public void setChartOfAccounts(Chart chartOfAccounts) { 488 this.chartOfAccounts = chartOfAccounts; 489 } 490 491 /** 492 * Gets the processingChartOfAccount attribute. 493 * 494 * @return Returns the processingChartOfAccount 495 * 496 */ 497 public Chart getProcessingChartOfAccount() { 498 return processingChartOfAccount; 499 } 500 501 /** 502 * Sets the processingChartOfAccount attribute. 503 * 504 * @param processingChartOfAccount The processingChartOfAccount to set. 505 * @deprecated 506 */ 507 public void setProcessingChartOfAccount(Chart processingChartOfAccount) { 508 this.processingChartOfAccount = processingChartOfAccount; 509 } 510 511 /** 512 * Gets the processingOrganization attribute. 513 * 514 * @return Returns the processingOrganization 515 * 516 */ 517 public Organization getProcessingOrganization() { 518 return processingOrganization; 519 } 520 521 /** 522 * Sets the processingOrganization attribute. 523 * 524 * @param processingOrganization The processingOrganization to set. 525 * @deprecated 526 */ 527 public void setProcessingOrganization(Organization processingOrganization) { 528 this.processingOrganization = processingOrganization; 529 } 530 531 /** 532 * Gets the organizationRemitToState attribute. 533 * @return Returns the organizationRemitToState. 534 */ 535 public State getOrganizationRemitToState() { 536 organizationRemitToState = SpringContext.getBean(StateService.class).getByPrimaryIdIfNecessary(organizationRemitToStateCode, organizationRemitToState); 537 return organizationRemitToState; 538 } 539 540 /** 541 * Sets the organizationRemitToState attribute value. 542 * @param organizationRemitToState The organizationRemitToState to set. 543 * @deprecated 544 */ 545 public void setOrganizationRemitToState(State organizationRemitToState) { 546 this.organizationRemitToState = organizationRemitToState; 547 } 548 549 /** 550 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper() 551 */ 552 protected LinkedHashMap toStringMapper() { 553 LinkedHashMap m = new LinkedHashMap(); 554 m.put("chartOfAccountsCode", this.chartOfAccountsCode); 555 m.put("organizationCode", this.organizationCode); 556 return m; 557 } 558 559 560 /** 561 * Gets the printOption attribute. 562 * @return Returns the printOption. 563 */ 564 public PrintInvoiceOptions getPrintInvoiceOptions() { 565 return printInvoiceOptions; 566 } 567 568 /** 569 * Sets the printOption attribute value. 570 * @param printOption The printOption to set. 571 */ 572 public void setPrintInvoiceOptions(PrintInvoiceOptions printInvoiceOptions) { 573 this.printInvoiceOptions = printInvoiceOptions; 574 } 575 576 /** 577 * This method (a hack by any other name...) returns a string so that an organization options can have a link to view its own 578 * inquiry page after a look up 579 * 580 * @return the String "View Organization Options" 581 */ 582 public String getOrganizationOptionsViewer() { 583 return "View Organization Options"; 584 } 585 586 public String getOrganizationPostalZipCode() { 587 return organizationPostalZipCode; 588 } 589 590 public String getOrganizationPostalCountryCode() { 591 return organizationPostalCountryCode; 592 } 593 594 public void setOrganizationPostalCountryCode(String organizationPostalCountryCode) { 595 this.organizationPostalCountryCode = organizationPostalCountryCode; 596 } 597 598 public void setOrganizationPostalZipCode(String organizationPostalZipCode) { 599 this.organizationPostalZipCode = organizationPostalZipCode; 600 } 601 602 public PostalCode getOrgPostalZipCode() { 603 if(ObjectUtils.isNull(orgPostalZipCode)) { 604 orgPostalZipCode = SpringContext.getBean(PostalCodeService.class).getByPostalCodeInDefaultCountry(organizationPostalZipCode); 605 } 606 return orgPostalZipCode; 607 } 608 609 public void setOrgPostalZipCode(PostalCode orgPostalZipCode) { 610 this.orgPostalZipCode = orgPostalZipCode; 611 } 612 613 public PostalCode getOrgRemitToZipCode() { 614 if(ObjectUtils.isNull(orgRemitToZipCode)) { 615 orgRemitToZipCode = SpringContext.getBean(PostalCodeService.class).getByPostalCodeInDefaultCountry(organizationRemitToZipCode); 616 } 617 return orgRemitToZipCode; 618 } 619 620 public void setOrgRemitToZipCode(PostalCode orgRemitToZipCode) { 621 this.orgRemitToZipCode = orgRemitToZipCode; 622 } 623 624 public PostalCode getOrgPostalCountryCode() { 625 return orgPostalCountryCode; 626 } 627 628 public void setOrgPostalCountryCode(PostalCode orgPostalCountryCode) { 629 this.orgPostalCountryCode = orgPostalCountryCode; 630 } 631 632 }