[Koha-bugs] [Bug 9481] charge not showing fines

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Apr 16 11:58:26 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9481

--- Comment #10 from Jonathan Druart <jonathan.druart at biblibre.com> ---
Comment on attachment 26457
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26457
Bug 9481 - charge not showing fines On 'Check out' and 'Details' screens in
patron record fines for item aren't showing. Added new soubroutine to sum up
all outstanding charges by borrower for this item including all historical
issues and rent charges. Pr

Review of attachment 26457:
 --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=9481&attachment=26457)
-----------------------------------------------------------------

::: C4/Overdues.pm
@@ +659,5 @@
>      return 0;
>  }
>  
> +=head2 GetItemCharges
> +

Why don't you put this subroutine into C4::Account?

@@ +668,5 @@
> +=cut
> +
> +sub GetItemCharges {
> +    my ( $borrowernumber, $itemnumber ) = @_;
> +

I would prefer you pass an hashref to this new subroutine.

@@ +674,5 @@
> +
> +    my $query = "SELECT SUM(amountoutstanding) FROM accountlines WHERE borrowernumber = ? AND itemnumber = ? ";
> +    my $sth = $dbh->prepare( $query );
> +    $sth->execute( $borrowernumber, $itemnumber );
> +    return $sth->fetchrow_arrayref()->[0];

Could be done using $dbh->selectcol_arrayref

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list