[Koha-patches] [PATCH] [SIGNED-OFF] Bug 5860: Order cancelling improvement : delete attached items & biblio
Katrin Fischer
Katrin.Fischer.83 at web.de
Sun Mar 13 23:49:56 CET 2011
From: Paul Poulain <paul.poulain at biblibre.com>
- all items attached to the order are deleted
- if there is no more items, then the biblio is deleted as well
Signed-off-by: Katrin Fischer <Katrin.Fischer.83 at web.de>
Works as advertised.
Tested:
- Deleting from order with no remaining items and remaining items
- Cancelling order from shipment with no remaining items and remaining items
The biblio record was only deleted, when no other items were left.
The bibio record remained and only the ordered items were deleted
when there were other items attached to the record.
---
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
More information about the Koha-patches
mailing list