From bf1812ff42a761cfc8da8fd0216618bca475c338 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Wed, 15 Dec 2010 20:27:24 +0100 Subject: [PATCH] Bug 5860: Order cancelling improvement : delete attached items & biblio - all items attached to the order are deleted - if there is no more items, then the biblio is deleted as well --- C4/Acquisition.pm | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index c1b837b..5c80435 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1219,6 +1219,9 @@ sub DelOrder { my $sth = $dbh->prepare($query); $sth->execute( $bibnum, $ordernumber ); $sth->finish; + my @itemnumbers = GetItemnumbersFromOrder( $ordernumber ); + C4::Items::DelItem( $dbh, $bibnum, $_ ) for @itemnumbers; + DelBiblio(($bibnum)) if C4::Items::GetItemsCount( $bibnum ) == 0; } =head2 FUNCTIONS ABOUT PARCELS -- 1.7.1