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