MT 1487 : Ability to cancel orders when receiving shipments
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / parcel.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Acquisitions &rsaquo; <!-- TMPL_IF name="date" -->
3             Receipt Summary for <!-- TMPL_VAR NAME="name" --> <!--TMPL_IF Name="invoice"-->Invoice <!-- TMPL_VAR NAME="invoice" --><!--/TMPL_IF --> on <!-- TMPL_VAR NAME="formatteddatereceived" --><!-- TMPL_ELSE -->Receive Orders from <!-- TMPL_VAR NAME="name" --><!-- /TMPL_IF --></title>
4 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
5 <!-- TMPL_INCLUDE NAME="greybox.inc" -->
6 <script type="text/JavaScript" language="JavaScript">
7 //<![CDATA[
8
9     var rowsToCollapse = 5;
10
11     $(document).ready(function(){
12
13         rowCountPending  = $("table#pendingt tbody.filterclass tr").length;
14         rowCountReceived = $("table#receivedt tbody.filterclass tr").length;
15         if (rowCountPending  > rowsToCollapse) { pendingCollapse(); }
16         if (rowCountReceived > rowsToCollapse) { receivedCollapse(); }
17     });
18
19      // Case-insensitive version of jquery's contains function
20      jQuery.extend(jQuery.expr[':'], { 
21             icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" 
22      });
23
24      // Contains exactly function
25      jQuery.extend(jQuery.expr[':'], {
26           containsExactly: "$(a).text() == m[3]"
27      });
28
29
30     // Collapse pending items table
31     function pendingCollapse() {
32         $("#pendingcollapserow").remove();
33         $("table#pendingt tbody.filterclass tr:gt(" + rowsToCollapse + ")").hide();
34         $("#basketfilter").focus();
35         $("<tr><td id=\"pendingcollapserow\" colspan=\"7\">Only the first " + rowsToCollapse + " items are displayed. <a href=\"javascript:pendingExpand();\">Click here to show all " + rowCountPending + " items<\/a>.<\/td><\/tr>").appendTo("table#pendingt");
36
37     }
38
39     // Expend pending items table
40     function pendingExpand() {
41         $("#pendingcollapserow").remove();
42         $("table#pendingt tr").show();
43         $("<tr><td id=\"pendingcollapserow\" colspan=\"7\">All " + rowCountPending + " items are displayed. <a href=\"javascript:pendingCollapse();\">Click here to show only the first " + rowsToCollapse + " items<\/a>.<\/td><\/tr>").appendTo("table#pendingt");
44     }
45
46     // Collapse already received items table
47     function receivedCollapse() {
48         $("#receivedcollapserow").remove();
49         $("table#receivedt tbody.filterclass tr:gt(" + rowsToCollapse + ")").hide();
50         $("<tr><td id=\"receivedcollapserow\" colspan=\"7\">Only the first " + rowsToCollapse + " items are displayed. <a href=\"javascript:receivedExpand();\">Click here to show all " + rowCountReceived + " items<\/a>.<\/td><\/tr>").appendTo("table#receivedt");
51
52     }
53
54     // Expand already received items table
55     function receivedExpand() {
56         $("#receivedcollapserow").remove();
57         $("table#receivedt tr").show();
58         $("<tr><td id=\"receivedcollapserow\" colspan=\"7\">All " + rowCountReceived + " items are displayed. <a href=\"javascript:receivedCollapse();\">Click here to show only the first " + rowsToCollapse + " items<\/a>.<\/td><\/tr>").appendTo("table#receivedt");
59     }
60
61     // Launch filtering
62     function filter() {
63
64         var summaryStatus = jQuery.trim($("#summaryfilter").val());
65         var basketStatus  = $("#basketfilter").val();
66         var orderStatus   = $("#orderfilter").val();
67
68         if (summaryStatus == '' && basketStatus == '' && orderStatus == '') { clearFilters(); return false; }
69
70         var filtered = "table#pendingt tbody.filterclass tr";
71         var foundCount = 0;
72
73         // We hide everything
74         $("#nothingfoundrow").remove();
75         $(filtered).hide();
76
77         // Then show what matches the filters
78         if (summaryStatus != '') {
79             // Case-insensitive search for a substring
80             $(filtered + " td.summaryfilterclass:icontains(" + summaryStatus + ")").parent().show();
81             foundCount += $(filtered + " td.summaryfilterclass:icontains(" + summaryStatus + ")").length;
82         }
83
84         if (basketStatus != '') {
85             // Exact search
86             $(filtered + " td.basketfilterclass:containsExactly(" + basketStatus + ")").parent().show();
87             foundCount += $(filtered + " td.basketfilterclass:containsExactly(" + basketStatus + ")").length;
88         }
89
90         if (orderStatus != '') {
91             // Exact search
92             $(filtered + " td.orderfilterclass:containsExactly(" + orderStatus + ")").parent().show();
93             foundCount += $(filtered + " td.orderfilterclass:containsExactly(" + orderStatus + ")").length;
94         }
95
96         // If nothing has been found, we tell the user so
97         if (foundCount == 0) {
98             $("<tr><td id=\"nothingfoundrow\" colspan=\"8\">No items match your criteria.<\/tr>").appendTo("table#pendingt");
99         }
100     }
101     
102     // Clear already applied filters
103     function clearFilters() {
104         $("#nothingfoundrow").remove();
105         $("table#pendingt tbody.filterclass tr").show();
106         pendingExpand();
107     }
108
109 //]]>
110 </script>
111
112 </head>
113 <body>
114 <!-- TMPL_INCLUDE NAME="header.inc" -->
115 <!-- TMPL_INCLUDE NAME="acquisitions-search.inc" -->
116
117 <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;  <!-- TMPL_IF name="datereceived" -->
118             Receipt Summary for <i><!-- TMPL_VAR NAME="name" --></i> <!--TMPL_IF Name="invoice"--><i>[ <!-- TMPL_VAR NAME="invoice" --> ]</i><!--/TMPL_IF --> on <i><!-- TMPL_VAR NAME="formatteddatereceived" --></i>
119         <!-- TMPL_ELSE -->
120             Receive orders from <!-- TMPL_VAR NAME="name" -->
121         <!-- /TMPL_IF --></div>
122
123 <div id="doc3" class="yui-t2">
124    
125    <div id="bd">
126         <div id="yui-main">
127         <div class="yui-b">
128         <!-- TMPL_IF NAME="receive_error" -->
129         <div class="dialog alert">
130         <h3>Error adding items:</h3>
131         <ul>
132         <!-- TMPL_LOOP NAME="error_loop" -->
133                 <li><!-- TMPL_VAR NAME="error_param" --><!-- TMPL_IF NAME="error_duplicate_barcode" -->Duplicate Barcode<!-- /TMPL_IF --> <!-- todo: other error conditions come here. --></li>
134         <!-- /TMPL_LOOP -->
135         </ul>
136         </div>
137         <!-- /TMPL_IF -->
138     <h1>
139         <!-- TMPL_IF name="datereceived" -->
140             Receipt Summary for <i><!-- TMPL_VAR NAME="name" --></i> <!--TMPL_IF Name="invoice"--> <i> [ <!-- TMPL_VAR NAME="invoice" --> ] </i><!--/TMPL_IF --> on <i><!-- TMPL_VAR NAME="formatteddatereceived" --></i>
141         <!-- TMPL_ELSE -->
142             Receive orders from <!-- TMPL_VAR NAME="name" -->
143         <!-- /TMPL_IF -->
144     </h1>
145
146     <!-- TMPL_IF NAME="success_delorder" -->
147     <div class="dialog message">The order has been successfully canceled.</div>
148     <!-- TMPL_ELSE -->
149         <!-- TMPL_IF NAME="error_delitem" -->
150             <div class="dialog alert">The order has been canceled, although one or more items could not have been deleted.</div>
151         <!-- /TMPL_IF -->
152         <!-- TMPL_IF NAME="error_delbiblio" -->
153             <div class="dialog alert">The order has been canceled, although the record has not been deleted.</div>
154         <!-- /TMPL_IF -->
155     <!-- /TMPL_IF -->
156
157 <div id="acqui_receive_summary">
158     <p>Invoice number: <!-- TMPL_VAR NAME="invoice" --></p>
159     <p>Received by: <!-- TMPL_VAR NAME="loggedinusername" --></p>
160     <p>On: <!-- TMPL_VAR NAME="formatteddatereceived" --></p>
161         <!-- TODO: Add date picker, change rcv date. -->
162 </div>
163 <div id="acqui_receive_search">
164     <h2>Items in shipment</h2>
165         <form action="/cgi-bin/koha/acqui/parcel.pl" id="filterform" onsubmit="filter(); return false;">
166         <fieldset class="rows">
167
168             <legend>Filters :</legend>
169          
170             <ol>
171
172                 <li>    
173                     <label for="summaryfilter">ISBN, author or title :</label>
174                     <input type="text" name="summaryfilter" id="summaryfilter" />
175                 </li>
176
177                 <li>    
178                     <label for="basketfilter">Basket :</label>
179                     <input type="text" name="basketfilter" id="basketfilter" /><br />
180                 </li>
181
182                 <li>    
183                     <label for="orderfilter">Order :</label>
184                     <input type="text" name="orderfilter" id="orderfilter" /><br />
185                 </li>
186
187                 <li>    
188                     <input type="submit" value="OK" />
189                     <input type="reset" value="Clear Filters" onclick="clearFilters();" />
190                 </li>
191                 
192             </ol>
193
194         </fieldset>
195     </form>
196
197  <table id="pendingt"> <caption>Pending Orders</caption>
198     <thead>
199         <tr>
200             <th>Basket</th>
201             <th>Order</th>
202             <th>Summary</th>
203             <th>View Record</th>
204             <th>Still on order</th>
205             <th>Unit cost</th>
206             <th>Order cost</th>
207             <th>Order</th>
208         </tr>
209     </thead>
210     <tbody class="filterclass">
211         <!-- TMPL_LOOP NAME="loop_orders" -->
212         <!-- TMPL_UNLESS NAME="__odd__" -->
213             <tr class="highlight">
214         <!-- TMPL_ELSE -->
215             <tr>
216         <!-- /TMPL_UNLESS -->
217                 <td class="basketfilterclass"><a href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->"><!-- TMPL_VAR NAME="basketno" --></a></td>
218                 <td class="orderfilterclass"><a href="neworderempty.pl?ordnum=<!-- TMPL_VAR NAME="ordernumber" -->&booksellerid=<!-- TMPL_VAR NAME="supplierid" -->"><!-- TMPL_VAR NAME="ordernumber" --></a></td>
219                 <td class="summaryfilterclass">
220                   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html"--></a>
221                 <!-- TMPL_IF NAME="author" --> / <!-- TMPL_VAR NAME="author" --><!--/TMPL_IF-->
222                 <!-- TMPL_IF NAME="isbn" --> &ndash; <!-- TMPL_VAR NAME="isbn" --><!--/TMPL_IF-->
223                 <!-- TMPL_IF NAME="publishercode" --><br />Publisher :<!-- TMPL_VAR NAME="publishercode" --><!--/TMPL_IF-->
224                 </td>
225                 <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
226                 <td><!-- TMPL_VAR NAME="quantrem" --> / <!-- TMPL_VAR NAME="quantity" --></td>
227                 <td><!-- TMPL_VAR NAME="ecost" --></td>
228                 <td><!-- TMPL_VAR NAME="ordertotal" --></td>
229                                 <td>
230                                     <a href="orderreceive.pl?ordernumber=<!-- TMPL_VAR NAME="ordernumber" -->&amp;datereceived=<!-- TMPL_VAR NAME="invoicedatereceived" -->&amp;invoice=<!-- TMPL_VAR NAME="invoice" -->&amp;gst=<!-- TMPL_VAR NAME="gst" -->&amp;freight=<!-- TMPL_VAR NAME="freight" -->&amp;supplierid=<!-- TMPL_VAR NAME="supplierid" -->">Receive</a> / 
231                                     <a href="parcel.pl?type=intra&amp;ordernumber=<!-- TMPL_VAR NAME="ordernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;action=cancelorder&amp;supplierid=<!-- TMPL_VAR NAME="supplierid" -->&amp;datereceived=<!-- TMPL_VAR NAME="invoicedatereceived" -->&amp;invoice=<!-- TMPL_VAR NAME="invoice" -->" onclick="return confirm(_('Are you sure you want to cancel this order?'));">Cancel</a>
232                                 </td>
233             </tr>
234         <!-- /TMPL_LOOP -->
235     </tbody>
236     <tbody>
237             <tr><td colspan="3">&nbsp;</td>
238                 <th>TOTAL</th>
239                 <th> <!-- TMPL_VAR NAME="totalPquantity" --> </th>
240                                 <td>&nbsp;</td>
241                 <th><!-- TMPL_VAR NAME="ordergrandtotal" --></th>
242                                 <td>&nbsp;</td>
243             </tr>
244     </tbody>
245      </table>
246    <div id="resultnumber">
247         <!-- Row of numbers corresponding to search result pages -->
248         <!-- TMPL_IF NAME="displayprev" -->
249                 <a href="parcel.pl?type=intra&amp;supplierid=<!-- TMPL_VAR NAME="supplierid" -->&amp;startfrom=<!-- TMPL_VAR NAME="prevstartfrom" --><!--TMPL_IF Name="datereceived"-->&amp;datereceived=<!--TMPL_VAR Name="datereceived"--><!--/TMPL_IF--><!--TMPL_IF Name="invoice"-->&amp;invoice=<!--TMPL_VAR Name="invoice"--><!--/TMPL_IF--><!--TMPL_IF Name="resultsperpage"-->&amp;resultsperpage=<!--TMPL_VAR Name="resultsperpage"--><!--/TMPL_IF-->#resultnumber">&lt;&lt; Previous</a>
250         <!-- /TMPL_IF -->
251         <!-- TMPL_LOOP NAME="numbers" -->
252                 <!-- TMPL_IF NAME="highlight" -->
253                 <span class="current"><!-- TMPL_VAR NAME="number" --></span>
254                 <!-- TMPL_ELSE -->
255                 <a href="parcel.pl?type=intra&amp;supplierid=<!-- TMPL_VAR NAME="supplierid" -->&amp;startfrom=<!-- TMPL_VAR NAME="startfrom" --><!--TMPL_IF Name="datereceived"-->&amp;datereceived=<!--TMPL_VAR Name="datereceived"--><!--/TMPL_IF--><!--TMPL_IF Name="invoice"-->&amp;invoice=<!--TMPL_VAR Name="invoice"--><!--/TMPL_IF--><!--TMPL_IF Name="resultsperpage"-->&amp;resultsperpage=<!--TMPL_VAR Name="resultsperpage"--><!--/TMPL_IF-->#resultnumber"><!-- TMPL_VAR NAME="number" --></a>
256                 <!-- /TMPL_IF -->
257         <!-- /TMPL_LOOP -->
258         <!-- TMPL_IF NAME="displaynext" -->
259                 <a href="parcel.pl?type=intra&amp;supplierid=<!-- TMPL_VAR NAME="supplierid" -->&amp;startfrom=<!-- TMPL_VAR NAME="nextstartfrom" --><!--TMPL_IF Name="datereceived"-->&amp;datereceived=<!--TMPL_VAR Name="datereceived"--><!--/TMPL_IF--><!--TMPL_IF Name="invoice"-->&amp;invoice=<!--TMPL_VAR Name="invoice"--><!--/TMPL_IF--><!--TMPL_IF Name="resultsperpage"-->&amp;resultsperpage=<!--TMPL_VAR Name="resultsperpage"--><!--/TMPL_IF-->#resultnumber">Next &gt;&gt;</a>
260         <!-- /TMPL_IF -->
261         </div>
262 </div>
263 <div id="acqui_receive_receivelist">
264     <h2>Already Received</h2>
265
266    <form action="/cgi-bin/koha/acqui/parcel.pl" method="get" name="orderform">
267     <table id="receivedt">
268         <thead>
269             <tr>
270                 <th>Basket</th>
271                 <th>Order</th>
272                 <th>Summary</th>
273                 <th>View Record</th>
274                 <th>Est cost</th>
275                 <th>Actual cost</th>
276                 <th>TOTAL</th>
277             </tr>
278         </thead>
279         <tbody class="filterclass">
280             <!-- TMPL_LOOP NAME="loop_received" -->
281         <!-- TMPL_UNLESS NAME="__odd__" -->
282             <tr class="highlight">
283         <!-- TMPL_ELSE -->
284             <tr>
285         <!-- /TMPL_UNLESS -->
286                 <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->"><!-- TMPL_VAR NAME="basketno" --></a></td>
287                 <td><a href="neworderempty.pl?ordnum=<!-- TMPL_VAR NAME="ordernumber" -->&booksellerid=<!-- TMPL_VAR NAME="supplierid" -->"><!-- TMPL_VAR NAME="ordernumber" --></a></td>
288                 <td><a href="/cgi-bin/koha/catalogue/detail.pl?amp;biblionumber=<!-- TMPL_VAR name="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a>
289                 <!-- TMPL_IF NAME="author" --> / <!-- TMPL_VAR NAME="author" --><!--/TMPL_IF-->
290                 <!-- TMPL_IF NAME="isbn" --> - <!-- TMPL_VAR NAME="isbn" --><!--/TMPL_IF-->
291                 <!-- TMPL_IF NAME="publishercode" --><br />Publisher :<!-- TMPL_VAR NAME="publishercode" --><!--/TMPL_IF-->
292                 </td>
293                 <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
294                 <td><!-- TMPL_VAR NAME="ecost" --></td>
295                 <td><!-- TMPL_VAR NAME="unitprice" --></td>
296                 <td><!-- TMPL_VAR NAME="total" --></td>
297             </tr>
298             <!-- /TMPL_LOOP -->
299         </tbody>
300         <tbody>
301             <tr>
302                 <td colspan="3">&nbsp;</td>
303                 <th>SUBTOTAL</th>
304                 <td>&nbsp;</td>
305                 <th><!-- TMPL_VAR NAME="totalprice" --></th>
306                 <th><!-- TMPL_VAR NAME="tototal" --></th>
307             </tr>
308               <!-- TMPL_IF NAME="totalfreight" -->
309                     <tr>
310                 <td colspan="5">
311                 </td>
312                 </p>
313                             <th colspan="1">Shipping</th>
314                 <td><!-- TMPL_VAR NAME="totalfreight" --></td>
315             </tr> <!-- /TMPL_IF -->
316               <!-- TMPL_IF NAME="gst" -->
317                     <tr>
318                 <td colspan="5">
319                 <p class="message">
320                             <b>HELP</b><br />
321                     The total at the bottom of the page should be within a few cents of the total for the invoice.
322                 </p>
323                 </td>
324                             <td><b>GST</b></td>
325                 <td><!-- TMPL_VAR NAME="gst" --></td>
326             </tr> <!-- /TMPL_IF -->
327             <tr>
328             <td colspan="3">&nbsp;</td>
329                 <th>TOTAL</th>
330                 <td colspan="2">&nbsp;</td>
331                 <th><!-- TMPL_VAR NAME="grandtot" --></th>
332             </tr>
333     </tbody>
334     </table>
335     </form>
336 </div>
337
338 </div>
339 </div>
340 <div class="yui-b">
341 <!-- TMPL_INCLUDE NAME="acquisitions-menu.inc" -->
342 </div>
343 </div>
344 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->