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