[Koha-devel] CVS: koha/C4/Circulation Circ2.pm,1.14,1.15

Chris Cormack rangi at users.sourceforge.net
Tue Apr 3 23:32:39 CEST 2001


Update of /cvsroot/koha/koha/C4/Circulation
In directory usw-pr-cvs1:/tmp/cvs-serv23813/C4/Circulation

Modified Files:
	Circ2.pm 
Log Message:
Making a change to the way charges are handled, the system originally worked such that if a borrower owed more than $5 issues werent allowed. This worked fine except that often borrowers wish to borrows say 3 pay videos at $2 each, then 2 books say. The three pay videos rack up charges of $6 and then they cant issue the books until that is paid.
Reworked so that it cares about previous charges, not the ones accrued during current issue process.


Index: Circ2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** Circ2.pm	2001/03/28 02:23:03	1.14
--- Circ2.pm	2001/04/03 21:32:37	1.15
***************
*** 187,191 ****
  
  sub issuebook {
!     my ($env, $patroninformation, $barcode, $responses) = @_;
      my $dbh=&C4Connect;
      my $iteminformation=getiteminformation($env, 0, $barcode);
--- 187,191 ----
  
  sub issuebook {
!     my ($env, $patroninformation, $barcode, $responses, $date) = @_;
      my $dbh=&C4Connect;
      my $iteminformation=getiteminformation($env, 0, $barcode);
***************
*** 205,209 ****
  	    last SWITCH;
  	}
! 	my $amount = checkaccount($env,$patroninformation->{'borrowernumber'}, $dbh);
  	if ($amount>5) {
  	    $rejected=sprintf "Patron owes \$%.02f.", $amount;
--- 205,209 ----
  	    last SWITCH;
  	}
! 	my $amount = checkaccount($env,$patroninformation->{'borrowernumber'}, $dbh,$date);
  	if ($amount>5) {
  	    $rejected=sprintf "Patron owes \$%.02f.", $amount;
***************
*** 318,321 ****
--- 318,322 ----
  	    $dateduef=$env->{'datedue'};
  	}
+ 	$dateduef=~ s/2001\-4\-25/2001\-4\-26/;
  	my $sth=$dbh->prepare("insert into issues (borrowernumber, itemnumber, date_due, branchcode) values ($patroninformation->{'borrowernumber'}, $iteminformation->{'itemnumber'}, '$dateduef', '$env->{'branchcode'}')");
  	$sth->execute;
***************
*** 643,649 ****
    #take borrower number
    #check accounts and list amounts owing
!   my ($env,$bornumber,$dbh)=@_;
!   my $sth=$dbh->prepare("Select sum(amountoutstanding) from accountlines where
!   borrowernumber=$bornumber and amountoutstanding<>0");
    $sth->execute;
    my $total=0;
--- 644,655 ----
    #take borrower number
    #check accounts and list amounts owing
!   my ($env,$bornumber,$dbh,$date)=@_;
!   my $select="Select sum(amountoutstanding) from accountlines where
!   borrowernumber=$bornumber and amountoutstanding<>0";
!   if ($date ne ''){
!     $select.=" and date < '$date'";
!   }
! #  print $select;
!   my $sth=$dbh->prepare($select);
    $sth->execute;
    my $total=0;





More information about the Koha-devel mailing list