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

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

Return to bug 29869