[Koha-cvs] CVS: koha/C4 Accounts.pm,1.13,1.14
Paul POULAIN
tipaul at users.sourceforge.net
Mon May 3 11:04:51 CEST 2004
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv386/C4
Modified Files:
Accounts.pm
Log Message:
added param to checkaccount API
Index: Accounts.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Accounts.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** Accounts.pm 15 Dec 2003 16:18:45 -0000 1.13
--- Accounts.pm 3 May 2004 09:04:49 -0000 1.14
***************
*** 65,69 ****
=item checkaccount
! $owed = &checkaccount($env, $borrowernumber, $dbh);
Looks up the total amount of money owed by a borrower (fines, etc.).
--- 65,69 ----
=item checkaccount
! $owed = &checkaccount($env, $borrowernumber, $dbh, $date);
Looks up the total amount of money owed by a borrower (fines, etc.).
***************
*** 80,101 ****
#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;
! while (my $data=$sth->fetchrow_hashref){
! $total += $data->{'sum(amountoutstanding)'};
! }
! $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);
}
--- 80,108 ----
#take borrower number
#check accounts and list amounts owing
! my ($env,$bornumber,$dbh,$date)=@_;
! my $select="SELECT SUM(amountoutstanding) AS total
! FROM accountlines
! WHERE borrowernumber = ?
! AND amountoutstanding<>0";
! my @bind = ($bornumber);
! if ($date ne ''){
! $select.=" AND date < ?";
! push(@bind,$date);
! }
! # print $select;
! my $sth=$dbh->prepare($select);
! $sth->execute(@bind);
! 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);
}
More information about the Koha-cvs
mailing list