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

(-)a/C4/Circulation.pm (-7 / +8 lines)
Lines 3238-3249 sub CanBookBeRenewed { Link Here
3238
        $final_unseen_renewal = ( C4::Context->preference('UnseenRenewals')
3238
        $final_unseen_renewal = ( C4::Context->preference('UnseenRenewals')
3239
                && $issuing_rule->{unseen_renewals_allowed} == ( $issue->unseen_renewals + 1 ) ) ? 1 : 0;
3239
                && $issuing_rule->{unseen_renewals_allowed} == ( $issue->unseen_renewals + 1 ) ) ? 1 : 0;
3240
3240
3241
        my $overduesblockrenewing    = C4::Context->preference('OverduesBlockRenewing');
3241
        my $overduesblockrenewing     = C4::Context->preference('OverduesBlockRenewing');
3242
        my $finesblockrenewing       = C4::Context->preference("FineNoRenewals");
3242
        my $finesblockrenewing        = C4::Context->preference("FineNoRenewals");
3243
        my $restrictionblockrenewing = C4::Context->preference('RestrictionBlockRenewing');
3243
        my $restrictionblockrenewing  = C4::Context->preference('RestrictionBlockRenewing');
3244
        my $restricted               = $patron->is_debarred;
3244
        my $allowfineoverriderenewing = C4::Context->preference("AllowFineOverrideRenewing");
3245
        my $hasoverdues              = $patron->has_overdues;
3245
        my $restricted                = $patron->is_debarred;
3246
        my $balance                  = $patron->account->balance;
3246
        my $hasoverdues               = $patron->has_overdues;
3247
        my $balance                   = $patron->account->balance;
3247
3248
3248
        if ( $restricted and $restrictionblockrenewing ) {
3249
        if ( $restricted and $restrictionblockrenewing ) {
3249
            return ( 0, 'restriction' );
3250
            return ( 0, 'restriction' );
Lines 3251-3257 sub CanBookBeRenewed { Link Here
3251
            || ( $issue->is_overdue and $overduesblockrenewing eq 'blockitem' ) )
3252
            || ( $issue->is_overdue and $overduesblockrenewing eq 'blockitem' ) )
3252
        {
3253
        {
3253
            return ( 0, 'overdue' );
3254
            return ( 0, 'overdue' );
3254
        } elsif ( $finesblockrenewing && $balance > $finesblockrenewing ) {
3255
        } elsif ( $finesblockrenewing && $balance > $finesblockrenewing && !$allowfineoverriderenewing ) {
3255
            return ( 0, 'too_much_oweing');
3256
            return ( 0, 'too_much_oweing');
3256
        }
3257
        }
3257
3258
(-)a/installer/data/mysql/atomicupdate/bug_23415.pl (-2 / +11 lines)
Lines 2-18 use Modern::Perl; Link Here
2
2
3
return {
3
return {
4
    bug_number  => "23415",
4
    bug_number  => "23415",
5
    description => "Rename OPACFineNoRenewals",
5
    description => "Rename OPACFineNoRenewals and add new syspref AllowFineOverrideRenewing",
6
    up          => sub {
6
    up          => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
9
10
        $dbh->do(
10
        $dbh->do(
11
            q{
11
            q{
12
            UPDATE systempreferences SET variable = "FineNoRenewals", explanation = "Fine limit above which user or staff cannot renew items" WHERE variable = "OPACFineNoRenewals";
12
            UPDATE IGNORE systempreferences SET variable = "FineNoRenewals", explanation = "Fine limit above which user or staff cannot renew items" WHERE variable = "OPACFineNoRenewals";
13
        }
13
        }
14
        );
14
        );
15
15
16
        say $out "Updated system preference 'OPACFineNoRenewals'";
16
        say $out "Updated system preference 'OPACFineNoRenewals'";
17
18
        $dbh->do(
19
            q{
20
            INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
21
            VALUES ('AllowFineOverrideRenewing', '0', '0', 'If on, staff will be able to renew items for patrons with fines greater than FineNoRenewals.','YesNo')
22
        }
23
        );
24
25
        say $out "Added new system preference 'AllowFineOverrideRenewing'";
17
    },
26
    },
18
};
27
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 30-35 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
30
('AllowAllMessageDeletion','0','','Allow any Library to delete any message','YesNo'),
30
('AllowAllMessageDeletion','0','','Allow any Library to delete any message','YesNo'),
31
('AllowCheckoutNotes', '0', NULL, 'Allow patrons to submit notes about checked out items.','YesNo'),
31
('AllowCheckoutNotes', '0', NULL, 'Allow patrons to submit notes about checked out items.','YesNo'),
32
('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'),
33
('AllowFineOverrideRenewing','0','0','If on, staff will be able to renew items for patrons with fines greater than FineNoRenewals.','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'),
34
('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'),
34
('AllowHoldItemTypeSelection','0','','If enabled, patrons and staff will be able to select the itemtype when placing a hold','YesNo'),
35
('AllowHoldItemTypeSelection','0','','If enabled, patrons and staff will be able to select the itemtype when placing a hold','YesNo'),
35
('AllowHoldPolicyOverride','0',NULL,'Allow staff to override hold policies when placing holds','YesNo'),
36
('AllowHoldPolicyOverride','0',NULL,'Allow staff to override hold policies when placing holds','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 263-268 Circulation: Link Here
263
                  1: Allow
263
                  1: Allow
264
                  0: "Don't allow"
264
                  0: "Don't allow"
265
            - staff to manually override and check out items to patrons who have more in fines than set in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=noissuescharge">noissuescharge</a> system preference.
265
            - staff to manually override and check out items to patrons who have more in fines than set in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=noissuescharge">noissuescharge</a> system preference.
266
        -
267
            - pref: AllowFineOverrideRenewing
268
              choices:
269
                  1: Allow
270
                  0: "Don't allow"
271
            - staff to manually override and renew items for patrons who have more in fines than set in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=FineNoRenewals">FineNoRenewals</a> system preference.
266
        -
272
        -
267
            - pref: AutomaticItemReturn
273
            - pref: AutomaticItemReturn
268
              choices:
274
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-1 / +12 lines)
Lines 470-475 function LoadIssuesTable() { Link Here
470
                                __("Renewal denied by syspref") +
470
                                __("Renewal denied by syspref") +
471
                                "</span>";
471
                                "</span>";
472
472
473
                            span_style = "display: none";
474
                            span_class = "renewals-allowed";
475
                        } else if (
476
                            oObj.can_renew_error == "too_much_oweing"
477
                        ) {
478
                            msg +=
479
                                "<span class='renewals-disabled'>" +
480
                                __(
481
                                    "Cannot renew, he patron has a debt of " + parseFloat(oObj.fine).format_price()
482
                                ) +
483
                                "</span>";
484
473
                            span_style = "display: none";
485
                            span_style = "display: none";
474
                            span_class = "renewals-allowed";
486
                            span_class = "renewals-allowed";
475
                        } else {
487
                        } else {
476
- 

Return to bug 23415