Browse Source

Bug 29283: Don't attempt to cancel cancelled orders

When deleting a basket we cancel all the contained orders - when a
basket contains an order that was previously cancelled this can cause
an error if the biblio was deleted

When picking the orders to cancel, we should limit our search
to those not already cancelled.

To test:
- have a basket with at least one order
- click "Cancel order and delete catalog record", confirm cancellation of order and deletion of bib
- click "Delete basket", confirm deletion
- get error "Cannot insert order: Mandatory parameter biblionumber is missing at /kohadevbox/koha/acqui/basket.pl line 136.
 at /usr/share/perl/5.28/Carp.pm line 289"
- apply patch
- restart
- delete the basket
- success!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.11.x
Nick Clemens 3 years ago
committed by Jonathan Druart
parent
commit
1de960e7e3
  1. 4
      acqui/basket.pl

4
acqui/basket.pl

@ -127,7 +127,9 @@ if ( $op eq 'delete_confirm' ) {
my $delbiblio = $query->param('delbiblio');
my $basket_obj = Koha::Acquisition::Baskets->find($basketno);
my $orders = $basket_obj->orders;
my $orders = $basket_obj->orders->search({
datecancellationprinted => undef
});
my @cannotdelbiblios;

Loading…
Cancel
Save