[Koha-devel] Deleting Orders

LAURENT Henri-Damien laurenthdl at alinto.com
Fri Nov 26 12:20:57 CET 2010


Le 26/11/2010 12:06, Colin Campbell a écrit :
> Hi,
>   I'm just looking at the branch of acquisitions fixes from Biblibre one
> fix in there is an addition to DelOrder to delete any items associated
> with the order on its deletion. However it goes further and deletes the
> associated bib record if it has no items. thus:
Hi Collin.
Thanks for your feedback.
This is a discussion we had at the moment we did that.
We had two options :
either
- Delete only the order and leave it to the cataloger to delete those
items. But he would have NO information on WHICH items to delete, unless
there would be a flag on the item....

OR
- Delete the items in order to remove them from catalogue, knowing that
having items linked in orders are items which are created by the order.
So this action was taken. Because looked safer and involved only the
acquisition person. The one that has created the items should be the one
responsible for them until they are received and quite get out of his hands.

Comments welcome.
-- 
Henri-Damien LAURENT
BibLibre

>> diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm
>> index c1b837b..54b01fa 100644
>> --- a/C4/Acquisition.pm
>> +++ b/C4/Acquisition.pm
>> @@ -28,6 +28,7 @@ use C4::Suggestions;
>>  use C4::Biblio;
>>  use C4::Debug;
>>  use C4::SQLHelper qw(InsertInTable);
>> +use C4::Items;
>>  
>>  use Time::localtime;
>>  use HTML::Entities;
>> @@ -1219,6 +1220,10 @@ 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( $dbh, $bibnum ) if C4::Items::GetItemsCount( $bibnum ) == 0;
>>  }
> My gut feeling is that deleting the biblio automatically at this point
> is not a good idea but I thought I'd throw it open for comments.



More information about the Koha-devel mailing list