]> git.koha-community.org Git - koha.git/blob - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
Merge remote-tracking branch 'origin/new/bug_8204'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / parcel.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( date ) %]
3             Receipt summary for [% name %] [% IF ( invoice ) %]invoice [% invoice %][% END %] on [% formatteddatereceived %][% ELSE %]Receive orders from [% name %][% END %]</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 [% INCLUDE 'greybox.inc' %]
10 <script type="text/javascript" src="[% yuipath %]/json/json-min.js"></script>
11 <script type="text/javascript">
12 //<![CDATA[
13
14     dt_overwrite_html_sorting_localeCompare();
15
16     var rowsToCollapse = 5;
17     $(document).ready(function(){
18         var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, {
19             "aoColumnDefs": [
20                 { "aTargets": [ 3, 7, 8 ], "bSortable": false, "bSearchable": false },
21             ],
22             "aoColumns": [
23                 { "sType": "num-html" },
24                 { "sType": "num-html" },
25                 { "sType": "html" },
26                 null,
27                 null,
28                 null,
29                 null,
30                 null,
31                 null,
32             ],
33             "sPaginationType": "four_button"
34         } ) );
35         var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
36             "aoColumnDefs": [
37                 { "aTargets": [ 3 ], "bSortable": false, "bSearchable": false },
38             ],
39             "aoColumns": [
40                 { "sType": "num-html" },
41                 { "sType": "num-html" },
42                 { "sType": "html" },
43                 null,
44                 null,
45                 null,
46                 null,
47                 null,
48             ],
49             "sPaginationType": "four_button"
50         } ) );
51
52         rowCountPending  = $("#pendingt tbody.filterclass tr").length;
53         rowCountReceived = $("#receivedt tbody.filterclass tr").length;
54         if (rowCountPending  > rowsToCollapse) { pendingCollapse(); }
55         if (rowCountReceived > rowsToCollapse) { receivedCollapse(); }
56     });
57
58      // Case-insensitive version of jquery's contains function
59      jQuery.extend(jQuery.expr[':'], {
60             icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0"
61      });
62
63      // Contains exactly function
64      jQuery.extend(jQuery.expr[':'], {
65           containsExactly: "$(a).text() == m[3]"
66      });
67
68
69     // Collapse pending items table
70     function pendingCollapse() {
71         $("#pendingcollapserow").remove();
72     $("#pendingt tr").show();
73         $("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
74         $("#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>");
75
76     }
77
78     // Expend pending items table
79     function pendingExpand() {
80         $("#pendingcollapserow").remove();
81         $("#pendingt tr").show();
82     $("#pendingt tbody.filterclass tr.orderfound").remove();
83         $("#pendingt").before("<p id=\"pendingcollapserow\">" + rowCountPending + _(" items are displayed.") + "<a href=\"javascript:pendingCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
84     }
85
86     // Collapse already received items table
87     function receivedCollapse() {
88         $("#receivedcollapserow").remove();
89         $("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
90         $("#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>");
91     }
92
93     // Expand already received items table
94     function receivedExpand() {
95         $("#receivedcollapserow").remove();
96         $("#receivedt tr").show();
97         $("#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>");
98     }
99
100 //]]>
101 </script>
102 <script type="text/javascript">
103 //<![CDATA[
104             function confirm_delete_item(ordernumber, basketno, biblionumber) {
105                 var is_confirmed = confirm(_('Are you sure you want to delete this order ?'));
106                 if (is_confirmed) {
107                     window.location = "addorder.pl?ordernumber="+ordernumber+"&basketno="+basketno+"&quantity=0&biblionumber="+biblionumber;
108                 }
109             }
110             
111             function confirm_delete_biblio(ordernumber, basketno, biblionumber) {
112                 var is_confirmed = confirm(_('Are you sure you want to delete this catalog record and order ?'));
113                 if (is_confirmed) {
114                     window.location = "addorder.pl?ordernumber="+ordernumber+"&basketno="+basketno+"&quantity=0&biblionumber="+biblionumber+"&delbiblio=1";
115                     }
116             }
117 //]]>
118 </script>
119 </head>
120 <body id="acq_parcel" class="acq">
121 [% INCLUDE 'header.inc' %]
122 [% INCLUDE 'acquisitions-search.inc' %]
123
124 <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;  [% IF ( datereceived ) %]
125             Receipt summary for <i>[% name %]</i> [% IF ( invoice ) %]<i>[ [% invoice %] ]</i>[% END %] on <i>[% formatteddatereceived %]</i>
126         [% ELSE %]
127             Receive orders from [% name %]
128         [% END %]</div>
129
130 <div id="doc3" class="yui-t2">
131
132    <div id="bd">
133         <div id="yui-main">
134         <div class="yui-b">
135         [% IF ( receive_error ) %]
136         <div class="dialog alert">
137         <h3>Error adding items:</h3>
138         <ul>
139         [% FOREACH error_loo IN error_loop %]
140                 <li>[% error_loo.error_param %][% IF ( error_loo.error_duplicate_barcode ) %]Duplicate Barcode[% END %] <!-- todo: other error conditions come here. --></li>
141         [% END %]
142         </ul>
143         </div>
144         [% END %]
145     <h1>
146         [% IF ( datereceived ) %]
147             Receipt summary for <i>[% name %]</i> [% IF ( invoice ) %] <i> [ [% invoice %] ] </i>[% END %] on <i>[% formatteddatereceived %]</i>
148         [% ELSE %]
149             Receive orders from [% name %]
150         [% END %]
151     </h1>
152
153     [% IF ( success_delorder ) %]
154     <div class="dialog message">The order has been successfully canceled.</div>
155     [% ELSE %]
156         [% IF ( error_delitem ) %]
157             <div class="dialog alert">The order has been canceled, although one or more items could not have been deleted.</div>
158         [% END %]
159         [% IF ( error_delbiblio ) %]
160             <div class="dialog alert">The order has been canceled, although the record has not been deleted.</div>
161         [% END %]
162     [% END %]
163
164 <div id="acqui_receive_summary">
165 <p><strong>Invoice number:</strong> [% invoice %] <strong>Received by:</strong> [% loggedinusername %] <strong>On:</strong> [% formatteddatereceived %]</p>
166         <!-- TODO: Add date picker, change rcv date. -->
167 </div>
168 <div id="acqui_receive_search">
169     <h3>Pending orders</h3>
170
171  [% IF ( loop_orders ) %]<table id="pendingt">
172     <thead>
173         <tr>
174             <th>Basket</th>
175             <th>Order line</th>
176             <th>Summary</th>
177             <th>View record</th>
178             <th>Quantity</th>
179             <th>Unit cost</th>
180             <th>Order cost</th>
181             <th>&nbsp;</th>
182             <th>&nbsp;</th>
183         </tr>
184     </thead>
185                 <tfoot>
186             <tr><td colspan="4" class="total">TOTAL</td>
187                 <td> [% totalPquantity %] </td>
188                                 <td>&nbsp;</td>
189                 <td>[% ordergrandtotal %]</td>
190                                 <td>&nbsp;</td>
191                                 <td>&nbsp;</td>
192             </tr>
193                 </tfoot>
194     <tbody class="filterclass">
195         [% FOREACH loop_order IN loop_orders %]
196             <tr>
197                 <td class="basketfilterclass"><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_order.basketno %]">[% loop_order.basketno %]</a></td>
198                 <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber %]&amp;booksellerid=[% loop_order.booksellerid %]">[% loop_order.ordernumber %]</a></td>
199                 <td class="summaryfilterclass">
200                   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblionumber %]">[% loop_order.title |html %]</a>
201                 [% IF ( loop_order.author ) %] by [% loop_order.author %][% END %]
202                 [% IF ( loop_order.isbn ) %] &ndash; [% loop_order.isbn %][% END %]
203                 [% IF ( loop_order.publishercode ) %]<br />Publisher :[% loop_order.publishercode %][% END %]
204                 [% IF ( loop_order.suggestionid ) %]
205                     <br/>
206                     Suggested by: [% loop_order.surnamesuggestedby %][% IF ( loop_order.firstnamesuggestedby ) %], [% loop_order.firstnamesuggestedby %] [% END %]
207                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_order.suggestionid %]&amp;op=show">suggestion #[% loop_order.suggestionid %]</a>)
208                 [% END %]
209                 <br />
210                 [% IF ( loop_order.notes ) %]
211                     <p class="ordernote"><strong>Note: </strong>[% loop_order.notes|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&amp;referrer=/cgi-bin/koha/acqui/parcel.pl%3Fbooksellerid=[% loop_order.booksellerid %]&amp;datereceived=[% loop_order.invoicedatereceived %]&amp;invoice=[% loop_order.invoice %]">Change note</a>]</p>
212                 [% ELSE %]
213                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&amp;referrer=/cgi-bin/koha/acqui/parcel.pl%3Fbooksellerid=[% loop_order.booksellerid %]&amp;datereceived=[% loop_order.invoicedatereceived %]&amp;invoice=[% loop_order.invoice %]">Add note</a>]
214                 [% END %]
215                 </td>
216                 <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
217                 <td>[% loop_order.quantity %]</td>
218                 <td>[% loop_order.ecost %]</td>
219                 <td>[% loop_order.ordertotal %]</td>
220                                 <td>
221                               <a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&amp;datereceived=[% invoicedatereceived %]&amp;invoice=[% invoice %]&amp;gst=[% loop_order.gst %]&amp;freight=[% loop_order.freight %]&amp;booksellerid=[% loop_order.booksellerid %]">Receive</a>
222                                     
223                                 </td>
224                                 <td>
225                                     [% IF ( loop_order.left_holds_on_order ) %]
226                     <span class="button" title="Can't delete order, ([% loop_order.holds_on_order %]) holds are linked with this order cancel holds first">Can't delete order</span><br>
227                     [% ELSE %]
228                     <a href="javascript:confirm_delete_item([% loop_order.ordernumber %],[% loop_order.basketno %],[% loop_order.biblionumber %])" class="button">Delete order</a><br>
229                     [% END %]
230                     [% IF ( loop_order.can_del_bib ) %]
231                     <a href="javascript:confirm_delete_biblio([% loop_order.ordernumber %],[% loop_order.basketno %],[% loop_order.biblionumber %])" class="button">Delete order and catalog record</a><br>
232                     [% ELSE %]
233                     <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
234                     [% END %]
235                     [% IF ( loop_order.left_item ) %]
236                     <b title="Can't delete catalog record, because of [% loop_order.items %] existing item(s)" >[% loop_order.items %] item(s) left</b><br>
237                     [% END %]
238                     [% IF ( loop_order.left_biblio ) %]
239                     <b title="Can't delete catalog record, delete other orders linked to it first">[% loop_order.biblios %] order(s) left</b><br>
240                     [% END %]
241                     [% IF ( loop_order.left_subscription ) %]
242                     <b title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions %] subscription(s) left</b><br>
243                     [% END %]
244                     [% IF ( loop_order.left_holds ) %]
245                     <b title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds %] hold(s) left</b>
246                     [% END %]
247                                 </td>
248             </tr>
249         [% END %]
250     </tbody>
251      </table>[% ELSE %]There are no pending orders.[% END %]
252    <div id="resultnumber">
253         <!-- Row of numbers corresponding to search result pages -->
254         [% IF ( displayprev ) %]
255                 <a href="parcel.pl?type=intra&amp;booksellerid=[% booksellerid %]&amp;startfrom=[% prevstartfrom %][% IF ( datereceived ) %]&amp;datereceived=[% datereceived %][% END %][% IF ( invoice ) %]&amp;invoice=[% invoice %][% END %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage %][% END %]#resultnumber">&lt;&lt; Previous</a>
256         [% END %]
257         [% FOREACH number IN numbers %]
258                 [% IF ( number.highlight ) %]
259                 <span class="current">[% number.number %]</span>
260                 [% ELSE %]
261                 <a href="parcel.pl?type=intra&amp;booksellerid=[% booksellerid %]&amp;startfrom=[% number.startfrom %][% IF ( datereceived ) %]&amp;datereceived=[% datereceived %][% END %][% IF ( invoice ) %]&amp;invoice=[% invoice %][% END %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage %][% END %]#resultnumber">[% number.number %]</a>
262                 [% END %]
263         [% END %]
264         [% IF ( displaynext ) %]
265                 <a href="parcel.pl?type=intra&amp;booksellerid=[% booksellerid %]&amp;startfrom=[% nextstartfrom %][% IF ( datereceived ) %]&amp;datereceived=[% datereceived %][% END %][% IF ( invoice ) %]&amp;invoice=[% invoice %][% END %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage %][% END %]#resultnumber">Next &gt;&gt;</a>
266         [% END %]
267         </div>
268 </div>
269 <div id="acqui_receive_receivelist">
270     <h3>Already received</h3>
271
272    [% IF ( loop_received ) %]
273    <form action="/cgi-bin/koha/acqui/parcel.pl" method="get" name="orderform">
274     <table id="receivedt">
275         <thead>
276             <tr>
277                 <th>Basket</th>
278         <th>Order line</th>
279                 <th>Summary</th>
280         <th>View record</th>
281                 <th>Quantity</th>  
282                 <th>Est cost</th>
283                 <th>Actual cost</th>
284                 <th>TOTAL</th>
285             </tr>
286     </thead>
287     <tfoot>
288             <tr>
289                 <td colspan="4" class="total">SUBTOTAL</td>
290                 <td colspan="2">&nbsp;</td>
291                 <td>[% totalprice %]</td>
292                 <td>[% tototal %]</td>
293             </tr>
294               
295               [% IF ( totalfreight ) %]
296                     <tr>
297                         <td colspan="6">&nbsp;
298                 </td>
299                             <td>Shipping</td>
300                 <td>[% totalfreight %]</td>
301                 </tr> 
302             [% END %]
303               [% IF ( gst ) %]
304                     <tr>
305                         <td colspan="6">
306                 <p class="message">
307                             <b>HELP</b><br />
308                     The total at the bottom of the page should be within a few cents of the total for the invoice.
309                 </p>
310                 </td>
311                             <td><b>Tax rate</b></td>
312                 <td>[% gst %]</td>
313                 </tr> 
314             [% END %]
315             <tr>
316             <td colspan="4" class="total">TOTAL</td>
317                 <td>[% totalquantity %]</td>
318                 <td colspan="2">&nbsp;</td>
319                 <td>[% grandtot %]</td>
320             </tr>
321     </tfoot>
322         <tbody class="filterclass">
323             [% FOREACH loop_receive IN loop_received %]
324             <tr>
325                 <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_receive.basketno %]">[% loop_receive.basketno %]</a></td>
326                 <td><a href="neworderempty.pl?ordernumber=[% loop_receive.ordernumber %]&amp;booksellerid=[% booksellerid %]">[% loop_receive.ordernumber %]</a></td>
327                 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_receive.biblionumber %]">[% loop_receive.title |html %]</a>
328                 [% IF ( loop_receive.author ) %] / [% loop_receive.author %][% END %]
329                 [% IF ( loop_receive.isbn ) %] - [% loop_receive.isbn %][% END %]
330                 [% IF ( loop_receive.publishercode ) %]<br />Publisher :[% loop_receive.publishercode %][% END %]
331                 [% IF ( loop_receive.suggestionid ) %]
332                     <br/>
333                     Suggested by: [% loop_receive.surnamesuggestedby %][% IF ( loop_receive.firstnamesuggestedby ) %], [% loop_receive.firstnamesuggestedby %] [% END %]
334                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_receive.suggestionid %]&amp;op=show">suggestion #[% loop_receive.suggestionid %]</a>)
335                 [% END %]
336                 </td>
337                 <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
338                 <td>[% loop_receive.quantityreceived %]</td>
339                 <td>[% loop_receive.ecost %]</td>
340                 <td>[% loop_receive.unitprice %]</td>
341                 <td>[% loop_receive.total %]</td>
342             </tr>
343             [% END %]
344         </tbody>
345     </table>
346     </form>
347         [% ELSE %]There are no received orders.[% END %]
348 </div>
349
350 <!--<form action="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid %]" method="post">-->
351 <form action="parcels.pl?booksellerid=[% booksellerid %]" method="post">
352     <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
353     <fieldset class="action">
354         <input type="submit" value="Finish receiving" />
355     </fieldset>
356 </form>
357
358 </div>
359 </div>
360 <div class="yui-b">
361 <form action="/cgi-bin/koha/acqui/parcel.pl" id="filterform" method="post">
362         <fieldset class="brief">
363
364             <h4>Filter</h4>
365
366             <ol>
367
368                 <li>
369                     <label for="summaryfilter">ISBN, author or title :</label>
370             <input type="text" name="summaryfilter" id="summaryfilter" value="[% summaryfilter %]"/>
371                 </li>
372
373                 <li>
374                     <label for="basketfilter">Basket :</label>
375             <input type="text" name="basketfilter" id="basketfilter" value="[% basketfilter %]"/>
376                 </li>
377
378                 <li>
379             <label for="orderfilter">Order line :</label>
380             <input type="text" name="orderfilter" id="orderfilter" value="[% orderfilter %]"/>
381                 </li>
382                 [% IF (UNIMARC) %]
383         <li>
384             <label for="eanfilter">EAN :</label>
385             <input type="text" name="eanfilter" id="eanfilter" value="[% eanfilter %]"/>
386         </li>
387                 [% END %]
388             </ol>
389                 <fieldset class="action">
390         <input type="hidden" value="search" name="op" />
391         <input type="hidden" value="[% booksellerid %]" name="booksellerid" />
392         <input type="hidden" value="[% invoice %]" name="invoice" />
393         <input type="hidden" value="[% invoicedatereceived %]" name="datereceived" />
394         <input type="submit" value="Filter" />
395         <a href="/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% booksellerid %]&invoice=[% invoice %]&op=new&datereceived=[% formatteddatereceived %]">Clear</a>
396                 </fieldset>
397
398
399         </fieldset>
400     </form>
401 [% INCLUDE 'acquisitions-menu.inc' %]
402 </div>
403 </div>
404 [% INCLUDE 'intranet-bottom.inc' %]
405