|
Lines 574-579
sub cancel {
Link Here
|
| 574 |
return $self; |
574 |
return $self; |
| 575 |
} |
575 |
} |
| 576 |
|
576 |
|
|
|
577 |
=head3 fill |
| 578 |
|
| 579 |
$hold->fill; |
| 580 |
|
| 581 |
This method marks the hold as filled. It effectively moves it to old_reserves. |
| 582 |
|
| 583 |
=cut |
| 584 |
|
| 585 |
sub fill { |
| 586 |
my ( $self ) = @_; |
| 587 |
$self->_result->result_source->schema->txn_do( |
| 588 |
sub { |
| 589 |
my $patron = $self->patron; |
| 590 |
|
| 591 |
$self->set( |
| 592 |
{ |
| 593 |
found => 'F', |
| 594 |
priority => 0, |
| 595 |
} |
| 596 |
); |
| 597 |
|
| 598 |
$self->_move_to_old; |
| 599 |
$self->SUPER::delete(); # Do not add a DELETE log |
| 600 |
|
| 601 |
# now fix the priority on the others.... |
| 602 |
C4::Reserves::_FixPriority({ biblionumber => $self->biblionumber }); |
| 603 |
|
| 604 |
if ( C4::Context->preference('HoldFeeMode') eq 'any_time_is_collected' ) { |
| 605 |
my $fee = $patron->category->reservefee // 0; |
| 606 |
if ( $fee > 0 ) { |
| 607 |
$patron->account->add_debit( |
| 608 |
{ |
| 609 |
amount => $fee, |
| 610 |
description => $self->biblio->title, |
| 611 |
user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef, |
| 612 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
| 613 |
interface => C4::Context->interface, |
| 614 |
type => 'RESERVE', |
| 615 |
item_id => $self->itemnumber |
| 616 |
} |
| 617 |
); |
| 618 |
} |
| 619 |
} |
| 620 |
|
| 621 |
C4::Log::logaction( 'HOLDS', 'FILL', $self->id, $self ) |
| 622 |
if C4::Context->preference('HoldsLog'); |
| 623 |
} |
| 624 |
); |
| 625 |
return $self; |
| 626 |
} |
| 627 |
|
| 577 |
=head3 store |
628 |
=head3 store |
| 578 |
|
629 |
|
| 579 |
Override base store method to set default |
630 |
Override base store method to set default |
| 580 |
- |
|
|