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 572-578 ok( !C4::Reserves::OnShelfHoldsAllowed($item, $borrower), "OnShelfHoldsAllowed() Link Here
572
572
573
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum));
573
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum));
574
my $patron = Koha::Patrons->find( $borrowernumber );
574
my $patron = Koha::Patrons->find( $borrowernumber );
575
my $bz14464_fines = $patron->get_account_lines->get_balance;
575
my $bz14464_fines = $patron->account->balance;
576
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines at beginning' );
576
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines at beginning' );
577
577
578
# First, test cancelling a reserve when there's no charge configured.
578
# First, test cancelling a reserve when there's no charge configured.
Lines 599-605 CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 }); Link Here
599
my $old_reserve = Koha::Database->new()->schema()->resultset('OldReserve')->find( $bz14464_reserve );
599
my $old_reserve = Koha::Database->new()->schema()->resultset('OldReserve')->find( $bz14464_reserve );
600
is($old_reserve->get_column('found'), 'W', 'Bug 14968 - Keep found column from reserve');
600
is($old_reserve->get_column('found'), 'W', 'Bug 14968 - Keep found column from reserve');
601
601
602
$bz14464_fines = $patron->get_account_lines->get_balance;
602
$bz14464_fines = $patron->account->balance;
603
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge configured' );
603
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge configured' );
604
604
605
# Then, test cancelling a reserve when there's no charge desired.
605
# Then, test cancelling a reserve when there's no charge desired.
Lines 623-629 ok( $bz14464_reserve, 'Bug 14464 - 2nd reserve correctly created' ); Link Here
623
623
624
CancelReserve({ reserve_id => $bz14464_reserve });
624
CancelReserve({ reserve_id => $bz14464_reserve });
625
625
626
$bz14464_fines = $patron->get_account_lines->get_balance;
626
$bz14464_fines = $patron->account->balance;
627
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge desired' );
627
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge desired' );
628
628
629
# Finally, test cancelling a reserve when there's a charge desired and configured.
629
# Finally, test cancelling a reserve when there's a charge desired and configured.
Lines 645-651 ok( $bz14464_reserve, 'Bug 14464 - 1st reserve correctly created' ); Link Here
645
645
646
CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 });
646
CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 });
647
647
648
$bz14464_fines = $patron->get_account_lines->get_balance;
648
$bz14464_fines = $patron->account->balance;
649
is( int( $bz14464_fines ), 42, 'Bug 14464 - Fine applied after cancelling reserve with charge desired and configured' );
649
is( int( $bz14464_fines ), 42, 'Bug 14464 - Fine applied after cancelling reserve with charge desired and configured' );
650
650
651
# tests for MoveReserve in relation to ConfirmFutureHolds (BZ 14526)
651
# 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