diff --git a/admin/currency.pl b/admin/currency.pl index f62f761994..d0c4be32c0 100755 --- a/admin/currency.pl +++ b/admin/currency.pl @@ -132,21 +132,23 @@ sub delete_confirm { my $curr = shift; $template->param( delete_confirm => 1 ); - my $total_row = $dbh->selectrow_hashref( - 'select count(*) as total from aqbooksellers where currency=?', - {}, $curr ); + my ($nb_of_vendors) = $dbh->selectrow_array(q{ + select count(*) from aqbooksellers + where listprice = ? or invoiceprice = ? + }, {}, $curr, $curr); + my ($nb_of_orders) = $dbh->selectrow_array(q{ + select count(*) from aqorders + where currency = ? + }, {}, $curr); my $curr_ref = $dbh->selectrow_hashref( 'select currency,rate from currency where currency=?', {}, $curr ); - if ( $total_row->{total} ) { - $template->param( totalgtzero => 1 ); - } - $template->param( rate => $curr_ref->{rate}, - total => $total_row->{total} + nb_of_orders => $nb_of_orders, + nb_of_vendors => $nb_of_vendors, ); return; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt index 57c38cfde9..45ba3fd59e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt @@ -125,10 +125,17 @@ [% END %] [% IF ( delete_confirm ) %] - [% IF ( totalgtzero ) %] + [% IF ( nb_of_orders or nb_of_vendors ) %]