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 51-60 Link Here
51
[% IF ( do_it ) %]
51
[% IF ( do_it ) %]
52
	[% FOREACH mainloo IN mainloop %]
52
	[% FOREACH mainloo IN mainloop %]
53
		<h1>Acquisitions statistics </h1>
53
		<h1>Acquisitions statistics </h1>
54
            [% IF ( mainloo.loopfilter.size ) %]
54
        [% IF ( mainloo.loopfilter.size ) %]
55
			<p><b>Filtered on:</b></p>
55
            <p><b>Filtered on:</b></p>
56
			[% FOREACH loopfilte IN mainloo.loopfilter %]
56
            [% FOREACH loopfilte IN mainloo.loopfilter %]
57
					<p>[% loopfilte.crit %]: [% loopfilte.filter %]</p>
57
                <p>
58
                    [% SWITCH loopfilte.crit %]
59
                        [% CASE '0' %] Placed on (from)
60
                        [% CASE '1' %] Placed on (to)
61
                        [% CASE '2' %] Received on (from)
62
                        [% CASE '3' %] Received on (to)
63
                        [% CASE '4' %] Supplier
64
                        [% CASE '5' %] Home branch
65
                        [% CASE '6' %] Collection
66
                        [% CASE '7' %] Item type
67
                        [% CASE '8' %] Budget
68
                        [% CASE '9' %] Sort1
69
                        [% CASE '10' %] Sort2
70
                        [% CASE %] Unknown filter
71
                    [% END %]
72
                    : [% loopfilte.filter %]
73
                </p>
58
			[% END %]
74
			[% END %]
59
		[% END %]
75
		[% END %]
60
76
Lines 155-162 Link Here
155
				<td>Vendor</td>
171
				<td>Vendor</td>
156
				<td><input type="radio" checked="checked" name="Line" value="aqbooksellers.name" /></td>
172
				<td><input type="radio" checked="checked" name="Line" value="aqbooksellers.name" /></td>
157
				<td><input type="radio" name="Column" value="aqbooksellers.name" /></td>
173
				<td><input type="radio" name="Column" value="aqbooksellers.name" /></td>
158
				<td>[% CGIBookSeller %]</td>
174
                <td>
159
			</tr>
175
                    <select name="Filter">
176
                        <option value="">All suppliers</option>
177
                        [% FOREACH bookseller IN booksellers %]
178
                            <option value="[% bookseller.name %]">[% bookseller.name %]</option>
179
                        [% END %]
180
                    </select>
181
                </td>
182
            </tr>
160
            <tr>
183
            <tr>
161
                <td>Home branch</td>
184
                <td>Home branch</td>
162
                <td><input type="radio" name="Line" value="items.homebranch" /></td>
185
                <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