# then turn it into one
my %hash = ();
if ( ! ref($detail) ) {
- $hash{'detail'} = 'detail';
+ $hash{'detail'} = $detail;
}
elsif ( ref($detail) eq 'HASH' ) {
%hash = %$detail;
if ( $self->get('details') ) {
- return sum(
+ return sum( 0,
map { $_->amount || 0 }
grep { !defined($classnum) or $classnum eq $_->classnum }
@{ $self->get('details') }
my $sth = dbh->prepare($sql) or die dbh->errstr;
$sth->execute or die $sth->errstr;
- return $sth->fetchrow_arrayref->[0];
+ return $sth->fetchrow_arrayref->[0] || 0;
}