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