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