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:
> 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.
Cheers
Colin

-- 
Colin Campbell
Chief Software Engineer,
PTFS Europe Limited
Content Management and Library Solutions
+44 (0) 208 366 1295 (phone)
+44 (0) 7759 633626  (mobile)
[email protected]
skype: colin_campbell2

http://www.ptfs-europe.com
_______________________________________________
Koha-devel mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to