1 package org.kuali.ole.select.document;
2
3 import org.kuali.ole.select.businessobject.OlePurchaseOrderItem;
4 import org.kuali.ole.sys.OLEConstants;
5 import org.kuali.rice.core.api.config.property.ConfigContext;
6 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
7 import org.kuali.rice.krad.service.BusinessObjectService;
8 import org.kuali.rice.krad.service.KRADServiceLocator;
9 import java.util.HashMap;
10 import java.util.List;
11 import java.util.Map;
12
13
14
15
16
17
18
19
20 public class OLEEResourcePO extends PersistableBusinessObjectBase {
21 private String oleEResPOId;
22 private String oleERSIdentifier;
23 private Integer olePOItemId;
24 private String redirectUrl;
25 private String instanceId;
26 private String title;
27 private Integer paidAmountCurrentFY;
28 private Integer paidAmountPreviousFY;
29 private Integer paidAmountTwoYearsPreviousFY;
30 private String purpose;
31 private String poItemId;
32 private OLEEResourceRecordDocument oleERSDocument;
33
34 private BusinessObjectService businessObjectService;
35 public BusinessObjectService getBusinessObjectService() {
36 if (null == businessObjectService) {
37 businessObjectService = KRADServiceLocator.getBusinessObjectService();
38 }
39 return businessObjectService;
40 }
41
42 public String getPoItemId() {
43 return poItemId;
44 }
45
46 public void setPoItemId(String poItemId) {
47 this.poItemId = poItemId;
48 }
49
50 public String getOleEResPOId() {
51 return oleEResPOId;
52 }
53
54 public void setOleEResPOId(String oleEResPOId) {
55 this.oleEResPOId = oleEResPOId;
56 }
57
58 public String getOleERSIdentifier() {
59 return oleERSIdentifier;
60 }
61
62 public void setOleERSIdentifier(String oleERSIdentifier) {
63 this.oleERSIdentifier = oleERSIdentifier;
64 }
65
66 public String getTitle() {
67 return title;
68 }
69
70 public void setTitle(String title) {
71 this.title = title;
72 }
73
74 public Integer getOlePOItemId() {
75 return olePOItemId;
76 }
77
78 public void setOlePOItemId(Integer olePOItemId) {
79 this.olePOItemId = olePOItemId;
80 }
81
82 public String getRedirectUrl() {
83 String purchaseOrderLineItemIdentifier = this.getOlePOItemId().toString();
84 if (purchaseOrderLineItemIdentifier != null && !"".equals(purchaseOrderLineItemIdentifier)) {
85 Map poNumber = new HashMap();
86 poNumber.put(OLEConstants.PUR_DOC_IDENTIFIER, purchaseOrderLineItemIdentifier);
87 List<OlePurchaseOrderDocument> olePurchaseOrderDocumentList = (List) getBusinessObjectService().findMatching(OlePurchaseOrderDocument.class, poNumber);
88 for (OlePurchaseOrderDocument olePurchaseOrderDocument : olePurchaseOrderDocumentList) {
89 if (olePurchaseOrderDocument != null) {
90 boolean validPO = olePurchaseOrderDocument != null ? olePurchaseOrderDocument.getPurchaseOrderCurrentIndicatorForSearching() : false;
91 if (validPO) {
92 redirectUrl = ConfigContext.getCurrentContextConfig().getProperty("kew.url") + OLEConstants.PO_LINE_ITEM_URL + olePurchaseOrderDocument.getDocumentNumber();
93 }
94 }
95 }
96 }
97 return redirectUrl;
98 }
99
100 public void setRedirectUrl(String redirectUrl) {
101 this.redirectUrl = redirectUrl;
102 }
103
104 public Integer getPaidAmountCurrentFY() {
105 return paidAmountCurrentFY;
106 }
107
108 public void setPaidAmountCurrentFY(Integer paidAmountCurrentFY) {
109 this.paidAmountCurrentFY = paidAmountCurrentFY;
110 }
111
112 public Integer getPaidAmountPreviousFY() {
113 return paidAmountPreviousFY;
114 }
115
116 public void setPaidAmountPreviousFY(Integer paidAmountPreviousFY) {
117 this.paidAmountPreviousFY = paidAmountPreviousFY;
118 }
119
120 public Integer getPaidAmountTwoYearsPreviousFY() {
121 return paidAmountTwoYearsPreviousFY;
122 }
123
124 public void setPaidAmountTwoYearsPreviousFY(Integer paidAmountTwoYearsPreviousFY) {
125 this.paidAmountTwoYearsPreviousFY = paidAmountTwoYearsPreviousFY;
126 }
127
128 public String getPurpose() {
129 return purpose;
130 }
131
132 public void setPurpose(String purpose) {
133 this.purpose = purpose;
134 }
135
136 public String getInstanceId() {
137 return instanceId;
138 }
139
140 public void setInstanceId(String instanceId) {
141 this.instanceId = instanceId;
142 }
143
144 public OLEEResourceRecordDocument getOleERSDocument() {
145 return oleERSDocument;
146 }
147
148 public void setOleERSDocument(OLEEResourceRecordDocument oleERSDocument) {
149 this.oleERSDocument = oleERSDocument;
150 }
151 }