Bug 5335 - More granular VAT
[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 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7 [% INCLUDE 'datatables-strings.inc' %]
8 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
9
10 <script type="text/javascript">
11 //<![CDATA[
12     function updateColumnsVisibility(visible) {
13         if ( visible ) {
14             $("table .gste, .gsti").show();
15         } else {
16             [% IF ( listincgst ) %]
17                 $("table .gste").hide();
18             [% ELSE %]
19                 $("table .gsti").hide();
20             [% END %]
21         }
22     }
23
24     $(document).ready(function() {
25         $("#show_all_details").click(function(){
26             updateColumnsVisibility($(this+":checked").val());
27         });
28
29         $("#show_all_details").attr('checked', false);
30         updateColumnsVisibility(false);
31     });
32 //]]>
33 </script>
34
35 [% UNLESS ( closedate ) %]
36 <script type="text/javascript">
37 //<![CDATA[
38             function confirm_close() {
39                 var is_confirmed = confirm(_('Are you sure you want to close this basket?'));
40                 if (is_confirmed) {
41                     window.location = "[% script_name %]?op=close&basketno=[% basketno %]";
42                 }
43             }
44             function confirm_deletion() {
45                 var is_confirmed = confirm(_('Are you sure you want to delete this basket?'));
46                 if (is_confirmed) {
47                     window.location = "[% script_name %]?op=delete_confirm&basketno=[% basketno %]&booksellerid=[% booksellerid %]";
48                 }
49             }
50             function confirm_delete_item(ordernumber, biblionumber) {
51                 var is_confirmed = confirm(_('Are you sure you want to delete this order ?'));
52                 if (is_confirmed) {
53                     window.location = "addorder.pl?ordernumber="+ordernumber+"&basketno=[% basketno %]&quantity=0&biblionumber="+biblionumber;
54                 }
55             }
56             
57             function confirm_delete_biblio(ordernumber, biblionumber) {
58                 var is_confirmed = confirm(_('Are you sure you want to delete this catalog record and order ?'));
59                 if (is_confirmed) {
60                     window.location = "addorder.pl?ordernumber="+ordernumber+"&basketno=[% basketno %]&quantity=0&biblionumber="+biblionumber+"&delbiblio=1";
61                     }
62             }
63
64 //]]>
65 </script>
66 [% ELSE %]
67 <script type="text/javascript">
68 //<![CDATA[
69     $(document).ready(function(){
70         $("#basketgroupid").change(function(){
71             if($(this).val() == "new"){
72                 location.href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% booksellerid %]";
73             }
74         });
75     });
76 //]]>
77 </script>
78 [% UNLESS ( grouped ) %]
79 <script type="text/javascript">
80 //<![CDATA[
81             function confirm_reopen(skip) {
82                 var is_confirmed = skip || confirm(_('Are you sure you want to reopen this basket?'));
83                 if (is_confirmed) {
84                     window.location = "[% script_name %]?op=reopen&basketno=[% basketno %]";
85                 }
86             }
87 //]]>
88 </script>
89 [% END %]
90 [% END %]
91 <script type="text/javascript">
92 //<![CDATA[
93     $(document).ready(function() {
94         var orderst = $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
95             "sPaginationType": "four_button",
96             [% IF ( active ) %]
97               [% UNLESS ( closedate ) %]
98                 "aoColumnDefs": [
99                     { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
100                 ],
101               [% END %]
102             [% END %]
103         } ) );
104         var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, {
105             "sPaginationType": "four_button"
106         } ) );
107     } );
108 //]]>
109 </script>
110
111 <style type="text/css">
112 .sortmsg {font-size: 80%;}
113 </style>
114 </head>
115 <body id="acq_basket" class="acq">
116 [% INCLUDE 'header.inc' %]
117 [% INCLUDE 'acquisitions-search.inc' %]
118
119
120 <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>
121
122 <div id="doc3" class="yui-t2">
123
124 <div id="bd">
125     <div id="yui-main">
126     <div class="yui-b">
127         [% UNLESS ( confirm_close ) %]
128         [% UNLESS ( selectbasketg ) %]
129             [% UNLESS ( closedate ) %]
130                 <div id="toolbar">
131                     <script type="text/javascript">
132                         //<![CDATA[
133                         // prepare DOM for YUI Toolbar
134                         $(document).ready(function() {
135                             yuiToolbar();
136                         });
137                         // YUI Toolbar Functions
138                         function yuiToolbar() {
139                             [% IF ( unclosable ) %]
140                                 new YAHOO.widget.Button("closebutton", {disabled:true});
141                             [% ELSIF ( uncertainprices ) %]
142                                 new YAHOO.widget.Button("uncertpricesbutton");
143                             [% ELSE %]
144                                 new YAHOO.widget.Button("closebutton");
145                             [% END %]
146                             new YAHOO.widget.Button("basketheadbutton");
147                             new YAHOO.widget.Button("exportbutton");
148                             new YAHOO.widget.Button("delbasketbutton");
149                         }
150                         //]]>
151                     </script>
152
153                     <ul id="toolbar-list" class="toolbar">
154                     <li><a href="basketheader.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]&amp;op=add_form" class="button" id="basketheadbutton">Edit basket</a></li>
155                     <li><a href="javascript:confirm_deletion();" class="button" id="delbasketbutton">Delete this basket</a></li>
156                     [% IF ( unclosable ) %]
157                     [% ELSIF ( uncertainprices ) %]
158                         <li><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid %]&amp;owner=1" class="button" id="uncertpricesbutton">Uncertain prices</a></li>
159                     [% ELSE %]
160                         <li><a href="[% script_name %]?op=close&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="button" id="closebutton">Close this basket</a></li>
161                     [% END %]
162                         <li><a href="[% script_name %]?op=export&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="button" id="exportbutton">Export this basket as CSV</a></li>
163                     </ul>
164
165                 </div>
166             [% ELSE %]
167                 [% UNLESS ( grouped ) %]
168                 <div id="toolbar">
169                     <script type="text/javascript">
170                         //<![CDATA[
171                         // prepare DOM for YUI Toolbar
172                         $(document).ready(function() {
173                             yuiToolbar();
174                         });
175                         // YUI Toolbar Functions
176                         function yuiToolbar() {
177                             new YAHOO.widget.Button("reopenbutton");
178                         }
179                         //]]>
180                     </script>
181                         <ul id="toolbar-list" class="toolbar">
182                             <li><a href="javascript:confirm_reopen([% skip_confirm_reopen %]);" class="button" id="reopenbutton">Reopen this basket</a></li>
183                         </ul>
184                 </div>
185                 [% END %]
186             [% END %]
187             [% END %]
188
189     [% IF ( NO_BOOKSELLER ) %]
190     <h2>Vendor not found</h2>
191     [% ELSE %]
192         [% IF ( delete_confirmed ) %]
193             <h3>Basket deleted</h3>
194             <META HTTP-EQUIV=Refresh CONTENT="0; url=booksellers.pl">
195         [% ELSE %]
196         <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>
197         [% IF ( delete_confirm ) %]
198             <h2>
199             <span class="yui-button yui-link-button">
200             <em class="first-child">
201                 <a href="[% script_name %]?op=delete_confirm&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="yui-link-button">Yes, delete this basket!</a>
202             </em>
203             </span>
204             <span class="yui-button yui-link-button">
205             <em class="first-child">
206                 <a href="[% script_name %]?basketno=[% basketno %]" class="yui-link-button">Cancel</a>
207             </em>
208             </span>
209             </h2>
210         [% END %]
211         [% IF ( basketno ) %]
212             <div id="acqui_basket_summary" class="yui-g">
213                 <div class="rows">
214                 <div class="yui-u first">
215                 <ol>
216                 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
217                 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
218                 [% IF ( basketcontractno ) %]
219                     <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]&amp;booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li>
220                 [% END %]
221                 [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
222                 [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
223                 [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
224                 [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates  %]</li>[% END %]
225
226                 </ol>
227                 </div>
228                 [% IF ( closedate ) %]
229                 <div class="yui-u">
230                     <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
231
232                         <p><label for="basketgroupid"><strong>Basket group:</strong></label></p>
233                         <p><select id="basketgroupid" name="basketgroupid">
234                             <option value="new">Add new group</option>
235                                                     [% FOREACH basketgroup IN basketgroups %]
236                                                         [% IF ( basketgroup.default ) %]
237                             <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
238                                                         [% ELSE %]
239                             <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
240                                                         [% END %]
241                                                     [% END %]
242                         </select></p>
243
244                         <p><input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
245                         <input type="hidden" value="mod_basket" name="op" />
246                         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
247                         <input type="submit" value="Change basket group" /></p>
248
249                     </form>
250                 </div>
251                 [% END %]
252             </div>
253             </div>
254         [% END %]
255
256         [% UNLESS ( delete_confirm ) %]
257         <div id="acqui_basket_content" class="yui-g">
258         <label for="show_all_details">
259             <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
260             Show all details
261         </label>
262         <h2>Order Details</h2>
263         [% IF ( books_loop ) %]
264             <table id="orders">
265                 <thead>
266                     <tr>
267                         <th>Order</th>
268                         <th class="gste">RRP tax exc.</th>
269                         <th class="gste">ecost tax exc.</th>
270                         <th class="gsti">RRP tax inc.</th>
271                         <th class="gsti">ecost tax inc.</th>
272                         <th>Qty.</th>
273                         <th class="gste">Total tax exc. ([% currency %])</th>
274                         <th class="gsti">Total tax inc. ([% currency %])</th>
275                         <th>GST %</th>
276                         <th>GST</th>
277                         <th>Fund</th>
278                         [% IF ( active ) %]
279                             [% UNLESS ( closedate ) %]
280                                 <th>Modify</th>
281                                 <th>Delete</th>
282                             [% END %]
283                         [% END %]
284                     </tr>
285                 </thead>
286                 <tfoot>
287                 [% FOREACH foot_loo IN book_foot_loop %]
288                     <tr>
289                         <th>Total (GST [% foot_loo.gstgsti %])</th>
290                         <th class="gste"/><th class="gste"/><th class="gsti"/><th class="gsti"/>
291                         <th>[% foot_loo.quantity %]</th>
292                         <th class="gste">[% foot_loo.totalgste %]</th>
293                         <th class="gsti">[% foot_loo.totalgsti %]</th>
294                         <th/>
295                         <th>[% foot_loo.gstvalue %]</th>
296                         <th/>
297                         [% IF ( active ) %]
298                             [% UNLESS ( closedate ) %]
299                                 <th>&nbsp;</th>
300                                 <th>&nbsp;</th>
301                             [% END %]
302                         [% END %]
303                     </tr>
304                 [% END %]
305                 <tr>
306                     <th>Total ([% currency %])</th>
307                     <th class="gste"/><th class="gste"/><th class="gsti"/><th class="gsti"/>
308                     <th>[% total_quantity %]</th>
309                     <th class="gste">[% total_gste %]</th>
310                     <th class="gsti">[% total_gsti %]</th>
311                     <th/>
312                     <th>[% total_gstvalue %]</th>
313                     <th/>
314                     [% IF ( active ) %]
315                         [% UNLESS ( closedate ) %]
316                             <th>&nbsp;</th>
317                             <th>&nbsp;</th>
318                         [% END %]
319                     [% END %]
320                 </tr>
321                 </tfoot>
322                 <tbody>
323                 [% FOREACH books_loo IN books_loop %]
324                     [% IF ( books_loo.order_received ) %]<tr class="disabled">[% ELSE %][% IF ( books_loo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %][% END %]
325                         <td>
326                             <p>[% IF ( books_loo.order_received ) %] (rcvd)[% END %]
327                                 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a> by [% books_loo.author %]
328                                 <br />
329                                 [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
330                                 [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
331                                 [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
332                                 [% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
333                                 [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
334                                 [% IF ( books_loo.suggestionid ) %]
335                                     <br/>
336                                     Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %]
337                                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&amp;op=show">suggestion #[% books_loo.suggestionid %]</a>)
338                                 [% END %]
339                                 [% IF ( books_loo.notes ) %]
340                                     <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>
341                                 [% ELSE %]
342                                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]">Add note</a>]
343                                 [% END %]
344                             </p>
345                         </td>
346                         <td class="number gste [% IF books_loo.rrpgste.search('^0') %]error[% END %]">[% books_loo.rrpgste %]</td>
347                         <td class="number gste [% IF books_loo.ecostgste.search('^0') %]error[% END %]">[% books_loo.ecostgste %]</td>
348                         <td class="number gsti [% IF books_loo.rrpgsti.search('^0') %]error[% END %]">[% books_loo.rrpgsti %]</td>
349                         <td class="number gsti [% IF books_loo.ecostgsti.search('^0') %]error[% END %]">[% books_loo.ecostgsti %]</td>
350                         <td class="number [% IF books_loo.quantity.search('^0') %]error[% END %]">[% books_loo.quantity %]</td>
351                         <td class="number gste [% IF books_loo.totalgste.search('^0') %]error[% END %]">[% books_loo.totalgste %]</td>
352                         <td class="number gsti [% IF books_loo.totalgsti.search('^0') %]error[% END %]">[% books_loo.totalgsti %]</td>
353                         <td class="number [% IF books_loo.gstgsti.search('^0') %]error[% END %]">[% books_loo.gstgsti %]</td>
354                         <td class="number [% IF books_loo.gstvalue.search('^0') %]error[% END %]">[% books_loo.gstvalue %]</td>
355                         <td>[% books_loo.budget_name %]</td>
356                         [% IF ( active ) %]
357                             [% UNLESS ( closedate ) %]
358                             <td>
359                                 <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Modify</a>
360                             </td>
361                             <td>
362                             [% IF ( books_loo.left_holds_on_order ) %]
363                             <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>
364                             [% ELSE %]
365                             <a href="javascript:confirm_delete_item([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order</a><br>
366                             [% END %]
367                             [% IF ( books_loo.can_del_bib ) %]
368                             <a href="javascript:confirm_delete_biblio([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order and catalog record</a><br>
369                             [% ELSE %]
370                             <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
371                             [% END %]
372                             [% IF ( books_loo.left_item ) %]
373                             <b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
374                             [% END %]
375                             [% IF ( books_loo.left_biblio ) %]
376                             <b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
377                             [% END %]
378                             [% IF ( books_loo.left_subscription ) %]
379                             <b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
380                             [% END %]
381                             [% IF ( books_loo.left_holds ) %]
382                             <b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
383                             [% END %]
384                             </td>
385                             [% END %]
386                         [% END %]
387                     </tr>
388                 [% END %]
389                 </tbody>
390             </table>
391         [% ELSE %]
392             <table>
393                 <tr><td>Basket empty</td></tr>
394             </table>
395         [% END %]
396         [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
397         [% END %]
398         </div>
399         [% IF (cancelledorders_loop) %]
400           <div id="cancelledorders">
401             <h2>Cancelled orders</h2>
402             <table id="cancelledorderst">
403               <thead>
404                 <tr>
405                   <th>Order</th>
406                   <th class="gste">RRP tax exc.</th>
407                   <th class="gste">ecost tax exc.</th>
408                   <th class="gsti">RRP tax inc.</th>
409                   <th class="gsti">ecost tax inc.</th>
410                   <th>Qty.</th>
411                   <th class="gste">Total tax exc. ([% currency %])</th>
412                   <th class="gsti">Total tax inc. ([% currency %])</th>
413                   <th>GST %</th>
414                   <th>GST</th>
415                   <th>Fund</th>
416                 </tr>
417               </thead>
418               <tbody>
419                 [% FOREACH order IN cancelledorders_loop %]
420                   <tr style="color:grey">
421                     <td>
422                       <p>
423                         [% IF ( order.order_received ) %] (rcvd)[% END %]
424                         [% IF (order.title) %]
425                           [% order.title |html %] by [% order.author %]<br />
426                         [% ELSE %]
427                           <em>Deleted bibliographic record, can't find title</em><br />
428                         [% END %]
429                         [% IF ( order.notes ) %] [% order.notes %][% END %]
430                         [% IF ( order.isbn ) %] - [% order.isbn %][% END %]
431                         [% IF ( order.issn ) %] - [% order.issn %][% END %]
432                         [% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
433                         [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
434                         [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
435                       </p>
436                     </td>
437                     <td class="number gste">[% order.rrpgste %]</td>
438                     <td class="number gste">[% order.ecostgste %]</td>
439                     <td class="number gsti">[% order.rrpgsti %]</td>
440                     <td class="number gsti">[% order.ecostgsti %]</td>
441                     <td class="number">[% order.quantity %]</td>
442                     <td class="number gste">[% order.totalgste %]</td>
443                     <td class="number gsti">[% order.totalgsti %]</td>
444                     <td class="number">[% order.gstgsti %]</td>
445                     <td class="number">[% order.gstvalue %]</td>
446                     <td>[% order.budget_name %]
447                   </tr>
448                 [% END %]
449               </tbody>
450             </table>
451           </div>
452         [% END %]
453         <br />
454         [% UNLESS ( closedate ) %]
455         [% INCLUDE 'acquisitions-add-to-basket.inc' %]
456         [% END %]
457         [% END %]
458 [% END %]
459 [% END %]    [% ELSE %] <!-- if we want just to select a basketgroup for a closed basket -->
460     [% END %]
461 [% IF ( confirm_close ) %]
462         <div id="closebasket_needsconfirmation" class="dialog alert">
463
464         <form action="/cgi-bin/koha/acqui/basket.pl" class="confirm">
465             <h1>Are you sure you want to close basket [% basketname|html %]?</h1>
466             <p>
467             <label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
468             <input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
469             </p>
470             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
471             <input type="hidden" value="close" name="op" />
472             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
473             <input type="hidden" name="confirm" value="1" />
474             <input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
475             <input type="submit" class="approve" value="Yes, Close (Y)" accesskey="y" />
476             <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;" />
477         </form>
478         </div>
479     [% END %]
480 </div>
481 </div>
482 <div class="yui-b">
483 [% INCLUDE 'acquisitions-menu.inc' %]
484 </div>
485 </div>
486 [% INCLUDE 'intranet-bottom.inc' %]