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

(-)a/Koha/Item.pm (+10 lines)
Lines 599-604 sub find_booking { Link Here
599
    my $due_date      = $params->{due_date};
599
    my $due_date      = $params->{due_date};
600
    my $biblio        = $self->biblio;
600
    my $biblio        = $self->biblio;
601
601
602
    my $rule = Koha::CirculationRules->get_effective_rule(
603
        {
604
            rule_name  => 'bookings_lead_period',
605
            itemtype   => $self->effective_itemtype,
606
            branchcode => "*"
607
        }
608
    );
609
    my $preparation_period = $rule ? $rule->rule_value : 0;
610
    $due_date = $due_date->clone->add( days => $preparation_period );
611
602
    my $dtf      = Koha::Database->new->schema->storage->datetime_parser;
612
    my $dtf      = Koha::Database->new->schema->storage->datetime_parser;
603
    my $bookings = $biblio->bookings(
613
    my $bookings = $biblio->bookings(
604
        [
614
        [
(-)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