001package org.kuali.ole.select.form;
002
003import java.util.HashMap;
004import java.util.Map;
005
006import org.kuali.ole.select.document.OleInvoiceDocument;
007import org.kuali.rice.krad.web.form.TransactionalDocumentFormBase;
008
009/**
010 * Created with IntelliJ IDEA.
011 * User: anithaa
012 * Date: 7/8/13
013 * Time: 7:30 PM
014 * To change this template use File | Settings | File Templates.
015 */
016public class OLEInvoiceForm extends TransactionalDocumentFormBase {
017
018    private String sfcFailRouteMsg;
019    private String sfcFailApproveMsg;
020    private String itemLimit;
021
022    private String validationMessage;
023    private String validationFlag;
024    private String subscriptionValidationMessage;
025    private String blanketApproveSubscriptionDateValidationFlag;
026    private String subscriptionDateValidationMessage;
027    private String subscriptionDateValidationFlag;
028
029    private String duplicationMessage;
030    private String duplicationApproveMessage;
031
032    private boolean filterProcessItems = true;
033    private Boolean filterAdditionalCharges;
034
035    private String pageNumber;
036    private String selectRowDetails;
037    private boolean showSelectedRowDetails;
038
039    public String getSubscriptionDateValidationFlag() {
040        return subscriptionDateValidationFlag;
041    }
042
043    public void setSubscriptionDateValidationFlag(String subscriptionDateValidationFlag) {
044        this.subscriptionDateValidationFlag = subscriptionDateValidationFlag;
045    }
046
047    private String amountExceedsMessage;
048    private String amountExceedsMesgForBlankApp;
049
050    public String getSubscriptionDateValidationMessage() {
051        return subscriptionDateValidationMessage;
052    }
053
054    public void setSubscriptionDateValidationMessage(String subscriptionDateValidationMessage) {
055        this.subscriptionDateValidationMessage = subscriptionDateValidationMessage;
056    }
057
058    public String getSubscriptionValidationMessage() {
059        return subscriptionValidationMessage;
060    }
061
062    public void setSubscriptionValidationMessage(String subscriptionValidationMessage) {
063        this.subscriptionValidationMessage = subscriptionValidationMessage;
064    }
065
066    public String getBlanketApproveSubscriptionDateValidationFlag() {
067        return blanketApproveSubscriptionDateValidationFlag;
068    }
069
070    public void setBlanketApproveSubscriptionDateValidationFlag(String blanketApproveSubscriptionDateValidationFlag) {
071        this.blanketApproveSubscriptionDateValidationFlag = blanketApproveSubscriptionDateValidationFlag;
072    }
073
074    public String getAmountExceedsMesgForBlankApp() {
075        return amountExceedsMesgForBlankApp;
076    }
077
078    public void setAmountExceedsMesgForBlankApp(String amountExceedsMesgForBlankApp) {
079        this.amountExceedsMesgForBlankApp = amountExceedsMesgForBlankApp;
080    }
081
082    public String getAmountExceedsMessage() {
083        return amountExceedsMessage;
084    }
085
086    public void setAmountExceedsMessage(String amountExceedsMessage) {
087        this.amountExceedsMessage = amountExceedsMessage;
088    }
089
090    public OLEInvoiceForm() {
091        super();
092    }
093
094    @Override
095    protected String getDefaultDocumentTypeName() {
096        return "OLE_PRQS";
097    }
098
099    public String getSfcFailRouteMsg() {
100        return sfcFailRouteMsg;
101    }
102
103    public void setSfcFailRouteMsg(String sfcFailRouteMsg) {
104        this.sfcFailRouteMsg = sfcFailRouteMsg;
105    }
106
107    public String getSfcFailApproveMsg() {
108        return sfcFailApproveMsg;
109    }
110
111    public void setSfcFailApproveMsg(String sfcFailApproveMsg) {
112        this.sfcFailApproveMsg = sfcFailApproveMsg;
113    }
114
115    public String getItemLimit() {
116        return itemLimit;
117    }
118
119    public void setItemLimit(String itemLimit) {
120        this.itemLimit = itemLimit;
121    }
122
123    public String getValidationMessage() {
124        return validationMessage;
125    }
126
127    public void setValidationMessage(String validationMessage) {
128        this.validationMessage = validationMessage;
129    }
130
131    public String getValidationFlag() {
132        return validationFlag;
133    }
134
135    public void setValidationFlag(String validationFlag) {
136        this.validationFlag = validationFlag;
137    }
138
139    /**
140     * This method gets the duplicationMessage
141     * @return duplicationMessage
142     */
143    public String getDuplicationMessage() {
144        return duplicationMessage;
145    }
146
147    /**
148     * This method sets the duplicationMessage
149     * @param duplicationMessage
150     */
151    public void setDuplicationMessage(String duplicationMessage) {
152        this.duplicationMessage = duplicationMessage;
153    }
154
155    public String getDuplicationApproveMessage() {
156        return duplicationApproveMessage;
157    }
158
159    public void setDuplicationApproveMessage(String duplicationApproveMessage) {
160        this.duplicationApproveMessage = duplicationApproveMessage;
161    }
162
163        public boolean isFilterProcessItems() {
164                return filterProcessItems;
165        }
166
167        public void setFilterProcessItems(boolean filterProcessItems) {
168                this.filterProcessItems = filterProcessItems;
169        }
170
171        public boolean isFilterAdditionalCharges() {
172                if (filterAdditionalCharges == null) {
173                        OleInvoiceDocument doc = (OleInvoiceDocument) getDocument();
174                        filterAdditionalCharges = doc == null ? true : !doc.isAdditionalChargesFlag();
175                }
176                return filterAdditionalCharges;
177        }
178        
179        public void setFilterAdditionalCharges(boolean filterAdditionalCharges) {
180                this.filterAdditionalCharges = filterAdditionalCharges;
181        }
182
183        public boolean isFilterRequisition() {
184                Map<String, Object> ext = getExtensionData();
185                for (String k : ext.keySet())
186                        if (k != null && k.startsWith("requisition"))
187                                return false;
188                return true;
189        }
190        
191        public boolean showRequisition(String id) {
192                return Boolean.TRUE.equals(getExtensionData().get("requisition" + id));
193        }
194
195        public void setShowRequisitionFor(String id) {
196                Map<String, Object> ext = getExtensionData();
197                synchronized (ext) {
198                        ext.put("requisition" + id, Boolean.TRUE);
199                }
200        }
201        
202        public void setHideRequisitionFor(String id) {
203                Map<String, Object> ext = getExtensionData();
204                synchronized (ext) {
205                        ext.remove("requisition" + id);
206                }
207        }
208        
209        public boolean isFilterLineItemReceiving() {
210                Map<String, Object> ext = getExtensionData();
211                for (String k : ext.keySet())
212                        if (k != null && k.startsWith("LineItemReceiving"))
213                                return false;
214                return true;
215        }
216        
217        public boolean showLineItemReceiving(String id) {
218                return Boolean.TRUE.equals(getExtensionData().get("LineItemReceiving" + id));
219        }
220
221        public void setShowLineItemReceivingFor(String id) {
222                Map<String, Object> ext = getExtensionData();
223                synchronized (ext) {
224                        ext.put("LineItemReceiving" + id, Boolean.TRUE);
225                }
226        }
227        
228        public void setHideLineItemReceivingFor(String id) {
229                Map<String, Object> ext = getExtensionData();
230                synchronized (ext) {
231                        ext.remove("LineItemReceiving" + id);
232                }
233        }
234        
235        public boolean isFilterCorrection() {
236                Map<String, Object> ext = getExtensionData();
237                for (String k : ext.keySet())
238                        if (k != null && k.startsWith("Correction"))
239                                return false;
240                return true;
241        }
242        
243        public boolean showCorrection(String id) {
244                return Boolean.TRUE.equals(getExtensionData().get("Correction" + id));
245        }
246
247        public void setShowCorrectionFor(String id) {
248                Map<String, Object> ext = getExtensionData();
249                synchronized (ext) {
250                        ext.put("Correction" + id, Boolean.TRUE);
251                }
252        }
253        
254        public void setHideCorrectionFor(String id) {
255                Map<String, Object> ext = getExtensionData();
256                synchronized (ext) {
257                        ext.remove("Correction" + id);
258                }
259        }
260        
261        public boolean isFilterPaymentRequest() {
262                Map<String, Object> ext = getExtensionData();
263                for (String k : ext.keySet())
264                        if (k != null && k.startsWith("PaymentRequest"))
265                                return false;
266                return true;
267        }
268        
269        public boolean showPaymentRequest(String id) {
270                return Boolean.TRUE.equals(getExtensionData().get("PaymentRequest" + id));
271        }
272
273        public void setShowPaymentRequestFor(String id) {
274                Map<String, Object> ext = getExtensionData();
275                synchronized (ext) {
276                        ext.put("PaymentRequest" + id, Boolean.TRUE);
277                }
278        }
279        
280        public void setHidePaymentRequestFor(String id) {
281                Map<String, Object> ext = getExtensionData();
282                synchronized (ext) {
283                        ext.remove("PaymentRequest" + id);
284                }
285        }
286        
287        public boolean isFilterCreditMemo() {
288                Map<String, Object> ext = getExtensionData();
289                for (String k : ext.keySet())
290                        if (k != null && k.startsWith("CreditMemo"))
291                                return false;
292                return true;
293        }
294        
295        public boolean showCreditMemo(String id) {
296                return Boolean.TRUE.equals(getExtensionData().get("CreditMemo" + id));
297        }
298
299        public void setShowCreditMemoFor(String id) {
300                Map<String, Object> ext = getExtensionData();
301                synchronized (ext) {
302                        ext.put("CreditMemo" + id, Boolean.TRUE);
303                }
304        }
305        
306        public void setHideCreditMemoFor(String id) {
307                Map<String, Object> ext = getExtensionData();
308                synchronized (ext) {
309                        ext.remove("CreditMemo" + id);
310                }
311        }
312        
313        public String getPageNumber() {
314                return pageNumber;
315        }
316
317        public void setPageNumber(String pageNumber) {
318                this.pageNumber = pageNumber;
319        }
320
321        public String getSelectRowDetails() {
322                return selectRowDetails;
323        }
324
325        public void setSelectRowDetails(String selectRowDetails) {
326                this.selectRowDetails = selectRowDetails;
327        }
328
329        public boolean isShowSelectedRowDetails() {
330                return showSelectedRowDetails;
331        }
332
333        public void setShowSelectedRowDetails(boolean showSelectedRowDetails) {
334                this.showSelectedRowDetails = showSelectedRowDetails;
335        }
336
337}
338