View | Details | Raw Unified | Return to bug 9481
Collapse All | Expand All

(-)a/C4/Overdues.pm (-5 / +4 lines)
Lines 661-681 sub GetFine { Link Here
661
661
662
=head2 GetItemCharges
662
=head2 GetItemCharges
663
663
664
    $charges = GetItemCharges( $borrowernumber, $itemnumber )
664
    $charges = GetItemCharges( $itemnumber , $borrowernumber)
665
    Gets fines and issue charge for item from accountlines. Icluding all outstanding amount for specific item,
665
    Gets fines and issue charge for item from accountlines. Icluding all outstanding amount for specific item,
666
    also from previous issue of this item.
666
    also from previous issue of this item.
667
    
667
668
=cut
668
=cut
669
669
670
sub GetItemCharges {
670
sub GetItemCharges {
671
    my ( $borrowernumber, $itemnumber ) = @_;
671
    my ( $itemnumber, $borrowernumber ) = @_;
672
673
    my $dbh = C4::Context->dbh();
672
    my $dbh = C4::Context->dbh();
674
673
675
    my $query = "SELECT SUM(amountoutstanding) FROM accountlines WHERE borrowernumber = ? AND itemnumber = ? ";
674
    my $query = "SELECT SUM(amountoutstanding) FROM accountlines WHERE borrowernumber = ? AND itemnumber = ? ";
676
    my $sth = $dbh->prepare( $query );
675
    my $sth = $dbh->prepare( $query );
677
    $sth->execute( $borrowernumber, $itemnumber );
676
    $sth->execute( $borrowernumber, $itemnumber );
678
    return $sth->fetchrow_arrayref()->[0];
677
    return $sth->fetchrow_arrayref()->[0] || 0;
679
}
678
}
680
679
681
=head2 NumberNotifyId
680
=head2 NumberNotifyId
(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 480-486 sub build_issue_data { Link Here
480
        $it->{'itemtype'} = ( C4::Context->preference( 'item-level_itypes' ) ) ? $it->{'itype'} : $it->{'itemtype'};
480
        $it->{'itemtype'} = ( C4::Context->preference( 'item-level_itypes' ) ) ? $it->{'itype'} : $it->{'itemtype'};
481
481
482
        $it->{'charge'} = GetItemCharges(
482
        $it->{'charge'} = GetItemCharges(
483
            $it->{'borrowernumber'}, $it->{'itemnumber'}
483
            $it->{'itemnumber'}, $it->{'borrowernumber'}
484
        );
484
        );
485
        $it->{'charge'} = sprintf("%.2f", $it->{'charge'});
485
        $it->{'charge'} = sprintf("%.2f", $it->{'charge'});
486
        my ($can_renew, $can_renew_error) = CanBookBeRenewed( 
486
        my ($can_renew, $can_renew_error) = CanBookBeRenewed( 
(-)a/members/moremember.pl (-2 / +1 lines)
Lines 504-510 sub build_issue_data { Link Here
504
        }
504
        }
505
505
506
        #find all charges for an item
506
        #find all charges for an item
507
        my $charge = GetItemCharges( $borrowernumber, $issue->{itemnumber} );
507
        my $charge = GetItemCharges( $issue->{itemnumber}, $borrowernumber );
508
508
509
        my $getiteminfo  = GetBiblioFromItemNumber( $issue->{'itemnumber'} );
509
        my $getiteminfo  = GetBiblioFromItemNumber( $issue->{'itemnumber'} );
510
        my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $getiteminfo->{'itype'} : $getiteminfo->{'itemtype'} );
510
        my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $getiteminfo->{'itype'} : $getiteminfo->{'itemtype'} );
511
- 

Return to bug 9481