Bug 18662: Fix currency deletion

Sounds like it is caused by bug 13726.
It is not possible to delete a currency, even if not used by any vendors

Test plan:
Try and delete currencies used or not by vendors.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2017-05-23 13:02:30 -03:00 committed by Kyle M Hall
parent 0b7c517bfe
commit f0eda04ddf

View file

@ -95,7 +95,7 @@ if ( $op eq 'add_form' ) {
# TODO rewrite the following when Koha::Acquisition::Orders will use Koha::Objects
my $schema = Koha::Database->schema;
my $nb_of_orders = $schema->resultset('Aqorder')->search( { currency => $currency->currency } )->count;
my $nb_of_vendors = Koha::Acquisition::Booksellers->search( { -or => { listprice => $currency->currency, invoiceprice => $currency->currency } });
my $nb_of_vendors = Koha::Acquisition::Booksellers->search( { -or => { listprice => $currency->currency, invoiceprice => $currency->currency } })->count;
$template->param(
currency => $currency,
nb_of_orders => $nb_of_orders,