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

(-)a/t/db_dependent/Circulation.t (-2 / +43 lines)
Lines 18-24 Link Here
18
use Modern::Perl;
18
use Modern::Perl;
19
use utf8;
19
use utf8;
20
20
21
use Test::More tests => 45;
21
use Test::More tests => 46;
22
use Test::MockModule;
22
use Test::MockModule;
23
23
24
use Data::Dumper;
24
use Data::Dumper;
Lines 3341-3346 subtest 'CanBookBeIssued & RentalFeesCheckoutConfirmation' => sub { Link Here
3341
    $itemtype->rentalcharge_daily('0')->store;
3341
    $itemtype->rentalcharge_daily('0')->store;
3342
};
3342
};
3343
3343
3344
subtest "Test Backdating of Returns" => sub {
3345
    plan tests => 2;
3346
3347
    my $branch = $library2->{branchcode};
3348
    my $biblio = $builder->build_sample_biblio();
3349
    my $item = $builder->build_sample_item(
3350
        {
3351
            biblionumber     => $biblio->biblionumber,
3352
            library          => $branch,
3353
            itype            => $itemtype,
3354
        }
3355
    );
3356
3357
    my %a_borrower_data = (
3358
        firstname =>  'Kyle',
3359
        surname => 'Hall',
3360
        categorycode => $patron_category->{categorycode},
3361
        branchcode => $branch,
3362
    );
3363
    my $borrowernumber = Koha::Patron->new(\%a_borrower_data)->store->borrowernumber;
3364
    my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed;
3365
3366
    my $due_date = dt_from_string;
3367
    my $issue = AddIssue( $borrower, $item->barcode, $due_date );
3368
    UpdateFine(
3369
        {
3370
            issue_id       => $issue->id(),
3371
            itemnumber     => $item->itemnumber,
3372
            borrowernumber => $borrowernumber,
3373
            amount         => .25,
3374
            type           => q{}
3375
        }
3376
    );
3377
3378
3379
    my ( undef, $message ) = AddReturn( $item->barcode, $branch, undef, $due_date );
3380
3381
    my $accountline = Koha::Account::Lines->find( { issue_id => $issue->id } );
3382
    is( $accountline->amountoutstanding, '0.000000', 'Fee amount outstanding was reduced to 0' );
3383
    is( $accountline->amount, '0.000000', 'Fee amount was reduced to 0' );
3384
};
3385
3344
$schema->storage->txn_rollback;
3386
$schema->storage->txn_rollback;
3345
C4::Context->clear_syspref_cache();
3387
C4::Context->clear_syspref_cache();
3346
$cache->clear_from_cache('single_holidays');
3388
$cache->clear_from_cache('single_holidays');
3347
- 

Return to bug 24075