1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.select.document;
17
18 import org.kuali.ole.module.purap.document.PurchaseOrderRemoveHoldDocument;
19 import org.kuali.ole.module.purap.document.RequisitionDocument;
20 import org.kuali.ole.select.document.service.OlePurchaseOrderDocumentHelperService;
21 import org.kuali.ole.sys.OLEConstants;
22 import org.kuali.ole.sys.context.SpringContext;
23 import org.kuali.ole.vnd.businessobject.VendorAlias;
24 import org.kuali.rice.krad.rules.rule.event.KualiDocumentEvent;
25
26 import java.util.HashMap;
27 import java.util.List;
28 import java.util.Map;
29
30
31
32
33 public class OlePurchaseOrderRemoveHoldDocument extends PurchaseOrderRemoveHoldDocument {
34 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OlePurchaseOrderRemoveHoldDocument.class);
35
36
37
38
39
40 private String vendorPoNumber;
41
42 public String getVendorPoNumber() {
43 return vendorPoNumber;
44 }
45
46 public void setVendorPoNumber(String vendorPoNumber) {
47 this.vendorPoNumber = vendorPoNumber;
48 }
49
50
51 @Override
52 public void populatePurchaseOrderFromRequisition(RequisitionDocument requisitionDocument) {
53
54 LOG.debug("Inside populatePurchaseOrderFromRequisition of OlePurchaseOrderRemoveHoldDocument");
55 SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).populatePurchaseOrderFromRequisition(this, requisitionDocument);
56 }
57
58
59
60
61
62
63 @Override
64 public void prepareForSave(KualiDocumentEvent event) {
65
66 LOG.debug("Inside prepareForSave of OlePurchaseOrderRemoveHoldDocument");
67 SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).prepareForSave(this, event);
68 super.prepareForSave(event);
69
70 }
71
72
73
74
75
76
77 @Override
78 public void processAfterRetrieve() {
79 LOG.debug("Inside processAfterRetrieve of OlePurchaseOrderRemoveHoldDocument");
80 if (this.getVendorAliasName() == null) {
81 populateVendorAliasName();
82 }
83 SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).processAfterRetrieve(this);
84 }
85
86 @Override
87 public List getItemsActiveOnly() {
88 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getItemsActiveOnly(this);
89 }
90
91
92
93
94
95
96 @Override
97 public List getItemsActiveOnlySetupAlternateAmount() {
98 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getItemsActiveOnlySetupAlternateAmount(this);
99 }
100
101 @Override
102 public boolean getAdditionalChargesExist() {
103 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getAdditionalChargesExist(this);
104 }
105
106
107
108
109
110
111 public boolean getIsFinalReqs() {
112 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getIsFinalReqs(this);
113 }
114
115 public boolean getIsSplitPO() {
116 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getIsSplitPO(this);
117 }
118
119 public boolean getIsReOpenPO() {
120 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getIsReOpenPO(this);
121 }
122
123
124
125
126
127
128 public String getBibeditorCreateURL() {
129 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getBibeditorCreateURL();
130 }
131
132 public String getBibSearchURL() {
133 LOG.debug("Inside getBibSearchURL of OlePurchaseOrderRemoveHoldDocument");
134 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getBibSearchURL();
135 }
136
137
138
139
140
141
142 public String getBibeditorEditURL() {
143 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getBibeditorEditURL();
144 }
145
146
147
148
149
150
151 public String getDublinEditorEditURL() {
152 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getDublinEditorEditURL();
153 }
154
155
156
157
158
159 public String getInstanceEditorURL() {
160 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getInstanceEditorURL();
161 }
162
163
164
165
166
167
168 public String getBibeditorViewURL() {
169 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getBibeditorViewURL();
170 }
171
172
173
174
175
176 public String getDublinEditorViewURL() {
177 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getDublinEditorViewURL();
178 }
179
180
181
182
183
184 public String getMarcXMLFileDirLocation() throws Exception {
185 return SpringContext.getBean(OlePurchaseOrderDocumentHelperService.class).getMarcXMLFileDirLocation();
186 }
187
188
189
190
191
192
193 public boolean getIsSaved() {
194 if (this.getDocumentHeader().getWorkflowDocument().isSaved() || this.getDocumentHeader().getWorkflowDocument().isInitiated()) {
195 return true;
196 }
197 return false;
198 }
199
200 public boolean getIsATypeOfRCVGDoc() {
201 return false;
202 }
203
204 public boolean getIsATypeOfCORRDoc() {
205 return false;
206 }
207
208 private void populateVendorAliasName() {
209 Map vendorDetailMap = new HashMap();
210 vendorDetailMap.put(OLEConstants.VENDOR_HEADER_IDENTIFIER, this.getVendorHeaderGeneratedIdentifier());
211 vendorDetailMap.put(OLEConstants.VENDOR_DETAIL_IDENTIFIER, this.getVendorDetailAssignedIdentifier());
212 List<VendorAlias> vendorDetailList = (List) getBusinessObjectService().findMatching(VendorAlias.class, vendorDetailMap);
213 if (vendorDetailList != null && vendorDetailList.size() > 0) {
214 this.setVendorAliasName(vendorDetailList.get(0).getVendorAliasName());
215 }
216 }
217 }