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