Bug 16239: Update templates
[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"><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>
171
172 <div id="doc3" class="yui-t2">
173
174 <div id="bd">
175     <div id="yui-main">
176     [% IF (cannot_manage_basket) %]
177         <div class="yui-b">
178             <p class="error">You are not authorised to manage this basket.</p>
179         </div>
180     [% ELSE %]
181     <div class="yui-b">
182         [% IF !confirm_close && !edi_confirm %]
183         [% UNLESS ( selectbasketg ) %]
184             [% UNLESS ( closedate ) %]
185                 <div id="toolbar" class="btn-toolbar">
186                     [% IF active %]
187                         <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>
188                     [% END %]
189                     <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>
190                     [%# FIXME This action should not be available for everyone %]
191                     <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>
192                    [% IF ( unclosable ) %]
193                     [% ELSIF ( uncertainprices ) %]
194                         <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">Uncertain prices</a></div>
195                     [% ELSE %]
196                         <div class="btn-group">
197                             <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>
198                         </div>
199                     [% END %]
200                         <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>
201                         [% IF ediaccount %]
202                         <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>
203                         [% END %]
204                         [% IF ( active && books_loop ) %]
205                             <div class="btn-group">
206                                 <form action="/cgi-bin/koha/acqui/basket.pl" method="post">
207                                     <input type="hidden" name="op" value="email" />
208                                     <input type="hidden" name="basketno" value="[% basketno %]" />
209                                     <button type="submit" class="btn btn-default btn-sm" id="emailvendorbutton"><i class="fa fa-envelope"></i> E-mail order</button>
210                                 </form>
211                             </div>
212                         [% END %]
213                 </div>
214 <!-- Modal for confirm deletion box-->
215                 <div class="modal" id="deleteBasketModal" tabindex="-1" role="dialog" aria-labelledby="delbasketModalLabel" aria-hidden="true">
216                     <div class="modal-dialog">
217                     <div class="modal-content">
218                     <div class="modal-header">
219                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
220                         <h3>Confirm deletion</h3>
221                     </div>
222                     [% UNLESS book_foot_loop %]
223                         <div class="modal-body">
224                            <p>Are you sure you want to delete this basket?</p>
225                         </div>
226                         <div class="modal-footer">
227                             <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
228                             <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
229                                 <input type="hidden" name="op" value="delete_confirm" />
230                                 <input type="hidden" name="basketno" value="[% basketno %]" />
231                                 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
232                                 <input type="hidden" name="delbiblio" value="0" />
233                                 <button type="submit" class="btn btn-default btn-default">Delete basket</button>
234                             </form>
235                         </div>
236                     [% ELSE %]
237                         <div class="modal-body">
238                            <p>Are you sure you want to delete this basket?</p>
239                            <p>Warning:</p>
240                            <p>All orders of this basket will be cancelled and used funds will be refunded.</p>
241                            <p>If items have been created when ordering or receiving, they will be deleted.</p>
242                            <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>
243                         </div>
244                         <div class="modal-footer">
245                             <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
246                             <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
247                                 <input type="hidden" name="op" value="delete_confirm" />
248                                 <input type="hidden" name="basketno" value="[% basketno %]" />
249                                 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
250                                 <input type="hidden" name="delbiblio" value="0" />
251                                 <button type="submit" class="btn btn-default btn-default">Delete basket and orders</button>
252                             </form>
253
254                             <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
255                                 <input type="hidden" name="op" value="delete_confirm" />
256                                 <input type="hidden" name="basketno" value="[% basketno %]" />
257                                 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
258                                 <input type="hidden" name="delbiblio" value="1" />
259                                 <button type="submit" class="btn btn-default btn-default">Delete basket, orders, and records</button>
260                             </form>
261
262                         </div>
263                     [% END %]
264                     </div>
265                     </div>
266                 </div>
267 <!-- End of Modal-->
268             [% ELSE %]
269                 [% UNLESS ( grouped ) %]
270                 <div id="toolbar" class="btn-toolbar">
271                     <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>
272                     <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>
273                 </div>
274                 [% END %]
275             [% END %]
276             [% END %]
277
278     [% IF ( NO_BOOKSELLER ) %]
279     <h2>Vendor not found</h2>
280     [% ELSE %]
281         [% IF ( delete_confirmed ) %]
282             <div class="dialog message">
283                 <h3>Basket deleted</h3>
284             </div>
285             [% IF (cannotdelbiblios) %]
286                 <div class="dialog alert">
287                     <p><strong>Warning:</strong></p>
288                     <p><strong>The following records could not be deleted:</strong></p>
289                     <ul>
290                     [% FOREACH cannotdelbiblio IN cannotdelbiblios %]
291                         <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cannotdelbiblio.biblionumber %]">[% cannotdelbiblio.title |html %]</a> by [% cannotdelbiblio.author %]:
292                             <ul>
293                             [% IF (cannotdelbiblio.itemcount) %]<li>[% cannotdelbiblio.itemcount %] item(s) attached.</li>[% END %]
294                             [% IF (cannotdelbiblio.subscriptions) %]<li>[% cannotdelbiblio.subscriptions %] subscription(s) attached.</li>[% END %]
295                             [% IF (cannotdelbiblio.countbiblio) %]<li>[% cannotdelbiblio.countbiblio %] order(s) attached.</li>[% END %]
296                             [% IF (cannotdelbiblio.othererror) %]<li>Unknown error.</li>[% END %]
297                             </ul>
298                         </li>
299                     [% END %]
300                     </ul>
301                 </div>
302                 <a href="booksellers.pl">Click here to go back to booksellers page</a>
303             [% ELSE %]
304             <META HTTP-EQUIV=Refresh CONTENT="0; url=booksellers.pl">
305             [% END %]
306         [% ELSE %]
307
308         [% FOR m IN messages %]
309             <div class="dialog [% m.type %]">
310                 [% SWITCH m.code %]
311                 [% CASE 'no_email' %]
312                     This vendor has no contact selected for sending orders to or is missing an e-mail address.
313                 [% CASE 'no_basketno' %]
314                     No basket given.
315                 [% CASE 'no_letter' %]
316                     There is no notice template with code ACQORDER defined.
317                 [% CASE 'email_sent' %]
318                     Order e-mail was sent to the vendor.
319                 [% CASE %]
320                     ERROR! - [% m.code %]
321                 [% END %]
322             </div>
323         [% END %]
324         <h1>[% UNLESS ( basketno ) %]New [% END %]Basket [% basketname|html %] ([% basketno %]) for <a href="supplier.pl?booksellerid=[% booksellerid %]">[% name|html %]</a></h1>
325         [% IF ( basketno ) %]
326             <div id="acqui_basket_summary" class="yui-g">
327                 <div class="rows">
328                 <div class="yui-u first">
329                 <ol>
330                 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
331                 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
332                 [% IF ( basketcontractno ) %]
333                     <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]&amp;booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li>
334                 [% END %]
335                 [% IF deliveryplace %]<li><span class="label">Delivery place:</span> [% Branches.GetName( deliveryplace ) %]</li>[% END %]
336                 [% IF billingplace %]<li><span class="label">Billing place:</span> [% Branches.GetName( billingplace ) %]</li>[% END %]
337                 [% IF ( authorisedbyname ) %]<li><span class="label">Created by:</span>  [% authorisedbyname %]</li>[% END %]
338                 <li id="managedby">
339                     <form action="" method="post">
340                         <span class="label">Managed by:</span>
341                         <div style="float:left">
342                             <ul id="users_names" style="padding-left:0">
343                               [% FOREACH user IN users %]
344                                 <li id="user_[% user.borrowernumber %]">
345                                     [% user.firstname %] [% user.surname %]
346                                     <a href="#" data-borrowernumber="[% user.borrowernumber %]" class="del_user"><i class="fa fa-trash"></i> Delete user</a>
347                                 </li>
348                               [% END %]
349                             </ul>
350                             <input type="hidden" id="basketno" name="basketno" value="[% basketno %]" />
351                             <input type="hidden" id="users_ids" name="users_ids" value="[% users_ids %]" />
352                             <input type="hidden" id="op" name="op" value="mod_users" />
353                             <input type="button" id="add_user" value="Add user" />
354                             <input type="submit" value="Save changes" />
355                         </div>
356                     </form>
357                 </li>
358                 <li id="branch">
359                     <span class="label">Library:</span>
360                     [% IF basketbranchcode %]
361                         [% Branches.GetName( basketbranchcode ) %]
362                     [% ELSE %]
363                         No library
364                     [% END %]
365                     [% IF branches_loop.size %]
366                         <form action="" method="post">
367                             <select id="branch" name="branch">
368                                 <option value="">(no library)</option>
369                                 [% FOREACH branch IN branches_loop %]
370                                     [% IF (branch.selected) %]
371                                         <option selected="selected" value="[% branch.branchcode %]"> [% branch.branchname %]</option>
372                                     [% ELSE %]
373                                         <option value="[% branch.branchcode %]"> [% branch.branchname %]</option>
374                                     [% END %]
375                                 [% END %]
376                             </select>
377                             <input type="hidden" id="basketno" name="basketno" value="[% basketno %]" />
378                             <input type="hidden" id="op" name="op" value="mod_branch" />
379                             <input type="submit" value="Change" />
380                         </form>
381                     [% END %]
382                 </li>
383                 [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
384                 [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
385                 [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates  %]</li>[% END %]
386                 [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates  %]</li>[% END %]
387                 <li><span class="label">Orders are standing:</span> [% IF is_standing %]Yes[% ELSE %]No[% END %]</li>
388
389
390                 </ol>
391                 </div>
392                 [% IF ( closedate ) %]
393                 <div class="yui-u">
394                     [% IF ( CAN_user_acquisition_group_manage ) %]
395                     <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
396                     [% END %]
397                         <ol>
398                         <li>
399                           <span class="label">Basket group:</span>
400                           [% IF basketgroup.id and not basketgroup.name %]
401                             [% SET basketgroup.name = "Basket group no. " _ basketgroup.id %]
402                           [% END %]
403                           [% IF basketgroup.closed %]
404                               [% IF ( CAN_user_acquisition_group_manage ) %]
405                                   <a href="basketgroup.pl?op=add&booksellerid=[% booksellerid %]&basketgroupid=[% basketgroup.id %]" title="basketgroup">[% basketgroup.name %] (closed)</a>
406                               [% ELSE %]
407                                   [% basketgroup.name %] (closed)
408                               [% END %]
409                           [% ELSIF ( ! CAN_user_acquisition_group_manage ) %]
410                             [%- IF basketgroup.id -%]
411                                 [% basketgroup.name %]
412                             [%- ELSE -%]
413                                 No group
414                             [%- END -%]
415                           [% ELSE %]
416                             <select id="basketgroupid" name="basketgroupid">
417                               <option value="">No group</option>
418                               [% FOREACH bg IN basketgroups %]
419                                 [% IF ( bg.default ) %]
420                                     <option value="[% bg.id %]" selected="selected">[% bg.name %]</option>
421                                 [% ELSE %]
422                                   [% UNLESS bg.closed %]
423                                     <option value="[% bg.id %]">[% bg.name %]</option>
424                                   [% ELSE %]
425                                     <option value="[% bg.id %]" disabled="disabled">[% bg.name %] (closed)</option>
426                                   [% END %]
427                                 [% END %]
428                               [% END %]
429                               <option value="new">Add new group</option>
430                             </select>
431                             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
432                             <input type="hidden" value="mod_basket" name="op" />
433                             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
434                             <input type="submit" value="Change basket group" />
435                           [% END %]
436                         </li>
437                     [% IF basketgroup.deliveryplace %]<li><span class="label">Basket group delivery placename:</span> [% Branches.GetName( basketgroup.deliveryplace ) %]</li>[% END %]
438                     [% IF basketgroup.billingplace %]<li><span class="label">Basket group billing place:</span> [% Branches.GetName( basketgroup.billingplace ) %]</li>[% END %]
439                         </ol>
440                     [% IF ( CAN_user_acquisition_group_manage ) %]
441                     </form>
442                     [% END %]
443                 </div>
444                 [% END %]
445             </div>
446             </div>
447         [% END %]
448         [% IF ( duplinbatch ) %]<div class="dialog alert">
449         <h4>Duplicate warning</h4>
450         <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>
451         </div>[% END %]
452
453         <div id="acqui_basket_content" class="yui-g">
454         [% IF ( books_loop ) %]
455         <h2>Orders</h2>
456         <label for="show_all_details">
457             <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
458             Show all details
459         </label>
460             <table id="orders">
461                 <thead>
462                     <tr>
463                         <th>No.</th>
464                         <th class="anti-the">Order</th>
465                         <th class="tax_excluded">RRP tax exc.</th>
466                         <th class="tax_excluded">ecost tax exc.</th>
467                         <th class="tax_included">RRP tax inc.</th>
468                         <th class="tax_included">ecost tax inc.</th>
469                         <th>Qty.</th>
470                         <th class="tax_excluded">Total tax exc. ([% currency %])</th>
471                         <th class="tax_included">Total tax inc. ([% currency %])</th>
472                         <th>GST %</th>
473                         <th>GST</th>
474                         <th>Fund</th>
475                         <th>Supplier report</th>
476                         [% IF ( active ) %]
477                             [% UNLESS ( closedate ) %]
478                                 <th>Modify</th>
479                                 <th>Cancel order</th>
480                             [% END %]
481                         [% END %]
482                     </tr>
483                 </thead>
484                 <tfoot>
485                 [% FOREACH foot_loo IN book_foot_loop %]
486                     <tr>
487                         <th></th>
488                         <th>Total (GST [% foot_loo.tax_rate * 100 %])</th>
489                         <th class="tax_excluded">&nbsp;</th>
490                         <th class="tax_excluded">&nbsp;</th>
491                         <th class="tax_included">&nbsp;</th>
492                         <th class="tax_included">&nbsp;</th>
493                         <th>[% foot_loo.quantity %]</th>
494                         <th class="tax_excluded">[% foot_loo.total_tax_excluded | $Price%]</th>
495                         <th class="tax_included">[% foot_loo.total_tax_included | $Price %]</th>
496                         <th>&nbsp;</th>
497                         <th>[% foot_loo.tax_value | $Price %]</th>
498                         <th>&nbsp;</th>
499                         <th>&nbsp;</th>
500                         [% IF ( active ) %]
501                             [% UNLESS ( closedate ) %]
502                                 <th>&nbsp;</th>
503                                 <th>&nbsp;</th>
504                             [% END %]
505                         [% END %]
506                     </tr>
507                 [% END %]
508                 <tr>
509                     <th></th>
510                     <th>Total ([% currency %])</th>
511                     <th class="tax_excluded">&nbsp;</th>
512                     <th class="tax_excluded">&nbsp;</th>
513                     <th class="tax_included">&nbsp;</th>
514                     <th class="tax_included">&nbsp;</th>
515                     <th>[% total_quantity %]</th>
516                     <th class="tax_excluded">[% total_tax_excluded | $Price %]</th>
517                     <th class="tax_included">[% total_tax_included | $Price %]</th>
518                     <th>&nbsp;</th>
519                     <th>[% total_tax_value | $Price %]</th>
520                     <th>&nbsp;</th>
521                     <th>&nbsp;</th>
522                     [% IF ( active ) %]
523                         [% UNLESS ( closedate ) %]
524                             <th>&nbsp;</th>
525                             <th>&nbsp;</th>
526                         [% END %]
527                     [% END %]
528                 </tr>
529                 </tfoot>
530                 <tbody>
531                 [% FOREACH books_loo IN books_loop %]
532                     [% IF ( books_loo.order_received ) %]
533                         <tr class="disabled">
534                     [% ELSE %]
535                         <tr>
536                     [% END %]
537                         <td>
538                             [% books_loo.ordernumber %]
539                         </td>
540                         <td>
541                             <p>
542                                 [% IF ( books_loo.order_received ) %] (rcvd)[% END %]
543                                 [% IF books_loo.title %]
544                                     <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 %]
545                                 [% ELSE %]
546                                     <em>Deleted bibliographic record, can't find title</em><br />
547                                 [% END %]
548                                 <br />
549                                 [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
550                                 [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
551                                 [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
552                                 [% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
553                                 [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
554                                 [% IF ( books_loo.suggestionid ) %]
555                                     <br/>
556                                     Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %]
557                                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&amp;op=show">suggestion #[% books_loo.suggestionid %]</a>)
558                                 [% END %]
559                             </p>
560                                 [% IF ( books_loo.order_internalnote ) %]
561                                     <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>
562                                 [% ELSE %]
563                                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=internal">Add internal note</a>]
564                                 [% END %]
565                                 [% IF ( books_loo.order_vendornote ) %]
566                                     <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>
567                                 [% ELSE %]
568                                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=vendor">Add vendor note</a>]
569                                 [% END %]
570                             [% IF (books_loo.transferred_from) %]
571                               [% basket = books_loo.transferred_from.basket %]
572                               [% bookseller = books_loo.transferred_from.bookseller %]
573                               [% timestamp = books_loo.transferred_from.timestamp %]
574                               <p>Transferred from basket:
575                                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]"> [% basket.basketname %]</a>
576                                 (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id %]">[% bookseller.name %]</a>)
577                                 on <span title="[% timestamp | $KohaDates with_hours = 1 %]">
578                                   [% timestamp | $KohaDates %]
579                                 </span>
580                               </p>
581                             [% END %]
582                         </td>
583                         [% 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 ... %]
584                         [%# FIXME: use of a regexp is not ideal; bugs 9410 and 10929 suggest better way of handling this %]
585                         <td class="number tax_excluded [% IF books_loo.rrp_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_excluded | $Price %]</td>
586                         <td class="number tax_excluded [% IF books_loo.ecost_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_excluded | $Price%]</td>
587                         <td class="number tax_included [% IF books_loo.rrp_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_included | $Price %]</td>
588                         <td class="number tax_included [% IF books_loo.ecost_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_included | $Price %]</td>
589                         <td class="number [% IF books_loo.quantity.search(zero_regex) %]error[% END %]">[% books_loo.quantity %]</td>
590                         <td class="number tax_excluded [% IF books_loo.total_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_excluded | $Price %]</td>
591                         <td class="number tax_included [% IF books_loo.total_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_included | $Price %]</td>
592                         <td class="number">[% books_loo.tax_rate * 100 %]</td>
593                         <td class="number [% IF books_loo.tax_value.search(zero_regex) %]error[% END %]">[% books_loo.tax_value | $Price %]</td>
594                         <td>[% books_loo.budget_name %]</td>
595                         <td>[% books_loo.suppliers_report %]</td>
596                         [% IF ( active ) %]
597                             [% UNLESS ( closedate ) %]
598                             <td>
599                                 <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Modify</a>
600                                 [% UNLESS (books_loo.order_received) %]
601                                     <br />
602                                     <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber %]">Transfer</a>
603                                 [% END %]
604                             </td>
605                             <td>
606                             [% IF ( books_loo.left_holds_on_order ) %]
607                             <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>
608                             [% ELSE %]
609                             <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>
610                             [% END %]
611                             [% IF ( books_loo.can_del_bib ) %]
612                             <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>
613                             [% ELSE %]
614                             <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br>
615                             [% END %]
616                             [% IF ( books_loo.left_item ) %]
617                             <b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
618                             [% END %]
619                             [% IF ( books_loo.left_biblio ) %]
620                             <b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
621                             [% END %]
622                             [% IF ( books_loo.left_subscription ) %]
623                             <b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
624                             [% END %]
625                             [% IF ( books_loo.left_holds ) %]
626                             <b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
627                             [% END %]
628                             </td>
629                             [% END %]
630                         [% END %]
631                     </tr>
632                 [% END %]
633                 </tbody>
634             </table>
635         [% END %]
636         [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
637         [% END %]
638         </div>
639         [% IF (cancelledorders_loop) %]
640           <div id="cancelledorders">
641             <h2>Cancelled orders</h2>
642             <table id="cancelledorderst">
643               <thead>
644                 <tr>
645                   <th>No.</th>
646                   <th>Order</th>
647                   <th class="tax_excluded">RRP tax exc.</th>
648                   <th class="tax_excluded">ecost tax exc.</th>
649                   <th class="tax_included">RRP tax inc.</th>
650                   <th class="tax_included">ecost tax inc.</th>
651                   <th>Qty.</th>
652                   <th class="tax_excluded">Total tax exc. ([% currency %])</th>
653                   <th class="tax_included">Total tax inc. ([% currency %])</th>
654                   <th>GST %</th>
655                   <th>GST</th>
656                   <th>Fund</th>
657                 </tr>
658               </thead>
659               <tbody>
660                 [% FOREACH order IN cancelledorders_loop %]
661                   <tr style="color:grey">
662                     <td>
663                         [% order.ordernumber %]
664                     </td>
665                     <td>
666                       <p>
667                         [% IF ( order.order_received ) %] (rcvd)[% END %]
668                         [% IF (order.title) %]
669                           [% order.title |html %][% IF order.author %] by [% order.author %][% END %]
670                         [% ELSE %]
671                           <em>Deleted bibliographic record, can't find title</em>
672                         [% END %]
673                         <br />
674                         [% IF ( order.order_internalnote ) %] [% order.order_internalnote %][% END %]
675                         [% IF ( order.isbn ) %] - [% order.isbn %][% END %]
676                         [% IF ( order.issn ) %] - [% order.issn %][% END %]
677                         [% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
678                         [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
679                         [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
680                         [% IF ( order.cancellationreason ) %]
681                           <br />
682                           Cancellation reason: [% AuthorisedValues.GetByCode( 'ORDER_CANCELLATION_REASON', order.cancellationreason ) %]
683                         [% END %]
684                       </p>
685                       [% IF order.transferred_to %]
686                         [% basket = order.transferred_to.basket %]
687                         [% bookseller = order.transferred_to.bookseller %]
688                         [% timestamp = order.transferred_to.timestamp %]
689                         <p>Transferred to basket:
690                           <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]"> [% basket.basketname %]</a>
691                           (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id %]">[% bookseller.name %]</a>)
692                           on <span title="[% timestamp | $KohaDates with_hours = 1%]">
693                             [% timestamp | $KohaDates %]
694                           </span>
695                         </p>
696                       [% END %]
697                     </td>
698                     <td class="number tax_excluded">[% order.rrp_tax_excluded | $Price %]</td>
699                     <td class="number tax_excluded">[% order.ecost_tax_excluded | $Price %]</td>
700                     <td class="number tax_included">[% order.rrp_tax_included | $Price %]</td>
701                     <td class="number tax_included">[% order.ecost_tax_included | $Price %]</td>
702                     <td class="number">[% order.quantity %]</td>
703                     <td class="number tax_excluded">[% order.total_tax_excluded | $Price %]</td>
704                     <td class="number tax_included">[% order.total_tax_included | $Price %]</td>
705                     <td class="number">[% order.tax_rate * 100 %]</td>
706                     <td class="number">[% order.tax_value | $Price %]</td>
707                     <td>[% order.budget_name %]
708                   </tr>
709                 [% END %]
710               </tbody>
711             </table>
712           </div>
713         [% END %]
714         <br />
715         [% UNLESS ( closedate ) %]
716
717     <!-- Modal -->
718     <div id="addtoBasket" class="modal" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel" aria-hidden="true">
719         <div class="modal-dialog">
720         <div class="modal-content">
721         <div class="modal-body">
722         [% IF active %]
723             [% INCLUDE 'acquisitions-add-to-basket.inc' %]
724         [% END %]
725         </div>
726         <div class="modal-footer">
727             <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
728         </div>
729         </div>
730         </div>
731     </div>
732
733         [% END %]
734
735 [% END %]
736 [% END %]    [% ELSE %] <!-- if we want just to select a basketgroup for a closed basket -->
737     [% END %]
738 [% IF ( confirm_close ) %]
739         <div id="closebasket_needsconfirmation" class="dialog alert">
740
741         <form action="/cgi-bin/koha/acqui/basket.pl">
742             <h1>Are you sure you want to close basket [% basketname|html %]?</h1>
743             [% IF ( CAN_user_acquisition_group_manage ) %]
744             <p>
745             <label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
746             <input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
747             </p>
748             [% END %]
749             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
750             <input type="hidden" value="close" name="op" />
751             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
752             <input type="hidden" name="confirm" value="1" />
753             <input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
754             <button type="submit" class="approve" accesskey="y"><i class="fa fa-fw fa-check"></i> Yes, close (Y)</button>
755         </form>
756         <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
757             <input type="hidden" name="basketno" value="[% basketno %]" />
758             <button type="submit" class="deny" accesskey="n"><i class="fa fa-fw fa-remove"></i> No, don't close (N)</button>
759         </form>
760         </div>
761     [% END %]
762 [% IF edi_confirm %]
763         <div id="closebasket_needsconfirmation" class="dialog alert">
764
765         <form action="/cgi-bin/koha/acqui/basket.pl">
766             <h1>Are you sure you want to generate an EDIFACT order and close basket [% basketname|html %]?</h1>
767             [% IF CAN_user_acquisition_group_manage %]
768             <p>
769             <label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
770             <input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
771             </p>
772             [% END %]
773             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
774             <input type="hidden" value="ediorder" name="op" />
775             <input type="hidden" name="ean" value="[% ean %]" />
776             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
777             <input type="hidden" name="confirm" value="1" />
778             <input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
779             <button type="submit" class="approve" accesskey="Y"><i class="fa fa-fw fa-check"></i> Yes, close (Y)</button>
780         </form>
781         <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
782             <input type="hidden" name="basketno" value="[% basketno %]" />
783             <button type="submit" class="deny" accesskey="N"><i class="fa fa-fw fa-remove"></i> No, don't close (N)</button>
784         </form>
785         </div>
786     [% END %]
787 </div>
788 [% END %][%# IF (cannot_manage_basket) %]
789 </div>
790 <div class="yui-b">
791 [% INCLUDE 'acquisitions-menu.inc' %]
792 </div>
793 </div>
794 [% INCLUDE 'intranet-bottom.inc' %]