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

(-)a/C4/Circulation.pm (+9 lines)
Lines 781-786 sub CanBookBeIssued { Link Here
781
781
782
    my $onsite_checkout     = $params->{onsite_checkout}     || 0;
782
    my $onsite_checkout     = $params->{onsite_checkout}     || 0;
783
    my $override_high_holds = $params->{override_high_holds} || 0;
783
    my $override_high_holds = $params->{override_high_holds} || 0;
784
    my $booking_id = $params->{booking_id};
784
785
785
    my $item_object = $params->{item}
786
    my $item_object = $params->{item}
786
      // Koha::Items->find( { barcode => $barcode } );
787
      // Koha::Items->find( { barcode => $barcode } );
Lines 1265-1270 sub CanBookBeIssued { Link Here
1265
        }
1266
        }
1266
    }
1267
    }
1267
1268
1269
    if ( $booking_id && !(C4::Context->preference('AllowExpiredBookingTransformation')) ) {
1270
        my $booking     = Koha::Bookings->find( { booking_id => $booking_id } );
1271
        my $booking_end = dt_from_string( $booking->end_date );
1272
        if ( $booking->patron_id == $patron->borrowernumber && $now > $booking_end ) {
1273
            $needsconfirmation{'BOOKED_TOO_LATE'} = $booking;
1274
        }
1275
    }
1276
1268
    ## CHECK AGE RESTRICTION
1277
    ## CHECK AGE RESTRICTION
1269
    my $agerestriction = $biblioitem->agerestriction;
1278
    my $agerestriction = $biblioitem->agerestriction;
1270
    my ( $restriction_age, $daysToAgeRestriction ) =
1279
    my ( $restriction_age, $daysToAgeRestriction ) =
(-)a/circ/circulation.pl (+1 lines)
Lines 341-346 if (@$barcodes && $op eq 'cud-checkout') { Link Here
341
                {
341
                {
342
                    onsite_checkout     => $onsite_checkout,
342
                    onsite_checkout     => $onsite_checkout,
343
                    override_high_holds => $override_high_holds || $override_high_holds_tmp || 0,
343
                    override_high_holds => $override_high_holds || $override_high_holds_tmp || 0,
344
                    booking_id => $booking_id,
344
                }
345
                }
345
            );
346
            );
346
        } catch {
347
        } catch {
(-)a/installer/data/mysql/atomicupdate/Bug_37201_allow-expired-booking-to-checkout.pl (+16 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "37201",
5
    description => "Add syspref AllowExpiredBookingTransformation",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{
11
        INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES  ('AllowExpiredBookingTransformation', 1, '', 'Prevent transform into checkout a past booking', 'YesNo');
12
        });
13
14
        say $out "Added new system preference 'AllowExpiredBookingTransformation'";
15
    },
16
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 616-621 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
616
('PreservationNotForLoanDefaultTrainIn', '', '', 'Not for loan to apply to items removed from the preservation waiting list', 'TextArea'),
616
('PreservationNotForLoanDefaultTrainIn', '', '', 'Not for loan to apply to items removed from the preservation waiting list', 'TextArea'),
617
('PreservationNotForLoanWaitingListIn', '', '', 'Not for loan to apply to items added to the preservation waiting list', 'TextArea'),
617
('PreservationNotForLoanWaitingListIn', '', '', 'Not for loan to apply to items added to the preservation waiting list', 'TextArea'),
618
('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'),
618
('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'),
619
('AllowExpiredBookingTransformation','1','','Prevent transform into checkout a past booking','YesNo'),
619
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
620
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
620
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
621
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
621
('PrivacyPolicyConsent','','Enforced|Permissive|Disabled','Data privacy policy consent in the OPAC', 'Choice'),
622
('PrivacyPolicyConsent','','Enforced|Permissive|Disabled','Data privacy policy consent in the OPAC', 'Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 615-620 Circulation: Link Here
615
                  open: "extend the loan period and set the checkout to be due at the library's open time."
615
                  open: "extend the loan period and set the checkout to be due at the library's open time."
616
                  close: "shorten the loan period and set the checkout to be due at the library's close time."
616
                  close: "shorten the loan period and set the checkout to be due at the library's close time."
617
                  ignore: "do not consider the library's opening hours."
617
                  ignore: "do not consider the library's opening hours."
618
        -
619
            - pref: AllowExpiredBookingTransformation
620
              choices:
621
                  1: Allow
622
                  0: "Don't allow"
623
            - patrons to transform a past booking into checkout.
618
    Checkin policy:
624
    Checkin policy:
619
        -
625
        -
620
            - pref: TrapHoldsOnOrder
626
            - pref: TrapHoldsOnOrder
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +5 lines)
Lines 275-280 Link Here
275
                                        Patron has this item booked for checkout on [% BOOKED_EARLY.start_date | $KohaDates %]
275
                                        Patron has this item booked for checkout on [% BOOKED_EARLY.start_date | $KohaDates %]
276
                                    </li>
276
                                    </li>
277
                                [% END %]
277
                                [% END %]
278
                                [% IF ( BOOKED_TOO_LATE ) %]
279
                                    <li class="needsconfirm booked_too_late">
280
                                        Booking ended on [% BOOKED_TOO_LATE.end_date | $KohaDates %] would you force the checkout ?
281
                                    </li>
282
                                [% END %]
278
                            </ul>
283
                            </ul>
279
284
280
                            [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
285
                            [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
281
- 

Return to bug 37201