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