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