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

(-)a/t/db_dependent/Circulation/Returns.t (-4 / +7 lines)
Lines 400-406 subtest 'BranchTransferLimitsType' => sub { Link Here
400
};
400
};
401
401
402
subtest 'Backdated returns should reduce fine if needed' => sub {
402
subtest 'Backdated returns should reduce fine if needed' => sub {
403
    plan tests => 1;
403
    plan tests => 3;
404
404
405
    t::lib::Mocks::mock_preference( "CalculateFinesOnReturn",   0 );
405
    t::lib::Mocks::mock_preference( "CalculateFinesOnReturn",   0 );
406
    t::lib::Mocks::mock_preference( "CalculateFinesOnBackdate", 1 );
406
    t::lib::Mocks::mock_preference( "CalculateFinesOnBackdate", 1 );
Lines 434-443 subtest 'Backdated returns should reduce fine if needed' => sub { Link Here
434
        branchcode => $patron->branchcode,
434
        branchcode => $patron->branchcode,
435
    })->store();
435
    })->store();
436
436
437
    my $account = $patron->account;
438
    is( $account->balance+0, 100, "Account balance before return is 100");
439
437
    my ( $doreturn, $messages, $issue ) = AddReturn($item->barcode, undef, undef, dt_from_string('1999-01-01') );
440
    my ( $doreturn, $messages, $issue ) = AddReturn($item->barcode, undef, undef, dt_from_string('1999-01-01') );
441
    is( $account->balance+0, 0, "Account balance after return is 0");
438
442
439
    $fine->discard_changes;
443
    $fine = $fine->get_from_storage;
440
    is( $fine->amountoutstanding+0, 0, "Fine was reduced correctly with a backdated return" );
444
    is( $fine, undef, "Fine was removed correctly with a backdated return" );
441
};
445
};
442
446
443
$schema->storage->txn_rollback;
447
$schema->storage->txn_rollback;
444
- 

Return to bug 8338