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