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.module.purap.businessobject; 018 019 import org.kuali.kfs.module.purap.util.PurApObjectUtils; 020 import org.kuali.kfs.sys.businessobject.AccountingLineBase; 021 import org.kuali.rice.kns.util.KualiDecimal; 022 023 /** 024 * Payment Request Account Business Object. 025 */ 026 public class PaymentRequestAccount extends PurApAccountingLineBase { 027 028 private KualiDecimal disencumberedAmount = KualiDecimal.ZERO; 029 030 /** 031 * Default constructor. 032 */ 033 public PaymentRequestAccount() { 034 035 } 036 037 /** 038 * Constructor. 039 * 040 * @param item - payment request item 041 * @param poa - purchase order account 042 */ 043 public PaymentRequestAccount(PaymentRequestItem item, PurchaseOrderAccount poa) { 044 // copy base attributes 045 PurApObjectUtils.populateFromBaseClass(AccountingLineBase.class, poa, this); 046 // copy percent 047 this.setAccountLinePercent(poa.getAccountLinePercent()); 048 setItemIdentifier(item.getItemIdentifier()); 049 setPaymentRequestItem(item); 050 } 051 052 public KualiDecimal getDisencumberedAmount() { 053 return disencumberedAmount; 054 } 055 056 public void setDisencumberedAmount(KualiDecimal disencumberedAmount) { 057 this.disencumberedAmount = disencumberedAmount; 058 } 059 060 public PaymentRequestItem getPaymentRequestItem() { 061 return super.getPurapItem(); 062 } 063 064 public void setPaymentRequestItem(PaymentRequestItem paymentRequestItem) { 065 super.setPurapItem(paymentRequestItem); 066 } 067 068 /** 069 * Caller of this method should take care of creating PaymentRequestItems 070 */ 071 public void copyFrom(PaymentRequestAccount other) { 072 super.copyFrom(other); 073 setDisencumberedAmount(other.getDisencumberedAmount()); 074 } 075 076 }