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