[% USE HTML %]
[% USE T8 %]
-<body onload="on_load()">
-
- <script type="text/javascript">
- <!--
- function on_load() {
- Calendar.setup({ inputField : "date_from", ifFormat :"[% MYCONFIG.jsc_dateformat %]", align : "BR", button : "date_from_trigger" });
- Calendar.setup({ inputField : "date_to", ifFormat :"[% MYCONFIG.jsc_dateformat %]", align : "BR", button : "date_to_trigger" });
- document.Form.subject.focus();
- }
- -->
- </script>
-
- <div class="listtop">[% title %]</div>
-
- <form action="letter.pl" method="post" name="Form">
- <input type="hidden" name="nextsub" value="report">
-
- <p>
- <table>
- <tr>
- <th align='right'>[% 'Letternumber' | $T8 %]</th>
- <td><input name='letternumber' style='width:250px' value='[% letternumber %]'></th>
- </tr>
- <tr>
- <td align="right">[% 'Customer' | $T8 %]</td>
- <td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'customer',
- style = 'width:250px',
- DATA = ALL_CUSTOMERS,
- id_key = 'id',
- label_key = 'name',
- select = vc_select,
- limit = MYCONFIG.vclimit,
- allow_textbox = 1,
- show_empty = 1,
- force_textbox = limit_exceeded_all_customer
- onChange = "document.getElementById('update_button').click();" -%]
-[%- IF MYCONFIG.vclimit > ALL_CUSTOMERS.size %]
- <input type="hidden" name='selectcustomer' value="1">
+[% USE L %]
+[% USE P %]
+[% USE LxERP %]
+<form action="controller.pl" method="post" name="Form" id="search_form">
+
+<div class='filter_toggle'>
+<a href='#' onClick='javascript:$(".filter_toggle").toggle()'>[% 'Show Filter' | $T8 %]</a>
+ [% SELF.filter_summary | html %]
+</div>
+<div class='filter_toggle' style='display:none'>
+<a href='#' onClick='javascript:$(".filter_toggle").toggle()'>[% 'Hide Filter' | $T8 %]</a>
+
+
+ <table id='filter_table'>
+ <tr>
+ <th align='right'>[% 'Letternumber' | $T8 %]</th>
+ <td>[% L.input_tag('filter.letternumber:substr::ilike', filter.letternumber_substr__ilike, style='width:250px') %]</th>
+ </tr>
+[%- IF SELF.is_sales %]
+ <tr>
+ <td align="right">[% 'Customer' | $T8 %]</td>
+ <td>[% P.customer_vendor.picker('filter.customer_id', filter.customer_id, type='customer', style='width:250px') %]</td>
+ </tr>
+[%- ELSE %]
+ <tr>
+ <td align="right">[% 'Vendor' | $T8 %]</td>
+ <td>[% P.customer_vendor.picker('filter.vendor_id', filter.vendor_id, type='vendor', style='width:250px') %]</td>
+ </tr>
[%- END %]
- </td>
- </tr>
-
- <tr>
- <td align="right">[% 'Contact' | $T8 %]</td>
- <td><input name="contact" style='width:250px'></td>
- </tr>
-
- <tr>
- <td align="right">[% 'Subject' | $T8 %]</td>
- <td><input name="subject" style='width:250px'></td>
- </tr>
-
- <tr>
- <td align="right">[% 'Body' | $T8 %]</td>
- <td><input name="body" style='width:250px'></td>
- </tr>
-
- <tr>
- <td align='right'>[% 'From' | $T8 %]</td>
- <td>
- <input name="date_from" id="date_from" size="12">
- <input type="button" name="date_from_button" id="date_from_trigger" value="?">
- [% 'To (time)' | $T8 %]
- <input name="date_to" id="date_to" size="12">
- <input type="button" name="date_to_button" id="date_to_trigger" value="?">
- </td>
- </tr>
-<!--
- <tr>
- <td align="right">[% 'Include in Report' | $T8 %]</td>
- <td>
-
- <table>
- </table>
-
- </td>
- </tr>
--->
- </table>
- </p>
-
- <p>
- <input type="submit" name="action" value="[% 'Continue' | $T8 %]">
- </p>
- </form>
-
-</body>
-</html>
+ <tr>
+ <td align="right">[% 'Contact' | $T8 %]</td>
+ <td>[% L.input_tag('filter.contact.cp_name:substr::ilike', filter.contact.cp_name_substr__ilike, style='width:250px') %]</th>
+ </tr>
+
+ <tr>
+ <td align="right">[% 'Subject' | $T8 %]</td>
+ <td>[% L.input_tag('filter.subject:substr::ilike', filter.subject_substr__ilike, style='width:250px') %]</th>
+ </tr>
+
+ <tr>
+ <td align="right">[% 'Body' | $T8 %]</td>
+ <td>[% L.input_tag('filter.body:substr::ilike', filter.body_substr__ilike, style='width:250px') %]</th>
+ </tr>
+
+ <tr>
+ <td align='right'>[% 'From' | $T8 %]</td>
+ <td> [% L.date_tag('filter.date:date::ge', filter.date_date__ge) %]
+ [% 'To (time)' | $T8 %]
+ [% L.date_tag('filter.date:date::le', filter.date_date__le) %]</td>
+ </tr>
+ </table>
+
+ [% L.hidden_tag('is_sales', SELF.is_sales) %]
+ [% L.hidden_tag('sort_by', FORM.sort_by) %]
+ [% L.hidden_tag('sort_dir', FORM.sort_dir) %]
+ [% L.hidden_tag('page', FORM.page) %]
+ [% L.button_tag("\$('#search_form').resetForm()", LxERP.t8("Reset")) %]
+</div>
+</form>