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