Lines 702-725
sub check_booking {
Link Here
|
702 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
702 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
703 |
|
703 |
|
704 |
my $existing_bookings = $self->bookings( |
704 |
my $existing_bookings = $self->bookings( |
705 |
[ |
705 |
{ |
706 |
start_date => { |
706 |
'-and' => [ |
707 |
'-between' => [ |
707 |
{ |
708 |
$dtf->format_datetime($start_date), |
708 |
'-or' => [ |
709 |
$dtf->format_datetime($end_date) |
709 |
start_date => { |
710 |
] |
710 |
'-between' => [ |
711 |
}, |
711 |
$dtf->format_datetime($start_date), |
712 |
end_date => { |
712 |
$dtf->format_datetime($end_date) |
713 |
'-between' => [ |
713 |
] |
714 |
$dtf->format_datetime($start_date), |
714 |
}, |
715 |
$dtf->format_datetime($end_date) |
715 |
end_date => { |
716 |
] |
716 |
'-between' => [ |
717 |
}, |
717 |
$dtf->format_datetime($start_date), |
718 |
{ |
718 |
$dtf->format_datetime($end_date) |
719 |
start_date => { '<' => $dtf->format_datetime($start_date) }, |
719 |
] |
720 |
end_date => { '>' => $dtf->format_datetime($end_date) } |
720 |
}, |
721 |
} |
721 |
{ |
722 |
] |
722 |
start_date => { '<' => $dtf->format_datetime($start_date) }, |
|
|
723 |
end_date => { '>' => $dtf->format_datetime($end_date) } |
724 |
} |
725 |
] |
726 |
}, |
727 |
{ status => { '-not_in' => [ 'cancelled', 'completed' ] } } |
728 |
] |
729 |
} |
723 |
); |
730 |
); |
724 |
|
731 |
|
725 |
my $bookings_count = |
732 |
my $bookings_count = |