Merge remote-tracking branch 'origin/new/bug_5327'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / basket.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Acquisitions &rsaquo; [% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% UNLESS ( closedate ) %]
5 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
6 <script type="text/javascript">
7 //<![CDATA[
8     $(document).ready(function() {
9         $("#orders").tablesorter({
10             headers: {
11                 9: { sorter: false },
12                 10: { sorter: false }
13             }
14         });
15     });
16             function confirm_close() {
17                 var is_confirmed = confirm(_('Are you sure you want to close this basket?'));
18                 if (is_confirmed) {
19                     window.location = "[% script_name %]?op=close&basketno=[% basketno %]";
20                 }
21             }
22             function confirm_deletion() {
23                 var is_confirmed = confirm(_('Are you sure you want to delete this basket?'));
24                 if (is_confirmed) {
25                     window.location = "[% script_name %]?op=delete_confirm&basketno=[% basketno %]&booksellerid=[% booksellerid %]";
26                 }
27             }
28             function confirm_delete_item(ordernumber, biblionumber) {
29                 var is_confirmed = confirm(_('Are you sure you want to delete this order ?'));
30                 if (is_confirmed) {
31                     window.location = "addorder.pl?ordernumber="+ordernumber+"&basketno=[% basketno %]&quantity=0&biblionumber="+biblionumber;
32                 }
33             }
34             
35             function confirm_delete_biblio(ordernumber, biblionumber) {
36                 var is_confirmed = confirm(_('Are you sure you want to delete this catalog record and order ?'));
37                 if (is_confirmed) {
38                     window.location = "addorder.pl?ordernumber="+ordernumber+"&basketno=[% basketno %]&quantity=0&biblionumber="+biblionumber+"&delbiblio=1";
39                     }
40             }
41
42 //]]>
43 </script>
44 [% ELSE %]
45 <script type="text/javascript">
46 //<![CDATA[
47     $(document).ready(function(){
48         $("#basketgroupid").change(function(){
49             if($(this).val() == "new"){
50                 location.href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% booksellerid %]";
51             }
52         });
53     });
54 //]]>
55 </script>
56 [% UNLESS ( grouped ) %]
57 <script type="text/javascript">
58 //<![CDATA[
59             function confirm_reopen(skip) {
60                 var is_confirmed = skip || confirm(_('Are you sure you want to reopen this basket?'));
61                 if (is_confirmed) {
62                     window.location = "[% script_name %]?op=reopen&basketno=[% basketno %]";
63                 }
64             }
65 //]]>
66 </script>
67 [% END %]
68 [% END %]
69 <style type="text/css">
70 .sortmsg {font-size: 80%;}
71 </style>
72 </head>
73 <body>
74 [% INCLUDE 'header.inc' %]
75 [% INCLUDE 'acquisitions-search.inc' %]
76
77
78 <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?supplierid=[% booksellerid %]">[% name|html %]</a> &rsaquo; [% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</div>
79
80 <div id="doc3" class="yui-t2">
81
82 <div id="bd">
83     <div id="yui-main">
84     <div class="yui-b">
85         [% UNLESS ( confirm_close ) %]
86         [% UNLESS ( selectbasketg ) %]
87             [% UNLESS ( closedate ) %]
88                 <div id="toolbar">
89                     <script type="text/javascript">
90                         //<![CDATA[
91                         // prepare DOM for YUI Toolbar
92                         $(document).ready(function() {
93                             yuiToolbar();
94                         });
95                         // YUI Toolbar Functions
96                         function yuiToolbar() {
97                             [% IF ( unclosable ) %]
98                                 new YAHOO.widget.Button("closebutton", {disabled:true});
99                             [% ELSIF ( uncertainprices ) %]
100                                 new YAHOO.widget.Button("uncertpricesbutton");
101                             [% ELSE %]
102                                 new YAHOO.widget.Button("closebutton");
103                             [% END %]
104                             new YAHOO.widget.Button("basketheadbutton");
105                             new YAHOO.widget.Button("exportbutton");
106                             new YAHOO.widget.Button("delbasketbutton");
107                         }
108                         //]]>
109                     </script>
110
111                     <ul id="toolbar-list" class="toolbar">
112                     <li><a href="basketheader.pl?basketno=[% basketno %]&amp;op=add_form" class="button" id="basketheadbutton">Edit basket header information</a></li>
113                     <li><a href="javascript:confirm_deletion();" class="button" id="delbasketbutton">Delete this basket</a></li>
114                     [% IF ( unclosable ) %]
115                     [% ELSIF ( uncertainprices ) %]
116                         <li><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid %]&amp;owner=1" class="button" id="uncertpricesbutton">Uncertain prices</a></li>
117                     [% ELSE %]
118                         <li><a href="[% script_name %]?op=close&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="button" id="closebutton">Close this basket</a></li>
119                     [% END %]
120                         <li><a href="[% script_name %]?op=export&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="button" id="exportbutton">Export this basket as CSV</a></li>
121                     </ul>
122
123                 </div>
124             [% ELSE %]
125                 [% UNLESS ( grouped ) %]
126                 <div id="toolbar">
127                     <script type="text/javascript">
128                         //<![CDATA[
129                         // prepare DOM for YUI Toolbar
130                         $(document).ready(function() {
131                             yuiToolbar();
132                         });
133                         // YUI Toolbar Functions
134                         function yuiToolbar() {
135                             new YAHOO.widget.Button("reopenbutton");
136                         }
137                         //]]>
138                     </script>
139                         <ul id="toolbar-list" class="toolbar">
140                             <li><a href="javascript:confirm_reopen([% skip_confirm_reopen %]);" class="button" id="reopenbutton">Reopen this basket</a></li>
141                         </ul>
142                 </div>
143                 [% END %]
144             [% END %]
145             [% END %]
146
147     [% IF ( NO_BOOKSELLER ) %]
148     <h2>Vendor not found</h2>
149     [% ELSE %]
150         [% IF ( delete_confirmed ) %]
151             <h3>Basket deleted</h3>
152             <META HTTP-EQUIV=Refresh CONTENT="0; url=booksellers.pl">
153         [% ELSE %]
154         <h1>[% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for <a href="supplier.pl?supplierid=[% booksellerid %]">[% name|html %]</a></h1>
155         [% IF ( delete_confirm ) %]
156             <h2>
157             <span class="yui-button yui-link-button">
158             <em class="first-child">
159                 <a href="[% script_name %]?op=delete_confirm&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="yui-link-button">Yes, delete this basket!</a>
160             </em>
161             </span>
162             <span class="yui-button yui-link-button">
163             <em class="first-child">
164                 <a href="[% script_name %]?basketno=[% basketno %]" class="yui-link-button">Cancel</a>
165             </em>
166             </span>
167             </h2>
168         [% END %]
169         [% IF ( basketno ) %]
170             <div id="acqui_basket_summary" class="yui-g">
171                 <div class="rows">
172                 <div class="yui-u first">
173                 <ol>
174                 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
175                 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
176                 [% IF ( basketcontractno ) %]
177                     <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]&amp;booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li>
178                 [% END %]
179                 [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
180                 [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate %]</li>[% END %]
181                 [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate %]</li>[% END %]
182
183                 </ol>
184                 </div>
185                 [% IF ( closedate ) %]
186                 <div class="yui-u">
187                     <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
188
189                         <p><label for="basketgroupid"><strong>Basket group:</strong></label></p>
190                         <p><select id="basketgroupid" name="basketgroupid">
191                             <option value="new">Add new group</option>
192                                                     [% FOREACH basketgroup IN basketgroups %]
193                                                         [% IF ( basketgroup.default ) %]
194                             <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
195                                                         [% ELSE %]
196                             <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
197                                                         [% END %]
198                                                     [% END %]
199                         </select></p>
200
201                         <p><input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
202                         <input type="hidden" value="mod_basket" name="op" />
203                         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
204                         <input type="submit" value="Change basket group" /></p>
205
206                     </form>
207                 </div>
208                 [% END %]
209             </div>
210             </div>
211         [% END %]
212
213         [% UNLESS ( delete_confirm ) %]
214         <div id="acqui_basket_content" class="yui-g">
215         <h2>Order Details</h2>
216         [% IF ( books_loop ) %]
217             <table id="orders">
218                 <thead>
219                     <tr>
220                         <th>Order</th>
221                         <th>RRP</th>
222                         <th>Est.</th>
223                         <th>Qty.</th>
224                         <th>Total</th>
225                         <th>Fund</th>
226                         [% IF ( active ) %]
227                             [% UNLESS ( closedate ) %]
228                                 <th>Modify</th>
229                                 <th>Delete</th>
230                             [% END %]
231                         [% END %]
232                     </tr>
233                 </thead>
234                 <tfoot>
235                 [% IF ( GST ) %]
236                 <tr>
237                     <th scope="row">Total Tax Exc.</th>
238                     <td>[% total_rrp_gste %]</td>
239                     <td>&nbsp;</td>
240                     <td>[% qty_total %]</td>
241                     <td>[% total_est_gste %]</td>
242                         [% IF ( active ) %]
243                             [% IF ( closedate ) %]
244                             <td colspan="1" rowspan="3">&nbsp;</td>
245                             [% ELSE %]
246                             <td colspan="3" rowspan="3">&nbsp;</td>
247                             [% END %]
248                         [% END %]
249                 </tr>
250                 <tr>
251                     <th scope="row">Tax ([% gist_rate %])</th>
252                     <td>[% gist_rrp %]</td>
253                     <td>&nbsp;</td>
254                     <td>&nbsp;</td>
255                     <td>[% gist_est %]</td>
256                 </tr>
257                 <tr>
258                     <th scope="row">Total Tax Inc. ([% currency %])</th>
259                     <td>[% total_rrp_gsti %]</td>
260                     <td>&nbsp;</td>
261                     <td>[% qty_total %]</td>
262                     <td>[% total_est_gsti %]</td>
263                 </tr>
264                 [% ELSE %]
265                 <tr>
266                     <th scope="row">Total ([% currency %])</th>
267                     <td>[% total_rrp_gsti %]</td>
268                     <td>&nbsp;</td>
269                     <td>[% qty_total %]</td>
270                     <td>[% total_est_gsti %]</td>
271                 </tr>
272                 [% END %]
273                 </tfoot>
274                 <tbody>
275                 [% FOREACH books_loo IN books_loop %]
276                     [% IF ( books_loo.order_received ) %]<tr class="disabled">[% ELSE %][% IF ( books_loo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %][% END %]
277                         <td>
278                             <p>[% IF ( books_loo.order_received ) %] (rcvd)[% END %]
279                                 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a> by [% books_loo.author %]
280                                     [% IF ( books_loo.notes ) %] [% books_loo.notes %][% END %]
281                                     [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
282                                     [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
283                                     [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
284                                     [% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
285                             </p>
286                             </td>
287                         <td class="number">[% books_loo.rrp %]</td>
288                         <td class="number">[% books_loo.ecost %]</td>
289                         <td class="number">[% books_loo.quantity %]</td>
290                         <td class="number">[% books_loo.line_total %]</td>
291                         <td>[% books_loo.budget_name %]</td>
292                         [% IF ( active ) %]
293                             [% UNLESS ( closedate ) %]
294                             <td>
295                                 <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Modify</a>
296                             </td>
297                             <td>
298                             [% IF ( books_loo.left_holds_on_order ) %]
299                             <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>
300                             [% ELSE %]
301                             <a href="javascript:confirm_delete_item([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order</a><br>
302                             [% END %]
303                             [% IF ( books_loo.can_del_bib ) %]
304                             <a href="javascript:confirm_delete_biblio([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order and catalog record</a><br>
305                             [% ELSE %]
306                             <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
307                             [% END %]
308                             [% IF ( books_loo.left_item ) %]
309                             <b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
310                             [% END %]
311                             [% IF ( books_loo.left_biblio ) %]
312                             <b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
313                             [% END %]
314                             [% IF ( books_loo.left_subscription ) %]
315                             <b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
316                             [% END %]
317                             [% IF ( books_loo.left_holds ) %]
318                             <b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
319                             [% END %]
320                             </td>
321                             [% END %]
322                         [% END %]
323                     </tr>
324                 [% END %]
325                 </tbody>
326             </table>
327         [% ELSE %]
328             <table>
329                 <tr><td>Basket empty</td></tr>
330             </table>
331         [% END %]
332         [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
333         [% END %]
334         </div>
335         <br />
336         [% UNLESS ( closedate ) %]
337         [% INCLUDE 'acquisitions-add-to-basket.inc' %]
338         [% END %]
339         [% END %]
340 [% END %]
341 [% END %]    [% ELSE %] <!-- if we want just to select a basketgroup for a closed basket -->
342     [% END %]
343 [% IF ( confirm_close ) %]
344         <div id="closebasket_needsconfirmation" class="dialog alert">
345
346         <form action="/cgi-bin/koha/acqui/basket.pl" class="confirm">
347             <h1>Are you sure you want to close basket [% basketname|html %]?</h1>
348             <p>
349             <label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
350             <input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
351             </p>
352             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
353             <input type="hidden" value="close" name="op" />
354             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
355             <input type="hidden" name="confirm" value="1" />
356             <input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
357             <input type="submit" class="approve" value="Yes, Close (Y)" accesskey="y" />
358             <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;" />
359         </form>
360         </div>
361     [% END %]
362 </div>
363 </div>
364 <div class="yui-b">
365 [% INCLUDE 'acquisitions-menu.inc' %]
366 </div>
367 </div>
368 [% INCLUDE 'intranet-bottom.inc' %]