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

(-)a/C4/Circulation.pm (+9 lines)
Lines 780-785 sub CanBookBeIssued { Link Here
780
780
781
    my $onsite_checkout     = $params->{onsite_checkout}     || 0;
781
    my $onsite_checkout     = $params->{onsite_checkout}     || 0;
782
    my $override_high_holds = $params->{override_high_holds} || 0;
782
    my $override_high_holds = $params->{override_high_holds} || 0;
783
    my $booking_id = $params->{booking_id};
783
784
784
    my $item_object = $params->{item}
785
    my $item_object = $params->{item}
785
      // Koha::Items->find( { barcode => $barcode } );
786
      // Koha::Items->find( { barcode => $barcode } );
Lines 1271-1276 sub CanBookBeIssued { Link Here
1271
        }
1272
        }
1272
    }
1273
    }
1273
1274
1275
    if ( $booking_id && !(C4::Context->preference('AllowExpiredBookingTransformation')) ) {
1276
        my $booking     = Koha::Bookings->find( { booking_id => $booking_id } );
1277
        my $booking_end = dt_from_string( $booking->end_date );
1278
        if ( $booking->patron_id == $patron->borrowernumber && $now > $booking_end ) {
1279
            $needsconfirmation{'BOOKED_TOO_LATE'} = $booking;
1280
        }
1281
    }
1282
1274
    ## CHECK AGE RESTRICTION
1283
    ## CHECK AGE RESTRICTION
1275
    my $agerestriction = $biblioitem->agerestriction;
1284
    my $agerestriction = $biblioitem->agerestriction;
1276
    my $restriction_age = GetAgeRestriction( $agerestriction );
1285
    my $restriction_age = GetAgeRestriction( $agerestriction );
(-)a/circ/circulation.pl (+1 lines)
Lines 339-344 if (@$barcodes && $op eq 'cud-checkout') { Link Here
339
                {
339
                {
340
                    onsite_checkout     => $onsite_checkout,
340
                    onsite_checkout     => $onsite_checkout,
341
                    override_high_holds => $override_high_holds || $override_high_holds_tmp || 0,
341
                    override_high_holds => $override_high_holds || $override_high_holds_tmp || 0,
342
                    booking_id => $booking_id,
342
                }
343
                }
343
            );
344
            );
344
        } catch {
345
        } 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 622-627 Circulation: Link Here
622
              choices: authval
622
              choices: authval
623
              source: LOST
623
              source: LOST
624
            - "when the outstanding balance is written off."
624
            - "when the outstanding balance is written off."
625
        -
626
            - pref: AllowExpiredBookingTransformation
627
              choices:
628
                  1: Allow
629
                  0: "Don't allow"
630
            - patrons to transform a past booking into checkout.
625
    Checkin policy:
631
    Checkin policy:
626
        -
632
        -
627
            - pref: TrapHoldsOnOrder
633
            - pref: TrapHoldsOnOrder
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +5 lines)
Lines 274-279 Link Here
274
                                        Patron has this item booked for checkout on [% BOOKED_EARLY.start_date | $KohaDates %]
274
                                        Patron has this item booked for checkout on [% BOOKED_EARLY.start_date | $KohaDates %]
275
                                    </li>
275
                                    </li>
276
                                [% END %]
276
                                [% END %]
277
                                [% IF ( BOOKED_TOO_LATE ) %]
278
                                    <li class="needsconfirm booked_too_late">
279
                                        Booking ended on [% BOOKED_TOO_LATE.end_date | $KohaDates %] would you force the checkout ?
280
                                    </li>
281
                                [% END %]
277
                            </ul>
282
                            </ul>
278
283
279
                            [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
284
                            [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
280
- 

Return to bug 37201