Merge commit 'colin_campbell/dbupgrade3.2' into master
[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\">All " + 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>'
87                        + '<td class="basketfilterclass"><a href="/cgi-bin/koha/acqui/basket.pl?basketno=' + order.basketno + '">' + order.basketno + '</a></td>'
88                        + '<td class="orderfilterclass"> ' + order.ordernumber + ' </td>'
89                        + '<td class="summaryfilterclass">'
90                        + '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + order.biblionumber + '">' + order.title + '</a> / ' + order.author + '&ndash;' + 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.quantrem + ' / ' + 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         pendingExpand();
118     }
119
120 //]]>
121 </script>
122
123 </head>
124 <body>
125 <!-- TMPL_INCLUDE NAME="header.inc" -->
126 <!-- TMPL_INCLUDE NAME="acquisitions-search.inc" -->
127
128 <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" -->
129             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>
130         <!-- TMPL_ELSE -->
131             Receive orders from <!-- TMPL_VAR NAME="name" -->
132         <!-- /TMPL_IF --></div>
133
134 <div id="doc3" class="yui-t2">
135    
136    <div id="bd">
137         <div id="yui-main">
138         <div class="yui-b">
139         <!-- TMPL_IF NAME="receive_error" -->
140         <div class="dialog alert">
141         <h3>Error adding items:</h3>
142         <ul>
143         <!-- TMPL_LOOP NAME="error_loop" -->
144                 <li><!-- TMPL_VAR NAME="error_param" --><!-- TMPL_IF NAME="error_duplicate_barcode" -->Duplicate Barcode<!-- /TMPL_IF --> <!-- todo: other error conditions come here. --></li>
145         <!-- /TMPL_LOOP -->
146         </ul>
147         </div>
148         <!-- /TMPL_IF -->
149     <h1>
150         <!-- TMPL_IF name="datereceived" -->
151             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>
152         <!-- TMPL_ELSE -->
153             Receive orders from <!-- TMPL_VAR NAME="name" -->
154         <!-- /TMPL_IF -->
155     </h1>
156
157     <!-- TMPL_IF NAME="success_delorder" -->
158     <div class="dialog message">The order has been successfully canceled.</div>
159     <!-- TMPL_ELSE -->
160         <!-- TMPL_IF NAME="error_delitem" -->
161             <div class="dialog alert">The order has been canceled, although one or more items could not have been deleted.</div>
162         <!-- /TMPL_IF -->
163         <!-- TMPL_IF NAME="error_delbiblio" -->
164             <div class="dialog alert">The order has been canceled, although the record has not been deleted.</div>
165         <!-- /TMPL_IF -->
166     <!-- /TMPL_IF -->
167
168 <div id="acqui_receive_summary">
169 <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>
170         <!-- TODO: Add date picker, change rcv date. -->
171 </div>
172 <div id="acqui_receive_search">
173     <h3>Pending Orders</h3>
174
175  <!-- TMPL_IF NAME="loop_orders" --><table id="pendingt">
176     <thead>
177         <tr>
178             <th>Basket</th>
179             <th>Order</th>
180             <th>Summary</th>
181             <th>View Record</th>
182             <th>Still on order</th>
183             <th>Unit cost</th>
184             <th>Order cost</th>
185             <th>&nbsp;</th>
186         </tr>
187     </thead>
188                 <tfoot>
189             <tr><td colspan="4" class="total">TOTAL</td>
190                 <td> <!-- TMPL_VAR NAME="totalPquantity" --> </td>
191                                 <td>&nbsp;</td>
192                 <td><!-- TMPL_VAR NAME="ordergrandtotal" --></td>
193                                 <td>&nbsp;</td>
194             </tr>
195                 </tfoot>
196     <tbody class="filterclass">
197         <!-- TMPL_LOOP NAME="loop_orders" -->
198         <!-- TMPL_UNLESS NAME="__odd__" -->
199             <tr class="highlight">
200         <!-- TMPL_ELSE -->
201             <tr>
202         <!-- /TMPL_UNLESS -->
203                 <td class="basketfilterclass"><a href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->"><!-- TMPL_VAR NAME="basketno" --></a></td>
204                 <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=<!-- TMPL_VAR NAME="ordernumber" -->&amp;booksellerid=<!-- TMPL_VAR NAME="supplierid" -->"><!-- TMPL_VAR NAME="ordernumber" --></a></td>
205                 <td class="summaryfilterclass">
206                   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html"--></a>
207                 <!-- TMPL_IF NAME="author" --> by <!-- TMPL_VAR NAME="author" --><!--/TMPL_IF-->
208                 <!-- TMPL_IF NAME="isbn" --> &ndash; <!-- TMPL_VAR NAME="isbn" --><!--/TMPL_IF-->
209                 <!-- TMPL_IF NAME="publishercode" --><br />Publisher :<!-- TMPL_VAR NAME="publishercode" --><!--/TMPL_IF-->
210                 </td>
211                 <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>
212                 <td><!-- TMPL_VAR NAME="quantrem" --> / <!-- TMPL_VAR NAME="quantity" --></td>
213                 <td><!-- TMPL_VAR NAME="ecost" --></td>
214                 <td><!-- TMPL_VAR NAME="ordertotal" --></td>
215                                 <td>
216                                     <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> / 
217                                     <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>
218                                 </td>
219             </tr>
220         <!-- /TMPL_LOOP -->
221     </tbody>
222      </table><!-- TMPL_ELSE -->There are no pending orders.<!-- /TMPL_IF -->
223    <div id="resultnumber">
224         <!-- Row of numbers corresponding to search result pages -->
225         <!-- TMPL_IF NAME="displayprev" -->
226                 <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>
227         <!-- /TMPL_IF -->
228         <!-- TMPL_LOOP NAME="numbers" -->
229                 <!-- TMPL_IF NAME="highlight" -->
230                 <span class="current"><!-- TMPL_VAR NAME="number" --></span>
231                 <!-- TMPL_ELSE -->
232                 <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>
233                 <!-- /TMPL_IF -->
234         <!-- /TMPL_LOOP -->
235         <!-- TMPL_IF NAME="displaynext" -->
236                 <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>
237         <!-- /TMPL_IF -->
238         </div>
239 </div>
240 <div id="acqui_receive_receivelist">
241     <h3>Already Received</h3>
242
243    <!-- TMPL_IF NAME="loop_received" -->
244    <form action="/cgi-bin/koha/acqui/parcel.pl" method="get" name="orderform">
245     <table id="receivedt">
246         <thead>
247             <tr>
248                 <th>Basket</th>
249                 <th>Order</th>
250                 <th>Summary</th>
251                 <th>View Record</th>
252                 <th>Est cost</th>
253                 <th>Actual cost</th>
254                 <th>TOTAL</th>
255             </tr>
256         </thead>
257 <tfoot>
258             <tr>
259                 <td colspan="4" class="total">SUBTOTAL</td>
260                 <td>&nbsp;</td>
261                 <td><!-- TMPL_VAR NAME="totalprice" --></td>
262                 <td><!-- TMPL_VAR NAME="tototal" --></td>
263             </tr>
264               <!-- TMPL_IF NAME="totalfreight" -->
265                     <tr>
266                 <td colspan="5">&nbsp;
267                 </td>
268                             <td>Shipping</td>
269                 <td><!-- TMPL_VAR NAME="totalfreight" --></td>
270             </tr> <!-- /TMPL_IF -->
271               <!-- TMPL_IF NAME="gst" -->
272                     <tr>
273                 <td colspan="5">
274                 <p class="message">
275                             <b>HELP</b><br />
276                     The total at the bottom of the page should be within a few cents of the total for the invoice.
277                 </p>
278                 </td>
279                             <td><b>GST</b></td>
280                 <td><!-- TMPL_VAR NAME="gst" --></td>
281             </tr> <!-- /TMPL_IF -->
282             <tr>
283             <td colspan="4" class="total">TOTAL</td>
284                 <td colspan="2">&nbsp;</td>
285                 <td><!-- TMPL_VAR NAME="grandtot" --></td>
286             </tr>
287     </tfoot>
288         <tbody class="filterclass">
289             <!-- TMPL_LOOP NAME="loop_received" -->
290         <!-- TMPL_UNLESS NAME="__odd__" -->
291             <tr class="highlight">
292         <!-- TMPL_ELSE -->
293             <tr>
294         <!-- /TMPL_UNLESS -->
295                 <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->"><!-- TMPL_VAR NAME="basketno" --></a></td>
296                 <td><a href="neworderempty.pl?ordernumber=<!-- TMPL_VAR NAME="ordernumber" -->&amp;booksellerid=<!-- TMPL_VAR NAME="supplierid" -->"><!-- TMPL_VAR NAME="ordernumber" --></a></td>
297                 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a>
298                 <!-- TMPL_IF NAME="author" --> / <!-- TMPL_VAR NAME="author" --><!--/TMPL_IF-->
299                 <!-- TMPL_IF NAME="isbn" --> - <!-- TMPL_VAR NAME="isbn" --><!--/TMPL_IF-->
300                 <!-- TMPL_IF NAME="publishercode" --><br />Publisher :<!-- TMPL_VAR NAME="publishercode" --><!--/TMPL_IF-->
301                 </td>
302                 <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>
303                 <td><!-- TMPL_VAR NAME="ecost" --></td>
304                 <td><!-- TMPL_VAR NAME="unitprice" --></td>
305                 <td><!-- TMPL_VAR NAME="total" --></td>
306             </tr>
307             <!-- /TMPL_LOOP -->
308         </tbody>
309     </table>
310     </form>
311         <!-- TMPL_ELSE -->There are no received orders.<!-- /TMPL_IF -->
312 </div>
313
314 </div>
315 </div>
316 <div class="yui-b">
317 <form action="/cgi-bin/koha/acqui/parcel.pl" id="filterform" onsubmit="return filter();">
318         <fieldset class="brief">
319
320             <h4>Filter</h4>
321
322             <ol>
323
324                 <li>
325                     <label for="summaryfilter">ISBN, author or title :</label>
326                     <input type="text" name="summaryfilter" id="summaryfilter" />
327                 </li>
328
329                 <li>
330                     <label for="basketfilter">Basket :</label>
331                     <input type="text" name="basketfilter" id="basketfilter" />
332                 </li>
333
334                 <li>
335                     <label for="orderfilter">Order :</label>
336                     <input type="text" name="orderfilter" id="orderfilter" />
337                 </li>
338             </ol>
339                 <fieldset class="action">
340                     <input type="submit" value="Filter" />
341                     <a href="#" onclick="clearFilters();">Clear</a>
342                 </fieldset>
343
344
345         </fieldset>
346     </form>
347 <!-- TMPL_INCLUDE NAME="acquisitions-menu.inc" -->
348 </div>
349 </div>
350 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->