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