1
2
3
4
5
6
7
8
9
10
11
12
13
14
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.PurchaseOrderDocument;
20 import org.kuali.ole.module.purap.document.PurchasingDocument;
21 import org.kuali.rice.krad.util.ObjectUtils;
22
23 import java.util.LinkedHashMap;
24
25 public class PurchaseOrderCapitalAssetItem extends PurchasingCapitalAssetItemBase {
26
27 private String documentNumber;
28
29 public PurchaseOrderCapitalAssetItem() {
30 super();
31 }
32
33 public PurchaseOrderCapitalAssetItem(RequisitionCapitalAssetItem reqAssetItem, Integer itemIdentifier) {
34 this.setItemIdentifier(itemIdentifier);
35 this.setCapitalAssetTransactionTypeCode(reqAssetItem.getCapitalAssetTransactionTypeCode());
36 if (ObjectUtils.isNotNull(reqAssetItem.getPurchasingCapitalAssetSystem())) {
37 this.setPurchasingCapitalAssetSystem(new PurchaseOrderCapitalAssetSystem((RequisitionCapitalAssetSystem) reqAssetItem.getPurchasingCapitalAssetSystem()));
38 }
39 }
40
41 public String getDocumentNumber() {
42 return documentNumber;
43 }
44
45 public void setDocumentNumber(String documentNumber) {
46 this.documentNumber = documentNumber;
47 }
48
49
50 public void setPurchasingDocument(PurchasingDocument pd) {
51 super.setPurchasingDocument(pd);
52
53 PurchaseOrderDocument po = (PurchaseOrderDocument) pd;
54 if (po != null) {
55 setDocumentNumber(po.getDocumentNumber());
56 }
57 }
58
59 @Override
60 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
61 LinkedHashMap m = new LinkedHashMap();
62 if (this.getCapitalAssetItemIdentifier() != null) {
63 m.put("capitalAssetItemIdentifier", this.getCapitalAssetItemIdentifier().toString());
64 }
65 if (this.getItemIdentifier() != null) {
66 m.put("itemIdentifier", this.getItemIdentifier().toString());
67 }
68 if (this.documentNumber != null) {
69 m.put("documentNumber", this.documentNumber);
70 }
71 return m;
72 }
73
74 @Override
75 public ItemCapitalAsset setupNewPurchasingItemCapitalAssetLine() {
76 ItemCapitalAsset asset = new PurchaseOrderItemCapitalAsset();
77 return asset;
78 }
79 }