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

(-)a/C4/Circulation.pm (-7 / +8 lines)
Lines 3173-3184 sub CanBookBeRenewed { Link Here
3173
        $final_unseen_renewal = ( C4::Context->preference('UnseenRenewals')
3173
        $final_unseen_renewal = ( C4::Context->preference('UnseenRenewals')
3174
                && $issuing_rule->{unseen_renewals_allowed} == ( $issue->unseen_renewals + 1 ) ) ? 1 : 0;
3174
                && $issuing_rule->{unseen_renewals_allowed} == ( $issue->unseen_renewals + 1 ) ) ? 1 : 0;
3175
3175
3176
        my $overduesblockrenewing    = C4::Context->preference('OverduesBlockRenewing');
3176
        my $overduesblockrenewing     = C4::Context->preference('OverduesBlockRenewing');
3177
        my $finesblockrenewing       = C4::Context->preference("FineNoRenewals");
3177
        my $finesblockrenewing        = C4::Context->preference("FineNoRenewals");
3178
        my $restrictionblockrenewing = C4::Context->preference('RestrictionBlockRenewing');
3178
        my $restrictionblockrenewing  = C4::Context->preference('RestrictionBlockRenewing');
3179
        my $restricted               = $patron->is_debarred;
3179
        my $allowfineoverriderenewing = C4::Context->preference("AllowFineOverrideRenewing");
3180
        my $hasoverdues              = $patron->has_overdues;
3180
        my $restricted                = $patron->is_debarred;
3181
        my $balance                  = $patron->account->balance;
3181
        my $hasoverdues               = $patron->has_overdues;
3182
        my $balance                   = $patron->account->balance;
3182
3183
3183
        if ( $restricted and $restrictionblockrenewing ) {
3184
        if ( $restricted and $restrictionblockrenewing ) {
3184
            return ( 0, 'restriction' );
3185
            return ( 0, 'restriction' );
Lines 3186-3192 sub CanBookBeRenewed { Link Here
3186
            || ( $issue->is_overdue and $overduesblockrenewing eq 'blockitem' ) )
3187
            || ( $issue->is_overdue and $overduesblockrenewing eq 'blockitem' ) )
3187
        {
3188
        {
3188
            return ( 0, 'overdue' );
3189
            return ( 0, 'overdue' );
3189
        } elsif ( $finesblockrenewing && $balance > $finesblockrenewing ) {
3190
        } elsif ( $finesblockrenewing && $balance > $finesblockrenewing && !$allowfineoverriderenewing ) {
3190
            return ( 0, 'too_much_oweing');
3191
            return ( 0, 'too_much_oweing');
3191
        }
3192
        }
3192
3193
(-)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 29-34 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
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
('AllowFineOverride','0','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','YesNo'),
31
('AllowFineOverride','0','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','YesNo'),
32
('AllowFineOverrideRenewing','0','0','If on, staff will be able to renew items for patrons with fines greater than FineNoRenewals.','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'),
34
('AllowHoldPolicyOverride','0',NULL,'Allow staff to override hold policies when placing holds','YesNo'),
35
('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