View Javadoc
1   /*
2    * Copyright 2006-2008 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
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  package org.kuali.ole.module.purap.businessobject;
17  
18  import org.kuali.ole.integration.purap.ItemCapitalAsset;
19  import org.kuali.ole.module.purap.document.OlePurchasingDocument;
20  import org.kuali.ole.module.purap.document.PurchasingDocument;
21  import org.kuali.ole.module.purap.document.RequisitionDocument;
22  import org.kuali.rice.krad.util.ObjectUtils;
23  
24  public class RequisitionCapitalAssetItem extends PurchasingCapitalAssetItemBase {
25  
26      private Integer purapDocumentIdentifier;
27  
28      public RequisitionCapitalAssetItem() {
29          super();
30          this.setPurchasingCapitalAssetSystem(new RequisitionCapitalAssetSystem());
31      }
32  
33      public RequisitionCapitalAssetItem(OlePurchasingDocument pd) {
34          super(pd);
35          setPurapDocumentIdentifier(pd.getPurapDocumentIdentifier());
36          this.setPurchasingCapitalAssetSystem(new RequisitionCapitalAssetSystem());
37      }
38  
39      public RequisitionCapitalAssetItem(PurchasingCapitalAssetItem reqAssetItem, Integer itemIdentifier) {
40          this.setItemIdentifier(itemIdentifier);
41          this.setCapitalAssetTransactionTypeCode(reqAssetItem.getCapitalAssetTransactionTypeCode());
42          if (ObjectUtils.isNotNull(reqAssetItem.getPurchasingCapitalAssetSystem())) {
43              this.setPurchasingCapitalAssetSystem(new PurchaseOrderCapitalAssetSystem(reqAssetItem.getPurchasingCapitalAssetSystem()));
44          }
45      }
46  
47      public Integer getPurapDocumentIdentifier() {
48          return purapDocumentIdentifier;
49      }
50  
51      public void setPurapDocumentIdentifier(Integer purapDocumentIdentifier) {
52          this.purapDocumentIdentifier = purapDocumentIdentifier;
53      }
54  
55      @Override
56      public void setPurchasingDocument(OlePurchasingDocument pd) {
57          super.setPurchasingDocument(pd);
58  
59          RequisitionDocument req = (RequisitionDocument) pd;
60          if (req != null) {
61              setPurapDocumentIdentifier(req.getPurapDocumentIdentifier());
62          }
63      }
64  
65      @Override
66      public void setPurchasingDocument(PurchasingDocument pd) {
67  
68      }
69  
70      @Override
71      public ItemCapitalAsset setupNewPurchasingItemCapitalAssetLine() {
72          ItemCapitalAsset asset = new RequisitionItemCapitalAsset();
73          return asset;
74      }
75  
76  }