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