Bug 9333: Remove useless JS code - confirm close basket
[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 %][% IF ( delete_confirm ) %]Delete [% 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 %][% IF ( delete_confirm ) %]Delete [% 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                     <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>
167                    [% IF ( unclosable ) %]
168                     [% ELSIF ( uncertainprices ) %]
169                         <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>
170                     [% ELSE %]
171                         <div class="btn-group">
172                             <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>
173                         </div>
174                     [% END %]
175                         <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>
176                 </div>
177 <!-- Modal for confirm deletion box-->
178                 <div class="modal hide" id="deleteBasketModal" tabindex="-1" role="dialog" aria-labelledby="delbasketModalLabel" aria-hidden="true">
179                     <div class="modal-header">
180                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
181                         <h3>Confirm deletion</h3>
182                     </div>
183                     [% UNLESS book_foot_loop.size > 0 %]
184                         <div class="modal-body">
185                            <p>Are you sure you want to delete this basket?</p>
186                         </div>
187                         <div class="modal-footer">
188                             <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
189                             <button type="submit" class="btn btn-default" onclick="delete_basket([% basketno %],[% booksellerid %],0); return false;" >Delete basket</button>
190                         </div>
191                     [% ELSE %]
192                         <div class="modal-body">
193                            <p>Are you sure you want to delete this basket?</p>
194                            <p>Warning:</p>
195                            <p>All orders of this basket will be cancelled and used funds will be refunded.</p>
196                            <p>If items have been created when ordering or receiving, they will be deleted.</p>
197                            <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>
198                         </div>
199                         <div class="modal-footer">
200                             <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
201                             <button type="submit" class="btn btn-default" onclick="delete_basket([% basketno %],[% booksellerid %],0); return false;">Delete basket and orders</button>
202                             <button type="submit" class="btn btn-default" onclick="delete_basket([% basketno %],[% booksellerid %],1); return false;">Delete basket, orders and bibs</button>
203                         </div>
204                     [% END %]
205                 </div>
206 <!-- End of Modal-->
207             [% ELSE %]
208                 [% UNLESS ( grouped ) %]
209                 <div id="toolbar" class="btn-toolbar">
210                     <div class="btn-group"><a href="#" class="btn btn-small" id="reopenbutton"><i class="icon-refresh"></i> Reopen this basket</a></div>
211                     <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>
212                 </div>
213                 [% END %]
214             [% END %]
215             [% END %]
216
217     [% IF ( NO_BOOKSELLER ) %]
218     <h2>Vendor not found</h2>
219     [% ELSE %]
220         [% IF ( delete_confirmed ) %]
221             <h3>Basket deleted</h3>
222             [% IF (cannotdelbiblios) %]
223                 <div class="dialog alert">
224                     <p><strong>Warning:</strong></p>
225                     <p><strong>The following records could not be deleted:</strong></p>
226                     <ul>
227                     [% FOREACH cannotdelbiblio IN cannotdelbiblios %]
228                         <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cannotdelbiblio.biblionumber %]">[% cannotdelbiblio.title |html %]</a> by [% cannotdelbiblio.author %]:
229                             <ul>
230                             [% IF (cannotdelbiblio.itemcount) %]<li>[% cannotdelbiblio.itemcount %] item(s) attached.</li>[% END %]
231                             [% IF (cannotdelbiblio.subscriptions) %]<li>[% cannotdelbiblio.subscriptions %] subscription(s) attached.</li>[% END %]
232                             [% IF (cannotdelbiblio.countbiblio) %]<li>[% cannotdelbiblio.countbiblio %] order(s) attached.</li>[% END %]
233                             [% IF (cannotdelbiblio.othererror) %]<li>Unknown error.</li>[% END %]
234                             </ul>
235                         </li>
236                     [% END %]
237                     </ul>
238                 </div>
239                 <a href="booksellers.pl">Click here to go back to booksellers page</a>
240             [% ELSE %]
241             <META HTTP-EQUIV=Refresh CONTENT="0; url=booksellers.pl">
242             [% END %]
243         [% ELSE %]
244         <h1>[% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for <a href="supplier.pl?booksellerid=[% booksellerid %]">[% name|html %]</a></h1>
245         [% IF ( delete_confirm ) %]
246             <h2>
247             <span class="yui-button yui-link-button">
248             <em class="first-child">
249                 <a href="[% script_name %]?op=delete_confirm&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="yui-link-button">Yes, delete this basket!</a>
250             </em>
251             </span>
252             <span class="yui-button yui-link-button">
253             <em class="first-child">
254                 <a href="[% script_name %]?basketno=[% basketno %]" class="yui-link-button">Cancel</a>
255             </em>
256             </span>
257             </h2>
258         [% END %]
259         [% IF ( basketno ) %]
260             <div id="acqui_basket_summary" class="yui-g">
261                 <div class="rows">
262                 <div class="yui-u first">
263                 <ol>
264                 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
265                 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
266                 [% IF ( basketcontractno ) %]
267                     <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]&amp;booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li>
268                 [% END %]
269                 [% IF ( deliveryplace ) %]<li><span class="label">Delivery place:</span> [% deliveryplace %]</li>[% END %]
270                 [% IF ( billingplace ) %]<li><span class="label">Billing place:</span> [% billingplace %]</li>[% END %]
271                 [% IF ( authorisedbyname ) %]<li><span class="label">Created by:</span>  [% authorisedbyname %]</li>[% END %]
272                 <li id="managedby">
273                     <form action="" method="post">
274                         <span class="label">Managed by:</span>
275                         <div style="float:left">
276                             <ul id="users_names" style="padding-left:0">
277                               [% FOREACH user IN users %]
278                                 <li id="user_[% user.borrowernumber %]">
279                                     [% user.firstname %] [% user.surname %]
280                                     [<a onclick="del_user([% user.borrowernumber %]);" style="cursor:pointer">Delete user</a>]
281                                 </li>
282                               [% END %]
283                             </ul>
284                             <input type="hidden" id="basketno" name="basketno" value="[% basketno %]" />
285                             <input type="hidden" id="users_ids" name="users_ids" value="[% users_ids %]" />
286                             <input type="hidden" id="op" name="op" value="mod_users" />
287                             <input type="button" id="add_user" onclick="UserSearchPopup();" value="Add user" />
288                             <input type="submit" value="Save changes" />
289                         </div>
290                     </form>
291                 </li>
292                 <li id="branch">
293                     <span class="label">Library:</span>
294                     [% IF basketbranchname %]
295                         [% basketbranchname %]
296                     [% ELSE %]
297                         No library
298                     [% END %]
299                     [% IF branches_loop.size %]
300                         <form action="" method="post">
301                             <select id="branch" name="branch">
302                                 <option value="">(no library)</option>
303                                 [% FOREACH branch IN branches_loop %]
304                                     [% IF (branch.selected) %]
305                                         <option selected="selected" value="[% branch.branchcode %]"> [% branch.branchname %]</option>
306                                     [% ELSE %]
307                                         <option value="[% branch.branchcode %]"> [% branch.branchname %]</option>
308                                     [% END %]
309                                 [% END %]
310                             </select>
311                             <input type="hidden" id="basketno" name="basketno" value="[% basketno %]" />
312                             <input type="hidden" id="op" name="op" value="mod_branch" />
313                             <input type="submit" value="Change" />
314                         </form>
315                     [% END %]
316                 </li>
317                 [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
318                 [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
319                 [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates  %]</li>[% END %]
320
321                 </ol>
322                 </div>
323                 [% IF ( closedate ) %]
324                 <div class="yui-u">
325                     [% IF ( CAN_user_acquisition_group_manage ) %]
326                     <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
327                     [% END %]
328                         <ol>
329                         <li>
330                           <span class="label">Basket group:</span>
331                           [% IF basketgroup.id and not basketgroup.name %]
332                             [% SET basketgroup.name = "Basket group no. " _ basketgroup.id %]
333                           [% END %]
334                           [% IF basketgroup.closed %]
335                               [% IF ( CAN_user_acquisition_group_manage ) %]
336                                   <a href="basketgroup.pl?op=add&booksellerid=[% booksellerid %]&basketgroupid=[% basketgroup.id %]" title="basketgroup">[% basketgroup.name %] (closed)</a>
337                               [% ELSE %]
338                                   [% basketgroup.name %] (closed)
339                               [% END %]
340                           [% ELSIF ( ! CAN_user_acquisition_group_manage ) %]
341                             [%- IF basketgroup.id -%]
342                                 [% basketgroup.name %]
343                             [%- ELSE -%]
344                                 No group
345                             [%- END -%]
346                           [% ELSE %]
347                             <select id="basketgroupid" name="basketgroupid">
348                               <option value="">No group</option>
349                               [% FOREACH bg IN basketgroups %]
350                                 [% IF ( bg.default ) %]
351                                     <option value="[% bg.id %]" selected="selected">[% bg.name %]</option>
352                                 [% ELSE %]
353                                   [% UNLESS bg.closed %]
354                                     <option value="[% bg.id %]">[% bg.name %]</option>
355                                   [% ELSE %]
356                                     <option value="[% bg.id %]" disabled="disabled">[% bg.name %] (closed)</option>
357                                   [% END %]
358                                 [% END %]
359                               [% END %]
360                               <option value="new">Add new group</option>
361                             </select>
362                             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
363                             <input type="hidden" value="mod_basket" name="op" />
364                             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
365                             <input type="submit" value="Change basket group" />
366                           [% END %]
367                         </li>
368                     [% IF ( basketgroup.deliveryplacename ) %]<li><span class="label">Basket group delivery placename:</span> [% basketgroup.deliveryplacename %]</li>[% END %]
369                     [% IF ( basketgroup.billingplacename ) %]<li><span class="label">Basket group billing place:</span> [% basketgroup.billingplacename %]</li>[% END %]
370                         </ol>
371                     [% IF ( CAN_user_acquisition_group_manage ) %]
372                     </form>
373                     [% END %]
374                 </div>
375                 [% END %]
376             </div>
377             </div>
378         [% END %]
379
380         [% UNLESS ( delete_confirm ) %]
381         <div id="acqui_basket_content" class="yui-g">
382         [% IF ( books_loop ) %]
383         <h2>Orders</h2>
384         <label for="show_all_details">
385             <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
386             Show all details
387         </label>
388             <table id="orders">
389                 <thead>
390                     <tr>
391                         <th>No.</th>
392                         <th>Order</th>
393                         <th class="gste">RRP tax exc.</th>
394                         <th class="gste">ecost tax exc.</th>
395                         <th class="gsti">RRP tax inc.</th>
396                         <th class="gsti">ecost tax inc.</th>
397                         <th>Qty.</th>
398                         <th class="gste">Total tax exc. ([% currency %])</th>
399                         <th class="gsti">Total tax inc. ([% currency %])</th>
400                         <th>GST %</th>
401                         <th>GST</th>
402                         <th>Fund</th>
403                         [% IF ( active ) %]
404                             [% UNLESS ( closedate ) %]
405                                 <th>Modify</th>
406                                 <th>Delete</th>
407                             [% END %]
408                         [% END %]
409                     </tr>
410                 </thead>
411                 <tfoot>
412                 [% FOREACH foot_loo IN book_foot_loop %]
413                     <tr>
414                         <th></th>
415                         <th>Total (GST [% foot_loo.gstrate * 100 | $Price %])</th>
416                         <th class="gste">&nbsp;</th>
417                         <th class="gste">&nbsp;</th>
418                         <th class="gsti">&nbsp;</th>
419                         <th class="gsti">&nbsp;</th>
420                         <th>[% foot_loo.quantity %]</th>
421                         <th class="gste">[% foot_loo.totalgste | $Price%]</th>
422                         <th class="gsti">[% foot_loo.totalgsti | $Price %]</th>
423                         <th>&nbsp;</th>
424                         <th>[% foot_loo.gstvalue | $Price %]</th>
425                         <th>&nbsp;</th>
426                         [% IF ( active ) %]
427                             [% UNLESS ( closedate ) %]
428                                 <th>&nbsp;</th>
429                                 <th>&nbsp;</th>
430                             [% END %]
431                         [% END %]
432                     </tr>
433                 [% END %]
434                 <tr>
435                     <th></th>
436                     <th>Total ([% currency %])</th>
437                     <th class="gste">&nbsp;</th>
438                     <th class="gste">&nbsp;</th>
439                     <th class="gsti">&nbsp;</th>
440                     <th class="gsti">&nbsp;</th>
441                     <th>[% total_quantity %]</th>
442                     <th class="gste">[% total_gste | $Price %]</th>
443                     <th class="gsti">[% total_gsti | $Price %]</th>
444                     <th>&nbsp;</th>
445                     <th>[% total_gstvalue | $Price %]</th>
446                     <th>&nbsp;</th>
447                     [% IF ( active ) %]
448                         [% UNLESS ( closedate ) %]
449                             <th>&nbsp;</th>
450                             <th>&nbsp;</th>
451                         [% END %]
452                     [% END %]
453                 </tr>
454                 </tfoot>
455                 <tbody>
456                 [% FOREACH books_loo IN books_loop %]
457                     [% IF ( books_loo.order_received ) %]<tr class="disabled">[% ELSE %][% IF ( books_loo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %][% END %]
458                         <td>
459                             [% books_loo.ordernumber %]
460                         </td>
461                         <td>
462                             <p>
463                                 [% IF ( books_loo.order_received ) %] (rcvd)[% END %]
464                                 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a> by [% books_loo.author %]
465                                 <br />
466                                 [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
467                                 [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
468                                 [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
469                                 [% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
470                                 [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
471                                 [% IF ( books_loo.suggestionid ) %]
472                                     <br/>
473                                     Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %]
474                                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&amp;op=show">suggestion #[% books_loo.suggestionid %]</a>)
475                                 [% END %]
476                             </p>
477                                 [% IF ( books_loo.order_internalnote ) %]
478                                     <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>
479                                 [% ELSE %]
480                                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=internal">Add internal note</a>]
481                                 [% END %]
482                                 [% IF ( books_loo.order_vendornote ) %]
483                                     <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>
484                                 [% ELSE %]
485                                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=vendor">Add vendor note</a>]
486                                 [% END %]
487                             [% IF (books_loo.transferred_from) %]
488                               [% basket = books_loo.transferred_from.basket %]
489                               [% bookseller = books_loo.transferred_from.bookseller %]
490                               [% timestamp = books_loo.transferred_from.timestamp %]
491                               <p>Transferred from
492                                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">basket: [% basket.basketname %]</a>
493                                 (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id %]">[% bookseller.name %]</a>)
494                                 on <span title="[% timestamp | $KohaDates with_hours = 1 %]">
495                                   [% timestamp | $KohaDates %]
496                                 </span>
497                               </p>
498                             [% END %]
499                         </td>
500                         [% 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 ... %]
501                         [%# FIXME: use of a regexp is not ideal; bugs 9410 and 10929 suggest better way of handling this %]
502                         <td class="number gste [% IF books_loo.rrpgste.search(zero_regex) %]error[% END %]">[% books_loo.rrpgste | $Price %]</td>
503                         <td class="number gste [% IF books_loo.ecostgste.search(zero_regex) %]error[% END %]">[% books_loo.ecostgste | $Price%]</td>
504                         <td class="number gsti [% IF books_loo.rrpgsti.search(zero_regex) %]error[% END %]">[% books_loo.rrpgsti | $Price %]</td>
505                         <td class="number gsti [% IF books_loo.ecostgsti.search(zero_regex) %]error[% END %]">[% books_loo.ecostgsti | $Price %]</td>
506                         <td class="number [% IF books_loo.quantity.search(zero_regex) %]error[% END %]">[% books_loo.quantity %]</td>
507                         <td class="number gste [% IF books_loo.totalgste.search(zero_regex) %]error[% END %]">[% books_loo.totalgste | $Price %]</td>
508                         <td class="number gsti [% IF books_loo.totalgsti.search(zero_regex) %]error[% END %]">[% books_loo.totalgsti | $Price %]</td>
509                         <td class="number">[% books_loo.gstrate * 100 | $Price %]</td>
510                         <td class="number [% IF books_loo.gstvalue.search(zero_regex) %]error[% END %]">[% books_loo.gstvalue | $Price %]</td>
511                         <td>[% books_loo.budget_name %]</td>
512                         [% IF ( active ) %]
513                             [% UNLESS ( closedate ) %]
514                             <td>
515                                 <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Modify</a>
516                                 [% UNLESS (books_loo.order_received) %]
517                                     <br />
518                                     <a href="#" onclick="transfer_order_popup([% books_loo.ordernumber %]); return false;">Transfer</a>
519                                 [% END %]
520                             </td>
521                             <td>
522                             [% IF ( books_loo.left_holds_on_order ) %]
523                             <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>
524                             [% ELSE %]
525                             <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>
526                             [% END %]
527                             [% IF ( books_loo.can_del_bib ) %]
528                             <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>
529                             [% ELSE %]
530                             <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
531                             [% END %]
532                             [% IF ( books_loo.left_item ) %]
533                             <b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
534                             [% END %]
535                             [% IF ( books_loo.left_biblio ) %]
536                             <b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
537                             [% END %]
538                             [% IF ( books_loo.left_subscription ) %]
539                             <b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
540                             [% END %]
541                             [% IF ( books_loo.left_holds ) %]
542                             <b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
543                             [% END %]
544                             </td>
545                             [% END %]
546                         [% END %]
547                     </tr>
548                 [% END %]
549                 </tbody>
550             </table>
551         [% END %]
552         [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
553         [% END %]
554         </div>
555         [% IF (cancelledorders_loop) %]
556           <div id="cancelledorders">
557             <h2>Cancelled orders</h2>
558             <table id="cancelledorderst">
559               <thead>
560                 <tr>
561                   <th>No.</th>
562                   <th>Order</th>
563                   <th class="gste">RRP tax exc.</th>
564                   <th class="gste">ecost tax exc.</th>
565                   <th class="gsti">RRP tax inc.</th>
566                   <th class="gsti">ecost tax inc.</th>
567                   <th>Qty.</th>
568                   <th class="gste">Total tax exc. ([% currency %])</th>
569                   <th class="gsti">Total tax inc. ([% currency %])</th>
570                   <th>GST %</th>
571                   <th>GST</th>
572                   <th>Fund</th>
573                 </tr>
574               </thead>
575               <tbody>
576                 [% FOREACH order IN cancelledorders_loop %]
577                   <tr style="color:grey">
578                     <td>
579                         [% order.ordernumber %]
580                     </td>
581                     <td>
582                       <p>
583                         [% IF ( order.order_received ) %] (rcvd)[% END %]
584                         [% IF (order.title) %]
585                           [% order.title |html %] by [% order.author %]<br />
586                         [% ELSE %]
587                           <em>Deleted bibliographic record, can't find title</em><br />
588                         [% END %]
589                         [% IF ( order.order_internalnote ) %] [% order.order_internalnote %][% END %]
590                         [% IF ( order.isbn ) %] - [% order.isbn %][% END %]
591                         [% IF ( order.issn ) %] - [% order.issn %][% END %]
592                         [% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
593                         [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
594                         [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
595                         [% IF ( order.cancellationreason ) %]
596                           <br />
597                           Cancellation reason: [% AuthorisedValues.GetByCode( 'ORDER_CANCELLATION_REASON', order.cancellationreason ) %]
598                         [% END %]
599                       </p>
600                       [% IF order.transferred_to %]
601                         [% basket = order.transferred_to.basket %]
602                         [% bookseller = order.transferred_to.bookseller %]
603                         [% timestamp = order.transferred_to.timestamp %]
604                         <p>Transferred to
605                           <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">basket: [% basket.basketname %]</a>
606                           (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id %]">[% bookseller.name %]</a>)
607                           on <span title="[% timestamp | $KohaDates with_hours = 1%]">
608                             [% timestamp | $KohaDates %]
609                           </span>
610                         </p>
611                       [% END %]
612                     </td>
613                     <td class="number gste">[% order.rrpgste | $Price %]</td>
614                     <td class="number gste">[% order.ecostgste | $Price %]</td>
615                     <td class="number gsti">[% order.rrpgsti | $Price %]</td>
616                     <td class="number gsti">[% order.ecostgsti | $Price %]</td>
617                     <td class="number">[% order.quantity %]</td>
618                     <td class="number gste">[% order.totalgste | $Price %]</td>
619                     <td class="number gsti">[% order.totalgsti | $Price %]</td>
620                     <td class="number">[% order.gstrate * 100 | $Price %]</td>
621                     <td class="number">[% order.gstvalue | $Price %]</td>
622                     <td>[% order.budget_name %]
623                   </tr>
624                 [% END %]
625               </tbody>
626             </table>
627           </div>
628         [% END %]
629         <br />
630         [% UNLESS ( closedate ) %]
631
632     <!-- Modal -->
633     <div id="addtoBasket" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel" aria-hidden="true">
634         <div class="modal-body"></div>
635         <div class="modal-footer">
636             <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
637         </div>
638     </div>
639
640         [% INCLUDE 'acquisitions-add-to-basket.inc' %]
641         [% END %]
642         [% END %]
643 [% END %]
644 [% END %]    [% ELSE %] <!-- if we want just to select a basketgroup for a closed basket -->
645     [% END %]
646 [% IF ( confirm_close ) %]
647         <div id="closebasket_needsconfirmation" class="dialog alert">
648
649         <form action="/cgi-bin/koha/acqui/basket.pl" class="confirm">
650             <h1>Are you sure you want to close basket [% basketname|html %]?</h1>
651             [% IF ( CAN_user_acquisition_group_manage ) %]
652             <p>
653             <label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
654             <input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
655             </p>
656             [% END %]
657             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
658             <input type="hidden" value="close" name="op" />
659             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
660             <input type="hidden" name="confirm" value="1" />
661             <input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
662             <input type="submit" class="approve" value="Yes, close (Y)" accesskey="y" />
663             <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;" />
664         </form>
665         </div>
666     [% END %]
667 </div>
668 [% END %][%# IF (cannot_manage_basket) %]
669 </div>
670 <div class="yui-b">
671 [% INCLUDE 'acquisitions-menu.inc' %]
672 </div>
673 </div>
674 [% INCLUDE 'intranet-bottom.inc' %]