Bug 11203 - Datatables in acqusitions do not ignore "stopwords" in titles
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / basket.tt
1 [% USE KohaDates %]
2 [% USE Price %]
3 [% USE AuthorisedValues %]
4
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Acquisitions &rsaquo; [% UNLESS ( basketno ) %]New [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</title>
7 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% INCLUDE 'datatables.inc' %]
10 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
11 <script type="text/javascript">
12 //<![CDATA[
13     function updateColumnsVisibility(visible) {
14         if ( visible ) {
15             $("table .gste, .gsti").show();
16         } else {
17             [% IF ( listincgst ) %]
18                 $("table .gste").hide();
19             [% ELSE %]
20                 $("table .gsti").hide();
21             [% END %]
22         }
23     }
24
25     $(document).ready(function() {
26         $('#toolbar').fixFloat();
27         $("#show_all_details").click(function(){
28             updateColumnsVisibility($(this).is(":checked"));
29         });
30
31         $("#show_all_details").attr('checked', false);
32         updateColumnsVisibility(false);
33         [% UNLESS ( closedate ) %]
34             $('#addtoBasket').on('show', function () {
35                $(this).find(".modal-body").html($(".acqui_basket_add")[0].outerHTML);
36             });
37         [% END %]
38     });
39 //]]>
40 </script>
41
42 [% UNLESS ( closedate ) %]
43 <script type="text/javascript">
44 //<![CDATA[
45
46             function delete_basket(basketno,booksellerid,delbiblio) {
47                 window.location = "[% script_name %]?op=delete_confirm&delbiblio="+delbiblio+"&basketno="+basketno+"&booksellerid="+booksellerid;
48             }
49
50             function transfer_order_popup(ordernumber) {
51                 var url = "/cgi-bin/koha/acqui/transferorder.pl?"
52                     + "ordernumber=" + ordernumber
53                 window.open(url, 'TransferOrder','width=600,height=400,toolbar=false,scrollbars=yes');
54             }
55
56             function confirm_ediorder() {
57                 var is_confirmed = confirm(_("Are you sure you want to close this basket and generate an Edifact order?"));
58                 if (is_confirmed) {
59                     window.location = "[% script_name %]?op=edi_confirm&basketno=[% basketno %]";
60                 }
61             }
62
63 //]]>
64 </script>
65 [% ELSE %]
66 <script type="text/javascript">
67 //<![CDATA[
68     $(document).ready(function(){
69         $("#basketgroupid").change(function(){
70             if($(this).val() == "new"){
71                 location.href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% booksellerid %]";
72             }
73         });
74     });
75 //]]>
76 </script>
77 [% UNLESS ( grouped ) %]
78 <script type="text/javascript">
79 //<![CDATA[
80             function confirm_reopen() {
81                 var skip = [% IF ( skip_confirm_reopen ) %] 1 [% ELSE %] 0 [% END %];
82                 var is_confirmed = skip || confirm(_("Are you sure you want to reopen this basket?"));
83                 if (is_confirmed) {
84                     window.location = "[% script_name %]?op=reopen&basketno=[% basketno %]";
85                 }
86             }
87 //]]>
88 </script>
89 [% END %]
90 [% END %]
91 <script type="text/javascript">
92 //<![CDATA[
93     $(document).ready(function() {
94         var orderst = $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
95             "sPaginationType": "four_button",
96             [% IF ( active ) %]
97                 "aoColumnDefs": [
98                     [% UNLESS ( closedate ) %]
99                         { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
100                     [% END %]
101                     { "sType": "anti-the", "aTargets": [ "anti-the" ] }
102                 ],
103             [% END %]
104         } ) );
105         var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, {
106             "sPaginationType": "four_button"
107         } ) );
108         $("#reopenbutton").on("click",function(e){
109             e.preventDefault();
110             confirm_reopen();
111         });
112     });
113
114     function UserSearchPopup(f) {
115         window.open(
116             "/cgi-bin/koha/acqui/add_user_search.pl",
117             'UserSearchPopup',
118             'width=740, height=450, scrollbars=yes, toolbar=no,'
119          );
120     }
121
122     function add_user(borrowernumber, borrowername) {
123         var ids = $("#users_ids").val();
124         if(ids.length > 0) {
125             ids = ids.split(':');
126         } else {
127             ids = new Array;
128         }
129         if (ids.indexOf(borrowernumber) < 0) {
130             ids.push(borrowernumber);
131             $("#users_ids").val(ids.join(':'));
132             var li = '<li id="user_'+borrowernumber+'">'+borrowername
133                 + ' [<a style="cursor:pointer" onclick="del_user('+borrowernumber+');">'
134                 + _("Delete user") + '</a>]</li>';
135             $("#users_names").append(li);
136             return 0;
137         }
138         return -1;
139     }
140
141     function del_user(borrowernumber) {
142       $("#user_"+borrowernumber).remove();
143       var ids = $("#users_ids").val().split(':');
144       ids.splice(ids.indexOf(borrowernumber.toString()), 1);
145       $("#users_ids").val(ids.join(':'));
146     }
147 //]]>
148 </script>
149 <style type="text/css">
150 .sortmsg {font-size: 80%;}
151 </style>
152 </head>
153 <body id="acq_basket" class="acq">
154 [% INCLUDE 'header.inc' %]
155 [% INCLUDE 'acquisitions-search.inc' %]
156
157
158 <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="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% name|html %]</a> &rsaquo; [% UNLESS ( basketno ) %]New [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</div>
159
160 <div id="doc3" class="yui-t2">
161
162 <div id="bd">
163     <div id="yui-main">
164     [% IF (cannot_manage_basket) %]
165         <div class="yui-b">
166             <p class="error">You are not authorised to manage this basket.</p>
167         </div>
168     [% ELSE %]
169     <div class="yui-b">
170         [% IF !confirm_close && !edi_confirm %]
171         [% UNLESS ( selectbasketg ) %]
172             [% UNLESS ( closedate ) %]
173                 <div id="toolbar" class="btn-toolbar">
174                     [% IF active %]
175                         <div class="btn-group"><a href="#addtoBasket" role="button" class="btn btn-small" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a></div>
176                     [% END %]
177                     <div class="btn-group"><a href="basketheader.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]&amp;op=add_form" class="btn btn-small" id="basketheadbutton"><i class="fa fa-pencil"></i> Edit basket</a></div>
178                     [%# FIXME This action should not be available for everyone %]
179                     <div class="btn-group"><a href="#deleteBasketModal" role="button" class="btn btn-small" data-toggle="modal" id="delbasketbutton"><i class="fa fa-remove"></i> Delete this basket</a></div>
180                    [% IF ( unclosable ) %]
181                     [% ELSIF ( uncertainprices ) %]
182                         <div class="btn-group"><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid %]&amp;owner=1" class="btn btn-small" id="uncertpricesbutton">Uncertain prices</a></div>
183                     [% ELSE %]
184                         <div class="btn-group">
185                             <a href="[% script_name %]?op=close&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="btn btn-small" id="closebutton"><i class="fa fa-times-circle"></i> Close this basket</a>
186                         </div>
187                     [% END %]
188                         <div class="btn-group"><a href="[% script_name %]?op=export&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="btn btn-small" id="exportbutton"><i class="fa fa-download"></i> Export this basket as CSV</a></div>
189                         [% IF ediaccount %]
190                         <div class="btn-group"><a href="/cgi-bin/koha/acqui/edi_ean.pl?op=ediorder&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="btn btn-small" id="ediorderbutton"><i class="fa fa-download"></i> Create edifact order</a></div>
191                         [% END %]
192                 </div>
193 <!-- Modal for confirm deletion box-->
194                 <div class="modal hide" id="deleteBasketModal" tabindex="-1" role="dialog" aria-labelledby="delbasketModalLabel" aria-hidden="true">
195                     <div class="modal-header">
196                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
197                         <h3>Confirm deletion</h3>
198                     </div>
199                     [% UNLESS book_foot_loop %]
200                         <div class="modal-body">
201                            <p>Are you sure you want to delete this basket?</p>
202                         </div>
203                         <div class="modal-footer">
204                             <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
205                             <button type="submit" class="btn btn-default" onclick="delete_basket([% basketno %],[% booksellerid %],0); return false;" >Delete basket</button>
206                         </div>
207                     [% ELSE %]
208                         <div class="modal-body">
209                            <p>Are you sure you want to delete this basket?</p>
210                            <p>Warning:</p>
211                            <p>All orders of this basket will be cancelled and used funds will be refunded.</p>
212                            <p>If items have been created when ordering or receiving, they will be deleted.</p>
213                            <p>You can choose to delete bibliographic records if possible (bibliographic records that have other items or that are used in a subscription or another order will not be deleted).</p>
214                         </div>
215                         <div class="modal-footer">
216                             <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
217                             <button type="submit" class="btn btn-default" onclick="delete_basket([% basketno %],[% booksellerid %],0); return false;">Delete basket and orders</button>
218                             <button type="submit" class="btn btn-default" onclick="delete_basket([% basketno %],[% booksellerid %],1); return false;">Delete basket, orders and bibs</button>
219                         </div>
220                     [% END %]
221                 </div>
222 <!-- End of Modal-->
223             [% ELSE %]
224                 [% UNLESS ( grouped ) %]
225                 <div id="toolbar" class="btn-toolbar">
226                     <div class="btn-group"><a href="#" class="btn btn-small" id="reopenbutton"><i class="fa fa-refresh"></i> Reopen this basket</a></div>
227                     <div class="btn-group"><a href="[% script_name %]?op=export&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="btn btn-small" id="exportbutton"><i class="fa fa-download"></i> Export this basket as CSV</a></div>
228                 </div>
229                 [% END %]
230             [% END %]
231             [% END %]
232
233     [% IF ( NO_BOOKSELLER ) %]
234     <h2>Vendor not found</h2>
235     [% ELSE %]
236         [% IF ( delete_confirmed ) %]
237             <h3>Basket deleted</h3>
238             [% IF (cannotdelbiblios) %]
239                 <div class="dialog alert">
240                     <p><strong>Warning:</strong></p>
241                     <p><strong>The following records could not be deleted:</strong></p>
242                     <ul>
243                     [% FOREACH cannotdelbiblio IN cannotdelbiblios %]
244                         <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cannotdelbiblio.biblionumber %]">[% cannotdelbiblio.title |html %]</a> by [% cannotdelbiblio.author %]:
245                             <ul>
246                             [% IF (cannotdelbiblio.itemcount) %]<li>[% cannotdelbiblio.itemcount %] item(s) attached.</li>[% END %]
247                             [% IF (cannotdelbiblio.subscriptions) %]<li>[% cannotdelbiblio.subscriptions %] subscription(s) attached.</li>[% END %]
248                             [% IF (cannotdelbiblio.countbiblio) %]<li>[% cannotdelbiblio.countbiblio %] order(s) attached.</li>[% END %]
249                             [% IF (cannotdelbiblio.othererror) %]<li>Unknown error.</li>[% END %]
250                             </ul>
251                         </li>
252                     [% END %]
253                     </ul>
254                 </div>
255                 <a href="booksellers.pl">Click here to go back to booksellers page</a>
256             [% ELSE %]
257             <META HTTP-EQUIV=Refresh CONTENT="0; url=booksellers.pl">
258             [% END %]
259         [% ELSE %]
260         <h1>[% UNLESS ( basketno ) %]New [% END %]Basket [% basketname|html %] ([% basketno %]) for <a href="supplier.pl?booksellerid=[% booksellerid %]">[% name|html %]</a></h1>
261         [% IF ( basketno ) %]
262             <div id="acqui_basket_summary" class="yui-g">
263                 <div class="rows">
264                 <div class="yui-u first">
265                 <ol>
266                 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
267                 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
268                 [% IF ( basketcontractno ) %]
269                     <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]&amp;booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li>
270                 [% END %]
271                 [% IF ( deliveryplace ) %]<li><span class="label">Delivery place:</span> [% deliveryplace %]</li>[% END %]
272                 [% IF ( billingplace ) %]<li><span class="label">Billing place:</span> [% billingplace %]</li>[% END %]
273                 [% IF ( authorisedbyname ) %]<li><span class="label">Created by:</span>  [% authorisedbyname %]</li>[% END %]
274                 <li id="managedby">
275                     <form action="" method="post">
276                         <span class="label">Managed by:</span>
277                         <div style="float:left">
278                             <ul id="users_names" style="padding-left:0">
279                               [% FOREACH user IN users %]
280                                 <li id="user_[% user.borrowernumber %]">
281                                     [% user.firstname %] [% user.surname %]
282                                     [<a onclick="del_user([% user.borrowernumber %]);" style="cursor:pointer">Delete user</a>]
283                                 </li>
284                               [% END %]
285                             </ul>
286                             <input type="hidden" id="basketno" name="basketno" value="[% basketno %]" />
287                             <input type="hidden" id="users_ids" name="users_ids" value="[% users_ids %]" />
288                             <input type="hidden" id="op" name="op" value="mod_users" />
289                             <input type="button" id="add_user" onclick="UserSearchPopup();" value="Add user" />
290                             <input type="submit" value="Save changes" />
291                         </div>
292                     </form>
293                 </li>
294                 <li id="branch">
295                     <span class="label">Library:</span>
296                     [% IF basketbranchname %]
297                         [% basketbranchname %]
298                     [% ELSE %]
299                         No library
300                     [% END %]
301                     [% IF branches_loop.size %]
302                         <form action="" method="post">
303                             <select id="branch" name="branch">
304                                 <option value="">(no library)</option>
305                                 [% FOREACH branch IN branches_loop %]
306                                     [% IF (branch.selected) %]
307                                         <option selected="selected" value="[% branch.branchcode %]"> [% branch.branchname %]</option>
308                                     [% ELSE %]
309                                         <option value="[% branch.branchcode %]"> [% branch.branchname %]</option>
310                                     [% END %]
311                                 [% END %]
312                             </select>
313                             <input type="hidden" id="basketno" name="basketno" value="[% basketno %]" />
314                             <input type="hidden" id="op" name="op" value="mod_branch" />
315                             <input type="submit" value="Change" />
316                         </form>
317                     [% END %]
318                 </li>
319                 [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
320                 [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
321                 [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates  %]</li>[% END %]
322
323                 </ol>
324                 </div>
325                 [% IF ( closedate ) %]
326                 <div class="yui-u">
327                     [% IF ( CAN_user_acquisition_group_manage ) %]
328                     <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
329                     [% END %]
330                         <ol>
331                         <li>
332                           <span class="label">Basket group:</span>
333                           [% IF basketgroup.id and not basketgroup.name %]
334                             [% SET basketgroup.name = "Basket group no. " _ basketgroup.id %]
335                           [% END %]
336                           [% IF basketgroup.closed %]
337                               [% IF ( CAN_user_acquisition_group_manage ) %]
338                                   <a href="basketgroup.pl?op=add&booksellerid=[% booksellerid %]&basketgroupid=[% basketgroup.id %]" title="basketgroup">[% basketgroup.name %] (closed)</a>
339                               [% ELSE %]
340                                   [% basketgroup.name %] (closed)
341                               [% END %]
342                           [% ELSIF ( ! CAN_user_acquisition_group_manage ) %]
343                             [%- IF basketgroup.id -%]
344                                 [% basketgroup.name %]
345                             [%- ELSE -%]
346                                 No group
347                             [%- END -%]
348                           [% ELSE %]
349                             <select id="basketgroupid" name="basketgroupid">
350                               <option value="">No group</option>
351                               [% FOREACH bg IN basketgroups %]
352                                 [% IF ( bg.default ) %]
353                                     <option value="[% bg.id %]" selected="selected">[% bg.name %]</option>
354                                 [% ELSE %]
355                                   [% UNLESS bg.closed %]
356                                     <option value="[% bg.id %]">[% bg.name %]</option>
357                                   [% ELSE %]
358                                     <option value="[% bg.id %]" disabled="disabled">[% bg.name %] (closed)</option>
359                                   [% END %]
360                                 [% END %]
361                               [% END %]
362                               <option value="new">Add new group</option>
363                             </select>
364                             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
365                             <input type="hidden" value="mod_basket" name="op" />
366                             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
367                             <input type="submit" value="Change basket group" />
368                           [% END %]
369                         </li>
370                     [% IF ( basketgroup.deliveryplacename ) %]<li><span class="label">Basket group delivery placename:</span> [% basketgroup.deliveryplacename %]</li>[% END %]
371                     [% IF ( basketgroup.billingplacename ) %]<li><span class="label">Basket group billing place:</span> [% basketgroup.billingplacename %]</li>[% END %]
372                         </ol>
373                     [% IF ( CAN_user_acquisition_group_manage ) %]
374                     </form>
375                     [% END %]
376                 </div>
377                 [% END %]
378             </div>
379             </div>
380         [% END %]
381         [% IF ( duplinbatch ) %]<div class="dialog alert">
382         <h4>Duplicate warning</h4>
383         <p>Some records have not been automatically added because they match an existing record in your catalog:<a href="/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=[% duplinbatch %]&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" title="Open in new window" target="_blank" class="popup" style="margin-left:10px">Display them</a></p>
384         </div>[% END %]
385
386         <div id="acqui_basket_content" class="yui-g">
387         [% IF ( books_loop ) %]
388         <h2>Orders</h2>
389         <label for="show_all_details">
390             <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
391             Show all details
392         </label>
393             <table id="orders">
394                 <thead>
395                     <tr>
396                         <th>No.</th>
397                         <th class="anti-the">Order</th>
398                         <th class="gste">RRP tax exc.</th>
399                         <th class="gste">ecost tax exc.</th>
400                         <th class="gsti">RRP tax inc.</th>
401                         <th class="gsti">ecost tax inc.</th>
402                         <th>Qty.</th>
403                         <th class="gste">Total tax exc. ([% currency %])</th>
404                         <th class="gsti">Total tax inc. ([% currency %])</th>
405                         <th>GST %</th>
406                         <th>GST</th>
407                         <th>Fund</th>
408                         <th>Supplier report</th>
409                         [% IF ( active ) %]
410                             [% UNLESS ( closedate ) %]
411                                 <th>Modify</th>
412                                 <th>Delete</th>
413                             [% END %]
414                         [% END %]
415                     </tr>
416                 </thead>
417                 <tfoot>
418                 [% FOREACH foot_loo IN book_foot_loop %]
419                     <tr>
420                         <th></th>
421                         <th>Total (GST [% foot_loo.gstrate * 100 | $Price %])</th>
422                         <th class="gste">&nbsp;</th>
423                         <th class="gste">&nbsp;</th>
424                         <th class="gsti">&nbsp;</th>
425                         <th class="gsti">&nbsp;</th>
426                         <th>[% foot_loo.quantity %]</th>
427                         <th class="gste">[% foot_loo.totalgste | $Price%]</th>
428                         <th class="gsti">[% foot_loo.totalgsti | $Price %]</th>
429                         <th>&nbsp;</th>
430                         <th>[% foot_loo.gstvalue | $Price %]</th>
431                         <th>&nbsp;</th>
432                         <th>&nbsp;</th>
433                         [% IF ( active ) %]
434                             [% UNLESS ( closedate ) %]
435                                 <th>&nbsp;</th>
436                                 <th>&nbsp;</th>
437                             [% END %]
438                         [% END %]
439                     </tr>
440                 [% END %]
441                 <tr>
442                     <th></th>
443                     <th>Total ([% currency %])</th>
444                     <th class="gste">&nbsp;</th>
445                     <th class="gste">&nbsp;</th>
446                     <th class="gsti">&nbsp;</th>
447                     <th class="gsti">&nbsp;</th>
448                     <th>[% total_quantity %]</th>
449                     <th class="gste">[% total_gste | $Price %]</th>
450                     <th class="gsti">[% total_gsti | $Price %]</th>
451                     <th>&nbsp;</th>
452                     <th>[% total_gstvalue | $Price %]</th>
453                     <th>&nbsp;</th>
454                     <th>&nbsp;</th>
455                     [% IF ( active ) %]
456                         [% UNLESS ( closedate ) %]
457                             <th>&nbsp;</th>
458                             <th>&nbsp;</th>
459                         [% END %]
460                     [% END %]
461                 </tr>
462                 </tfoot>
463                 <tbody>
464                 [% FOREACH books_loo IN books_loop %]
465                     [% IF ( books_loo.order_received ) %]
466                         <tr class="disabled">
467                     [% ELSE %]
468                         <tr>
469                     [% END %]
470                         <td>
471                             [% books_loo.ordernumber %]
472                         </td>
473                         <td>
474                             <p>
475                                 [% IF ( books_loo.order_received ) %] (rcvd)[% END %]
476                                 [% IF books_loo.title %]
477                                     <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a>[% IF books_loo.author %] by [% books_loo.author %][% END %]
478                                 [% ELSE %]
479                                     <em>Deleted bibliographic record, can't find title</em><br />
480                                 [% END %]
481                                 <br />
482                                 [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
483                                 [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
484                                 [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
485                                 [% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
486                                 [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
487                                 [% IF ( books_loo.suggestionid ) %]
488                                     <br/>
489                                     Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %]
490                                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&amp;op=show">suggestion #[% books_loo.suggestionid %]</a>)
491                                 [% END %]
492                             </p>
493                                 [% IF ( books_loo.order_internalnote ) %]
494                                     <p class="ordernote"><strong>Internal note: </strong>[% books_loo.order_internalnote|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=internal">Change internal note</a>]</p>
495                                 [% ELSE %]
496                                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=internal">Add internal note</a>]
497                                 [% END %]
498                                 [% IF ( books_loo.order_vendornote ) %]
499                                     <p class="ordernote"><strong>Vendor note: </strong>[% books_loo.order_vendornote|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=vendor">Change vendor note</a>]</p>
500                                 [% ELSE %]
501                                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=vendor">Add vendor note</a>]
502                                 [% END %]
503                             [% IF (books_loo.transferred_from) %]
504                               [% basket = books_loo.transferred_from.basket %]
505                               [% bookseller = books_loo.transferred_from.bookseller %]
506                               [% timestamp = books_loo.transferred_from.timestamp %]
507                               <p>Transferred from basket:
508                                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]"> [% basket.basketname %]</a>
509                                 (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id %]">[% bookseller.name %]</a>)
510                                 on <span title="[% timestamp | $KohaDates with_hours = 1 %]">
511                                   [% timestamp | $KohaDates %]
512                                 </span>
513                               </p>
514                             [% END %]
515                         </td>
516                         [% SET zero_regex = "^0{1,}\.?0{1,}[^1-9]" %] [%# 0 or 0.0 or 0.00 or 00 or 00.0 or 00.00 or 0.000 ... %]
517                         [%# FIXME: use of a regexp is not ideal; bugs 9410 and 10929 suggest better way of handling this %]
518                         <td class="number gste [% IF books_loo.rrpgste.search(zero_regex) %]error[% END %]">[% books_loo.rrpgste | $Price %]</td>
519                         <td class="number gste [% IF books_loo.ecostgste.search(zero_regex) %]error[% END %]">[% books_loo.ecostgste | $Price%]</td>
520                         <td class="number gsti [% IF books_loo.rrpgsti.search(zero_regex) %]error[% END %]">[% books_loo.rrpgsti | $Price %]</td>
521                         <td class="number gsti [% IF books_loo.ecostgsti.search(zero_regex) %]error[% END %]">[% books_loo.ecostgsti | $Price %]</td>
522                         <td class="number [% IF books_loo.quantity.search(zero_regex) %]error[% END %]">[% books_loo.quantity %]</td>
523                         <td class="number gste [% IF books_loo.totalgste.search(zero_regex) %]error[% END %]">[% books_loo.totalgste | $Price %]</td>
524                         <td class="number gsti [% IF books_loo.totalgsti.search(zero_regex) %]error[% END %]">[% books_loo.totalgsti | $Price %]</td>
525                         <td class="number">[% books_loo.gstrate * 100 | $Price %]</td>
526                         <td class="number [% IF books_loo.gstvalue.search(zero_regex) %]error[% END %]">[% books_loo.gstvalue | $Price %]</td>
527                         <td>[% books_loo.budget_name %]</td>
528                         <td>[% books_loo.suppliers_report %]</td>
529                         [% IF ( active ) %]
530                             [% UNLESS ( closedate ) %]
531                             <td>
532                                 <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Modify</a>
533                                 [% UNLESS (books_loo.order_received) %]
534                                     <br />
535                                     <a href="#" onclick="transfer_order_popup([% books_loo.ordernumber %]); return false;">Transfer</a>
536                                 [% END %]
537                             </td>
538                             <td>
539                             [% IF ( books_loo.left_holds_on_order ) %]
540                             <span class="button" title="Can't delete order, ([% books_loo.holds_on_order %]) holds are linked with this order cancel holds first">Can't delete order</span><br>
541                             [% ELSE %]
542                             <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber %]&biblionumber=[% books_loo.biblionumber %]&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno %]" class="button">Delete order</a><br>
543                             [% END %]
544                             [% IF ( books_loo.can_del_bib ) %]
545                             <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% books_loo.ordernumber %]&biblionumber=[% books_loo.biblionumber %]&del_biblio=1&referrer=/cgi-bin/koha/acqui/basket.pl%3Fbasketno=[% basketno %]" class="button">Delete order and catalog record</a><br>
546                             [% ELSE %]
547                             <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
548                             [% END %]
549                             [% IF ( books_loo.left_item ) %]
550                             <b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
551                             [% END %]
552                             [% IF ( books_loo.left_biblio ) %]
553                             <b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
554                             [% END %]
555                             [% IF ( books_loo.left_subscription ) %]
556                             <b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
557                             [% END %]
558                             [% IF ( books_loo.left_holds ) %]
559                             <b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
560                             [% END %]
561                             </td>
562                             [% END %]
563                         [% END %]
564                     </tr>
565                 [% END %]
566                 </tbody>
567             </table>
568         [% END %]
569         [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
570         [% END %]
571         </div>
572         [% IF (cancelledorders_loop) %]
573           <div id="cancelledorders">
574             <h2>Cancelled orders</h2>
575             <table id="cancelledorderst">
576               <thead>
577                 <tr>
578                   <th>No.</th>
579                   <th>Order</th>
580                   <th class="gste">RRP tax exc.</th>
581                   <th class="gste">ecost tax exc.</th>
582                   <th class="gsti">RRP tax inc.</th>
583                   <th class="gsti">ecost tax inc.</th>
584                   <th>Qty.</th>
585                   <th class="gste">Total tax exc. ([% currency %])</th>
586                   <th class="gsti">Total tax inc. ([% currency %])</th>
587                   <th>GST %</th>
588                   <th>GST</th>
589                   <th>Fund</th>
590                 </tr>
591               </thead>
592               <tbody>
593                 [% FOREACH order IN cancelledorders_loop %]
594                   <tr style="color:grey">
595                     <td>
596                         [% order.ordernumber %]
597                     </td>
598                     <td>
599                       <p>
600                         [% IF ( order.order_received ) %] (rcvd)[% END %]
601                         [% IF (order.title) %]
602                           [% order.title |html %][% IF order.author %] by [% order.author %][% END %]
603                         [% ELSE %]
604                           <em>Deleted bibliographic record, can't find title</em>
605                         [% END %]
606                         <br />
607                         [% IF ( order.order_internalnote ) %] [% order.order_internalnote %][% END %]
608                         [% IF ( order.isbn ) %] - [% order.isbn %][% END %]
609                         [% IF ( order.issn ) %] - [% order.issn %][% END %]
610                         [% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
611                         [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
612                         [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
613                         [% IF ( order.cancellationreason ) %]
614                           <br />
615                           Cancellation reason: [% AuthorisedValues.GetByCode( 'ORDER_CANCELLATION_REASON', order.cancellationreason ) %]
616                         [% END %]
617                       </p>
618                       [% IF order.transferred_to %]
619                         [% basket = order.transferred_to.basket %]
620                         [% bookseller = order.transferred_to.bookseller %]
621                         [% timestamp = order.transferred_to.timestamp %]
622                         <p>Transferred to basket:
623                           <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]"> [% basket.basketname %]</a>
624                           (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id %]">[% bookseller.name %]</a>)
625                           on <span title="[% timestamp | $KohaDates with_hours = 1%]">
626                             [% timestamp | $KohaDates %]
627                           </span>
628                         </p>
629                       [% END %]
630                     </td>
631                     <td class="number gste">[% order.rrpgste | $Price %]</td>
632                     <td class="number gste">[% order.ecostgste | $Price %]</td>
633                     <td class="number gsti">[% order.rrpgsti | $Price %]</td>
634                     <td class="number gsti">[% order.ecostgsti | $Price %]</td>
635                     <td class="number">[% order.quantity %]</td>
636                     <td class="number gste">[% order.totalgste | $Price %]</td>
637                     <td class="number gsti">[% order.totalgsti | $Price %]</td>
638                     <td class="number">[% order.gstrate * 100 | $Price %]</td>
639                     <td class="number">[% order.gstvalue | $Price %]</td>
640                     <td>[% order.budget_name %]
641                   </tr>
642                 [% END %]
643               </tbody>
644             </table>
645           </div>
646         [% END %]
647         <br />
648         [% UNLESS ( closedate ) %]
649
650     <!-- Modal -->
651     <div id="addtoBasket" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel" aria-hidden="true">
652         <div class="modal-body">
653         [% IF active %]
654             [% INCLUDE 'acquisitions-add-to-basket.inc' %]
655         [% END %]
656         </div>
657         <div class="modal-footer">
658             <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
659         </div>
660     </div>
661
662         [% END %]
663
664 [% END %]
665 [% END %]    [% ELSE %] <!-- if we want just to select a basketgroup for a closed basket -->
666     [% END %]
667 [% IF ( confirm_close ) %]
668         <div id="closebasket_needsconfirmation" class="dialog alert">
669
670         <form action="/cgi-bin/koha/acqui/basket.pl">
671             <h1>Are you sure you want to close basket [% basketname|html %]?</h1>
672             [% IF ( CAN_user_acquisition_group_manage ) %]
673             <p>
674             <label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
675             <input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
676             </p>
677             [% END %]
678             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
679             <input type="hidden" value="close" name="op" />
680             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
681             <input type="hidden" name="confirm" value="1" />
682             <input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
683             <button type="submit" class="approve" accesskey="y"><i class="fa fa-fw fa-check"></i> Yes, close (Y)</button>
684         </form>
685         <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
686             <input type="hidden" name="basketno" value="[% basketno %]" />
687             <button type="submit" class="deny" accesskey="n"><i class="fa fa-fw fa-remove"></i> No, don't close (N)</button>
688         </form>
689         </div>
690     [% END %]
691 [% IF edi_confirm %]
692         <div id="closebasket_needsconfirmation" class="dialog alert">
693
694         <form action="/cgi-bin/koha/acqui/basket.pl" class="confirm">
695             <h1>Are you sure you want to generate an edifact order and close basket [% basketname|html %]?</h1>
696             [% IF CAN_user_acquisition_group_manage %]
697             <p>
698             <label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
699             <input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
700             </p>
701             [% END %]
702             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
703             <input type="hidden" value="ediorder" name="op" />
704             <input type="hidden" name="ean" value="[% ean %]" />
705             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
706             <input type="hidden" name="confirm" value="1" />
707             <input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
708             <input type="submit" class="approve" value="Yes, close (Y)" accesskey="y" />
709             <input type="submit" class="deny" value="No, don't close (N)" accesskey="n" onclick="javascript:window.location='/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]';return false;" />
710         </form>
711         </div>
712     [% END %]
713 </div>
714 [% END %][%# IF (cannot_manage_basket) %]
715 </div>
716 <div class="yui-b">
717 [% INCLUDE 'acquisitions-menu.inc' %]
718 </div>
719 </div>
720 [% INCLUDE 'intranet-bottom.inc' %]