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 017 package org.kuali.kfs.coa.businessobject; 018 019 import java.sql.Date; 020 import java.util.ArrayList; 021 import java.util.LinkedHashMap; 022 import java.util.List; 023 024 import org.apache.commons.lang.StringUtils; 025 import org.kuali.kfs.sys.KFSPropertyConstants; 026 import org.kuali.kfs.sys.context.SpringContext; 027 import org.kuali.rice.kim.bo.Person; 028 import org.kuali.rice.kns.bo.DocumentHeader; 029 import org.kuali.rice.kns.bo.GlobalBusinessObject; 030 import org.kuali.rice.kns.bo.GlobalBusinessObjectDetail; 031 import org.kuali.rice.kns.bo.PersistableBusinessObject; 032 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase; 033 import org.kuali.rice.kns.bo.PostalCode; 034 import org.kuali.rice.kns.bo.State; 035 import org.kuali.rice.kns.service.BusinessObjectService; 036 import org.kuali.rice.kns.service.PersistenceStructureService; 037 import org.kuali.rice.kns.service.PostalCodeService; 038 import org.kuali.rice.kns.service.StateService; 039 import org.kuali.rice.kns.util.TypedArrayList; 040 041 /** 042 * 043 */ 044 public class AccountGlobal extends PersistableBusinessObjectBase implements GlobalBusinessObject { 045 046 private String documentNumber; 047 private String accountFiscalOfficerSystemIdentifier; 048 private String accountsSupervisorySystemsIdentifier; 049 private String accountManagerSystemIdentifier; 050 private String chartOfAccountsCode; 051 private String organizationCode; 052 private String subFundGroupCode; 053 private String accountCityName; 054 private String accountStateCode; 055 private String accountStreetAddress; 056 private String accountZipCode; 057 private Date accountExpirationDate; 058 private String continuationFinChrtOfAcctCd; 059 private String continuationAccountNumber; 060 private String incomeStreamFinancialCoaCode; 061 private String incomeStreamAccountNumber; 062 private String accountCfdaNumber; 063 private String financialHigherEdFunctionCd; 064 private String accountSufficientFundsCode; 065 private Boolean pendingAcctSufficientFundsIndicator; 066 private String accountSearchCriteriaTxt; 067 private List<AccountGlobalDetail> accountGlobalDetails; 068 069 private DocumentHeader financialDocument; 070 private Person accountFiscalOfficerUser; 071 private Person accountSupervisoryUser; 072 private Person accountManagerUser; 073 private Chart continuationFinChrtOfAcct; 074 private Account continuationAccount; 075 private Account incomeStreamAccount; 076 private Chart incomeStreamFinancialCoa; 077 private Chart chartOfAccounts; 078 private Organization organization; 079 private SubFundGroup subFundGroup; 080 private State accountState; 081 private HigherEducationFunction financialHigherEdFunction; 082 private PostalCode postalZipCode; 083 private SufficientFundsCode sufficientFundsCode; 084 085 /** 086 * Default constructor. 087 */ 088 public AccountGlobal() { 089 accountGlobalDetails = new TypedArrayList(AccountGlobalDetail.class); 090 } 091 092 /** 093 * @see org.kuali.rice.kns.document.GlobalBusinessObject#getGlobalChangesToDelete() 094 */ 095 public List<PersistableBusinessObject> generateDeactivationsToPersist() { 096 return null; 097 } 098 099 /** 100 * @see org.kuali.rice.kns.document.GlobalBusinessObject#applyGlobalChanges(org.kuali.rice.kns.bo.BusinessObject) 101 */ 102 public List<PersistableBusinessObject> generateGlobalChangesToPersist() { 103 104 105 // the list of persist-ready BOs 106 List<PersistableBusinessObject> persistables = new ArrayList(); 107 108 // walk over each change detail record 109 for (AccountGlobalDetail detail : accountGlobalDetails) { 110 111 // load the object by keys 112 Account account = (Account) SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(Account.class, detail.getPrimaryKeys()); 113 114 // if we got a valid account, do the processing 115 if (account != null) { 116 117 // NOTE that the list of fields that are updated may be a subset of the total 118 // number of fields in this class. This is because the class may contain a superset 119 // of the fields actually used in the Global Maintenance Document. 120 121 // FISCAL OFFICER 122 if (StringUtils.isNotBlank(accountFiscalOfficerSystemIdentifier)) { 123 account.setAccountFiscalOfficerSystemIdentifier(accountFiscalOfficerSystemIdentifier); 124 } 125 126 // ACCOUNT SUPERVISOR 127 if (StringUtils.isNotBlank(accountsSupervisorySystemsIdentifier)) { 128 account.setAccountsSupervisorySystemsIdentifier(accountsSupervisorySystemsIdentifier); 129 } 130 131 // ACCOUNT MANAGER 132 if (StringUtils.isNotBlank(accountManagerSystemIdentifier)) { 133 account.setAccountManagerSystemIdentifier(accountManagerSystemIdentifier); 134 } 135 136 // ORGANIZATION CODE 137 if (StringUtils.isNotBlank(organizationCode)) { 138 account.setOrganizationCode(organizationCode); 139 } 140 141 // SUB FUND GROUP CODE 142 if (StringUtils.isNotBlank(subFundGroupCode)) { 143 account.setSubFundGroupCode(subFundGroupCode); 144 } 145 146 // CITY NAME 147 if (StringUtils.isNotBlank(accountCityName)) { 148 account.setAccountCityName(accountCityName); 149 } 150 151 // STATE CODE 152 if (StringUtils.isNotBlank(accountStateCode)) { 153 account.setAccountStateCode(accountStateCode); 154 } 155 156 // STREET ADDRESS 157 if (StringUtils.isNotBlank(accountStreetAddress)) { 158 account.setAccountStreetAddress(accountStreetAddress); 159 } 160 161 // ZIP CODE 162 if (StringUtils.isNotBlank(accountZipCode)) { 163 account.setAccountZipCode(accountZipCode); 164 } 165 166 // EXPIRATION DATE 167 if (accountExpirationDate != null) { 168 account.setAccountExpirationDate(new Date(accountExpirationDate.getTime())); 169 } 170 171 // CONTINUATION CHART OF ACCOUNTS CODE 172 if (StringUtils.isNotBlank(continuationFinChrtOfAcctCd)) { 173 account.setContinuationFinChrtOfAcctCd(continuationFinChrtOfAcctCd); 174 } 175 176 // CONTINUATION ACCOUNT NUMBER 177 if (StringUtils.isNotBlank(continuationAccountNumber)) { 178 account.setContinuationAccountNumber(continuationAccountNumber); 179 } 180 181 // INCOME STREAM CHART OF ACCOUNTS CODE 182 if (StringUtils.isNotBlank(incomeStreamFinancialCoaCode)) { 183 account.setIncomeStreamFinancialCoaCode(incomeStreamFinancialCoaCode); 184 } 185 186 // INCOME STREAM ACCOUNT NUMBER 187 if (StringUtils.isNotBlank(incomeStreamAccountNumber)) { 188 account.setIncomeStreamAccountNumber(incomeStreamAccountNumber); 189 } 190 191 // CG CATL FED DOMESTIC ASSIST NBR 192 if (StringUtils.isNotBlank(accountCfdaNumber)) { 193 account.setAccountCfdaNumber(accountCfdaNumber); 194 } 195 196 // FINANCIAL HIGHER ED FUNCTION CODE 197 if (StringUtils.isNotBlank(financialHigherEdFunctionCd)) { 198 account.setFinancialHigherEdFunctionCd(financialHigherEdFunctionCd); 199 } 200 201 // SUFFICIENT FUNDS CODE 202 if (StringUtils.isNotBlank(accountSufficientFundsCode)) { 203 account.setAccountSufficientFundsCode(accountSufficientFundsCode); 204 } 205 206 // PENDING ACCOUNT SUFFICIENT FUNDS CODE INDICATOR 207 if (pendingAcctSufficientFundsIndicator != null) { 208 account.setPendingAcctSufficientFundsIndicator(pendingAcctSufficientFundsIndicator); 209 } 210 211 persistables.add(account); 212 213 } 214 } 215 216 return persistables; 217 } 218 219 /** 220 * Gets the documentNumber attribute. 221 * 222 * @return Returns the documentNumber 223 */ 224 public String getDocumentNumber() { 225 return documentNumber; 226 } 227 228 /** 229 * Sets the documentNumber attribute. 230 * 231 * @param documentNumber The documentNumber to set. 232 */ 233 public void setDocumentNumber(String documentNumber) { 234 this.documentNumber = documentNumber; 235 } 236 237 /** 238 * Gets the chartOfAccountsCode attribute. 239 * 240 * @return Returns the chartOfAccountsCode. 241 */ 242 public String getChartOfAccountsCode() { 243 return chartOfAccountsCode; 244 } 245 246 /** 247 * Sets the chartOfAccountsCode attribute value. 248 * 249 * @param chartOfAccountsCode The chartOfAccountsCode to set. 250 */ 251 public void setChartOfAccountsCode(String chartOfAccountsCode) { 252 this.chartOfAccountsCode = chartOfAccountsCode; 253 } 254 255 /** 256 * Gets the organizationCode attribute. 257 * 258 * @return Returns the organizationCode 259 */ 260 public String getOrganizationCode() { 261 return organizationCode; 262 } 263 264 /** 265 * Sets the organizationCode attribute. 266 * 267 * @param organizationCode The organizationCode to set. 268 */ 269 public void setOrganizationCode(String organizationCode) { 270 this.organizationCode = organizationCode; 271 } 272 273 /** 274 * Gets the subFundGroupCode attribute. 275 * 276 * @return Returns the subFundGroupCode 277 */ 278 public String getSubFundGroupCode() { 279 return subFundGroupCode; 280 } 281 282 /** 283 * Sets the subFundGroupCode attribute. 284 * 285 * @param subFundGroupCode The subFundGroupCode to set. 286 */ 287 public void setSubFundGroupCode(String subFundGroupCode) { 288 this.subFundGroupCode = subFundGroupCode; 289 } 290 291 /** 292 * Gets the accountCityName attribute. 293 * 294 * @return Returns the accountCityName 295 */ 296 public String getAccountCityName() { 297 return accountCityName; 298 } 299 300 /** 301 * Sets the accountCityName attribute. 302 * 303 * @param accountCityName The accountCityName to set. 304 */ 305 public void setAccountCityName(String accountCityName) { 306 this.accountCityName = accountCityName; 307 } 308 309 310 /** 311 * Gets the accountStateCode attribute. 312 * 313 * @return Returns the accountStateCode 314 */ 315 public String getAccountStateCode() { 316 return accountStateCode; 317 } 318 319 /** 320 * Sets the accountStateCode attribute. 321 * 322 * @param accountStateCode The accountStateCode to set. 323 */ 324 public void setAccountStateCode(String accountStateCode) { 325 this.accountStateCode = accountStateCode; 326 } 327 328 329 /** 330 * Gets the accountStreetAddress attribute. 331 * 332 * @return Returns the accountStreetAddress 333 */ 334 public String getAccountStreetAddress() { 335 return accountStreetAddress; 336 } 337 338 /** 339 * Sets the accountStreetAddress attribute. 340 * 341 * @param accountStreetAddress The accountStreetAddress to set. 342 */ 343 public void setAccountStreetAddress(String accountStreetAddress) { 344 this.accountStreetAddress = accountStreetAddress; 345 } 346 347 348 /** 349 * Gets the accountZipCode attribute. 350 * 351 * @return Returns the accountZipCode 352 */ 353 public String getAccountZipCode() { 354 return accountZipCode; 355 } 356 357 /** 358 * Sets the accountZipCode attribute. 359 * 360 * @param accountZipCode The accountZipCode to set. 361 */ 362 public void setAccountZipCode(String accountZipCode) { 363 this.accountZipCode = accountZipCode; 364 } 365 366 /** 367 * Gets the accountExpirationDate attribute. 368 * 369 * @return Returns the accountExpirationDate 370 */ 371 public Date getAccountExpirationDate() { 372 return accountExpirationDate; 373 } 374 375 /** 376 * Sets the accountExpirationDate attribute. 377 * 378 * @param accountExpirationDate The accountExpirationDate to set. 379 */ 380 public void setAccountExpirationDate(Date accountExpirationDate) { 381 this.accountExpirationDate = accountExpirationDate; 382 } 383 384 385 /** 386 * Gets the continuationFinChrtOfAcctCd attribute. 387 * 388 * @return Returns the continuationFinChrtOfAcctCd 389 */ 390 public String getContinuationFinChrtOfAcctCd() { 391 return continuationFinChrtOfAcctCd; 392 } 393 394 /** 395 * Sets the continuationFinChrtOfAcctCd attribute. 396 * 397 * @param continuationFinChrtOfAcctCd The continuationFinChrtOfAcctCd to set. 398 */ 399 public void setContinuationFinChrtOfAcctCd(String continuationFinChrtOfAcctCd) { 400 this.continuationFinChrtOfAcctCd = continuationFinChrtOfAcctCd; 401 } 402 403 404 /** 405 * Gets the continuationAccountNumber attribute. 406 * 407 * @return Returns the continuationAccountNumber 408 */ 409 public String getContinuationAccountNumber() { 410 return continuationAccountNumber; 411 } 412 413 /** 414 * Sets the continuationAccountNumber attribute. 415 * 416 * @param continuationAccountNumber The continuationAccountNumber to set. 417 */ 418 public void setContinuationAccountNumber(String continuationAccountNumber) { 419 this.continuationAccountNumber = continuationAccountNumber; 420 } 421 422 /** 423 * Gets the incomeStreamFinancialCoaCode attribute. 424 * 425 * @return Returns the incomeStreamFinancialCoaCode 426 */ 427 public String getIncomeStreamFinancialCoaCode() { 428 return incomeStreamFinancialCoaCode; 429 } 430 431 /** 432 * Sets the incomeStreamFinancialCoaCode attribute. 433 * 434 * @param incomeStreamFinancialCoaCode The incomeStreamFinancialCoaCode to set. 435 */ 436 public void setIncomeStreamFinancialCoaCode(String incomeStreamFinancialCoaCode) { 437 this.incomeStreamFinancialCoaCode = incomeStreamFinancialCoaCode; 438 } 439 440 441 /** 442 * Gets the incomeStreamAccountNumber attribute. 443 * 444 * @return Returns the incomeStreamAccountNumber 445 */ 446 public String getIncomeStreamAccountNumber() { 447 return incomeStreamAccountNumber; 448 } 449 450 /** 451 * Sets the incomeStreamAccountNumber attribute. 452 * 453 * @param incomeStreamAccountNumber The incomeStreamAccountNumber to set. 454 */ 455 public void setIncomeStreamAccountNumber(String incomeStreamAccountNumber) { 456 this.incomeStreamAccountNumber = incomeStreamAccountNumber; 457 } 458 459 /** 460 * Gets the accountSufficientFundsCode attribute. 461 * 462 * @return Returns the accountSufficientFundsCode 463 */ 464 public String getAccountSufficientFundsCode() { 465 return accountSufficientFundsCode; 466 } 467 468 /** 469 * Sets the accountSufficientFundsCode attribute. 470 * 471 * @param accountSufficientFundsCode The accountSufficientFundsCode to set. 472 */ 473 public void setAccountSufficientFundsCode(String accountSufficientFundsCode) { 474 this.accountSufficientFundsCode = accountSufficientFundsCode; 475 } 476 477 478 /** 479 * Gets the pendingAcctSufficientFundsIndicator attribute. 480 * 481 * @return Returns the pendingAcctSufficientFundsIndicator 482 */ 483 public Boolean getPendingAcctSufficientFundsIndicator() { 484 return pendingAcctSufficientFundsIndicator; 485 } 486 487 488 /** 489 * Sets the pendingAcctSufficientFundsIndicator attribute. 490 * 491 * @param pendingAcctSufficientFundsIndicator The pendingAcctSufficientFundsIndicator to set. 492 */ 493 public void setPendingAcctSufficientFundsIndicator(Boolean pendingAcctSufficientFundsIndicator) { 494 this.pendingAcctSufficientFundsIndicator = pendingAcctSufficientFundsIndicator; 495 } 496 497 /** 498 * Gets the accountCfdaNumber attribute. 499 * 500 * @return Returns the accountCfdaNumber 501 */ 502 public String getAccountCfdaNumber() { 503 return accountCfdaNumber; 504 } 505 506 /** 507 * Sets the accountCfdaNumber attribute. 508 * 509 * @param accountCfdaNumber The accountCfdaNumber to set. 510 */ 511 public void setAccountCfdaNumber(String accountCfdaNumber) { 512 this.accountCfdaNumber = accountCfdaNumber; 513 } 514 515 /** 516 * Gets the accountSearchCriteriaTxt attribute. 517 * 518 * @return Returns the accountSearchCriteriaTxt 519 */ 520 public String getAccountSearchCriteriaTxt() { 521 return accountSearchCriteriaTxt; 522 } 523 524 /** 525 * Sets the accountSearchCriteriaTxt attribute. 526 * 527 * @param accountSearchCriteriaTxt The accountSearchCriteriaTxt to set. 528 */ 529 public void setAccountSearchCriteriaTxt(String accountSearchCriteriaTxt) { 530 this.accountSearchCriteriaTxt = accountSearchCriteriaTxt; 531 } 532 533 534 /** 535 * Gets the financialDocument attribute. 536 * 537 * @return Returns the financialDocument 538 */ 539 public DocumentHeader getFinancialDocument() { 540 return financialDocument; 541 } 542 543 /** 544 * Sets the financialDocument attribute. 545 * 546 * @param financialDocument The financialDocument to set. 547 * @deprecated 548 */ 549 public void setFinancialDocument(DocumentHeader financialDocument) { 550 this.financialDocument = financialDocument; 551 } 552 553 public Person getAccountFiscalOfficerUser() { 554 accountFiscalOfficerUser = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).updatePersonIfNecessary(accountFiscalOfficerSystemIdentifier, accountFiscalOfficerUser); 555 return accountFiscalOfficerUser; 556 } 557 558 559 /** 560 * @param accountFiscalOfficerUser The accountFiscalOfficerUser to set. 561 * @deprecated 562 */ 563 public void setAccountFiscalOfficerUser(Person accountFiscalOfficerUser) { 564 this.accountFiscalOfficerUser = accountFiscalOfficerUser; 565 } 566 567 public Person getAccountManagerUser() { 568 accountManagerUser = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).updatePersonIfNecessary(accountManagerSystemIdentifier, accountManagerUser); 569 return accountManagerUser; 570 } 571 572 /** 573 * @param accountManagerUser The accountManagerUser to set. 574 * @deprecated 575 */ 576 public void setAccountManagerUser(Person accountManagerUser) { 577 this.accountManagerUser = accountManagerUser; 578 } 579 580 581 public Person getAccountSupervisoryUser() { 582 accountSupervisoryUser = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).updatePersonIfNecessary(accountsSupervisorySystemsIdentifier, accountSupervisoryUser); 583 return accountSupervisoryUser; 584 } 585 586 587 /** 588 * @param accountSupervisoryUser The accountSupervisoryUser to set. 589 * @deprecated 590 */ 591 public void setAccountSupervisoryUser(Person accountSupervisoryUser) { 592 this.accountSupervisoryUser = accountSupervisoryUser; 593 } 594 595 /** 596 * Gets the continuationFinChrtOfAcct attribute. 597 * 598 * @return Returns the continuationFinChrtOfAcct 599 */ 600 public Chart getContinuationFinChrtOfAcct() { 601 return continuationFinChrtOfAcct; 602 } 603 604 /** 605 * Sets the continuationFinChrtOfAcct attribute. 606 * 607 * @param continuationFinChrtOfAcct The continuationFinChrtOfAcct to set. 608 * @deprecated 609 */ 610 public void setContinuationFinChrtOfAcct(Chart continuationFinChrtOfAcct) { 611 this.continuationFinChrtOfAcct = continuationFinChrtOfAcct; 612 } 613 614 /** 615 * Gets the continuationAccount attribute. 616 * 617 * @return Returns the continuationAccount 618 */ 619 public Account getContinuationAccount() { 620 return continuationAccount; 621 } 622 623 /** 624 * Sets the continuationAccount attribute. 625 * 626 * @param continuationAccount The continuationAccount to set. 627 * @deprecated 628 */ 629 public void setContinuationAccount(Account continuationAccount) { 630 this.continuationAccount = continuationAccount; 631 } 632 633 /** 634 * Gets the incomeStreamAccount attribute. 635 * 636 * @return Returns the incomeStreamAccount 637 */ 638 public Account getIncomeStreamAccount() { 639 return incomeStreamAccount; 640 } 641 642 /** 643 * Sets the incomeStreamAccount attribute. 644 * 645 * @param incomeStreamAccount The incomeStreamAccount to set. 646 * @deprecated 647 */ 648 public void setIncomeStreamAccount(Account incomeStreamAccount) { 649 this.incomeStreamAccount = incomeStreamAccount; 650 } 651 652 /** 653 * Gets the incomeStreamFinancialCoa attribute. 654 * 655 * @return Returns the incomeStreamFinancialCoa 656 */ 657 public Chart getIncomeStreamFinancialCoa() { 658 return incomeStreamFinancialCoa; 659 } 660 661 /** 662 * Sets the incomeStreamFinancialCoa attribute. 663 * 664 * @param incomeStreamFinancialCoa The incomeStreamFinancialCoa to set. 665 * @deprecated 666 */ 667 public void setIncomeStreamFinancialCoa(Chart incomeStreamFinancialCoa) { 668 this.incomeStreamFinancialCoa = incomeStreamFinancialCoa; 669 } 670 671 /** 672 * @return Returns the accountGlobalDetail. 673 */ 674 public List<AccountGlobalDetail> getAccountGlobalDetails() { 675 return accountGlobalDetails; 676 } 677 678 /** 679 * @param accountGlobalDetail The accountGlobalDetail to set. 680 */ 681 public void setAccountGlobalDetails(List<AccountGlobalDetail> accountGlobalDetails) { 682 this.accountGlobalDetails = accountGlobalDetails; 683 } 684 685 /** 686 * Gets the financialHigherEdFunctionCd attribute. 687 * 688 * @return Returns the financialHigherEdFunctionCd. 689 */ 690 public String getFinancialHigherEdFunctionCd() { 691 return financialHigherEdFunctionCd; 692 } 693 694 /** 695 * Sets the financialHigherEdFunctionCd attribute value. 696 * 697 * @param financialHigherEdFunctionCd The financialHigherEdFunctionCd to set. 698 */ 699 public void setFinancialHigherEdFunctionCd(String financialHigherEdFunctionCd) { 700 this.financialHigherEdFunctionCd = financialHigherEdFunctionCd; 701 } 702 703 /** 704 * Gets the accountFiscalOfficerSystemIdentifier attribute. 705 * 706 * @return Returns the accountFiscalOfficerSystemIdentifier. 707 */ 708 public String getAccountFiscalOfficerSystemIdentifier() { 709 return accountFiscalOfficerSystemIdentifier; 710 } 711 712 /** 713 * Sets the accountFiscalOfficerSystemIdentifier attribute value. 714 * 715 * @param accountFiscalOfficerSystemIdentifier The accountFiscalOfficerSystemIdentifier to set. 716 */ 717 public void setAccountFiscalOfficerSystemIdentifier(String accountFiscalOfficerSystemIdentifier) { 718 this.accountFiscalOfficerSystemIdentifier = accountFiscalOfficerSystemIdentifier; 719 } 720 721 /** 722 * Gets the accountManagerSystemIdentifier attribute. 723 * 724 * @return Returns the accountManagerSystemIdentifier. 725 */ 726 public String getAccountManagerSystemIdentifier() { 727 return accountManagerSystemIdentifier; 728 } 729 730 /** 731 * Sets the accountManagerSystemIdentifier attribute value. 732 * 733 * @param accountManagerSystemIdentifier The accountManagerSystemIdentifier to set. 734 */ 735 public void setAccountManagerSystemIdentifier(String accountManagerSystemIdentifier) { 736 this.accountManagerSystemIdentifier = accountManagerSystemIdentifier; 737 } 738 739 /** 740 * Gets the accountsSupervisorySystemsIdentifier attribute. 741 * 742 * @return Returns the accountsSupervisorySystemsIdentifier. 743 */ 744 public String getAccountsSupervisorySystemsIdentifier() { 745 return accountsSupervisorySystemsIdentifier; 746 } 747 748 /** 749 * Sets the accountsSupervisorySystemsIdentifier attribute value. 750 * 751 * @param accountsSupervisorySystemsIdentifier The accountsSupervisorySystemsIdentifier to set. 752 */ 753 public void setAccountsSupervisorySystemsIdentifier(String accountsSupervisorySystemsIdentifier) { 754 this.accountsSupervisorySystemsIdentifier = accountsSupervisorySystemsIdentifier; 755 } 756 757 /** 758 * Gets the chartOfAccounts attribute. 759 * 760 * @return Returns the chartOfAccounts. 761 */ 762 public Chart getChartOfAccounts() { 763 return chartOfAccounts; 764 } 765 766 /** 767 * Sets the chartOfAccounts attribute value. 768 * 769 * @param chartOfAccounts The chartOfAccounts to set. 770 * @deprecated 771 */ 772 public void setChartOfAccounts(Chart chartOfAccounts) { 773 this.chartOfAccounts = chartOfAccounts; 774 } 775 776 /** 777 * Gets the accountState attribute. 778 * 779 * @return Returns the accountState. 780 */ 781 public State getAccountState() { 782 accountState = SpringContext.getBean(StateService.class).getByPrimaryIdIfNecessary(accountStateCode, accountState); 783 return accountState; 784 } 785 786 /** 787 * Sets the accountState attribute value. 788 * 789 * @param accountState The accountState to set. 790 */ 791 public void setAccountState(State accountState) { 792 this.accountState = accountState; 793 } 794 795 /** 796 * Gets the financialHigherEdFunction attribute. 797 * 798 * @return Returns the financialHigherEdFunction. 799 */ 800 public HigherEducationFunction getFinancialHigherEdFunction() { 801 return financialHigherEdFunction; 802 } 803 804 /** 805 * Sets the financialHigherEdFunction attribute value. 806 * 807 * @param financialHigherEdFunction The financialHigherEdFunction to set. 808 */ 809 public void setFinancialHigherEdFunction(HigherEducationFunction financialHigherEdFunction) { 810 this.financialHigherEdFunction = financialHigherEdFunction; 811 } 812 813 /** 814 * Gets the organization attribute. 815 * 816 * @return Returns the organization. 817 */ 818 public Organization getOrganization() { 819 return organization; 820 } 821 822 /** 823 * Sets the organization attribute value. 824 * 825 * @param organization The organization to set. 826 */ 827 public void setOrganization(Organization organization) { 828 this.organization = organization; 829 } 830 831 /** 832 * Gets the postalZipCode attribute. 833 * 834 * @return Returns the postalZipCode. 835 */ 836 public PostalCode getPostalZipCode() { 837 postalZipCode = SpringContext.getBean(PostalCodeService.class).getByPostalCodeInDefaultCountryIfNecessary(accountZipCode, postalZipCode); 838 839 return postalZipCode; 840 } 841 842 /** 843 * Sets the postalZipCode attribute value. 844 * 845 * @param postalZipCode The postalZipCode to set. 846 */ 847 public void setPostalZipCode(PostalCode postalZipCode) { 848 this.postalZipCode = postalZipCode; 849 } 850 851 /** 852 * Gets the subFundGroup attribute. 853 * 854 * @return Returns the subFundGroup. 855 */ 856 public SubFundGroup getSubFundGroup() { 857 return subFundGroup; 858 } 859 860 /** 861 * Sets the subFundGroup attribute value. 862 * 863 * @param subFundGroup The subFundGroup to set. 864 */ 865 public void setSubFundGroup(SubFundGroup subFundGroup) { 866 this.subFundGroup = subFundGroup; 867 } 868 869 /** 870 * Gets the sufficientFundsCode attribute. 871 * 872 * @return Returns the sufficientFundsCode. 873 */ 874 public final SufficientFundsCode getSufficientFundsCode() { 875 return sufficientFundsCode; 876 } 877 878 /** 879 * Sets the sufficientFundsCode attribute value. 880 * 881 * @param sufficientFundsCode The sufficientFundsCode to set. 882 */ 883 public final void setSufficientFundsCode(SufficientFundsCode sufficientFundsCode) { 884 this.sufficientFundsCode = sufficientFundsCode; 885 } 886 887 /** 888 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper() 889 */ 890 protected LinkedHashMap toStringMapper() { 891 LinkedHashMap m = new LinkedHashMap(); 892 m.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber); 893 return m; 894 } 895 896 /** 897 * @see org.kuali.rice.kns.document.GlobalBusinessObject#isPersistable() 898 */ 899 public boolean isPersistable() { 900 PersistenceStructureService persistenceStructureService = SpringContext.getBean(PersistenceStructureService.class); 901 902 // fail if the PK for this object is emtpy 903 if (StringUtils.isBlank(documentNumber)) { 904 return false; 905 } 906 907 // fail if the PKs for any of the contained objects are empty 908 for (AccountGlobalDetail account : getAccountGlobalDetails()) { 909 if (!persistenceStructureService.hasPrimaryKeyFieldValues(account)) { 910 return false; 911 } 912 } 913 914 // otherwise, its all good 915 return true; 916 } 917 918 public List<? extends GlobalBusinessObjectDetail> getAllDetailObjects() { 919 return accountGlobalDetails; 920 } 921 922 /** 923 * @see org.kuali.rice.kns.bo.PersistableBusinessObjectBase#buildListOfDeletionAwareLists() 924 */ 925 @Override 926 public List buildListOfDeletionAwareLists() { 927 List<List> managedLists = super.buildListOfDeletionAwareLists(); 928 929 managedLists.add(getAccountGlobalDetails()); 930 931 return managedLists; 932 } 933 }