|
Lines 3538-3543
subtest 'Filling a hold should cancel existing transfer' => sub {
Link Here
|
| 3538 |
is( Koha::Item::Transfers->search({ itemnumber => $item->itemnumber, datearrived => undef })->count, 0, "No outstanding transfers when hold is waiting"); |
3538 |
is( Koha::Item::Transfers->search({ itemnumber => $item->itemnumber, datearrived => undef })->count, 0, "No outstanding transfers when hold is waiting"); |
| 3539 |
}; |
3539 |
}; |
| 3540 |
|
3540 |
|
|
|
3541 |
subtest 'Do not return on renewal (LOST charge)' => sub { |
| 3542 |
plan tests => 1; |
| 3543 |
|
| 3544 |
t::lib::Mocks::mock_preference('MarkLostItemsAsReturned', 'onpayment'); |
| 3545 |
my $library = $builder->build_object( { class => "Koha::Libraries" } ); |
| 3546 |
my $manager = $builder->build_object( { class => "Koha::Patrons" } ); |
| 3547 |
t::lib::Mocks::mock_userenv({ patron => $manager,branchcode => $manager->branchcode }); |
| 3548 |
|
| 3549 |
my $biblio = $builder->build_sample_biblio; |
| 3550 |
|
| 3551 |
my $item = $builder->build_sample_item( |
| 3552 |
{ |
| 3553 |
biblionumber => $biblio->biblionumber, |
| 3554 |
library => $library->branchcode, |
| 3555 |
replacementprice => 99.00, |
| 3556 |
itype => $itemtype, |
| 3557 |
} |
| 3558 |
); |
| 3559 |
|
| 3560 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 3561 |
AddIssue( $patron->unblessed, $item->barcode ); |
| 3562 |
|
| 3563 |
my $accountline = Koha::Account::Line->new( |
| 3564 |
{ |
| 3565 |
borrowernumber => $patron->borrowernumber, |
| 3566 |
debit_type_code => 'LOST', |
| 3567 |
status => undef, |
| 3568 |
itemnumber => $item->itemnumber, |
| 3569 |
amount => 12, |
| 3570 |
amountoutstanding => 12, |
| 3571 |
interface => 'something', |
| 3572 |
} |
| 3573 |
)->store(); |
| 3574 |
|
| 3575 |
# AddRenewal doesn't call _FixAccountForLostAndFound |
| 3576 |
AddIssue( $patron->unblessed, $item->barcode ); |
| 3577 |
|
| 3578 |
is( $patron->checkouts->count, 1, |
| 3579 |
'Renewal should not return the item even if a LOST payment has been made earlier' |
| 3580 |
); |
| 3581 |
}; |
| 3582 |
|
| 3541 |
$schema->storage->txn_rollback; |
3583 |
$schema->storage->txn_rollback; |
| 3542 |
C4::Context->clear_syspref_cache(); |
3584 |
C4::Context->clear_syspref_cache(); |
| 3543 |
$cache->clear_from_cache('single_holidays'); |
3585 |
$cache->clear_from_cache('single_holidays'); |
| 3544 |
- |
|
|