Bug 24958: Remember last selected tab in SQL reports
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / orders_by_budget.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Price %]
4 [% USE TablesSettings %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha &rsaquo; Reports &rsaquo; Orders by fund</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 </head>
10 <body id="rep_orders_by_budget" class="rep">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'cat-search.inc' %]
13
14 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>[% IF ( get_orders ) %] &rsaquo; <a href="/cgi-bin/koha/reports/orders_by_fund.pl">Orders by fund</a> &rsaquo; Results[% ELSE %] &rsaquo; Orders by fund[% END %]</div>
15
16 <div class="main container-fluid">
17     <div class="row">
18         <div class="col-sm-10 col-sm-push-2">
19             <main>
20
21
22 [% IF ( current_budget_name ) %]<h1>Orders for fund '[% current_budget_name | html %]'</h1>
23 [% ELSE %]<h1>Orders by fund</h1>
24 [% END %]
25
26 [% IF ( get_orders ) %]
27
28     [% IF ( ordersloop ) %]<table id="funds">
29         <thead>
30         <tr>
31         <th>Fund</th>
32         <th>Basket</th>
33         <th>Basket name</th>
34         <th>Basket by</th>
35         <th>Title</th>
36         <th>Currency</th>
37         <th>List price</th>
38         <th>RRP</th>
39         <th>Budgeted cost</th>
40         <th>Quantity</th>
41         <th>Total RRP</th>
42         <th>Total cost</th>
43         <th>Entry date</th>
44         <th>Date received</th>
45         <th>Internal note</th>
46         <th>Vendor note</th>
47         </tr>
48         </thead>
49         <tbody>
50         [% FOREACH ordersloo IN ordersloop %]
51             [% UNLESS ( loop.odd ) %]<tr class="highlight">
52             [% ELSE %] <tr>
53             [% END %]
54             <td>[% ordersloo.budget_name | html %]</td>
55             <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% ordersloo.basketno | uri %]"> [% ordersloo.basketno | html %]</a></td>
56             <td>[% ordersloo.basketname | html %]</td>
57             <td>[% ordersloo.authorisedbyname | html %]</td>
58             <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ordersloo.biblionumber | uri %]"> [% ordersloo.title | html %]</a></td>
59             <td>[% ordersloo.currency | html %]</td>
60             <td>[% ordersloo.listprice | $Price %]</td>
61             <td>[% ordersloo.rrp | $Price %]</td>
62             <td>[% ordersloo.ecost | $Price %]</td>
63             <td>[% ordersloo.quantity | html %]</td>
64             <td>[% ordersloo.total_rrp | $Price %]</td>
65             <td>[% ordersloo.total_ecost | $Price %]</td>
66             <td>[% ordersloo.entrydate | html %]</td>
67             <td>[% ordersloo.datereceived | html %]</td>
68             <td>[% ordersloo.order_internalnote | html %]</td>
69             <td>[% ordersloo.order_vendornote | html %]</td>
70             </tr>
71         [% END %]
72         </tbody>
73         <tfoot><tr><th>TOTAL</th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th>[% total_quantity | html %]</th><th>[% total_rrp | $Price %]</th><th>[% total_ecost | $Price %]</th><th></th><th></th><th></th><th></th></tr></tfoot>
74         </table>
75     [% END %]
76     [% ELSE %]
77         <form name="f" action="/cgi-bin/koha/reports/orders_by_fund.pl" method="post">
78         <fieldset class="rows">
79         <legend>Filters</legend>
80         <ol><li><label for="budgetfilter">Fund: </label>
81         <select name="budgetfilter" id="budgetfilter">
82             <option value="">All funds</option>
83             <option value="activebudgets">All active funds</option>
84         [% FOREACH budgetsloo IN budgetsloop %]
85             [% IF ( budgetsloo.selected ) %]
86                 <option value="[% budgetsloo.value | html %]" selected="selected">
87             [% ELSE %]
88                 [% bdgclass=budgetsloo.active? "": "b_inactive" | html %]
89                     <option class="[% bdgclass | html %]" value="[% budgetsloo.value | html %]">
90             [% END %]
91             [% budgetsloo.description | html %] [% IF !budgetsloo.active %](inactive)[% END %]
92             </option>
93         [% END %]
94         </select>
95         <label for="showallbudgets" style="float:none;">&nbsp;Show inactive:</label>
96         <input type="checkbox" id="showbudgets" />
97         </li></ol>
98         </fieldset>
99
100         <fieldset class="rows">
101         <legend>Output</legend>
102         <ol><li><label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" /> </li>
103             <li><label for="outputfile">To a file:</label>
104                 <input type="radio" name="output" value="file" id="outputfile" />
105                 <label class="inline" for="basename">Named: </label>
106                 <input type="text" name="basename" id="basename" value="Export" />
107                 <label class="inline" for="MIME">Into an application </label>
108                 <select id='MIME' name='MIME' size='1'>
109                 [% FOREACH outputFormatloo IN outputFormatloop %]
110                     <option value="[% outputFormatloo | html %]">[% outputFormatloo | html %]</option>
111                 [% END %]
112                 </select>
113                 <select id='sep' name='sep' size='1'>
114                 [% FOREACH delimiterloo IN delimiterloop %]
115                     [% IF delimiterloo == delimiterPreference %]
116                         <option value="[% delimiterloo | html %]">[% delimiterloo | html %]</option>
117                     [% END %]
118                 [% END %]
119                 [% FOREACH delimiterloo IN delimiterloop %]
120                     [% IF delimiterloo != delimiterPreference %]
121                         <option value="[% delimiterloo | html %]">[% delimiterloo | html %]</option>
122                     [% END %]
123                 [% END %]
124                 </select>
125         </li></ol>
126         </fieldset>
127
128         <fieldset class="action">
129         <input type="submit" value="Submit" />
130         <input type="hidden" name="get_orders" value="1" /></fieldset>
131         </form>
132
133     [% END %]
134
135             </main>
136         </div> <!-- /.col-sm-10.col-sm-push-2 -->
137
138         <div class="col-sm-2 col-sm-pull-10">
139             <aside>
140                 [% INCLUDE 'reports-menu.inc' %]
141             </aside>
142         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
143      </div> <!-- /.row -->
144
145 [% MACRO jsinclude BLOCK %]
146     [% INCLUDE 'datatables.inc' %]
147     [% INCLUDE 'columns_settings.inc' %]
148     <script>
149         var columns_settings = [% TablesSettings.GetColumns( 'reports', 'orders_by_fund', 'funds-table', 'json' ) | $raw %];
150         [% SET table_settings = TablesSettings.GetTableSettings( 'reports', 'orders_by_fund', 'funds-table' ) %];
151         $(document).ready( function () {
152             var funds_table = KohaTable("funds", {
153                 "pageLength": [% table_settings.default_display_length | html %],
154                 "order": [[ [% table_settings.default_sort_order | html %], 'asc']],
155                 'autoWidth': false,
156             }, columns_settings );
157
158             showallbudgets = $('#budgetfilter').html();
159             $('#budgetfilter .b_inactive').remove();
160
161             $('#showbudgets').click(function(){
162                 if ($(this).is(":checked")) {
163                     $('#budgetfilter').html(showallbudgets);
164                 } else {
165                     $('#budgetfilter .b_inactive').remove();
166                 }
167             });
168         } );
169     </script>
170
171 [% END %]
172
173 [% INCLUDE 'intranet-bottom.inc' %]