[Koha-cvs] CVS: koha/C4/Circulation Circ2.pm,1.53,1.54 Renewals2.pm,1.9,1.10

Paul POULAIN tipaul at users.sourceforge.net
Mon May 5 11:41:06 CEST 2003


Update of /cvsroot/koha/koha/C4/Circulation
In directory sc8-pr-cvs1:/tmp/cvs-serv5835/C4/Circulation

Modified Files:
	Circ2.pm Renewals2.pm 
Log Message:
fix for 191, code reindenting & some query improvment

Index: Circ2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -r1.53 -r1.54
*** Circ2.pm	29 Apr 2003 16:51:16 -0000	1.53
--- Circ2.pm	5 May 2003 09:41:03 -0000	1.54
***************
*** 32,45 ****
  use DBI;
  use C4::Context;
- #use C4::Accounts;
- #use C4::InterfaceCDK;
- #use C4::Circulation::Main;
- #use C4::Circulation::Renewals;
- #use C4::Scan;
  use C4::Stats;
  use C4::Reserves2;
  use C4::Koha;
[...1540 lines suppressed...]
! 	if ($date ne ''){
! 	$select.=" AND date < '$date'";
! 	}
! 	#  print $select;
! 	my $sth=$dbh->prepare($select);
! 	$sth->execute;
! 	my $data=$sth->fetchrow_hashref;
! 	my $total = $data->{'total'};
! 	$sth->finish;
! 	# output(1,2,"borrower owes $total");
! 	#if ($total > 0){
! 	#  # output(1,2,"borrower owes $total");
! 	#  if ($total > 5){
! 	#    reconcileaccount($env,$dbh,$bornumber,$total);
! 	#  }
! 	#}
! 	#  pause();
! 	return($total);
  }
  

Index: Renewals2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Circulation/Renewals2.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** Renewals2.pm	30 Apr 2003 22:55:54 -0000	1.9
--- Renewals2.pm	5 May 2003 09:41:03 -0000	1.10
***************
*** 222,232 ****
      my $accountno=getnextacctno($env,$bornum,$dbh);
      my $item=getiteminformation($env, $itemno);
!     my $account="Insert into accountlines
!     (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber)
!     values
!     (?,?,now(),?,?,?,?,?)";
!     $sth=$dbh->prepare($account);
!     $sth->execute($bornum,$accountno,$charge,"Renewal of Rental Item $item->{'title'} $item->{'barcode'}",
!     'Rent',$charge,$itemno)";
      $sth->finish;
  #     print $account;
--- 222,228 ----
      my $accountno=getnextacctno($env,$bornum,$dbh);
      my $item=getiteminformation($env, $itemno);
!     $sth=$dbh->prepare("Insert into accountlines (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber)
! 						values (?,?,now(),?,?,?,?,?)");
!     $sth->execute($bornum,$accountno,$charge,"Renewal of Rental Item $item->{'title'} $item->{'barcode'}",'Rent',$charge,$itemno);
      $sth->finish;
  #     print $account;
***************
*** 267,277 ****
  
    # Get the book's item type and rental charge (via its biblioitem).
!   my $q1 = "select itemtypes.itemtype,rentalcharge from
!   items,biblioitems,itemtypes
!   where (items.itemnumber ='$itemno')
!   and (biblioitems.biblioitemnumber = items.biblioitemnumber)
!   and (biblioitems.itemtype = itemtypes.itemtype)";
!   my $sth1= $dbh->prepare($q1);
!   $sth1->execute;
    # FIXME - Why not just use fetchrow_array?
    if (my $data1=$sth1->fetchrow_hashref) {
--- 263,271 ----
  
    # Get the book's item type and rental charge (via its biblioitem).
!   my $sth1= $dbh->prepare("select itemtypes.itemtype,rentalcharge from items,biblioitems,itemtypes
!   						 where (items.itemnumber =?)
! 						 		and (biblioitems.biblioitemnumber = items.biblioitemnumber)
! 								and (biblioitems.itemtype = itemtypes.itemtype)");
!   $sth1->execute($itemno);
    # FIXME - Why not just use fetchrow_array?
    if (my $data1=$sth1->fetchrow_hashref) {





More information about the Koha-cvs mailing list