Bug 9416: add new order vendor note field
[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="">No 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                               <option value="new">Add new group</option>
378                             </select>
379                             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
380                             <input type="hidden" value="mod_basket" name="op" />
381                             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
382                             <input type="submit" value="Change basket group" />
383                           [% END %]
384                         </li>
385                     [% IF ( basketgroup.deliveryplacename ) %]<li><span class="label">Basket group delivery placename:</span> [% basketgroup.deliveryplacename %]</li>[% END %]
386                     [% IF ( basketgroup.billingplacename ) %]<li><span class="label">Basket group billing place:</span> [% basketgroup.billingplacename %]</li>[% END %]
387                         </ol>
388                     [% IF ( CAN_user_acquisition_group_manage ) %]
389                     </form>
390                     [% END %]
391                 </div>
392                 [% END %]
393             </div>
394             </div>
395         [% END %]
396
397         [% UNLESS ( delete_confirm ) %]
398         <div id="acqui_basket_content" class="yui-g">
399         [% IF ( books_loop ) %]
400         <h2>Orders</h2>
401         <label for="show_all_details">
402             <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
403             Show all details
404         </label>
405             <table id="orders">
406                 <thead>
407                     <tr>
408                         <th>No.</th>
409                         <th>Order</th>
410                         <th class="gste">RRP tax exc.</th>
411                         <th class="gste">ecost tax exc.</th>
412                         <th class="gsti">RRP tax inc.</th>
413                         <th class="gsti">ecost tax inc.</th>
414                         <th>Qty.</th>
415                         <th class="gste">Total tax exc. ([% currency %])</th>
416                         <th class="gsti">Total tax inc. ([% currency %])</th>
417                         <th>GST %</th>
418                         <th>GST</th>
419                         <th>Fund</th>
420                         [% IF ( active ) %]
421                             [% UNLESS ( closedate ) %]
422                                 <th>Modify</th>
423                                 <th>Delete</th>
424                             [% END %]
425                         [% END %]
426                     </tr>
427                 </thead>
428                 <tfoot>
429                 [% FOREACH foot_loo IN book_foot_loop %]
430                     <tr>
431                         <th></th>
432                         <th>Total (GST [% foot_loo.gstgsti %])</th>
433                         <th class="gste">&nbsp;</th>
434                         <th class="gste">&nbsp;</th>
435                         <th class="gsti">&nbsp;</th>
436                         <th class="gsti">&nbsp;</th>
437                         <th>[% foot_loo.quantity %]</th>
438                         <th class="gste">[% foot_loo.totalgste %]</th>
439                         <th class="gsti">[% foot_loo.totalgsti %]</th>
440                         <th>&nbsp;</th>
441                         <th>[% foot_loo.gstvalue %]</th>
442                         <th>&nbsp;</th>
443                         [% IF ( active ) %]
444                             [% UNLESS ( closedate ) %]
445                                 <th>&nbsp;</th>
446                                 <th>&nbsp;</th>
447                             [% END %]
448                         [% END %]
449                     </tr>
450                 [% END %]
451                 <tr>
452                     <th></th>
453                     <th>Total ([% currency %])</th>
454                     <th class="gste">&nbsp;</th>
455                     <th class="gste">&nbsp;</th>
456                     <th class="gsti">&nbsp;</th>
457                     <th class="gsti">&nbsp;</th>
458                     <th>[% total_quantity %]</th>
459                     <th class="gste">[% total_gste %]</th>
460                     <th class="gsti">[% total_gsti %]</th>
461                     <th>&nbsp;</th>
462                     <th>[% total_gstvalue %]</th>
463                     <th>&nbsp;</th>
464                     [% IF ( active ) %]
465                         [% UNLESS ( closedate ) %]
466                             <th>&nbsp;</th>
467                             <th>&nbsp;</th>
468                         [% END %]
469                     [% END %]
470                 </tr>
471                 </tfoot>
472                 <tbody>
473                 [% FOREACH books_loo IN books_loop %]
474                     [% IF ( books_loo.order_received ) %]<tr class="disabled">[% ELSE %][% IF ( books_loo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %][% END %]
475                         <td>
476                             [% books_loo.ordernumber %]
477                         </td>
478                         <td>
479                             <p>
480                                 [% IF ( books_loo.order_received ) %] (rcvd)[% END %]
481                                 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a> by [% books_loo.author %]
482                                 <br />
483                                 [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
484                                 [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
485                                 [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
486                                 [% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
487                                 [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
488                                 [% IF ( books_loo.suggestionid ) %]
489                                     <br/>
490                                     Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %]
491                                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&amp;op=show">suggestion #[% books_loo.suggestionid %]</a>)
492                                 [% END %]
493                             </p>
494                                 [% IF ( books_loo.order_internalnote ) %]
495                                     <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>
496                                 [% ELSE %]
497                                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=internal">Add internal note</a>]
498                                 [% END %]
499                                 [% IF ( books_loo.order_vendornote ) %]
500                                     <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>
501                                 [% ELSE %]
502                                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=vendor">Add vendor note</a>]
503                                 [% END %]
504                             [% IF (books_loo.transferred_from) %]
505                               [% basket = books_loo.transferred_from.basket %]
506                               [% bookseller = books_loo.transferred_from.bookseller %]
507                               [% timestamp = books_loo.transferred_from.timestamp %]
508                               <p>Transferred from
509                                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">basket: [% basket.basketname %]</a>
510                                 (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id %]">[% bookseller.name %]</a>)
511                                 on <span title="[% timestamp | $KohaDates with_hours = 1 %]">
512                                   [% timestamp | $KohaDates %]
513                                 </span>
514                               </p>
515                             [% END %]
516                         </td>
517                         [% 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 ... %]
518                         [%# FIXME: use of a regexp is not ideal; bugs 9410 and 10929 suggest better way of handling this %]
519                         <td class="number gste [% IF books_loo.rrpgste.search(zero_regex) %]error[% END %]">[% books_loo.rrpgste %]</td>
520                         <td class="number gste [% IF books_loo.ecostgste.search(zero_regex) %]error[% END %]">[% books_loo.ecostgste %]</td>
521                         <td class="number gsti [% IF books_loo.rrpgsti.search(zero_regex) %]error[% END %]">[% books_loo.rrpgsti %]</td>
522                         <td class="number gsti [% IF books_loo.ecostgsti.search(zero_regex) %]error[% END %]">[% books_loo.ecostgsti %]</td>
523                         <td class="number [% IF books_loo.quantity.search(zero_regex) %]error[% END %]">[% books_loo.quantity %]</td>
524                         <td class="number gste [% IF books_loo.totalgste.search(zero_regex) %]error[% END %]">[% books_loo.totalgste %]</td>
525                         <td class="number gsti [% IF books_loo.totalgsti.search(zero_regex) %]error[% END %]">[% books_loo.totalgsti %]</td>
526                         <td class="number [% IF books_loo.gstgsti.search(zero_regex) %]error[% END %]">[% books_loo.gstgsti %]</td>
527                         <td class="number [% IF books_loo.gstvalue.search(zero_regex) %]error[% END %]">[% books_loo.gstvalue %]</td>
528                         <td>[% books_loo.budget_name %]</td>
529                         [% IF ( active ) %]
530                             [% UNLESS ( closedate ) %]
531                             <td>
532                                 <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Modify</a>
533                                 [% UNLESS (books_loo.order_received) %]
534                                     <br />
535                                     <a href="#" onclick="transfer_order_popup([% books_loo.ordernumber %]); return false;">Transfer</a>
536                                 [% END %]
537                             </td>
538                             <td>
539                             [% IF ( books_loo.left_holds_on_order ) %]
540                             <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>
541                             [% ELSE %]
542                             <a href="javascript:confirm_delete_item([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order</a><br>
543                             [% END %]
544                             [% IF ( books_loo.can_del_bib ) %]
545                             <a href="javascript:confirm_delete_biblio([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order and catalog record</a><br>
546                             [% ELSE %]
547                             <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
548                             [% END %]
549                             [% IF ( books_loo.left_item ) %]
550                             <b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
551                             [% END %]
552                             [% IF ( books_loo.left_biblio ) %]
553                             <b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
554                             [% END %]
555                             [% IF ( books_loo.left_subscription ) %]
556                             <b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
557                             [% END %]
558                             [% IF ( books_loo.left_holds ) %]
559                             <b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
560                             [% END %]
561                             </td>
562                             [% END %]
563                         [% END %]
564                     </tr>
565                 [% END %]
566                 </tbody>
567             </table>
568         [% END %]
569         [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
570         [% END %]
571         </div>
572         [% IF (cancelledorders_loop) %]
573           <div id="cancelledorders">
574             <h2>Cancelled orders</h2>
575             <table id="cancelledorderst">
576               <thead>
577                 <tr>
578                   <th>No.</th>
579                   <th>Order</th>
580                   <th class="gste">RRP tax exc.</th>
581                   <th class="gste">ecost tax exc.</th>
582                   <th class="gsti">RRP tax inc.</th>
583                   <th class="gsti">ecost tax inc.</th>
584                   <th>Qty.</th>
585                   <th class="gste">Total tax exc. ([% currency %])</th>
586                   <th class="gsti">Total tax inc. ([% currency %])</th>
587                   <th>GST %</th>
588                   <th>GST</th>
589                   <th>Fund</th>
590                 </tr>
591               </thead>
592               <tbody>
593                 [% FOREACH order IN cancelledorders_loop %]
594                   <tr style="color:grey">
595                     <td>
596                         [% order.ordernumber %]
597                     </td>
598                     <td>
599                       <p>
600                         [% IF ( order.order_received ) %] (rcvd)[% END %]
601                         [% IF (order.title) %]
602                           [% order.title |html %] by [% order.author %]<br />
603                         [% ELSE %]
604                           <em>Deleted bibliographic record, can't find title</em><br />
605                         [% END %]
606                         [% IF ( order.order_internalnote ) %] [% order.order_internalnote %][% END %]
607                         [% IF ( order.isbn ) %] - [% order.isbn %][% END %]
608                         [% IF ( order.issn ) %] - [% order.issn %][% END %]
609                         [% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
610                         [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
611                         [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
612                       </p>
613                       [% IF order.transferred_to %]
614                         [% basket = order.transferred_to.basket %]
615                         [% bookseller = order.transferred_to.bookseller %]
616                         [% timestamp = order.transferred_to.timestamp %]
617                         <p>Transferred to
618                           <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">basket: [% basket.basketname %]</a>
619                           (<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% bookseller.id %]">[% bookseller.name %]</a>)
620                           on <span title="[% timestamp | $KohaDates with_hours = 1%]">
621                             [% timestamp | $KohaDates %]
622                           </span>
623                         </p>
624                       [% END %]
625                     </td>
626                     <td class="number gste">[% order.rrpgste %]</td>
627                     <td class="number gste">[% order.ecostgste %]</td>
628                     <td class="number gsti">[% order.rrpgsti %]</td>
629                     <td class="number gsti">[% order.ecostgsti %]</td>
630                     <td class="number">[% order.quantity %]</td>
631                     <td class="number gste">[% order.totalgste %]</td>
632                     <td class="number gsti">[% order.totalgsti %]</td>
633                     <td class="number">[% order.gstgsti %]</td>
634                     <td class="number">[% order.gstvalue %]</td>
635                     <td>[% order.budget_name %]
636                   </tr>
637                 [% END %]
638               </tbody>
639             </table>
640           </div>
641         [% END %]
642         <br />
643         [% UNLESS ( closedate ) %]
644
645     <!-- Modal -->
646     <div id="addtoBasket" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel" aria-hidden="true">
647         <div class="modal-body"></div>
648         <div class="modal-footer">
649             <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
650         </div>
651     </div>
652
653         [% INCLUDE 'acquisitions-add-to-basket.inc' %]
654         [% END %]
655         [% END %]
656 [% END %]
657 [% END %]    [% ELSE %] <!-- if we want just to select a basketgroup for a closed basket -->
658     [% END %]
659 [% IF ( confirm_close ) %]
660         <div id="closebasket_needsconfirmation" class="dialog alert">
661
662         <form action="/cgi-bin/koha/acqui/basket.pl" class="confirm">
663             <h1>Are you sure you want to close basket [% basketname|html %]?</h1>
664             [% IF ( CAN_user_acquisition_group_manage ) %]
665             <p>
666             <label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
667             <input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
668             </p>
669             [% END %]
670             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
671             <input type="hidden" value="close" name="op" />
672             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
673             <input type="hidden" name="confirm" value="1" />
674             <input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
675             <input type="submit" class="approve" value="Yes, close (Y)" accesskey="y" />
676             <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;" />
677         </form>
678         </div>
679     [% END %]
680 </div>
681 [% END %][%# IF (cannot_manage_basket) %]
682 </div>
683 <div class="yui-b">
684 [% INCLUDE 'acquisitions-menu.inc' %]
685 </div>
686 </div>
687 [% INCLUDE 'intranet-bottom.inc' %]