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 28-33 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
28
('AllFinesNeedOverride','1','0','If on, staff will be asked to override every fine, even if it is below noissuescharge.','YesNo'),
28
('AllFinesNeedOverride','1','0','If on, staff will be asked to override every fine, even if it is below noissuescharge.','YesNo'),
29
('AllowAllMessageDeletion','0','','Allow any Library to delete any message','YesNo'),
29
('AllowAllMessageDeletion','0','','Allow any Library to delete any message','YesNo'),
30
('AllowCheckoutNotes', '0', NULL, 'Allow patrons to submit notes about checked out items.','YesNo'),
30
('AllowCheckoutNotes', '0', NULL, 'Allow patrons to submit notes about checked out items.','YesNo'),
31
('AllowExpiredBookingTransformation','1','','Prevent transform into checkout a past booking','YesNo'),
31
('AllowFineOverride','0','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','YesNo'),
32
('AllowFineOverride','0','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','YesNo'),
32
('AllowHoldDateInFuture','0','','If set a date field is displayed on the Hold screen of the Staff Interface, allowing the hold date to be set in the future.','YesNo'),
33
('AllowHoldDateInFuture','0','','If set a date field is displayed on the Hold screen of the Staff Interface, allowing the hold date to be set in the future.','YesNo'),
33
('AllowHoldItemTypeSelection','0','','If enabled, patrons and staff will be able to select the itemtype when placing a hold','YesNo'),
34
('AllowHoldItemTypeSelection','0','','If enabled, patrons and staff will be able to select the itemtype when placing a hold','YesNo'),
(-)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