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.pdp.businessobject; 017 018 import java.sql.Date; 019 import java.sql.Timestamp; 020 import java.text.ParseException; 021 import java.util.ArrayList; 022 import java.util.Iterator; 023 import java.util.LinkedHashMap; 024 import java.util.List; 025 026 import org.apache.commons.lang.StringUtils; 027 import org.kuali.kfs.pdp.PdpConstants; 028 import org.kuali.kfs.pdp.PdpKeyConstants; 029 import org.kuali.kfs.pdp.PdpPropertyConstants; 030 import org.kuali.kfs.sys.KFSConstants; 031 import org.kuali.kfs.sys.KFSPropertyConstants; 032 import org.kuali.kfs.sys.businessobject.Bank; 033 import org.kuali.kfs.sys.businessobject.TimestampedBusinessObjectBase; 034 import org.kuali.kfs.sys.context.SpringContext; 035 import org.kuali.rice.kns.service.DateTimeService; 036 import org.kuali.rice.kns.service.KeyValuesService; 037 import org.kuali.rice.kns.service.KualiConfigurationService; 038 import org.kuali.rice.kns.service.ParameterService; 039 import org.kuali.rice.kns.util.KualiDecimal; 040 import org.kuali.rice.kns.util.KualiInteger; 041 042 /** 043 * This class represents the PaymentGroup 044 */ 045 public class PaymentGroup extends TimestampedBusinessObjectBase { 046 private static KualiDecimal zero = KualiDecimal.ZERO; 047 048 private KualiInteger id; // PMT_GRP_ID 049 private String payeeName; // PMT_PAYEE_NM 050 private String payeeId; // PAYEE_ID 051 private String payeeIdTypeCd; // PAYEE_ID_TYP_CD 052 private String alternatePayeeId; // ALTRNT_PAYEE_ID 053 private String alternatePayeeIdTypeCd; // ALTRNT_PAYEE_ID_TYP_CD 054 private String payeeOwnerCd; // PAYEE_OWNR_CD 055 private String customerInstitutionNumber; // CUST_IU_NBR 056 private String line1Address; // PMT_LN1_ADDR 057 private String line2Address; // PMT_LN2_ADDR 058 private String line3Address; // PMT_LN3_ADDR 059 private String line4Address; // PMT_LN4_ADDR 060 private String city; // PMT_CTY_NM 061 private String state; // PMT_ST_NM 062 private String country; // PMT_CNTRY_NM 063 private String zipCd; // PMT_ZIP_CD 064 private Boolean campusAddress; // CMP_ADDR_IND 065 private Date paymentDate; // PMT_DT DATE 066 private Boolean pymtAttachment; // PMT_ATTCHMNT_IND 067 private Boolean pymtSpecialHandling; // PMT_SPCL_HANDLG_IND 068 private Boolean taxablePayment; // PMT_TXBL_IND 069 private Boolean nraPayment; // NRA_PMT_IND 070 private Boolean processImmediate; // PROC_IMD_IND 071 private boolean combineGroups; // PMT_GRP_CMB_IND 072 private String achBankRoutingNbr; // ACH_BNK_RTNG_NBR 073 private String adviceEmailAddress; // ADV_EMAIL_ADDR 074 private Boolean employeeIndicator; // EMP_IND 075 private String creditMemoNbr; // PMT_CRDT_MEMO_NBR 076 private KualiDecimal creditMemoAmount; // PMT_CRDT_MEMO_AMT 077 private KualiInteger disbursementNbr; // DISB_NBR 078 private Date disbursementDate; // DISB_TS 079 private String physCampusProcessCd; // PHYS_CMP_PROC_CD 080 private String sortValue; // PMT_SORT_ORD_VAL 081 private String achAccountType; // CUST_ACCT_TYP_CD 082 private Timestamp epicPaymentCancelledExtractedDate; // PDP_EPIC_PMT_CNCL_EXTRT_TS 083 private Timestamp epicPaymentPaidExtractedDate; // PDP_EPIC_PMT_PD_EXTRT_TS 084 private Timestamp adviceEmailSentDate; // ADV_EMAIL_SNT_TS 085 086 private KualiInteger batchId; 087 private Batch batch; // PMT_BATCH_ID 088 089 private KualiInteger processId; 090 private PaymentProcess process; // PROC_ID 091 092 private String paymentStatusCode; 093 private PaymentStatus paymentStatus; // PMT_STAT_CD 094 095 private String disbursementTypeCode; 096 private DisbursementType disbursementType; // DISB_TYP_CD 097 098 private String bankCode; 099 private Bank bank; // BNK_ID 100 101 private AchAccountNumber achAccountNumber; 102 103 private List<PaymentGroupHistory> paymentGroupHistory = new ArrayList<PaymentGroupHistory>(); 104 private List<PaymentDetail> paymentDetails = new ArrayList<PaymentDetail>(); 105 106 /** 107 * Constructs a PaymentGroup.java. 108 */ 109 public PaymentGroup() { 110 super(); 111 } 112 113 /** 114 * This method gets the dailyReportSpecialHandling 115 * @return dailyReportSpecialHandling 116 */ 117 public boolean isDailyReportSpecialHandling() { 118 return pymtSpecialHandling && !processImmediate; 119 } 120 121 /** 122 * This method gets the dailyReportAttachment 123 * @return dailyReportAttachment 124 */ 125 public boolean isDailyReportAttachment() { 126 return !pymtSpecialHandling && !processImmediate && pymtAttachment; 127 } 128 129 /** 130 * This method gets the paymentStatusCode 131 * @return paymentStatusCode 132 */ 133 public String getPaymentStatusCode() { 134 return paymentStatusCode; 135 } 136 137 /** 138 * @return String containing the payment status code and indication or cancel/reissued payments or stale payments 139 */ 140 public String getPaymentStatusCodeWithHistory() { 141 if (paymentStatus == null) { 142 this.refreshReferenceObject(PdpPropertyConstants.PAYMENT_STATUS); 143 } 144 145 // check for canceled and reissued 146 String paymentStatusWithHistory = ""; 147 if (paymentStatus != null) { 148 paymentStatusWithHistory += paymentStatus.getName(); 149 } 150 151 boolean isCanceledReissued = false; 152 for (PaymentGroupHistory paymentGroupHistory : getPaymentGroupHistory()) { 153 if (PdpConstants.PaymentChangeCodes.CANCEL_REISSUE_DISBURSEMENT.equals(paymentGroupHistory.getPaymentChangeCode())) { 154 isCanceledReissued = true; 155 } 156 } 157 158 if (isCanceledReissued) { 159 paymentStatusWithHistory += " (Reissued)"; 160 } 161 162 // check for stale payments, if one payment detail is stale then they all are 163 PaymentDetail paymentDetail = getPaymentDetails().get(0); 164 if (!paymentDetail.isDisbursementActionAllowed()) { 165 paymentStatusWithHistory += " (Stale)"; 166 } 167 168 return paymentStatusWithHistory; 169 } 170 171 /** 172 * WIDTH MUST BE LESS THAN THE # OF SPACES 173 * 174 * @param width 175 * @param val 176 * @return 177 */ 178 private String getWidthString(int width, String val) { 179 return (val + " ").substring(0, width - 1); 180 } 181 182 /** 183 * This method gets the boolean valuse of a Boolean object. 184 * @param b the boolean object 185 * @return the boolean value 186 */ 187 private boolean booleanValue(Boolean b) { 188 boolean bv = false; 189 if (b != null) { 190 bv = b.booleanValue(); 191 } 192 return bv; 193 } 194 195 /** 196 * This method gets the notle lines 197 * @return the note lines 198 */ 199 public int getNoteLines() { 200 int count = 0; 201 for (Iterator iter = this.getPaymentDetails().iterator(); iter.hasNext();) { 202 PaymentDetail element = (PaymentDetail) iter.next(); 203 count++; // Add a line for the invoice # 204 count = count + element.getNotes().size(); 205 } 206 return count; 207 } 208 209 /** 210 * Get the total of all the detail items 211 * 212 * @return 213 */ 214 public KualiDecimal getNetPaymentAmount() { 215 KualiDecimal amt = KualiDecimal.ZERO; 216 for (Iterator iter = this.getPaymentDetails().iterator(); iter.hasNext();) { 217 PaymentDetail element = (PaymentDetail) iter.next(); 218 amt = amt.add(element.getNetPaymentAmount()); 219 } 220 return amt; 221 } 222 223 /** 224 * @hibernate.set name="paymentDetail" 225 * @hibernate.collection-key column="pmt_grp_id" 226 * @hibernate.collection-one-to-many class="edu.iu.uis.pdp.bo.PaymentDetail" 227 */ 228 public List<PaymentDetail> getPaymentDetails() { 229 return paymentDetails; 230 } 231 232 /** 233 * This method sets the payment details list 234 * @param paymentDetail 235 */ 236 public void setPaymentDetails(List<PaymentDetail> paymentDetail) { 237 this.paymentDetails = paymentDetail; 238 } 239 240 /** 241 * This method adds a paymentDetail 242 * @param pgh the payments detail to be added 243 */ 244 public void addPaymentDetails(PaymentDetail pgh) { 245 pgh.setPaymentGroup(this); 246 paymentDetails.add(pgh); 247 } 248 249 public void deletePaymentDetails(PaymentDetail pgh) { 250 paymentDetails.remove(pgh); 251 } 252 253 /** 254 * @hibernate.set name="paymentGroupHistory" 255 * @hibernate.collection-key column="pmt_grp_id" 256 * @hibernate.collection-one-to-many class="edu.iu.uis.pdp.bo.PaymentGroupHistory" 257 */ 258 public List<PaymentGroupHistory> getPaymentGroupHistory() { 259 return paymentGroupHistory; 260 } 261 262 /** 263 * This method sets the payment group history list 264 * @param paymentGroupHistory 265 */ 266 public void setPaymentGroupHistory(List<PaymentGroupHistory> paymentGroupHistory) { 267 this.paymentGroupHistory = paymentGroupHistory; 268 } 269 270 /** 271 * This method adds a paymentGroupHistory 272 * @param pd the paymentGroupHistory to be added 273 */ 274 public void addPaymentGroupHistory(PaymentGroupHistory pd) { 275 pd.setPaymentGroup(this); 276 paymentGroupHistory.add(pd); 277 } 278 279 /** 280 * This method deletes a paymentGroupHistory 281 * @param pd the paymentGroupHistory to be deleted 282 */ 283 public void deletePaymentGroupHistory(PaymentGroupHistory pd) { 284 paymentGroupHistory.remove(pd); 285 } 286 287 /** 288 * @hibernate.id column="PMT_GRP_ID" generator-class="sequence" 289 * @hibernate.generator-param name="sequence" value="PDP.PDP_PMT_GRP_ID_SEQ" 290 * @return 291 */ 292 public KualiInteger getId() { 293 return id; 294 } 295 296 /** 297 * @hibernate.one-to-one class="edu.iu.uis.pdp.bo.AchAccountNumber" 298 * @return 299 */ 300 public AchAccountNumber getAchAccountNumber() { 301 return achAccountNumber; 302 } 303 304 /** 305 * This method sets the achAccountNumber 306 * @param aan 307 */ 308 public void setAchAccountNumber(AchAccountNumber aan) { 309 this.achAccountNumber = aan; 310 } 311 312 /** 313 * This method gets the sortValue 314 * @return sortValue 315 */ 316 public String getSortValue() { 317 return sortValue; 318 } 319 320 /** 321 * This method sets the sort value 322 * @param sortGroupId 323 */ 324 public void setSortValue(int sortGroupId) { 325 String defaultSortOrderParameterName = SpringContext.getBean(KualiConfigurationService.class).getPropertyString(PdpKeyConstants.DEFAULT_SORT_GROUP_ID_PARAMETER); 326 String defaultSortOrderParameterValue = SpringContext.getBean(ParameterService.class).getParameterValue(PaymentGroup.class, defaultSortOrderParameterName); 327 328 StringBuffer sb = new StringBuffer(); 329 330 sb.append(sortGroupId); 331 332 CustomerProfile cp = this.getBatch().getCustomerProfile(); 333 sb.append(cp.getChartCode()); 334 sb.append(getWidthString(4, cp.getUnitCode())); 335 sb.append(getWidthString(4, cp.getSubUnitCode())); 336 337 if (defaultSortOrderParameterValue.equals(String.valueOf(sortGroupId))) { 338 sb.append(this.getPayeeId()); 339 sb.append(this.getPayeeIdTypeCd()); 340 } 341 else { 342 sb.append(this.getPayeeName()); 343 } 344 this.sortValue = sb.toString(); 345 } 346 347 /** 348 * @hibernate.property column="PMT_CTY_NM" length="30" 349 * @return Returns the city. 350 */ 351 public String getCity() { 352 return city; 353 } 354 355 /** 356 * @param city The city to set. 357 */ 358 public void setCity(String city) { 359 this.city = city; 360 } 361 362 public boolean getCombineGroups() { 363 return combineGroups; 364 } 365 366 public void setCombineGroups(boolean combineGroups) { 367 this.combineGroups = combineGroups; 368 } 369 370 /** 371 * @hibernate.property column="PMT_CNTRY_NM" length="30" 372 * @return Returns the country. 373 */ 374 public String getCountry() { 375 return country; 376 } 377 378 /** 379 * @param country The country to set. 380 */ 381 public void setCountry(String country) { 382 this.country = country; 383 } 384 385 /** 386 * @hibernate.property column="PMT_ST_NM" length="30" 387 * @return Returns the state. 388 */ 389 public String getState() { 390 return state; 391 } 392 393 /** 394 * @param state The state to set. 395 */ 396 public void setState(String state) { 397 this.state = state; 398 } 399 400 /** 401 * @return 402 * @hibernate.property column="ACH_BNK_RTNG_NBR" length="9" 403 */ 404 public String getAchBankRoutingNbr() { 405 return achBankRoutingNbr; 406 } 407 408 /** 409 * @return 410 * @hibernate.property column="ADV_EMAIL_ADDR" length="50" 411 */ 412 public String getAdviceEmailAddress() { 413 return adviceEmailAddress; 414 } 415 416 /** 417 * @return 418 * @hibernate.property column="ALTRNT_PAYEE_ID" length="25" 419 */ 420 public String getAlternatePayeeId() { 421 return alternatePayeeId; 422 } 423 424 /** 425 * @return 426 * @hibernate.property column="ALTRNT_PAYEE_ID_TYP_CD" length="2" 427 */ 428 public String getAlternatePayeeIdTypeCd() { 429 return alternatePayeeIdTypeCd; 430 } 431 432 /** 433 * @return 434 * @hibernate.many-to-one column="BNK_ID" class="edu.iu.uis.pdp.bo.Bank" not-null="false" 435 */ 436 public Bank getBank() { 437 return bank; 438 } 439 440 /** 441 * @return 442 * @hibernate.many-to-one column="PMT_BATCH_ID" class="edu.iu.uis.pdp.bo.Batch" not-null="true" 443 */ 444 public Batch getBatch() { 445 return batch; 446 } 447 448 /** 449 * Gets the bankCode attribute. 450 * 451 * @return Returns the bankCode. 452 */ 453 public String getBankCode() { 454 return bankCode; 455 } 456 457 /** 458 * Sets the bankCode attribute value. 459 * 460 * @param bankCode The bankCode to set. 461 */ 462 public void setBankCode(String bankCode) { 463 this.bankCode = bankCode; 464 } 465 466 /** 467 * @return 468 * @hibernate.property column="CMP_ADDR_IND" type="yes_no" 469 */ 470 public Boolean getCampusAddress() { 471 return campusAddress; 472 } 473 474 /** 475 * @return 476 * @hibernate.property column="PMT_CRDT_MEMO_AMT" length="14" 477 */ 478 public KualiDecimal getCreditMemoAmount() { 479 return creditMemoAmount; 480 } 481 482 /** 483 * @return 484 * @hibernate.property column="PMT_CRDT_MEMO_NBR" length="14" 485 */ 486 public String getCreditMemoNbr() { 487 return creditMemoNbr; 488 } 489 490 public String getCustomerInstitutionNumber() { 491 return customerInstitutionNumber; 492 } 493 494 /** 495 * This method gets the disbursementDate. 496 * @return disbursementDate 497 */ 498 public Date getDisbursementDate() { 499 return disbursementDate; 500 } 501 502 /** 503 * @return 504 * @hibernate.property column="DISB_NBR" length="9" 505 */ 506 public KualiInteger getDisbursementNbr() { 507 return disbursementNbr; 508 } 509 510 /** 511 * @return 512 * @hibernate.many-to-one column="DISB_TYP_CD" class="edu.iu.uis.pdp.bo.DisbursementType" not-null="false" 513 */ 514 public DisbursementType getDisbursementType() { 515 return disbursementType; 516 } 517 518 public Boolean getEmployeeIndicator() { 519 return employeeIndicator; 520 } 521 522 /** 523 * @return 524 * @hibernate.property column="PMT_LN1_ADDR" length="45" 525 */ 526 public String getLine1Address() { 527 return line1Address; 528 } 529 530 /** 531 * @return 532 * @hibernate.property column="PMT_LN2_ADDR" length="45" 533 */ 534 public String getLine2Address() { 535 return line2Address; 536 } 537 538 /** 539 * @return 540 * @hibernate.property column="PMT_LN3_ADDR" length="45" 541 */ 542 public String getLine3Address() { 543 return line3Address; 544 } 545 546 /** 547 * @return 548 * @hibernate.property column="PMT_LN4_ADDR" length="45" 549 */ 550 public String getLine4Address() { 551 return line4Address; 552 } 553 554 /** 555 * @return 556 * @hibernate.property column="NRA_PMT_IND" type="yes_no" 557 */ 558 public Boolean getNraPayment() { 559 return nraPayment; 560 } 561 562 /** 563 * @return 564 * @hibernate.property column="PAYEE_ID" length="25" 565 */ 566 public String getPayeeId() { 567 return payeeId; 568 } 569 570 /** 571 * @return 572 * @hibernate.property column="PAYEE_ID_TYP_CD" length="1" 573 */ 574 public String getPayeeIdTypeCd() { 575 return payeeIdTypeCd; 576 } 577 578 /** 579 * @return 580 * @hibernate.property column="PMT_PAYEE_NM" length="40" 581 */ 582 public String getPayeeName() { 583 return payeeName; 584 } 585 586 /** 587 * @return 588 * @hibernate.property column="PAYEE_OWNR_CD" length="2" 589 */ 590 public String getPayeeOwnerCd() { 591 return payeeOwnerCd; 592 } 593 594 /** 595 * @return 596 * @hibernate.property column="PMT_DT" 597 */ 598 public Date getPaymentDate() { 599 return paymentDate; 600 } 601 602 /** 603 * @return 604 * @hibernate.many-to-one column="PMT_STAT_CD" class="edu.iu.uis.pdp.bo.PaymentStatus" not-null="true" 605 */ 606 public PaymentStatus getPaymentStatus() { 607 return paymentStatus; 608 } 609 610 /** 611 * @return 612 * @hibernate.property column="PHYS_CMP_PROC_CD" length="2" 613 */ 614 public String getPhysCampusProcessCd() { 615 return physCampusProcessCd; 616 } 617 618 /** 619 * @return 620 * @hibernate.many-to-one column="PROC_ID" class="edu.iu.uis.pdp.bo.PaymentProcess" not-null="false" 621 */ 622 public PaymentProcess getProcess() { 623 return process; 624 } 625 626 /** 627 * @return 628 * @hibernate.property column="PROC_IMD_IND" type="yes_no" length="1" 629 */ 630 public Boolean getProcessImmediate() { 631 return processImmediate; 632 } 633 634 /** 635 * @return 636 * @hibernate.property column="PMT_ATTCHMNT_IND" type="yes_no" length="1" 637 */ 638 public Boolean getPymtAttachment() { 639 return pymtAttachment; 640 } 641 642 /** 643 * @return 644 * @hibernate.property column="PMT_SPCL_HANDLG_IND" type="yes_no" length="1" 645 */ 646 public Boolean getPymtSpecialHandling() { 647 return pymtSpecialHandling; 648 } 649 650 /** 651 * @return 652 * @hibernate.property column="PMT_TXBL_IND" type="yes_no" length="1" 653 */ 654 public Boolean getTaxablePayment() { 655 return taxablePayment; 656 } 657 658 /** 659 * @return 660 * @hibernate.property column="PMT_ZIP_CD" length="2" 661 */ 662 public String getZipCd() { 663 return zipCd; 664 } 665 666 /** 667 * @param integer 668 */ 669 public void setAchBankRoutingNbr(String s) { 670 achBankRoutingNbr = s; 671 } 672 673 /** 674 * @param string 675 */ 676 public void setAdviceEmailAddress(String string) { 677 adviceEmailAddress = string; 678 } 679 680 /** 681 * @param string 682 */ 683 public void setAlternatePayeeId(String string) { 684 alternatePayeeId = string; 685 } 686 687 /** 688 * @param string 689 */ 690 public void setAlternatePayeeIdTypeCd(String string) { 691 alternatePayeeIdTypeCd = string; 692 } 693 694 /** 695 * @param integer 696 */ 697 public void setBank(Bank bank) { 698 this.bank = bank; 699 } 700 701 /** 702 * @param integer 703 */ 704 public void setBatch(Batch b) { 705 batch = b; 706 } 707 708 /** 709 * @param boolean1 710 */ 711 public void setCampusAddress(Boolean boolean1) { 712 campusAddress = boolean1; 713 } 714 715 /** 716 * @param decimal 717 */ 718 public void setCreditMemoAmount(KualiDecimal decimal) { 719 creditMemoAmount = decimal; 720 } 721 722 public void setCreditMemoAmount(String decimal) { 723 creditMemoAmount = new KualiDecimal(decimal); 724 } 725 726 /** 727 * @param string 728 */ 729 public void setCreditMemoNbr(String string) { 730 creditMemoNbr = string; 731 } 732 733 /** 734 * @param string 735 */ 736 public void setCustomerInstitutionNumber(String string) { 737 customerInstitutionNumber = string; 738 } 739 740 /** 741 * @param timestamp 742 */ 743 public void setDisbursementDate(Date timestamp) { 744 disbursementDate = timestamp; 745 } 746 747 /** 748 * This method sets disbursementDate. 749 * @param disbursementDate a string representing the disbursementDate 750 * @throws ParseException 751 */ 752 public void setDisbursementDate(String disbursementDate) throws ParseException { 753 this.disbursementDate = SpringContext.getBean(DateTimeService.class).convertToSqlDate(disbursementDate); 754 } 755 756 /** 757 * @param integer 758 */ 759 public void setDisbursementNbr(KualiInteger integer) { 760 disbursementNbr = integer; 761 } 762 763 public void setDisbursementNbr(String integer) { 764 disbursementNbr = new KualiInteger(integer); 765 } 766 767 /** 768 * @param string 769 */ 770 public void setDisbursementType(DisbursementType dt) { 771 disbursementType = dt; 772 } 773 774 /** 775 * @param integer 776 */ 777 public void setId(KualiInteger integer) { 778 id = integer; 779 } 780 781 /** 782 * @param boolean1 783 */ 784 public void setEmployeeIndicator(Boolean boolean1) { 785 employeeIndicator = boolean1; 786 } 787 788 /** 789 * @param string 790 */ 791 public void setLine1Address(String string) { 792 line1Address = string; 793 } 794 795 /** 796 * @param string 797 */ 798 public void setLine2Address(String string) { 799 line2Address = string; 800 } 801 802 /** 803 * @param string 804 */ 805 public void setLine3Address(String string) { 806 line3Address = string; 807 } 808 809 /** 810 * @param string 811 */ 812 public void setLine4Address(String string) { 813 line4Address = string; 814 } 815 816 /** 817 * @param boolean1 818 */ 819 public void setNraPayment(Boolean boolean1) { 820 nraPayment = boolean1; 821 } 822 823 /** 824 * @param string 825 */ 826 public void setPayeeId(String string) { 827 payeeId = string; 828 } 829 830 /** 831 * @param string 832 */ 833 public void setPayeeIdTypeCd(String string) { 834 payeeIdTypeCd = string; 835 } 836 837 /** 838 * @param string 839 */ 840 public void setPayeeName(String string) { 841 payeeName = string; 842 } 843 844 /** 845 * @param string 846 */ 847 public void setPayeeOwnerCd(String string) { 848 payeeOwnerCd = string; 849 } 850 851 /** 852 * @param timestamp 853 */ 854 public void setPaymentDate(Date timestamp) { 855 paymentDate = timestamp; 856 } 857 858 /** 859 * Takes a <code>String</code> and attempt to format as <code>Timestamp</code for setting the 860 * paymentDate field 861 * 862 * @param paymentDate Timestamp as string 863 */ 864 public void setPaymentDate(String paymentDate) throws ParseException { 865 this.paymentDate = SpringContext.getBean(DateTimeService.class).convertToSqlDate(paymentDate); 866 } 867 868 /** 869 * @param string 870 */ 871 public void setPaymentStatus(PaymentStatus stat) { 872 paymentStatus = stat; 873 } 874 875 /** 876 * @param string 877 */ 878 public void setPhysCampusProcessCd(String string) { 879 physCampusProcessCd = string; 880 } 881 882 /** 883 * @param integer 884 */ 885 public void setProcess(PaymentProcess p) { 886 if (p != null) { 887 processId = p.getId(); 888 } 889 else { 890 processId = null; 891 } 892 this.process = p; 893 } 894 895 /** 896 * @param boolean1 897 */ 898 public void setProcessImmediate(Boolean boolean1) { 899 processImmediate = boolean1; 900 } 901 902 /** 903 * @param boolean1 904 */ 905 public void setPymtAttachment(Boolean boolean1) { 906 pymtAttachment = boolean1; 907 } 908 909 /** 910 * @param boolean1 911 */ 912 public void setTaxablePayment(Boolean boolean1) { 913 taxablePayment = boolean1; 914 } 915 916 /** 917 * @param string 918 */ 919 public void setZipCd(String string) { 920 zipCd = string; 921 } 922 923 /** 924 * @param string 925 */ 926 public void setPymtSpecialHandling(Boolean pymtSpecialHandling) { 927 this.pymtSpecialHandling = pymtSpecialHandling; 928 } 929 930 public String toStringKey() { 931 StringBuffer buffer = new StringBuffer(); 932 CustomerProfile customerProfile = batch.getCustomerProfile(); 933 934 buffer.append(PdpPropertyConstants.CustomerProfile.CUSTOMER_PROFILE_CHART_CODE); 935 buffer.append("="); 936 buffer.append(customerProfile.getChartCode()); 937 buffer.append(PdpPropertyConstants.CustomerProfile.CUSTOMER_PROFILE_UNIT_CODE); 938 buffer.append("="); 939 buffer.append(customerProfile.getUnitCode()); 940 buffer.append(PdpPropertyConstants.CustomerProfile.CUSTOMER_PROFILE_SUB_UNIT_CODE); 941 buffer.append("="); 942 buffer.append(customerProfile.getSubUnitCode()); 943 buffer.append(PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_PAYEE_NAME); 944 buffer.append("="); 945 buffer.append(payeeName); 946 buffer.append(PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_LINE1_ADDRESS); 947 buffer.append("="); 948 buffer.append(line1Address); 949 buffer.append(PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_PAYEE_ID); 950 buffer.append("="); 951 buffer.append(payeeId); 952 buffer.append(PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_PAYEE_ID_TYPE_CODE); 953 buffer.append("="); 954 buffer.append(payeeIdTypeCd); 955 buffer.append(PdpPropertyConstants.PaymentGroup.PAYMENT_GROUP_BANK_CODE); 956 buffer.append("="); 957 buffer.append(bankCode); 958 959 return buffer.toString(); 960 } 961 962 /** 963 * @return Returns the achAccountType. 964 */ 965 public String getAchAccountType() { 966 return achAccountType; 967 } 968 969 /** 970 * @param achAccountType The achAccountType to set. 971 */ 972 public void setAchAccountType(String achAccountType) { 973 this.achAccountType = achAccountType; 974 } 975 976 public Timestamp getEpicPaymentCancelledExtractedDate() { 977 return epicPaymentCancelledExtractedDate; 978 } 979 980 public void setEpicPaymentCancelledExtractedDate(Timestamp epicPaymentCancelledExtractedDate) { 981 this.epicPaymentCancelledExtractedDate = epicPaymentCancelledExtractedDate; 982 } 983 984 public Timestamp getEpicPaymentPaidExtractedDate() { 985 return epicPaymentPaidExtractedDate; 986 } 987 988 public void setEpicPaymentPaidExtractedDate(Timestamp epicPaymentPaidExtractedDate) { 989 this.epicPaymentPaidExtractedDate = epicPaymentPaidExtractedDate; 990 } 991 992 /** 993 * Gets the batchId attribute. 994 * 995 * @return Returns the batchId. 996 */ 997 public KualiInteger getBatchId() { 998 return batchId; 999 } 1000 1001 /** 1002 * Sets the batchId attribute value. 1003 * 1004 * @param batchId The batchId to set. 1005 */ 1006 public void setBatchId(KualiInteger batchId) { 1007 this.batchId = batchId; 1008 } 1009 1010 @Override 1011 protected LinkedHashMap toStringMapper() { 1012 LinkedHashMap m = new LinkedHashMap(); 1013 1014 m.put(KFSPropertyConstants.ID, this.id); 1015 1016 return m; 1017 } 1018 1019 public String getDisbursementTypeCode() { 1020 return disbursementTypeCode; 1021 } 1022 1023 public void setDisbursementTypeCode(String disbursementTypeCode) { 1024 this.disbursementTypeCode = disbursementTypeCode; 1025 } 1026 1027 public KualiInteger getProcessId() { 1028 return processId; 1029 } 1030 1031 public void setProcessId(KualiInteger processId) { 1032 this.processId = processId; 1033 } 1034 1035 public void setPaymentStatusCode(String paymentStatusCode) { 1036 this.paymentStatusCode = paymentStatusCode; 1037 } 1038 1039 public void setId_type(String idType) { 1040 this.payeeIdTypeCd = idType; 1041 } 1042 1043 /** 1044 * Gets the adviceEmailSentDate attribute. 1045 * 1046 * @return Returns the adviceEmailSentDate. 1047 */ 1048 public Timestamp getAdviceEmailSentDate() { 1049 return adviceEmailSentDate; 1050 } 1051 1052 /** 1053 * Sets the adviceEmailSentDate attribute value. 1054 * 1055 * @param adviceEmailSentDate The adviceEmailSentDate to set. 1056 */ 1057 public void setAdviceEmailSentDate(Timestamp adviceEmailSentDate) { 1058 this.adviceEmailSentDate = adviceEmailSentDate; 1059 } 1060 1061 /** 1062 * This method gets a string representation of the address lines 1063 * @return the street as a combined representation of the address lines 1064 */ 1065 public String getStreet() { 1066 StringBuffer street = new StringBuffer(); 1067 1068 street.append(StringUtils.isNotBlank(line1Address) ? (line1Address + KFSConstants.NEWLINE) : KFSConstants.EMPTY_STRING); 1069 street.append(StringUtils.isNotBlank(line2Address) ? (line2Address + KFSConstants.NEWLINE) : KFSConstants.EMPTY_STRING); 1070 street.append(StringUtils.isNotBlank(line3Address) ? (line3Address + KFSConstants.NEWLINE) : KFSConstants.EMPTY_STRING); 1071 street.append(StringUtils.isNotBlank(line4Address) ? (line4Address + KFSConstants.NEWLINE) : KFSConstants.EMPTY_STRING); 1072 1073 return street.toString(); 1074 } 1075 1076 /** 1077 * This method gets the payeeIdTypeDesc 1078 * @return the payeeIdTypeDesc 1079 */ 1080 public String getPayeeIdTypeDesc() { 1081 String payeeIdTypeCd = getPayeeIdTypeCd(); 1082 List<PayeeType> boList = (List) SpringContext.getBean(KeyValuesService.class).findAll(PayeeType.class); 1083 for (PayeeType payeeType : boList) { 1084 if (payeeType.getCode().equalsIgnoreCase(payeeIdTypeCd)) { 1085 return payeeType.getName(); 1086 } 1087 } 1088 return KFSConstants.EMPTY_STRING; 1089 } 1090 }