View | Details | Raw Unified | Return to bug 7896
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt (-6 / +29 lines)
Lines 18-27 Link Here
18
[% IF ( do_it ) %]
18
[% IF ( do_it ) %]
19
	[% FOREACH mainloo IN mainloop %]
19
	[% FOREACH mainloo IN mainloop %]
20
		<h1>Acquisitions statistics </h1>
20
		<h1>Acquisitions statistics </h1>
21
            [% IF ( mainloo.loopfilter.size ) %]
21
        [% IF ( mainloo.loopfilter.size ) %]
22
			<p><b>Filtered on:</b></p>
22
            <p><b>Filtered on:</b></p>
23
			[% FOREACH loopfilte IN mainloo.loopfilter %]
23
            [% FOREACH loopfilte IN mainloo.loopfilter %]
24
					<p>[% loopfilte.crit %]: [% loopfilte.filter %]</p>
24
                <p>
25
                    [% SWITCH loopfilte.crit %]
26
                        [% CASE '0' %] Placed on (from)
27
                        [% CASE '1' %] Placed on (to)
28
                        [% CASE '2' %] Received on (from)
29
                        [% CASE '3' %] Received on (to)
30
                        [% CASE '4' %] Supplier
31
                        [% CASE '5' %] Home branch
32
                        [% CASE '6' %] Collection
33
                        [% CASE '7' %] Item type
34
                        [% CASE '8' %] Budget
35
                        [% CASE '9' %] Sort1
36
                        [% CASE '10' %] Sort2
37
                        [% CASE %] Unknown filter
38
                    [% END %]
39
                    : [% loopfilte.filter %]
40
                </p>
25
			[% END %]
41
			[% END %]
26
		[% END %]
42
		[% END %]
27
43
Lines 242-249 Link Here
242
				<td>Vendor</td>
258
				<td>Vendor</td>
243
				<td><input type="radio" checked="checked" name="Line" value="aqbooksellers.name" /></td>
259
				<td><input type="radio" checked="checked" name="Line" value="aqbooksellers.name" /></td>
244
				<td><input type="radio" name="Column" value="aqbooksellers.name" /></td>
260
				<td><input type="radio" name="Column" value="aqbooksellers.name" /></td>
245
				<td>[% CGIBookSeller %]</td>
261
                <td>
246
			</tr>
262
                    <select name="Filter">
263
                        <option value="">All suppliers</option>
264
                        [% FOREACH bookseller IN booksellers %]
265
                            <option value="[% bookseller.name %]">[% bookseller.name %]</option>
266
                        [% END %]
267
                    </select>
268
                </td>
269
            </tr>
247
            <tr>
270
            <tr>
248
                <td>Home branch</td>
271
                <td>Home branch</td>
249
                <td><input type="radio" name="Line" value="items.homebranch" /></td>
272
                <td><input type="radio" name="Line" value="items.homebranch" /></td>
(-)a/reports/acquisitions_stats.pl (-34 / +5 lines)
Lines 117-146 if ($do_it) { Link Here
117
}
117
}
118
else {
118
else {
119
    my $dbh = C4::Context->dbh;
119
    my $dbh = C4::Context->dbh;
120
    my @select;
121
    my %select;
122
    my $req;
120
    my $req;
123
    $req = $dbh->prepare("SELECT distinctrow id,name FROM aqbooksellers ORDER BY name");
121
    $req = $dbh->prepare("SELECT distinctrow id,name FROM aqbooksellers ORDER BY name");
124
    $req->execute;
122
    $req->execute;
125
    push @select, "";
123
    my $booksellers = $req->fetchall_arrayref({});
126
    $select{''} = "All Suppliers";
127
    while ( my ( $value, $desc ) = $req->fetchrow ) {
128
        push @select, $desc;
129
        $select{$value}=$desc;
130
    }
131
    my $CGIBookSellers = CGI::scrolling_list(
132
        -name   => 'Filter',
133
        -id     => 'supplier',
134
        -values => \@select,
135
        -labels   => \%select,
136
        -size     => 1,
137
        -multiple => 0
138
    );
139
124
140
    $req = $dbh->prepare("SELECT DISTINCTROW itemtype,description FROM itemtypes ORDER BY description");
125
    $req = $dbh->prepare("SELECT DISTINCTROW itemtype,description FROM itemtypes ORDER BY description");
141
    $req->execute;
126
    $req->execute;
142
    undef @select;
127
    my @select;
143
    undef %select;
128
    my %select;
144
    push @select, "";
129
    push @select, "";
145
    $select{''} = "All Item Types";
130
    $select{''} = "All Item Types";
146
    while ( my ( $value, $desc ) = $req->fetchrow ) {
131
    while ( my ( $value, $desc ) = $req->fetchrow ) {
Lines 256-262 else { Link Here
256
    }
241
    }
257
242
258
    $template->param(
243
    $template->param(
259
        CGIBookSeller => $CGIBookSellers,
244
        booksellers   => $booksellers,
260
        CGIItemType   => $CGIItemTypes,
245
        CGIItemType   => $CGIItemTypes,
261
        CGIBudget     => $CGIBudget,
246
        CGIBudget     => $CGIBudget,
262
        hassort1      => $hassort1,
247
        hassort1      => $hassort1,
Lines 305-324 sub calculate { Link Here
305
            } else {
290
            } else {
306
                $cell{filter} = format_date(@$filters[$i]);
291
                $cell{filter} = format_date(@$filters[$i]);
307
            }
292
            }
308
            given ($i) {
293
            $cell{crit} = $i;
309
                when (0)  { $cell{crit} = "Placed On From" }
310
                when (1)  { $cell{crit} = "Placed On To" }
311
                when (2)  { $cell{crit} = "Received On From" }
312
                when (3)  { $cell{crit} = "Received On To" }
313
                when (4)  { $cell{crit} = "Bookseller" }
314
                when (5)  { $cell{crit} = "Home branch" }
315
                when (6)  { $cell{crit} = "Collection" }
316
                when (7)  { $cell{crit} = "Doc Type" }
317
                when (8)  { $cell{crit} = "Budget" }
318
                when (9)  { $cell{crit} = "Sort1" }
319
                when (10) { $cell{crit} = "Sort2" }
320
                default   { $cell{crit} = "" }
321
            }
322
            push @loopfilter, \%cell;
294
            push @loopfilter, \%cell;
323
        }
295
        }
324
    }
296
    }
325
- 

Return to bug 7896