my @select;
my %select;
push @select, "";
- $select{''} = "All Item Types";
+ $select{''} = "All item types";
while ( my ( $value, $desc ) = $req->fetchrow ) {
push @select, $value;
$select{$value} = $desc;
undef @select;
undef %select;
push @select, "";
- $select{''} = "All budgets";
+ $select{''} = "All funds";
while ( my ( $value, $desc ) = $req->fetchrow ) {
push @select, $value;
foreach ($line, $column) {
$filter{$_} = [];
$field{$_} = $_;
- given ($_) {
- when (/closedate/) {
- $filter{$_}->[0] = @$filters[0];
- $filter{$_}->[1] = @$filters[1];
- my $a = $_;
- given ($podsp) {
- when (1) { $field{$a} = "concat(hex(weekday($a)+1),'-',dayname($a))" }
- when (2) { $field{$a} = "concat(hex(month($a)),'-',monthname($a))" }
- when (3) { $field{$a} = "Year($a)" }
- default { $field{$a} = $a }
- }
- }
- when (/received/) {
- $filter{$_}->[0] = @$filters[2];
- $filter{$_}->[1] = @$filters[3];
- my $a = $_;
- given ($rodsp) {
- when (1) { $field{$a} = "concat(hex(weekday($a)+1),'-',dayname($a))" }
- when (2) { $field{$a} = "concat(hex(month($a)),'-',monthname($a))" }
- when (3) { $field{$a} = "Year($a)" }
- default { $field{$a} = $a }
- }
- }
- when (/bookseller/) {
- $filter{$_}->[0] = @$filters[4];
- }
- when (/homebranch/) {
- $filter{$_}->[0] = @$filters[5];
- }
- when (/ccode/) {
- $filter{$_}->[0] = @$filters[6];
- }
- when (/itemtype/) {
- $filter{$_}->[0] = @$filters[7];
- }
- when (/budget/) {
- $filter{$_}->[0] = @$filters[8];
- }
- when (/sort1/) {
- $filter{$_}->[0] = @$filters[9];
+ if ( $_ =~ /closedate/ ) {
+ $filter{$_}->[0] = @$filters[0];
+ $filter{$_}->[1] = @$filters[1];
+ my $a = $_;
+ if ( $podsp == 1 ) {
+ $field{$a} = "concat(hex(weekday($a)+1),'-',dayname($a))";
+ } elsif ( $podsp == 2 ) {
+ $field{$a} = "concat(hex(month($a)),'-',monthname($a))";
+ } elsif ( $podsp == 3 ) {
+ $field{$a} = "Year($a)";
+ } else {
+ $field{$a} = $a;
}
- when (/sort2/) {
- $filter{$_}->[0] = @$filters[10];
+ }
+ elsif ( $_ =~ /received/ ) {
+ $filter{$_}->[0] = @$filters[2];
+ $filter{$_}->[1] = @$filters[3];
+ my $a = $_;
+ if ( $rodsp == 1 ) {
+ $field{$a} = "concat(hex(weekday($a)+1),'-',dayname($a))";
+ } elsif ( $rodsp == 2 ) {
+ $field{$a} = "concat(hex(month($a)),'-',monthname($a))";
+ } elsif ( $rodsp == 3 ) {
+ $field{$a} = "Year($a)";
+ } else {
+ field{$a} = $a;
}
}
+ elsif ( $_ =~ /bookseller/ ) {
+ $filter{$_}->[0] = @$filters[4];
+ }
+ elsif ( $_ =~ /homebranch/ ) {
+ $filter{$_}->[0] = @$filters[5];
+ }
+ elsif ( $_ =~ /ccode/ ) {
+ $filter{$_}->[0] = @$filters[6];
+ }
+ elsif ( $_ =~ /itemtype/ ) {
+ $filter{$_}->[0] = @$filters[7];
+ }
+ elsif ( $_ =~ /budget/ ) {
+ $filter{$_}->[0] = @$filters[8];
+ }
+ elsif ( $_ =~ /sort1/ ) {
+ $filter{$_}->[0] = @$filters[9];
+ }
+ elsif ( $_ =~ /sort2/ ) {
+ $filter{$_}->[0] = @$filters[10];
+ }
}
my @linefilter = @{ $filter{$line} };
# preparing calculation
my $strcalc;
$strcalc .= "SELECT $linefield, $colfield, ";
- given ($process) {
- when (1) { $strcalc .= "COUNT(*) " }
- when (2) { $strcalc .= "COUNT(DISTINCT(aqorders.biblionumber)) " }
- when ([3,4,5]) { $strcalc .= "SUM(aqorders.listprice) " }
- default { $strcalc .= "NULL " }
+ if ( $process == 1 ) {
+ $strcalc .= "COUNT(*) ";
+ } elsif ( $process == 2 ) {
+ $strcalc .= "COUNT(DISTINCT(aqorders.biblionumber)) ";
+ } elsif ( $process == 3 || $process == 4 || $process == 5 ) {
+ $strcalc .= "SUM(aqorders.listprice) ";
+ } else {
+ $strcalc .= "NULL ";
}
$strcalc .= "
FROM aqorders