01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.kuali.module.purap.bo;
18:
19: import org.kuali.core.util.KualiDecimal;
20: import org.kuali.core.util.ObjectUtils;
21:
22: /**
23: * Purchase Order Account Business Object.
24: */
25: public class PurchaseOrderAccount extends PurApAccountingLineBase {
26:
27: /**
28: * NOTE FOR POTENTIAL ACCOUNTING LINE REFACTORING documentNumber is needed for PO accounts and not for other PURAP docs, however
29: * it is already defined in AccountingLineBase so we don't need to add it here
30: */
31: // private String documentNumber;
32: private KualiDecimal itemAccountOutstandingEncumbranceAmount;
33:
34: private PurchaseOrderItem purchaseOrderItem;
35:
36: /**
37: * Default constructor.
38: */
39: public PurchaseOrderAccount() {
40:
41: }
42:
43: public PurchaseOrderAccount(PurApAccountingLine ra) {
44: this .setAccountLinePercent(ra.getAccountLinePercent());
45: this .setAccountNumber(ra.getAccountNumber());
46: this .setChartOfAccountsCode(ra.getChartOfAccountsCode());
47: this .setFinancialObjectCode(ra.getFinancialObjectCode());
48: this .setFinancialSubObjectCode(ra.getFinancialSubObjectCode());
49: this
50: .setOrganizationReferenceId(ra
51: .getOrganizationReferenceId());
52: this .setProjectCode(ra.getProjectCode());
53: this .setSubAccountNumber(ra.getSubAccountNumber());
54: }
55:
56: /**
57: * @see org.kuali.module.purap.bo.PurApAccountingLine#getAlternateAmountForGLEntryCreation()
58: */
59: public KualiDecimal getAlternateAmountForGLEntryCreation() {
60: if (ObjectUtils.isNull(super
61: .getAlternateAmountForGLEntryCreation())) {
62: return getItemAccountOutstandingEncumbranceAmount();
63: }
64: return super .getAlternateAmountForGLEntryCreation();
65: }
66:
67: public KualiDecimal getItemAccountOutstandingEncumbranceAmount() {
68: return itemAccountOutstandingEncumbranceAmount;
69: }
70:
71: public void setItemAccountOutstandingEncumbranceAmount(
72: KualiDecimal itemAccountOutstandingEncumbranceAmount) {
73: this .itemAccountOutstandingEncumbranceAmount = itemAccountOutstandingEncumbranceAmount;
74: }
75:
76: public PurchaseOrderItem getPurchaseOrderItem() {
77: return purchaseOrderItem;
78: }
79:
80: /**
81: * Sets the purchaseOrderItem attribute value.
82: *
83: * @param purchaseOrderItem The purchaseOrderItem to set.
84: * @deprecated
85: */
86: public void setPurchaseOrderItem(PurchaseOrderItem purchaseOrderItem) {
87: this.purchaseOrderItem = purchaseOrderItem;
88: }
89:
90: }
|