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