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