Merge remote-tracking branch 'origin/new/bug_6199'
[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
185                 </ol>
186                 </div>
187                 [% IF ( closedate ) %]
188                 <div class="yui-u">
189                     <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
190
191                         <p><label for="basketgroupid"><strong>Basket group:</strong></label></p>
192                         <p><select id="basketgroupid" name="basketgroupid">
193                             <option value="new">Add new group</option>
194                                                     [% FOREACH basketgroup IN basketgroups %]
195                                                         [% IF ( basketgroup.default ) %]
196                             <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
197                                                         [% ELSE %]
198                             <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
199                                                         [% END %]
200                                                     [% END %]
201                         </select></p>
202
203                         <p><input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
204                         <input type="hidden" value="mod_basket" name="op" />
205                         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
206                         <input type="submit" value="Change basket group" /></p>
207
208                     </form>
209                 </div>
210                 [% END %]
211             </div>
212             </div>
213         [% END %]
214
215         [% UNLESS ( delete_confirm ) %]
216         <div id="acqui_basket_content" class="yui-g">
217         <h2>Order Details</h2>
218         [% IF ( books_loop ) %]
219             <table id="orders">
220                 <thead>
221                     <tr>
222                         <th>Order</th>
223                         <th>RRP</th>
224                         <th>Est.</th>
225                         <th>Qty.</th>
226                         <th>Total</th>
227                         <th>Fund</th>
228                         [% IF ( active ) %]
229                             [% UNLESS ( closedate ) %]
230                                 <th>Modify</th>
231                                 <th>Delete</th>
232                             [% END %]
233                         [% END %]
234                     </tr>
235                 </thead>
236                 <tfoot>
237                 [% IF ( GST ) %]
238                 <tr>
239                     <th scope="row">Total Tax Exc.</th>
240                     <td>[% total_rrp_gste %]</td>
241                     <td>&nbsp;</td>
242                     <td>[% qty_total %]</td>
243                     <td>[% total_est_gste %]</td>
244                         [% IF ( active ) %]
245                             [% IF ( closedate ) %]
246                             <td colspan="1" rowspan="3">&nbsp;</td>
247                             [% ELSE %]
248                             <td colspan="3" rowspan="3">&nbsp;</td>
249                             [% END %]
250                         [% END %]
251                 </tr>
252                 <tr>
253                     <th scope="row">Tax ([% gist_rate %])</th>
254                     <td>[% gist_rrp %]</td>
255                     <td>&nbsp;</td>
256                     <td>&nbsp;</td>
257                     <td>[% gist_est %]</td>
258                 </tr>
259                 <tr>
260                     <th scope="row">Total Tax Inc. ([% currency %])</th>
261                     <td>[% total_rrp_gsti %]</td>
262                     <td>&nbsp;</td>
263                     <td>[% qty_total %]</td>
264                     <td>[% total_est_gsti %]</td>
265                 </tr>
266                 [% ELSE %]
267                 <tr>
268                     <th scope="row">Total ([% currency %])</th>
269                     <td>[% total_rrp_gsti %]</td>
270                     <td>&nbsp;</td>
271                     <td>[% qty_total %]</td>
272                     <td>[% total_est_gsti %]</td>
273                 </tr>
274                 [% END %]
275                 </tfoot>
276                 <tbody>
277                 [% FOREACH books_loo IN books_loop %]
278                     [% IF ( books_loo.order_received ) %]<tr class="disabled">[% ELSE %][% IF ( books_loo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %][% END %]
279                         <td>
280                             <p>[% IF ( books_loo.order_received ) %] (rcvd)[% END %]
281                                 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a> by [% books_loo.author %]
282                                 <br />
283                                 [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
284                                 [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
285                                 [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
286                                 [% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
287                                 [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
288                                 [% IF ( books_loo.suggestionid ) %]
289                                     <br/>
290                                     Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %]
291                                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&op=show">suggestion #[% books_loo.suggestionid %]</a>)
292                                 [% END %]
293                                 [% IF ( books_loo.notes ) %]
294                                     <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>
295                                 [% ELSE %]
296                                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]">Add note</a>]
297                                 [% END %]
298                             </p>
299                         </td>
300                         <td class="number">[% books_loo.rrp %]</td>
301                         <td class="number">[% books_loo.ecost %]</td>
302                         <td class="number">[% books_loo.quantity %]</td>
303                         <td class="number">[% books_loo.line_total %]</td>
304                         <td>[% books_loo.budget_name %]</td>
305                         [% IF ( active ) %]
306                             [% UNLESS ( closedate ) %]
307                             <td>
308                                 <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Modify</a>
309                             </td>
310                             <td>
311                             [% IF ( books_loo.left_holds_on_order ) %]
312                             <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>
313                             [% ELSE %]
314                             <a href="javascript:confirm_delete_item([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order</a><br>
315                             [% END %]
316                             [% IF ( books_loo.can_del_bib ) %]
317                             <a href="javascript:confirm_delete_biblio([% books_loo.ordernumber %],[% books_loo.biblionumber %])" class="button">Delete order and catalog record</a><br>
318                             [% ELSE %]
319                             <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
320                             [% END %]
321                             [% IF ( books_loo.left_item ) %]
322                             <b title="Can't delete catalog record, because of [% books_loo.items %] existing hold(s)" >[% books_loo.items %] item(s) left</b><br>
323                             [% END %]
324                             [% IF ( books_loo.left_biblio ) %]
325                             <b title="Can't delete catalog record, delete other orders linked to it first">[% books_loo.biblios %] order(s) left</b><br>
326                             [% END %]
327                             [% IF ( books_loo.left_subscription ) %]
328                             <b title="Can't delete catalog record, delete subscriptions first">[% books_loo.subscriptions %] subscription(s) left</b><br>
329                             [% END %]
330                             [% IF ( books_loo.left_holds ) %]
331                             <b title="Can't delete catalog record or order, cancel holds first">[% books_loo.holds %] hold(s) left</b>
332                             [% END %]
333                             </td>
334                             [% END %]
335                         [% END %]
336                     </tr>
337                 [% END %]
338                 </tbody>
339             </table>
340         [% ELSE %]
341             <table>
342                 <tr><td>Basket empty</td></tr>
343             </table>
344         [% END %]
345         [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
346         [% END %]
347         </div>
348         [% IF (cancelledorders_loop) %]
349           <div id="cancelledorders">
350             <h2>Cancelled orders</h2>
351             <table id="cancelledorderst">
352               <thead>
353                 <tr>
354                   <th>Order</th>
355                   <th>RRP</th>
356                   <th>Est.</th>
357                   <th>Qty.</th>
358                   <th>Total</th>
359                   <th>Fund</th>
360                 </tr>
361               </thead>
362               <tbody>
363                 [% FOREACH order IN cancelledorders_loop %]
364                   <tr style="color:grey">
365                     <td>
366                       <p>
367                         [% IF ( order.order_received ) %] (rcvd)[% END %]
368                         [% IF (order.title) %]
369                           [% order.title |html %] by [% order.author %]<br />
370                         [% ELSE %]
371                           <em>Deleted bibliographic record, can't find title</em><br />
372                         [% END %]
373                         [% IF ( order.notes ) %] [% order.notes %][% END %]
374                         [% IF ( order.isbn ) %] - [% order.isbn %][% END %]
375                         [% IF ( order.issn ) %] - [% order.issn %][% END %]
376                         [% IF ( order.publishercode ) %], [% order.publishercode %][% END %]
377                         [% IF ( order.publicationyear ) %], [% order.publicationyear %][% END %]
378                         [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
379                       </p>
380                     </td>
381                     <td><p>[% order.rrp %]</p></td>
382                     <td><p>[% order.ecost %]</p></td>
383                     <td><p>[% order.quantity %]</p></td>
384                     <td><p>[% order.line_total %]</p></td>
385                     <td><p>[% order.budget_name %]</p></td>
386                   </tr>
387                 [% END %]
388               </tbody>
389             </table>
390           </div>
391         [% END %]
392         <br />
393         [% UNLESS ( closedate ) %]
394         [% INCLUDE 'acquisitions-add-to-basket.inc' %]
395         [% END %]
396         [% END %]
397 [% END %]
398 [% END %]    [% ELSE %] <!-- if we want just to select a basketgroup for a closed basket -->
399     [% END %]
400 [% IF ( confirm_close ) %]
401         <div id="closebasket_needsconfirmation" class="dialog alert">
402
403         <form action="/cgi-bin/koha/acqui/basket.pl" class="confirm">
404             <h1>Are you sure you want to close basket [% basketname|html %]?</h1>
405             <p>
406             <label for="createbasketgroup">Attach this basket to a new basket group with the same name</label>
407             <input type="checkbox" id="createbasketgroup" name="createbasketgroup"/>
408             </p>
409             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
410             <input type="hidden" value="close" name="op" />
411             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
412             <input type="hidden" name="confirm" value="1" />
413             <input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
414             <input type="submit" class="approve" value="Yes, Close (Y)" accesskey="y" />
415             <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;" />
416         </form>
417         </div>
418     [% END %]
419 </div>
420 </div>
421 <div class="yui-b">
422 [% INCLUDE 'acquisitions-menu.inc' %]
423 </div>
424 </div>
425 [% INCLUDE 'intranet-bottom.inc' %]