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.PurchasingDocument;
20  import org.kuali.ole.module.purap.document.RequisitionDocument;
21  import org.kuali.rice.krad.util.ObjectUtils;
22  
23  public class RequisitionCapitalAssetItem extends PurchasingCapitalAssetItemBase {
24  
25      private Integer purapDocumentIdentifier;
26  
27      public RequisitionCapitalAssetItem() {
28          super();
29          this.setPurchasingCapitalAssetSystem(new RequisitionCapitalAssetSystem());
30      }
31  
32      public RequisitionCapitalAssetItem(PurchasingDocument pd) {
33          super(pd);
34          setPurapDocumentIdentifier(pd.getPurapDocumentIdentifier());
35          this.setPurchasingCapitalAssetSystem(new RequisitionCapitalAssetSystem());
36      }
37  
38      public RequisitionCapitalAssetItem(PurchasingCapitalAssetItem reqAssetItem, Integer itemIdentifier) {
39          this.setItemIdentifier(itemIdentifier);
40          this.setCapitalAssetTransactionTypeCode(reqAssetItem.getCapitalAssetTransactionTypeCode());
41          if (ObjectUtils.isNotNull(reqAssetItem.getPurchasingCapitalAssetSystem())) {
42              this.setPurchasingCapitalAssetSystem(new PurchaseOrderCapitalAssetSystem(reqAssetItem.getPurchasingCapitalAssetSystem()));
43          }
44      }
45  
46      public Integer getPurapDocumentIdentifier() {
47          return purapDocumentIdentifier;
48      }
49  
50      public void setPurapDocumentIdentifier(Integer purapDocumentIdentifier) {
51          this.purapDocumentIdentifier = purapDocumentIdentifier;
52      }
53  
54      @Override
55      public void setPurchasingDocument(PurchasingDocument pd) {
56          super.setPurchasingDocument(pd);
57  
58          RequisitionDocument req = (RequisitionDocument) pd;
59          if (req != null) {
60              setPurapDocumentIdentifier(req.getPurapDocumentIdentifier());
61          }
62      }
63  
64      @Override
65      public ItemCapitalAsset setupNewPurchasingItemCapitalAssetLine() {
66          ItemCapitalAsset asset = new RequisitionItemCapitalAsset();
67          return asset;
68      }
69  
70  }