Lines 773-778
elsif ($phase eq 'Run this report'){
Link Here
|
773 |
%authorised_lib = map { $_->categorycode => $_->description } @patron_categories; |
773 |
%authorised_lib = map { $_->categorycode => $_->description } @patron_categories; |
774 |
push @authorised_values, $_->categorycode for @patron_categories; |
774 |
push @authorised_values, $_->categorycode for @patron_categories; |
775 |
} |
775 |
} |
|
|
776 |
elsif ( $authorised_value eq "cash_registers" ) { |
777 |
my $sth = $dbh->prepare("SELECT id, name FROM cash_registers ORDER BY description"); |
778 |
$sth->execute; |
779 |
while ( my ( $id, $name ) = $sth->fetchrow_array ) { |
780 |
push @authorised_values, $id; |
781 |
$authorised_lib{$id} = $name; |
782 |
} |
783 |
} |
784 |
elsif ( $authorised_value eq "debit_types" ) { |
785 |
my $sth = $dbh->prepare("SELECT code, description FROM account_debit_types ORDER BY code"); |
786 |
$sth->execute; |
787 |
while ( my ( $code, $description ) = $sth->fetchrow_array ) { |
788 |
push @authorised_values, $code; |
789 |
$authorised_lib{$code} = $description; |
790 |
} |
791 |
} |
792 |
elsif ( $authorised_value eq "credit_types" ) { |
793 |
my $sth = $dbh->prepare("SELECT code, description FROM account_credit_types ORDER BY code"); |
794 |
$sth->execute; |
795 |
while ( my ( $code, $description ) = $sth->fetchrow_array ) { |
796 |
push @authorised_values, $code; |
797 |
$authorised_lib{$code} = $description; |
798 |
} |
799 |
} |
776 |
else { |
800 |
else { |
777 |
if ( Koha::AuthorisedValues->search({ category => $authorised_value })->count ) { |
801 |
if ( Koha::AuthorisedValues->search({ category => $authorised_value })->count ) { |
778 |
my $query = ' |
802 |
my $query = ' |
Lines 812-817
elsif ($phase eq 'Run this report'){
Link Here
|
812 |
|
836 |
|
813 |
push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid, 'name' => $text.$sep.$authorised_value_all, 'include_all' => $all }; |
837 |
push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid, 'name' => $text.$sep.$authorised_value_all, 'include_all' => $all }; |
814 |
} |
838 |
} |
|
|
839 |
|
815 |
$template->param('sql' => $sql, |
840 |
$template->param('sql' => $sql, |
816 |
'name' => $name, |
841 |
'name' => $name, |
817 |
'sql_params' => \@tmpl_parameters, |
842 |
'sql_params' => \@tmpl_parameters, |
Lines 875-881
elsif ($phase eq 'Run this report'){
Link Here
|
875 |
push @errors, { no_sql_for_id => $report_id }; |
900 |
push @errors, { no_sql_for_id => $report_id }; |
876 |
} |
901 |
} |
877 |
} |
902 |
} |
878 |
|
|
|
879 |
elsif ($phase eq 'Export'){ |
903 |
elsif ($phase eq 'Export'){ |
880 |
|
904 |
|
881 |
# export results to tab separated text or CSV |
905 |
# export results to tab separated text or CSV |