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