Merge remote-tracking branch 'origin/new/bug_7143'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / lateorders.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
4 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5 [% INCLUDE 'doc-head-close.inc' %]
6 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7 [% INCLUDE 'datatables-strings.inc' %]
8 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
9 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
10 [% INCLUDE 'calendar.inc' %]
11 <script type="text/javascript">
12 //<![CDATA[
13 $(document).ready(function() {
14     var late_orderst = $("#late_orders").dataTable($.extend(true, {}, dataTablesDefaults, {
15         "aoColumnDefs": [
16             { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
17         ],
18         "sPaginationType": "four_button"
19     } ) );
20
21     $("input:checkbox[name=claim_for]").click(function(){
22         var booksellerid = $(this).attr('booksellerid');
23         if ( $("input:checkbox[name=claim_for]:checked").length > 0) {
24             $("input:checkbox[name=claim_for][booksellerid!="+booksellerid+"]").attr('disabled', true);
25         } else {
26             $("input:checkbox[name=claim_for]").attr('disabled', false);
27         }
28     });
29     $('#CheckAll').click(function(){ $("#late_orders td").checkCheckboxes();});
30     $('#CheckNone').click(function(){ $("#late_orders td").unCheckCheckboxes();});
31 });
32 //]]>
33 </script>
34 </head>
35 <body id="acq_lateorders" class="acq">
36 [% INCLUDE 'header.inc' %]
37 [% INCLUDE 'acquisitions-search.inc' %]
38
39 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="lateorders.pl">Late orders</a></div>
40
41 <div id="doc3" class="yui-t2">
42    
43    <div id="bd">
44         <div id="yui-main">
45         <div class="yui-b">
46         
47 <h1>[% IF ( Supplier ) %][% Supplier %] : [% END %]Late orders</h1>
48 <div id="acqui_lateorders">
49
50 [% IF error_claim %]
51     [% IF ( error_claim == "no_email" ) %]
52         <div class="error">This vendor has no email</div>
53     [% ELSE %]
54         <div class="error">[% error_claim %]</div>
55     [% END %]
56 [% END %]
57 [% IF info_claim %]
58     <div class="dialog message">Email has been sent.</div>
59 [% END %]
60 [% IF ( lateorders ) %]
61 <form action="lateorders.pl" name="claim" method="post">
62   <input type="hidden" name="op" value="send_alert" />
63   <input type="hidden" name="delay" value="[% delay %]" />
64   <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
65         [% IF ( letters ) %]
66         <p><label for="letter_code">Claim using notice: </label><select name="letter_code" id="letter_code">
67           [% FOREACH letter IN letters %]
68                 <option value="[% letter.code %]">[% letter.name %]</option>
69           [% END %]
70           </select>
71         </p>
72         [% END %]
73     <table id="late_orders">
74         <thead>
75         <tr>
76             <th>Order date</th>
77             <th>Estimated delivery date</th>
78             <th>Vendor</th>
79             <th>Information</th>
80             <th>Total cost</th>
81             <th>Basket</th>
82             <th>Claims count</th>
83             <th>Claimed date</th>
84             [% IF Supplier %]
85                 <th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th>
86             [% ELSE %]
87                 <th></th>
88             [% END %]
89         </tr>
90         </thead>
91         <tbody>
92     [% FOREACH lateorder IN lateorders %]
93         [% UNLESS ( loop.odd ) %]<tr class="highlight">
94         [% ELSE %]<tr>[% END %]
95             <td>
96                 ([% lateorder.supplierid %])
97                 [% lateorder.orderdate %]
98                 ([% lateorder.latesince %] days)
99             </td>
100             <td>
101                 [% IF ( lateorder.estimateddeliverydate ) %]
102                     [% lateorder.estimateddeliverydate | $KohaDates  %]
103                 [% END %]
104             </td>
105             <td>
106                 [% lateorder.supplier %]
107             </td>
108             <td>
109                 <b>[% lateorder.title |html %]</b>
110                    [% IF ( lateorder.author ) %]<br/><i>Author:</i> [% lateorder.author %][% END %]
111                    [% IF ( lateorder.publisher ) %]
112                         <br/><i>Published by:</i> [% lateorder.publisher %]
113                         [% IF ( lateorder.publicationyear ) %]
114                             <i> in </i>[% lateorder.publicationyear %]
115                         [% END %]
116                    [% END %]
117             </td>
118             <td>
119                    [% lateorder.unitpricesupplier %]x[% lateorder.quantity %] = 
120                    [% lateorder.subtotal %]
121                     <p title="budget">[% lateorder.budget %]</p>
122             </td>
123             <td>
124                  <p><a href="basket.pl?basketno=[% lateorder.basketno %]" title="basket">
125                         [% lateorder.basketno %]
126                         </a>
127                  </p>
128                  <p title="branch">[% lateorder.branch %]</p>
129             </td>
130             <td>[% lateorder.claims_count %]</td>
131             <td>[% lateorder.claimed_date %]</td>
132             <td>
133                 [% UNLESS lateorder.budget_lock %]
134                     <input type="checkbox" class="checkbox" name="claim_for" value="[% lateorder.ordernumber %]"  booksellerid="[% lateorder.supplierid %]"/>
135                 [% END %]
136              </td>
137             </td>
138         </tr>
139         [% END %]
140     </tbody>
141     <tfoot>
142         <tr> 
143             <th>Total</th>
144             <th>&nbsp;</th>
145             <th>&nbsp;</th>
146             <th>&nbsp;</th>
147             <th>[% total %]</th>
148             <th>&nbsp;</th>
149             <th>&nbsp;</th>
150             <th>&nbsp;</th>
151             <td>
152                 <input type="submit" value="Claim Order" />
153             </td>
154         </tr>
155     </tfoot>
156     </table>
157 </form>
158 [% ELSE %]<p>There are no late orders.</p>
159 [% END %]
160 </div>
161 </div>
162 </div>
163 <div class="yui-b">
164 <form action="lateorders.pl" method="get">
165 <fieldset class="brief">
166 <h4>Filter Results:</h4>
167 [% FOREACH ERROR_LOO IN ERROR_LOOP %]
168 [% IF ( ERROR_LOO.delay_digits ) %]<p class="error">The number of days ([% ERROR_LOO.bad_delay %]) must be a number between 0 and 999.</p>[% END %]
169 [% END %]
170 <ol>
171     <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay %]" /> days ago</li>
172     <li><label for="delay">Estimated Delivery date from: </label>
173         <input type="text" size="10" id="estimateddeliverydatefrom" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom %]" />
174         <img src="[% themelang %]/lib/calendar/cal.gif" id="openCalendarFrom" style="cursor: pointer;" alt="Show Calendar" />
175         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
176     </li>
177     <li><label for="delay">To: </label>
178         <input type="text" size="10" id="estimateddeliverydateto" name="estimateddeliverydateto" value="[% estimateddeliverydateto %]" />
179         <img src="[% themelang %]/lib/calendar/cal.gif" id="openCalendarTo" style="cursor: pointer;" alt="Show Calendar" />
180         <script type="text/javascript">
181             // return true if the date is blocked.
182             function disable_from(date) {var limit = get_Calendar_limit(date,'estimateddeliverydatefrom'); return (limit && limit < date);}
183             function disable_to(date) {var limit = get_Calendar_limit(date,'estimateddeliverydateto'); return (limit && limit < date);}
184             Calendar.setup({
185                 inputField : "estimateddeliverydatefrom",
186                 ifFormat : "[% DHTMLcalendar_dateformat %]",
187                 button : "openCalendarFrom",
188                 disableFunc : disable_from,
189                 dateStatusFunc : disable_from
190             });
191             Calendar.setup({
192                 inputField : "estimateddeliverydateto",
193                 ifFormat : "[% DHTMLcalendar_dateformat %]",
194                 button : "openCalendarTo",
195                 disableFunc : disable_to,
196                 dateStatusFunc : disable_to
197              });
198         </script>
199         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
200     </li>
201
202         <li><label for="booksellerid">Vendor:</label>
203                 <select id="booksellerid" size="1" tabindex="" name="booksellerid">
204                         <option value=""/>
205                         [% FOREACH SUPPLIER_LOO IN SUPPLIER_LOOP %]
206                 [% IF ( SUPPLIER_LOO.selected ) %]<option value="[% SUPPLIER_LOO.id %]" selected="selected">[% SUPPLIER_LOO.name %]</option>
207                 [% ELSE %]<option value="[% SUPPLIER_LOO.id %]">[% SUPPLIER_LOO.name %]</option>[% END %]
208                 [% END %]
209                 </select>
210 </ol>
211         <fieldset class="action"><input type="submit" value="filter" /></fieldset>
212 </fieldset>
213     </form>
214 [% INCLUDE 'acquisitions-menu.inc' %]
215 </div>
216 </div>
217 [% INCLUDE 'intranet-bottom.inc' %]