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

(-)a/C4/Overdues.pm (+20 lines)
Lines 45-50 BEGIN { Link Here
45
        &AmountNotify
45
        &AmountNotify
46
        &UpdateFine
46
        &UpdateFine
47
        &GetFine
47
        &GetFine
48
        &GetItemCharges
48
        
49
        
49
        &CheckItemNotify
50
        &CheckItemNotify
50
        &GetOverduesForBranch
51
        &GetOverduesForBranch
Lines 658-663 sub GetFine { Link Here
658
    return 0;
659
    return 0;
659
}
660
}
660
661
662
=head2 GetItemCharges
663
664
    $charges = GetItemCharges( $borrowernumber, $itemnumber )
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.
667
    
668
=cut
669
670
sub GetItemCharges {
671
    my ( $borrowernumber, $itemnumber ) = @_;
672
673
    my $dbh = C4::Context->dbh();
674
675
    my $query = "SELECT SUM(amountoutstanding) FROM accountlines WHERE borrowernumber = ? AND itemnumber = ? ";
676
    my $sth = $dbh->prepare( $query );
677
    $sth->execute( $borrowernumber, $itemnumber );
678
    return $sth->fetchrow_arrayref()->[0];
679
}
680
661
=head2 NumberNotifyId
681
=head2 NumberNotifyId
662
682
663
    (@notify) = &NumberNotifyId($borrowernumber);
683
    (@notify) = &NumberNotifyId($borrowernumber);
(-)a/circ/circulation.pl (-2 / +3 lines)
Lines 41-46 use C4::Context; Link Here
41
use CGI::Session;
41
use CGI::Session;
42
use C4::Members::Attributes qw(GetBorrowerAttributes);
42
use C4::Members::Attributes qw(GetBorrowerAttributes);
43
use Koha::Borrower::Debarments qw(GetDebarments);
43
use Koha::Borrower::Debarments qw(GetDebarments);
44
use C4::Overdues qw/GetItemCharges/;
44
use Koha::DateUtils;
45
use Koha::DateUtils;
45
46
46
use Date::Calc qw(
47
use Date::Calc qw(
Lines 478-485 sub build_issue_data { Link Here
478
        # set itemtype per item-level_itype syspref - FIXME this is an ugly hack
479
        # set itemtype per item-level_itype syspref - FIXME this is an ugly hack
479
        $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'};
480
481
481
        ($it->{'charge'}, $it->{'itemtype_charge'}) = GetIssuingCharges(
482
        $it->{'charge'} = GetItemCharges(
482
            $it->{'itemnumber'}, $it->{'borrowernumber'}
483
            $it->{'borrowernumber'}, $it->{'itemnumber'}
483
        );
484
        );
484
        $it->{'charge'} = sprintf("%.2f", $it->{'charge'});
485
        $it->{'charge'} = sprintf("%.2f", $it->{'charge'});
485
        my ($can_renew, $can_renew_error) = CanBookBeRenewed( 
486
        my ($can_renew, $can_renew_error) = CanBookBeRenewed( 
(-)a/members/moremember.pl (-5 / +5 lines)
Lines 52-57 use C4::Form::MessagingPreferences; Link Here
52
use List::MoreUtils qw/uniq/;
52
use List::MoreUtils qw/uniq/;
53
use C4::Members::Attributes qw(GetBorrowerAttributes);
53
use C4::Members::Attributes qw(GetBorrowerAttributes);
54
use Koha::Borrower::Debarments qw(GetDebarments);
54
use Koha::Borrower::Debarments qw(GetDebarments);
55
use C4::Overdues qw(GetItemCharges);
55
#use Smart::Comments;
56
#use Smart::Comments;
56
#use Data::Dumper;
57
#use Data::Dumper;
57
use DateTime;
58
use DateTime;
Lines 502-512 sub build_issue_data { Link Here
502
            }
503
            }
503
        }
504
        }
504
505
505
        #find the charge for an item
506
        #find all charges for an item
506
        my ( $charge, $itemtype ) =
507
        my $charge = GetItemCharges( $borrowernumber, $issue->{itemnumber} );
507
          GetIssuingCharges( $issue->{itemnumber}, $borrowernumber );
508
508
509
        my $itemtypeinfo = getitemtypeinfo($itemtype);
509
        my $getiteminfo  = GetBiblioFromItemNumber( $issue->{'itemnumber'} );
510
        my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $getiteminfo->{'itype'} : $getiteminfo->{'itemtype'} );
510
        $row{'itemtype_description'} = $itemtypeinfo->{description};
511
        $row{'itemtype_description'} = $itemtypeinfo->{description};
511
        $row{'itemtype_image'}       = $itemtypeinfo->{imageurl};
512
        $row{'itemtype_image'}       = $itemtypeinfo->{imageurl};
512
513
513
- 

Return to bug 9481