more reports
This commit is contained in:
parent
75ae5fe5c8
commit
06f7ec1e0a
1 changed files with 10 additions and 0 deletions
10
C4/Stats.pm
10
C4/Stats.pm
|
@ -125,8 +125,18 @@ sub Overdues{
|
|||
}
|
||||
|
||||
sub TotalOwing{
|
||||
my ($type)=@_;
|
||||
my $dbh=C4Connect;
|
||||
my $query="Select sum(amountoutstanding) from accountlines";
|
||||
if ($type eq 'fine'){
|
||||
$query=$query." where accounttype='F'";
|
||||
}
|
||||
my $sth=$dbh->prepare($query);
|
||||
$sth->execute;
|
||||
my $total=$sth->fetchrow_hashref;
|
||||
$sth->finish;
|
||||
$dbh->disconnect;
|
||||
return($total->{'sum'});
|
||||
}
|
||||
|
||||
END { } # module clean-up code here (global destructor)
|
||||
|
|
Loading…
Reference in a new issue