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

(-)a/Koha/Item.pm (+10 lines)
Lines 602-607 sub find_booking { Link Here
602
    my $due_date      = $params->{due_date};
602
    my $due_date      = $params->{due_date};
603
    my $biblio        = $self->biblio;
603
    my $biblio        = $self->biblio;
604
604
605
    my $rule = Koha::CirculationRules->get_effective_rule(
606
        {
607
            rule_name  => 'bookings_lead_period',
608
            itemtype   => $self->effective_itemtype,
609
            branchcode => "*"
610
        }
611
    );
612
    my $preparation_period = $rule ? $rule->rule_value : 0;
613
    $due_date = $due_date->clone->add( days => $preparation_period );
614
605
    my $dtf      = Koha::Database->new->schema->storage->datetime_parser;
615
    my $dtf      = Koha::Database->new->schema->storage->datetime_parser;
606
    my $bookings = $biblio->bookings(
616
    my $bookings = $biblio->bookings(
607
        [
617
        [
(-)a/circ/circulation.pl (-2 / +11 lines)
Lines 52-57 use Koha::Plugins; Link Here
52
use Koha::Database;
52
use Koha::Database;
53
use Koha::BiblioFrameworks;
53
use Koha::BiblioFrameworks;
54
use Koha::Items;
54
use Koha::Items;
55
use Koha::CirculationRules;
55
use Koha::SearchEngine;
56
use Koha::SearchEngine;
56
use Koha::SearchEngine::Search;
57
use Koha::SearchEngine::Search;
57
use Koha::Patron::Modifications;
58
use Koha::Patron::Modifications;
Lines 482-489 if (@$barcodes && $op eq 'cud-checkout') { Link Here
482
                $template_params->{NEEDSCONFIRMATION} = 1;
483
                $template_params->{NEEDSCONFIRMATION} = 1;
483
                $confirm_required = 1;
484
                $confirm_required = 1;
484
                if ( $needsconfirmation_key eq 'BOOKED_TO_ANOTHER' ) {
485
                if ( $needsconfirmation_key eq 'BOOKED_TO_ANOTHER' ) {
486
                    my $rule = Koha::CirculationRules->get_effective_rule(
487
                        {
488
                            rule_name  => 'bookings_lead_period',
489
                            itemtype   => $item->effective_itemtype,
490
                            branchcode => "*"
491
                        }
492
                    );
493
                    my $preparation_period = $rule ? $rule->rule_value : 1;
485
                    my $reduceddue =
494
                    my $reduceddue =
486
                        dt_from_string( $$needsconfirmation{$needsconfirmation_key}->start_date )->subtract( days => 1 );
495
                        dt_from_string( $$needsconfirmation{$needsconfirmation_key}->start_date )
496
                        ->subtract( days => $preparation_period );
487
                    $template_params->{reduceddue} = $reduceddue;
497
                    $template_params->{reduceddue} = $reduceddue;
488
                }
498
                }
489
            }
499
            }
490
- 

Return to bug 34440