Fix for a bug in reserves, if a charge was incurred we got a server error, and it...
authorChris Cormack <crc@liblime.com>
Mon, 1 Oct 2007 23:24:07 +0000 (18:24 -0500)
committerChris Cormack <crc@liblime.com>
Mon, 1 Oct 2007 23:25:19 +0000 (18:25 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
C4/Reserves.pm
opac/opac-reserve.pl

index 3d948a2..a2c9d3a 100755 (executable)
@@ -30,6 +30,7 @@ use C4::Context;
 use C4::Biblio;
 use C4::Search;
 use C4::Circulation;
+use C4::Accounts;
 
 our ($VERSION,@ISA,@EXPORT,@EXPORT_OK,%EXPORT_TAGS);
 
index 5e85aa8..4c2794d 100755 (executable)
@@ -28,6 +28,7 @@ use C4::Date;
 use C4::Context;
 use C4::Members;
 use C4::Branch; # GetBranches
+use Data::Dumper;
 
 my $MAXIMUM_NUMBER_OF_RESERVES = C4::Context->preference("maxreserves");
 
@@ -100,8 +101,7 @@ $template->param( CGIbranch => $CGIbranchloop );
 
 #### THIS IS A BIT OF A HACK BECAUSE THE BIBLIOITEMS DATA IS A LITTLE MESSED UP!
 # get the itemtype data....
-my @items = GetItemInfosOf($biblionumber);
-
+my @items = GetItemsInfo($biblionumber);
 #######################################################
 # old version, add so that old templates still work
 my %types_old;
@@ -143,11 +143,11 @@ $template->param( itemcount => $itemcount );
 my %types;
 my %itemtypes;
 my @duedates;
+#die @items;
 foreach my $itm (@items) {
     push @duedates, { date_due => format_date( $itm->{'date_due'} ) }
       if defined $itm->{'date_due'};
     $itm->{ $itm->{'publictype'} } = 1;
-
     my $fee = GetReserveFee( undef, $borrowernumber, $itm->{'biblionumber'},
         'a', ( $itm->{'biblioitemnumber'} ) );
     $fee = sprintf "%.02f", $fee;