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