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

(-)a/C4/Utils/DataTables/Members.pm (-1 / +1 lines)
Lines 171-177 sub search { Link Here
171
        my $patron_object = Koha::Patrons->find( $patron->{borrowernumber} );
171
        my $patron_object = Koha::Patrons->find( $patron->{borrowernumber} );
172
        $patron->{overdues} = $patron_object->get_overdues->count;
172
        $patron->{overdues} = $patron_object->get_overdues->count;
173
        $patron->{issues} = $patron_object->get_issues->count;
173
        $patron->{issues} = $patron_object->get_issues->count;
174
        my $balance = $patron_object->get_account_lines->get_balance;
174
        my $balance = $patron_object->account->balance;
175
        # FIXME Should be formatted from the template
175
        # FIXME Should be formatted from the template
176
        $patron->{fines} = sprintf("%.2f", $balance);
176
        $patron->{fines} = sprintf("%.2f", $balance);
177
177
(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 268-274 if ($borrowernumber) { Link Here
268
    $borrower = GetMember( borrowernumber => $borrowernumber );
268
    $borrower = GetMember( borrowernumber => $borrowernumber );
269
    my $overdues = $patron->get_overdues;
269
    my $overdues = $patron->get_overdues;
270
    my $issues = $patron->get_issues;
270
    my $issues = $patron->get_issues;
271
    my $balance = $patron->get_account_lines->get_balance;
271
    my $balance = $patron->account->balance;
272
272
273
273
274
    # if the expiry date is before today ie they have expired
274
    # if the expiry date is before today ie they have expired
(-)a/circ/returns.pl (-2 / +1 lines)
Lines 324-331 if ($barcode) { Link Here
324
324
325
        if ( C4::Context->preference("FineNotifyAtCheckin") ) {
325
        if ( C4::Context->preference("FineNotifyAtCheckin") ) {
326
            my $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
326
            my $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
327
            my $account_lines = $patron->get_account_lines;
327
            my $balance = $patron->account->balance;
328
            my $balance = $patron->get_account_lines->get_balance;
329
328
330
            if ($balance > 0) {
329
            if ($balance > 0) {
331
                $template->param( fines => sprintf("%.2f", $balance) );
330
                $template->param( fines => sprintf("%.2f", $balance) );
(-)a/members/moremember.pl (-1 / +1 lines)
Lines 121-127 $template->param( error => $error ) if ( $error ); Link Here
121
121
122
my $patron        = Koha::Patrons->find($borrowernumber);
122
my $patron        = Koha::Patrons->find($borrowernumber);
123
my $issues        = $patron->get_issues;
123
my $issues        = $patron->get_issues;
124
my $balance       = $patron->get_account_lines->get_balance;
124
my $balance       = $patron->account->balance;
125
$template->param(
125
$template->param(
126
    issuecount => $issues->count,
126
    issuecount => $issues->count,
127
    fines      => $balance,
127
    fines      => $balance,
(-)a/t/db_dependent/Reserves.t (-4 / +4 lines)
Lines 573-579 ok( !C4::Reserves::OnShelfHoldsAllowed($item, $borrower), "OnShelfHoldsAllowed() Link Here
573
573
574
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum));
574
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum));
575
my $patron = Koha::Patrons->find( $borrowernumber );
575
my $patron = Koha::Patrons->find( $borrowernumber );
576
my $bz14464_fines = $patron->get_account_lines->get_balance;
576
my $bz14464_fines = $patron->account->balance;
577
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines at beginning' );
577
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines at beginning' );
578
578
579
# First, test cancelling a reserve when there's no charge configured.
579
# First, test cancelling a reserve when there's no charge configured.
Lines 600-606 CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 }); Link Here
600
my $old_reserve = Koha::Database->new()->schema()->resultset('OldReserve')->find( $bz14464_reserve );
600
my $old_reserve = Koha::Database->new()->schema()->resultset('OldReserve')->find( $bz14464_reserve );
601
is($old_reserve->get_column('found'), 'W', 'Bug 14968 - Keep found column from reserve');
601
is($old_reserve->get_column('found'), 'W', 'Bug 14968 - Keep found column from reserve');
602
602
603
$bz14464_fines = $patron->get_account_lines->get_balance;
603
$bz14464_fines = $patron->account->balance;
604
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge configured' );
604
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge configured' );
605
605
606
# Then, test cancelling a reserve when there's no charge desired.
606
# Then, test cancelling a reserve when there's no charge desired.
Lines 624-630 ok( $bz14464_reserve, 'Bug 14464 - 2nd reserve correctly created' ); Link Here
624
624
625
CancelReserve({ reserve_id => $bz14464_reserve });
625
CancelReserve({ reserve_id => $bz14464_reserve });
626
626
627
$bz14464_fines = $patron->get_account_lines->get_balance;
627
$bz14464_fines = $patron->account->balance;
628
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge desired' );
628
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge desired' );
629
629
630
# Finally, test cancelling a reserve when there's a charge desired and configured.
630
# Finally, test cancelling a reserve when there's a charge desired and configured.
Lines 646-652 ok( $bz14464_reserve, 'Bug 14464 - 1st reserve correctly created' ); Link Here
646
646
647
CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 });
647
CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 });
648
648
649
$bz14464_fines = $patron->get_account_lines->get_balance;
649
$bz14464_fines = $patron->account->balance;
650
is( int( $bz14464_fines ), 42, 'Bug 14464 - Fine applied after cancelling reserve with charge desired and configured' );
650
is( int( $bz14464_fines ), 42, 'Bug 14464 - Fine applied after cancelling reserve with charge desired and configured' );
651
651
652
# tests for MoveReserve in relation to ConfirmFutureHolds (BZ 14526)
652
# tests for MoveReserve in relation to ConfirmFutureHolds (BZ 14526)
(-)a/tools/cleanborrowers.pl (-2 / +1 lines)
Lines 200-206 sub _skip_borrowers_with_nonzero_balance { Link Here
200
    my $balance;
200
    my $balance;
201
    @$borrowers = map {
201
    @$borrowers = map {
202
        my $patron = Koha::Patrons->find( $_->{borrowernumber} );
202
        my $patron = Koha::Patrons->find( $_->{borrowernumber} );
203
        my $balance = $patron->get_account_lines->get_balance;
203
        my $balance = $patron->account->balance;
204
        (defined $balance && $balance != 0) ? (): ($_);
204
        (defined $balance && $balance != 0) ? (): ($_);
205
    } @$borrowers;
205
    } @$borrowers;
206
}
206
}
207
- 

Return to bug 17588