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