[Koha-cvs] koha/C4/Circulation Fines.pm [rel_3_0]

Bruno Toumi btoumi at ouestprovence.fr
Thu Oct 12 12:27:55 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Bruno Toumi <btoumi>	06/10/12 10:27:55

Modified files:
	C4/Circulation : Fines.pm 

Log message:
	add two function : amountnotify(sum amount per notifyid) and numbernotifyid(retunr number of file number per borrowers

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Circulation/Fines.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.14.2.1&r2=1.14.2.2

Patches:
Index: Fines.pm
===================================================================
RCS file: /sources/koha/koha/C4/Circulation/Fines.pm,v
retrieving revision 1.14.2.1
retrieving revision 1.14.2.2
diff -u -b -r1.14.2.1 -r1.14.2.2
--- Fines.pm	9 Oct 2006 12:33:07 -0000	1.14.2.1
+++ Fines.pm	12 Oct 2006 10:27:55 -0000	1.14.2.2
@@ -1,6 +1,6 @@
 package C4::Circulation::Fines;
 
-# $Id: Fines.pm,v 1.14.2.1 2006/10/09 12:33:07 btoumi Exp $
+# $Id: Fines.pm,v 1.14.2.2 2006/10/12 10:27:55 btoumi Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -65,6 +65,8 @@
 		&GetItems  
 		&GetNotifyId
 		&GetNextIdNotify
+		&NumberNotifyId 
+		&AmountNotify
 		&UpdateAccountLines 
 		&UpdateFine
 		&CreateItemAccountLine 
@@ -635,8 +637,59 @@
 }
 
 
+=item AmountNotify
 
+(@notify) = &AmountNotify($bornum);
 
+Returns amount for all file per borrowers
+C<@notify> array contains all file per borrowers
+
+C<$notify_id> contains the file number for the borrower number nad item number
+
+=cut
+sub NumberNotifyId{
+	my ($bornum)=@_;
+	my $dbh = C4::Context->dbh;
+	my $env;
+	my $query=qq|	SELECT distinct(notify_id)  
+			FROM accountlines 
+			WHERE borrowernumber=?|;
+	my @notify;
+	my $sth=$dbh->prepare($query);
+        $sth->execute($bornum);
+      	while ( my $numberofotify=$sth->fetchrow_array){
+	push (@notify,$numberofotify);
+	}
+	$sth->finish;
+		
+	return (@notify);
+
+}
+
+=item AmountNotify
+
+($totalnotify) = &AmountNotify($notifyid);
+
+Returns amount for all file per borrowers
+C<$notifyid> is the file number
+
+C<$totalnotify> contains amount of a file
+
+C<$notify_id> contains the file number for the borrower number nad item number
+
+=cut
+sub AmountNotify{
+	my ($notifyid)=@_;
+	my $dbh = C4::Context->dbh;
+	my $query=qq|	SELECT sum(amountoutstanding) 
+			FROM accountlines 
+			WHERE notify_id=?|;
+	my $sth=$dbh->prepare($query);
+        $sth->execute($notifyid);
+      	my $totalnotify=$sth->fetchrow;
+	$sth->finish;
+	return ($totalnotify);
+}
 
 
 =item GetNotifyId





More information about the Koha-cvs mailing list