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