[Koha-cvs] koha pay_by_amount.pl [dev_week]

Kyle Hall kyle.m.hall at gmail.com
Tue Dec 19 17:10:28 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Kyle Hall <kylemhall>	06/12/19 16:10:28

Modified files:
	.              : pay_by_amount.pl 

Log message:
	

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/pay_by_amount.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.2&r2=1.1.2.3

Patches:
Index: pay_by_amount.pl
===================================================================
RCS file: /sources/koha/koha/Attic/pay_by_amount.pl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -b -r1.1.2.2 -r1.1.2.3
--- pay_by_amount.pl	14 Dec 2006 12:55:09 -0000	1.1.2.2
+++ pay_by_amount.pl	19 Dec 2006 16:10:28 -0000	1.1.2.3
@@ -21,15 +21,6 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# THIS SCRIPT DOES NOT YET WORK
-
-# Algorithm:
-# 1) Get a patrons borrowernumber and the amount to be pay via POST
-# 2) Grab all the patrons unpaid fines from the database
-# 3) Loop through fines, paying each fine off until the given amount has been paid
-# 4) Insert a payment line into the database for the entire amount paid
-# 5) Redirect the user back to moremember.pl
-
 use strict;
 use C4::Context;
 use C4::Auth;
@@ -58,9 +49,9 @@
 $sth = $dbh->prepare( "SELECT * FROM accountlines WHERE borrowernumber = ? AND amountoutstanding > 0" ) || die $sth->errstr;
 $sth->execute( $bornum ) || die $sth->errstr;
 
-while ( my @data = $sth->fetchrow_hashref() && $amountpaid > 0 ) {
-  my $accountno = $data['accountno'];
-  my $amountoutstanding = $data['amountoutstanding'];
+while ( my $data = $sth->fetchrow_hashref() && $amountpaid > 0 ) { #was my @data = ...
+  my $accountno = $data{'accountno'}; #was $data['accoutno']
+  my $amountoutstanding = $data{'amountoutstanding'};
   
   # If the amount paid in is less than the current fine, just lower the amountoutstanding by what is in $amountpaid
   my $balance = 0;





More information about the Koha-cvs mailing list