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