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

(-)a/t/db_dependent/Circulation.t (-2 / +7 lines)
Lines 2291-2297 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2291
};
2291
};
2292
2292
2293
subtest '_FixOverduesOnReturn' => sub {
2293
subtest '_FixOverduesOnReturn' => sub {
2294
    plan tests => 6;
2294
    plan tests => 10;
2295
2295
2296
    # Generate test biblio
2296
    # Generate test biblio
2297
    my $title  = 'Koha for Dummies';
2297
    my $title  = 'Koha for Dummies';
Lines 2344-2352 subtest '_FixOverduesOnReturn' => sub { Link Here
2344
    C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $itemnumber, 1 );
2344
    C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $itemnumber, 1 );
2345
2345
2346
    $accountline->_result()->discard_changes();
2346
    $accountline->_result()->discard_changes();
2347
    my $offset = Koha::Account::Offsets->search({ debit_id => $accountline->id, type => 'Forgiven' })->next();
2347
2348
2348
    is( $accountline->amountoutstanding + 0, 0, 'Fine has been reduced to 0' );
2349
    is( $accountline->amountoutstanding + 0, 0, 'Fine has been reduced to 0' );
2349
    is( $accountline->accounttype, 'FFOR', 'Open fine ( account type FU ) has been set to fine forgiven ( account type FFOR )');
2350
    is( $accountline->accounttype, 'FFOR', 'Open fine ( account type FU ) has been set to fine forgiven ( account type FFOR )');
2351
    is( ref $offset, "Koha::Account::Offset", "Found matching offset for fine reduction via forgiveness" );
2352
    is( $offset->amount, '-99.000000', "Amount of offset is correct" );
2350
2353
2351
    ## Run again, with dropbox mode enabled
2354
    ## Run again, with dropbox mode enabled
2352
    $accountline->set(
2355
    $accountline->set(
Lines 2359-2367 subtest '_FixOverduesOnReturn' => sub { Link Here
2359
    C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $itemnumber, 0, 1 );
2362
    C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $itemnumber, 0, 1 );
2360
2363
2361
    $accountline->_result()->discard_changes();
2364
    $accountline->_result()->discard_changes();
2365
    my $offset = Koha::Account::Offsets->search({ debit_id => $accountline->id, type => 'Dropbox' })->next();
2362
2366
2363
    is( $accountline->amountoutstanding + 0, 90, 'Fine has been reduced to 90' );
2367
    is( $accountline->amountoutstanding + 0, 90, 'Fine has been reduced to 90' );
2364
    is( $accountline->accounttype, 'F', 'Open fine ( account type FU ) has been closed out ( account type F )');
2368
    is( $accountline->accounttype, 'F', 'Open fine ( account type FU ) has been closed out ( account type F )');
2369
    is( ref $offset, "Koha::Account::Offset", "Found matching offset for fine reduction via dropbox" );
2370
    is( $offset->amount, '-9.000000', "Amount of offset is correct" );
2365
};
2371
};
2366
2372
2367
subtest 'Set waiting flag' => sub {
2373
subtest 'Set waiting flag' => sub {
2368
- 

Return to bug 21849