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

(-)a/C4/Circulation.pm (-8 / +164 lines)
Lines 2773-2778 sub CanBookBeRenewed { Link Here
2773
                    'no_auto_renewal_after_hard_limit',
2773
                    'no_auto_renewal_after_hard_limit',
2774
                    'lengthunit',
2774
                    'lengthunit',
2775
                    'norenewalbefore',
2775
                    'norenewalbefore',
2776
                    'unseen_renewals_allowed'
2776
                ]
2777
                ]
2777
            }
2778
            }
2778
        );
2779
        );
Lines 2951-2962 sub CanBookBeRenewed { Link Here
2951
2952
2952
    return ( 0, "auto_renew" ) if $auto_renew eq "ok" && !$override_limit; # 0 if auto-renewal should not succeed
2953
    return ( 0, "auto_renew" ) if $auto_renew eq "ok" && !$override_limit; # 0 if auto-renewal should not succeed
2953
2954
2955
    return ( 1, undef ) if $override_limit;
2956
2957
    my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed );
2958
    my $issuing_rule = Koha::CirculationRules->get_effective_rules(
2959
        {
2960
            categorycode => $patron->categorycode,
2961
            itemtype     => $item->effective_itemtype,
2962
            branchcode   => $branchcode,
2963
            rules => [
2964
                'renewalsallowed',
2965
                'no_auto_renewal_after',
2966
                'no_auto_renewal_after_hard_limit',
2967
                'lengthunit',
2968
                'norenewalbefore',
2969
                'unseen_renewals_allowed'
2970
            ]
2971
        }
2972
    );
2973
2974
    return ( 0, "too_many" )
2975
      if not $issuing_rule->{renewalsallowed} or $issuing_rule->{renewalsallowed} <= $issue->renewals;
2976
2977
    return ( 0, "too_unseen" )
2978
      if C4::Context->preference('UnseenRenewals') &&
2979
        $issuing_rule->{unseen_renewals_allowed} &&
2980
        $issuing_rule->{unseen_renewals_allowed} <= $issue->unseen_renewals;
2981
2982
    my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing');
2983
    my $restrictionblockrenewing = C4::Context->preference('RestrictionBlockRenewing');
2984
    $patron         = Koha::Patrons->find($borrowernumber); # FIXME Is this really useful?
2985
    my $restricted  = $patron->is_debarred;
2986
    my $hasoverdues = $patron->has_overdues;
2987
2988
    if ( $restricted and $restrictionblockrenewing ) {
2989
        return ( 0, 'restriction');
2990
    } elsif ( ($hasoverdues and $overduesblockrenewing eq 'block') || ($issue->is_overdue and $overduesblockrenewing eq 'blockitem') ) {
2991
        return ( 0, 'overdue');
2992
    }
2993
2994
    if ( $issue->auto_renew ) {
2995
2996
        if ( $patron->category->effective_BlockExpiredPatronOpacActions and $patron->is_expired ) {
2997
            return ( 0, 'auto_account_expired' );
2998
        }
2999
3000
        if ( defined $issuing_rule->{no_auto_renewal_after}
3001
                and $issuing_rule->{no_auto_renewal_after} ne "" ) {
3002
            # Get issue_date and add no_auto_renewal_after
3003
            # If this is greater than today, it's too late for renewal.
3004
            my $maximum_renewal_date = dt_from_string($issue->issuedate, 'sql');
3005
            $maximum_renewal_date->add(
3006
                $issuing_rule->{lengthunit} => $issuing_rule->{no_auto_renewal_after}
3007
            );
3008
            my $now = dt_from_string;
3009
            if ( $now >= $maximum_renewal_date ) {
3010
                return ( 0, "auto_too_late" );
3011
            }
3012
        }
3013
        if ( defined $issuing_rule->{no_auto_renewal_after_hard_limit}
3014
                      and $issuing_rule->{no_auto_renewal_after_hard_limit} ne "" ) {
3015
            # If no_auto_renewal_after_hard_limit is >= today, it's also too late for renewal
3016
            if ( dt_from_string >= dt_from_string( $issuing_rule->{no_auto_renewal_after_hard_limit} ) ) {
3017
                return ( 0, "auto_too_late" );
3018
            }
3019
        }
3020
3021
        if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) {
3022
            my $fine_no_renewals = C4::Context->preference("OPACFineNoRenewals");
3023
            my $amountoutstanding =
3024
              C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
3025
              ? $patron->account->balance
3026
              : $patron->account->outstanding_debits->total_outstanding;
3027
            if ( $amountoutstanding and $amountoutstanding > $fine_no_renewals ) {
3028
                return ( 0, "auto_too_much_oweing" );
3029
            }
3030
        }
3031
    }
3032
3033
    if ( defined $issuing_rule->{norenewalbefore}
3034
        and $issuing_rule->{norenewalbefore} ne "" )
3035
    {
3036
3037
        # Calculate soonest renewal by subtracting 'No renewal before' from due date
3038
        my $soonestrenewal = dt_from_string( $issue->date_due, 'sql' )->subtract(
3039
            $issuing_rule->{lengthunit} => $issuing_rule->{norenewalbefore} );
3040
3041
        # Depending on syspref reset the exact time, only check the date
3042
        if ( C4::Context->preference('NoRenewalBeforePrecision') eq 'date'
3043
            and $issuing_rule->{lengthunit} eq 'days' )
3044
        {
3045
            $soonestrenewal->truncate( to => 'day' );
3046
        }
3047
3048
        if ( $soonestrenewal > DateTime->now( time_zone => C4::Context->tz() ) )
3049
        {
3050
            return ( 0, "auto_too_soon" ) if $issue->auto_renew;
3051
            return ( 0, "too_soon" );
3052
        }
3053
        elsif ( $issue->auto_renew ) {
3054
            return ( 0, "auto_renew" );
3055
        }
3056
    }
3057
3058
    # Fallback for automatic renewals:
3059
    # If norenewalbefore is undef, don't renew before due date.
3060
    if ( $issue->auto_renew ) {
3061
        my $now = dt_from_string;
3062
        return ( 0, "auto_renew" )
3063
          if $now >= dt_from_string( $issue->date_due, 'sql' );
3064
        return ( 0, "auto_too_soon" );
3065
    }
3066
2954
    return ( 1, undef );
3067
    return ( 1, undef );
2955
}
3068
}
2956
3069
2957
=head2 AddRenewal
3070
=head2 AddRenewal
2958
3071
2959
  &AddRenewal($borrowernumber, $itemnumber, $branch, [$datedue], [$lastreneweddate]);
3072
  &AddRenewal($borrowernumber, $itemnumber, $branch, [$datedue], [$lastreneweddate], [$seen]);
2960
3073
2961
Renews a loan.
3074
Renews a loan.
2962
3075
Lines 2981-2986 syspref) Link Here
2981
If C<$datedue> is the empty string, C<&AddRenewal> will calculate the due date automatically
3094
If C<$datedue> is the empty string, C<&AddRenewal> will calculate the due date automatically
2982
from the book's item type.
3095
from the book's item type.
2983
3096
3097
C<$seen> is a boolean flag indicating if the item was seen or not during the renewal. This
3098
informs the incrementing of the unseen_renewals column. If this flag is not supplied, we
3099
fallback to a true value
3100
2984
=cut
3101
=cut
2985
3102
2986
sub AddRenewal {
3103
sub AddRenewal {
Lines 2990-2995 sub AddRenewal { Link Here
2990
    my $datedue         = shift;
3107
    my $datedue         = shift;
2991
    my $lastreneweddate = shift || dt_from_string();
3108
    my $lastreneweddate = shift || dt_from_string();
2992
    my $skipfinecalc    = shift;
3109
    my $skipfinecalc    = shift;
3110
    my $seen            = shift;
3111
3112
    # Fallback on a 'seen' renewal
3113
    $seen = defined $seen && $seen == 0 ? 0 : 1;
2993
3114
2994
    my $item_object   = Koha::Items->find($itemnumber) or return;
3115
    my $item_object   = Koha::Items->find($itemnumber) or return;
2995
    my $biblio = $item_object->biblio;
3116
    my $biblio = $item_object->biblio;
Lines 3042-3056 sub AddRenewal { Link Here
3042
            }
3163
            }
3043
        );
3164
        );
3044
3165
3166
        # Increment the unseen renewals, if appropriate
3167
        # We only do so if the syspref is enabled and
3168
        # a maximum value has been set in the circ rules
3169
        my $unseen_renewals = $issue->unseen_renewals;
3170
        if (C4::Context->preference('UnseenRenewals')) {
3171
            my $rule = Koha::CirculationRules->get_effective_rule(
3172
                {   categorycode => $patron->categorycode,
3173
                    itemtype     => $item_object->effective_itemtype,
3174
                    branchcode   => $circ_library->branchcode,
3175
                    rule_name    => 'unseen_renewals_allowed'
3176
                }
3177
            );
3178
            if (!$seen && $rule && $rule->rule_value) {
3179
                $unseen_renewals++;
3180
            } else {
3181
                # If the renewal is seen, unseen should revert to 0
3182
                $unseen_renewals = 0;
3183
            }
3184
        }
3185
3045
        # Update the issues record to have the new due date, and a new count
3186
        # Update the issues record to have the new due date, and a new count
3046
        # of how many times it has been renewed.
3187
        # of how many times it has been renewed.
3047
        my $renews = ( $issue->renewals || 0 ) + 1;
3188
        my $renews = ( $issue->renewals || 0 ) + 1;
3048
        my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, lastreneweddate = ?
3189
        my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, unseen_renewals = ?, lastreneweddate = ?
3049
                                WHERE borrowernumber=?
3190
                                WHERE borrowernumber=?
3050
                                AND itemnumber=?"
3191
                                AND itemnumber=?"
3051
        );
3192
        );
3052
3193
3053
        $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $lastreneweddate, $borrowernumber, $itemnumber );
3194
        $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $unseen_renewals, $lastreneweddate, $borrowernumber, $itemnumber );
3054
3195
3055
        # Update the renewal count on the item, and tell zebra to reindex
3196
        # Update the renewal count on the item, and tell zebra to reindex
3056
        $renews = ( $item_object->renewals || 0 ) + 1;
3197
        $renews = ( $item_object->renewals || 0 ) + 1;
Lines 3137-3144 sub GetRenewCount { Link Here
3137
    my ( $bornum, $itemno ) = @_;
3278
    my ( $bornum, $itemno ) = @_;
3138
    my $dbh           = C4::Context->dbh;
3279
    my $dbh           = C4::Context->dbh;
3139
    my $renewcount    = 0;
3280
    my $renewcount    = 0;
3281
    my $unseencount    = 0;
3140
    my $renewsallowed = 0;
3282
    my $renewsallowed = 0;
3283
    my $unseenallowed = 0;
3141
    my $renewsleft    = 0;
3284
    my $renewsleft    = 0;
3285
    my $unseenleft    = 0;
3142
3286
3143
    my $patron = Koha::Patrons->find( $bornum );
3287
    my $patron = Koha::Patrons->find( $bornum );
3144
    my $item   = Koha::Items->find($itemno);
3288
    my $item   = Koha::Items->find($itemno);
Lines 3157-3178 sub GetRenewCount { Link Here
3157
    $sth->execute( $bornum, $itemno );
3301
    $sth->execute( $bornum, $itemno );
3158
    my $data = $sth->fetchrow_hashref;
3302
    my $data = $sth->fetchrow_hashref;
3159
    $renewcount = $data->{'renewals'} if $data->{'renewals'};
3303
    $renewcount = $data->{'renewals'} if $data->{'renewals'};
3304
    $unseencount = $data->{'unseen_renewals'} if $data->{'unseen_renewals'};
3160
    # $item and $borrower should be calculated
3305
    # $item and $borrower should be calculated
3161
    my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed);
3306
    my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed);
3162
3307
3163
    my $rule = Koha::CirculationRules->get_effective_rule(
3308
    my $rules = Koha::CirculationRules->get_effective_rules(
3164
        {
3309
        {
3165
            categorycode => $patron->categorycode,
3310
            categorycode => $patron->categorycode,
3166
            itemtype     => $item->effective_itemtype,
3311
            itemtype     => $item->effective_itemtype,
3167
            branchcode   => $branchcode,
3312
            branchcode   => $branchcode,
3168
            rule_name    => 'renewalsallowed',
3313
            rules        => [ 'renewalsallowed', 'unseen_renewals_allowed' ]
3169
        }
3314
        }
3170
    );
3315
    );
3171
3316
    $renewsallowed = $rules ? $rules->{renewalsallowed} : 0;
3172
    $renewsallowed = $rule ? $rule->rule_value : 0;
3317
    $unseenallowed = $rules->{unseen_renewals_allowed} ?
3318
        $rules->{unseen_renewals_allowed} :
3319
        0;
3173
    $renewsleft    = $renewsallowed - $renewcount;
3320
    $renewsleft    = $renewsallowed - $renewcount;
3321
    $unseenleft    = $unseenallowed - $unseencount;
3174
    if($renewsleft < 0){ $renewsleft = 0; }
3322
    if($renewsleft < 0){ $renewsleft = 0; }
3175
    return ( $renewcount, $renewsallowed, $renewsleft );
3323
    if($unseenleft < 0){ $unseenleft = 0; }
3324
    return (
3325
        $renewcount,
3326
        $renewsallowed,
3327
        $renewsleft,
3328
        $unseencount,
3329
        $unseenallowed,
3330
        $unseenleft
3331
    );
3176
}
3332
}
3177
3333
3178
=head2 GetSoonestRenewDate
3334
=head2 GetSoonestRenewDate
(-)a/C4/ILSDI/Services.pm (-1 / +1 lines)
Lines 669-675 sub RenewLoan { Link Here
669
669
670
    # Add renewal if possible
670
    # Add renewal if possible
671
    my @renewal = CanBookBeRenewed( $borrowernumber, $itemnumber );
671
    my @renewal = CanBookBeRenewed( $borrowernumber, $itemnumber );
672
    if ( $renewal[0] ) { AddRenewal( $borrowernumber, $itemnumber ); }
672
    if ( $renewal[0] ) { AddRenewal( $borrowernumber, $itemnumber, undef, undef, undef, 0 ); }
673
673
674
    my $issue = $item->checkout;
674
    my $issue = $item->checkout;
675
    return unless $issue; # FIXME should be handled
675
    return unless $issue; # FIXME should be handled
(-)a/C4/SIP/ILS/Transaction/Renew.pm (+1 lines)
Lines 51-56 sub do_renew_for { Link Here
51
    } else {
51
    } else {
52
        $renewerror=~s/on_reserve/Item unavailable due to outstanding holds/;
52
        $renewerror=~s/on_reserve/Item unavailable due to outstanding holds/;
53
        $renewerror=~s/too_many/Item has reached maximum renewals/;
53
        $renewerror=~s/too_many/Item has reached maximum renewals/;
54
        $renewerror=~s/too_unseen/Item has reached maximum consecutive renewals without being seen/;
54
        $renewerror=~s/item_denied_renewal/Item renewal is not allowed/;
55
        $renewerror=~s/item_denied_renewal/Item renewal is not allowed/;
55
        $self->screen_msg($renewerror);
56
        $self->screen_msg($renewerror);
56
        $self->renewal_ok(0);
57
        $self->renewal_ok(0);
(-)a/Koha/CirculationRules.pm (+3 lines)
Lines 151-156 our $RULE_KINDS = { Link Here
151
    renewalsallowed => {
151
    renewalsallowed => {
152
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
152
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
153
    },
153
    },
154
    unseen_renewals_allowed => {
155
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
156
    },
154
    rentaldiscount => {
157
    rentaldiscount => {
155
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
158
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
156
    },
159
    },
(-)a/Koha/REST/V1/Checkouts.pm (-1 / +10 lines)
Lines 146-151 sub renew { Link Here
146
    my $c = shift->openapi->valid_input or return;
146
    my $c = shift->openapi->valid_input or return;
147
147
148
    my $checkout_id = $c->validation->param('checkout_id');
148
    my $checkout_id = $c->validation->param('checkout_id');
149
    my $seen = $c->validation->param('seen') || 1;
149
    my $checkout = Koha::Checkouts->find( $checkout_id );
150
    my $checkout = Koha::Checkouts->find( $checkout_id );
150
151
151
    unless ($checkout) {
152
    unless ($checkout) {
Lines 169-175 sub renew { Link Here
169
            );
170
            );
170
        }
171
        }
171
172
172
        AddRenewal($borrowernumber, $itemnumber, $checkout->branchcode);
173
        AddRenewal(
174
            $borrowernumber,
175
            $itemnumber,
176
            $checkout->branchcode,
177
            undef,
178
            undef,
179
            $seen
180
        );
173
        $checkout = Koha::Checkouts->find($checkout_id);
181
        $checkout = Koha::Checkouts->find($checkout_id);
174
182
175
        $c->res->headers->location( $c->req->url->to_string );
183
        $c->res->headers->location( $c->req->url->to_string );
Lines 223-228 sub allows_renewal { Link Here
223
                allows_renewal => $renewable,
231
                allows_renewal => $renewable,
224
                max_renewals => $rule->rule_value,
232
                max_renewals => $rule->rule_value,
225
                current_renewals => $checkout->renewals,
233
                current_renewals => $checkout->renewals,
234
                unseen_renewals => $checkout->unseen_renewals,
226
                error => $error
235
                error => $error
227
            }
236
            }
228
        );
237
        );
(-)a/api/v1/swagger/definitions/checkout.json (+4 lines)
Lines 39-44 Link Here
39
      "type": ["integer", "null"],
39
      "type": ["integer", "null"],
40
      "description": "Number of renewals"
40
      "description": "Number of renewals"
41
    },
41
    },
42
    "unseen_renewals": {
43
      "type": ["integer", "null"],
44
      "description": "Number of consecutive unseen renewals"
45
    },
42
    "auto_renew": {
46
    "auto_renew": {
43
      "type": "boolean",
47
      "type": "boolean",
44
      "description": "Auto renewal"
48
      "description": "Auto renewal"
(-)a/api/v1/swagger/parameters.json (+3 lines)
Lines 38-43 Link Here
38
  "checkout_id_pp": {
38
  "checkout_id_pp": {
39
    "$ref": "parameters/checkout.json#/checkout_id_pp"
39
    "$ref": "parameters/checkout.json#/checkout_id_pp"
40
  },
40
  },
41
  "seen_pp": {
42
    "$ref": "parameters/checkout.json#/seen_pp"
43
  },
41
  "match": {
44
  "match": {
42
    "name": "_match",
45
    "name": "_match",
43
    "in": "query",
46
    "in": "query",
(-)a/api/v1/swagger/parameters/checkout.json (+7 lines)
Lines 5-9 Link Here
5
    "description": "Internal checkout identifier",
5
    "description": "Internal checkout identifier",
6
    "required": true,
6
    "required": true,
7
    "type": "integer"
7
    "type": "integer"
8
  },
9
  "seen_pp": {
10
    "name": "seen",
11
    "in": "query",
12
    "description": "Item was seen flag",
13
    "required": false,
14
    "type": "integer"
8
  }
15
  }
9
}
16
}
(-)a/api/v1/swagger/paths/checkouts.json (-3 / +4 lines)
Lines 87-95 Link Here
87
      "x-mojo-to": "Checkouts#renew",
87
      "x-mojo-to": "Checkouts#renew",
88
      "operationId": "renewCheckout",
88
      "operationId": "renewCheckout",
89
      "tags": ["patrons", "checkouts"],
89
      "tags": ["patrons", "checkouts"],
90
      "parameters": [{
90
      "parameters": [
91
        "$ref": "../parameters.json#/checkout_id_pp"
91
        { "$ref": "../parameters.json#/checkout_id_pp" },
92
      }],
92
        { "$ref": "../parameters.json#/seen_pp" }
93
      ],
93
      "produces": ["application/json"],
94
      "produces": ["application/json"],
94
      "responses": {
95
      "responses": {
95
        "201": {
96
        "201": {
(-)a/circ/renew.pl (-1 / +10 lines)
Lines 43-48 my ( $template, $librarian, $cookie, $flags ) = get_template_and_user( Link Here
43
my $schema = Koha::Database->new()->schema();
43
my $schema = Koha::Database->new()->schema();
44
44
45
my $barcode        = $cgi->param('barcode');
45
my $barcode        = $cgi->param('barcode');
46
my $unseen         = $cgi->param('unseen') || 0;
46
$barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespae
47
$barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespae
47
$barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
48
$barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
48
my $override_limit = $cgi->param('override_limit');
49
my $override_limit = $cgi->param('override_limit');
Lines 102-108 if ($barcode) { Link Here
102
                    if ( C4::Context->preference('SpecifyDueDate') && $hard_due_date ) {
103
                    if ( C4::Context->preference('SpecifyDueDate') && $hard_due_date ) {
103
                        $date_due = dt_from_string( $hard_due_date );
104
                        $date_due = dt_from_string( $hard_due_date );
104
                    }
105
                    }
105
                    $date_due = AddRenewal( undef, $item->itemnumber(), $branchcode, $date_due );
106
                    $date_due = AddRenewal(
107
                        undef,
108
                        $item->itemnumber(),
109
                        $branchcode,
110
                        $date_due,
111
                        undef,
112
                        undef,
113
                        !$unseen
114
                    );
106
                    $template->param( date_due => $date_due );
115
                    $template->param( date_due => $date_due );
107
                }
116
                }
108
            }
117
            }
(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (+12 lines)
Lines 1025-1030 div { Link Here
1025
        width: auto;
1025
        width: auto;
1026
    }
1026
    }
1027
1027
1028
    .renew_formfield {
1029
        margin-bottom: 1em;
1030
    }
1031
1028
    .circmessage {
1032
    .circmessage {
1029
        margin-bottom: .3em;
1033
        margin-bottom: .3em;
1030
        padding: 0 .4em .4em;
1034
        padding: 0 .4em .4em;
Lines 2489-2494 li { Link Here
2489
    position: relative;
2493
    position: relative;
2490
}
2494
}
2491
2495
2496
#renew_as_unseen_label {
2497
    margin-left: 1em;
2498
}
2499
2500
#renew_as_unseen_checkbox {
2501
    margin-right: 1em;
2502
}
2503
2492
#clearscreen {
2504
#clearscreen {
2493
    position: absolute;
2505
    position: absolute;
2494
    right: 0;
2506
    right: 0;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc (+4 lines)
Lines 49-54 Link Here
49
                        [% END %]
49
                        [% END %]
50
                    [% END %]
50
                    [% END %]
51
                    [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
51
                    [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
52
                        [% IF Koha.Preference( 'UnseenRenewals' ) %]
53
                            <label id="renew_as_unseen_label" for="override_limit">Renew as &quot;unseen&quot; if appropriate:</label>
54
                            <input type="checkbox" name="renew_as_unseen" id="renew_as_unseen_checkbox" value="1" />
55
                        [% END %]
52
                        <button class="btn btn-default" id="RenewCheckinChecked"><i class="fa fa-check"></i> Renew or check in selected items</button>
56
                        <button class="btn btn-default" id="RenewCheckinChecked"><i class="fa fa-check"></i> Renew or check in selected items</button>
53
                        <button class="btn btn-default" id="RenewAll"><i class="fa fa-book"></i> Renew all</button>
57
                        <button class="btn btn-default" id="RenewAll"><i class="fa fa-book"></i> Renew all</button>
54
                    [% END %]
58
                    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 1078-1083 Link Here
1078
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1078
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1079
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1079
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1080
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
1080
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
1081
        var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
1081
        var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
1082
        var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
1082
        var interface = "[% interface | html %]";
1083
        var interface = "[% interface | html %]";
1083
        var theme = "[% theme | html %]";
1084
        var theme = "[% theme | html %]";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt (-7 / +31 lines)
Lines 52-57 Link Here
52
                                    </form>
52
                                    </form>
53
                                [% END %]
53
                                [% END %]
54
54
55
                            [% ELSIF error == "too_unseen" %]
56
57
                                <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio %] ( [% item.barcode | html %] ) has been renewed the maximum number of consecutive times without being seen by the library )</p>
58
59
                                [% IF Koha.Preference('AllowRenewalLimitOverride') %]
60
                                    <form method="post" action="/cgi-bin/koha/circ/renew.pl">
61
                                        <input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
62
                                        <input type="hidden" name="override_limit" value="1" />
63
                                        <button type="submit" class="approve"><i class="fa fa-check"></i> Override limit and renew</button>
64
                                    </form>
65
                                [% END %]
66
55
                            [% ELSIF error == "too_soon" %]
67
                            [% ELSIF error == "too_soon" %]
56
68
57
                                <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ) cannot be renewed before [% soonestrenewdate | $KohaDates %]. </p>
69
                                <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ) cannot be renewed before [% soonestrenewdate | $KohaDates %]. </p>
Lines 169-180 Link Here
169
                    <fieldset>
181
                    <fieldset>
170
                        <h2>Renew</h2>
182
                        <h2>Renew</h2>
171
183
172
                        <div>
184
                        [% IF Koha.Preference('UnseenRenewals') %]
173
                            <label for="barcode" class="hint">Enter item barcode: </label>
185
                            <div class="renew_formfield">
174
                        </div>
186
                                <div>
175
187
                                    <label for="barcode" class="hint">Enter item barcode: </label>
176
                        <input name="barcode" id="barcode" size="14" class="barcode focus" type="text" />
188
                                </div>
177
189
                                <input name="barcode" id="barcode" size="14" class="barcode focus" type="text" />
190
                            </div>
191
                            <div class="renew_formfield">
192
                                <label for="unseen" class="hint">Record renewal as unseen if appropriate: </label>
193
                                <input value="1" name="unseen" id="unseen" type="checkbox" />
194
                            </div>
195
                        [% ELSE %]
196
                            <div>
197
                                <label for="barcode" class="hint">Enter item barcode: </label>
198
                            </div>
199
200
                            <input name="barcode" id="barcode" size="14" class="barcode focus" type="text" />
201
202
                        [% END %]
178
                        <button type="submit" class="btn btn-default">Submit</button>
203
                        <button type="submit" class="btn btn-default">Submit</button>
179
204
180
                        <div class="circ-settings show">
205
                        <div class="circ-settings show">
Lines 184-190 Link Here
184
                                <button type="button" class="action btn btn-default btn-xs" id="cleardate" name="cleardate">Clear</button>
209
                                <button type="button" class="action btn btn-default btn-xs" id="cleardate" name="cleardate">Clear</button>
185
                            </div> <!-- /.date-select -->
210
                            </div> <!-- /.date-select -->
186
                        </div>
211
                        </div>
187
188
                    </fieldset>
212
                    </fieldset>
189
213
190
214
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+1 lines)
Lines 920-925 Link Here
920
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
920
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
921
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
921
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
922
        var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
922
        var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
923
        var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
923
        var interface = "[% interface | html %]";
924
        var interface = "[% interface | html %]";
924
        var theme = "[% theme | html %]";
925
        var theme = "[% theme | html %]";
925
        var borrowernumber = "[% patron.borrowernumber | html %]";
926
        var borrowernumber = "[% patron.borrowernumber | html %]";
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-3 / +21 lines)
Lines 152-160 $(document).ready(function() { Link Here
152
                itemnumber:      itemnumber,
152
                itemnumber:      itemnumber,
153
                borrowernumber:  borrowernumber,
153
                borrowernumber:  borrowernumber,
154
                branchcode:      branchcode,
154
                branchcode:      branchcode,
155
                override_limit:  override_limit,
155
                override_limit:  override_limit
156
            };
156
            };
157
157
158
            if (UnseenRenewals) {
159
                var ren = $("#renew_as_unseen_checkbox");
160
                var renew_unseen = ren.length > 0 && ren.is(':checked') ? 1 : 0;
161
                params.seen = renew_unseen === 1 ? 0 : 1;
162
            }
163
158
            // Determine which due date we need to use
164
            // Determine which due date we need to use
159
            var dueDate = isOnReserve ?
165
            var dueDate = isOnReserve ?
160
                $("#newonholdduedate input").val() :
166
                $("#newonholdduedate input").val() :
Lines 177-182 $(document).ready(function() { Link Here
177
                        content += __("not checked out");
183
                        content += __("not checked out");
178
                    } else if ( data.error == "too_many" ) {
184
                    } else if ( data.error == "too_many" ) {
179
                        content += __("too many renewals");
185
                        content += __("too many renewals");
186
                    } else if ( data.error == "too_unseen" ) {
187
                        content += __("too many consecutive renewals without being seen by the library");
180
                    } else if ( data.error == "on_reserve" ) {
188
                    } else if ( data.error == "on_reserve" ) {
181
                        content += __("on hold");
189
                        content += __("on hold");
182
                    } else if ( data.error == "restriction" ) {
190
                    } else if ( data.error == "restriction" ) {
Lines 445-450 $(document).ready(function() { Link Here
445
                                    + __("Not renewable")
453
                                    + __("Not renewable")
446
                                    + "</span>";
454
                                    + "</span>";
447
455
456
                            span_style = "display: none";
457
                            span_class = "renewals-allowed";
458
                        } else if ( oObj.can_renew_error == "too_unseen" ) {
459
                            msg += "<span class='renewals-disabled'>"
460
                                    + __("Must be renewed at the library")
461
                                    + "</span>";
462
448
                            span_style = "display: none";
463
                            span_style = "display: none";
449
                            span_class = "renewals-allowed";
464
                            span_class = "renewals-allowed";
450
                        } else if ( oObj.can_renew_error == "restriction" ) {
465
                        } else if ( oObj.can_renew_error == "restriction" ) {
Lines 541-548 $(document).ready(function() { Link Here
541
                        }
556
                        }
542
                        content += msg;
557
                        content += msg;
543
                        if ( can_renew || can_force_renew ) {
558
                        if ( can_renew || can_force_renew ) {
544
                            content += "<span class='renewals'>("
559
                            content += "<span class='renewals'>(";
545
                                    + __("%s of %s renewals remaining").format(oObj.renewals_remaining, oObj.renewals_allowed)
560
                            content + __("%s of %s renewals remaining").format(oObj.renewals_remaining, oObj.renewals_allowed);
561
                            if (UnseenRenewals && oObj.unseen_allowed) {
562
                                content += __(" / %s of %s unseen renewals remaining").format(oObj.unseen_remaining, oObj.unseen_allowed);
563
                            }
546
                                    + ")</span>";
564
                                    + ")</span>";
547
                        }
565
                        }
548
566
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-6 / +38 lines)
Lines 95-100 Link Here
95
                                            <li>Your account has expired. Please contact the library for more information.</li>
95
                                            <li>Your account has expired. Please contact the library for more information.</li>
96
                                        [% ELSIF error == 'too_many' %]
96
                                        [% ELSIF error == 'too_many' %]
97
                                            <li>You have renewed this item the maximum number of times allowed.</li>
97
                                            <li>You have renewed this item the maximum number of times allowed.</li>
98
                                        [% ELSIF error == 'too_unseen' %]
99
                                            <li>You have renewed this item the maximum number of consecutive times without it being seen by the library.</li>
98
                                        [% ELSIF error == 'too_soon' %]
100
                                        [% ELSIF error == 'too_soon' %]
99
                                            <li>It is too soon after the checkout date for this item to be renewed.</li>
101
                                            <li>It is too soon after the checkout date for this item to be renewed.</li>
100
                                        [% ELSIF error == 'on_reserve' %]
102
                                        [% ELSIF error == 'on_reserve' %]
Lines 366-372 Link Here
366
                                                            [% IF ISSUE.itemtype_object.rentalcharge_hourly > 0 %]
368
                                                            [% IF ISSUE.itemtype_object.rentalcharge_hourly > 0 %]
367
                                                                <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_hourly | $Price %] per hour</span>
369
                                                                <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_hourly | $Price %] per hour</span>
368
                                                            [% END %]
370
                                                            [% END %]
369
                                                            <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
371
                                                            <span class="renewals">(
372
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
373
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
374
                                                                    / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
375
                                                                [% END %]
376
                                                            )</span>
370
                                                        [% ELSIF ( ISSUE.on_reserve ) %]
377
                                                        [% ELSIF ( ISSUE.on_reserve ) %]
371
                                                            Not renewable <span class="renewals">(on hold)</span>
378
                                                            Not renewable <span class="renewals">(on hold)</span>
372
                                                        [% ELSIF ( ISSUE.too_many ) %]
379
                                                        [% ELSIF ( ISSUE.too_many ) %]
Lines 377-392 Link Here
377
                                                            No longer renewable
384
                                                            No longer renewable
378
                                                        [% ELSIF ISSUE.auto_too_much_oweing %]
385
                                                        [% ELSIF ISSUE.auto_too_much_oweing %]
379
                                                            Automatic renewal failed, you have unpaid fines.
386
                                                            Automatic renewal failed, you have unpaid fines.
380
                                                            <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
387
                                                            <span class="renewals">(
388
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
389
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
390
                                                                    / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
391
                                                                [% END %]
392
                                                            )</span>
381
                                                        [% ELSIF ISSUE.auto_account_expired %]
393
                                                        [% ELSIF ISSUE.auto_account_expired %]
382
                                                            Automatic renewal failed, your account is expired.
394
                                                            Automatic renewal failed, your account is expired.
383
                                                            <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
395
                                                            <span class="renewals">(
396
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
397
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
398
                                                                    / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
399
                                                                [% END %]
400
                                                            )</span>
384
                                                        [% ELSIF ( ISSUE.too_soon ) %]
401
                                                        [% ELSIF ( ISSUE.too_soon ) %]
385
                                                            No renewal before [% ISSUE.soonestrenewdate | html %]
402
                                                            No renewal before [% ISSUE.soonestrenewdate | html %]
386
                                                            <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
403
                                                            <span class="renewals">(
404
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
405
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
406
                                                                    / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
407
                                                                [% END %]
408
                                                            )</span>
387
                                                        [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
409
                                                        [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
388
                                                            Automatic renewal
410
                                                            Automatic renewal
389
                                                            <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
411
                                                            <span class="renewals">(
412
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
413
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
414
                                                                    / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
415
                                                                [% END %]
416
                                                            )</span>
390
                                                        [% ELSIF ( ISSUE.item_denied_renewal ) %]
417
                                                        [% ELSIF ( ISSUE.item_denied_renewal ) %]
391
                                                            Renewal not allowed
418
                                                            Renewal not allowed
392
                                                        [% END %]
419
                                                        [% END %]
Lines 641-647 Link Here
641
                                                            [% IF ( canrenew ) %]
668
                                                            [% IF ( canrenew ) %]
642
                                                                <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber | uri %]&amp;bornum=[% OVERDUE.borrowernumber | uri %]">Renew</a>
669
                                                                <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber | uri %]&amp;bornum=[% OVERDUE.borrowernumber | uri %]">Renew</a>
643
                                                            [% END %]
670
                                                            [% END %]
644
                                                                <span class="renewals">([% OVERDUE.renewsleft | html %] of [% OVERDUE.renewsallowed | html %] renewals remaining)</span>
671
                                                                <span class="renewals">(
672
                                                                    [% OVERDUE.renewsleft | html %] of [% OVERDUE.renewsallowed | html %] renewals remaining
673
                                                                    [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
674
                                                                        / [% OVERDUE.unseenleft | html %] of [% OVERDUE.unseenallowed | html %] renewals left before the item must be seen by the library
675
                                                                    [% END %]
676
                                                                )</span>
645
                                                        [% ELSIF ( OVERDUE.norenew_overdue ) %]
677
                                                        [% ELSIF ( OVERDUE.norenew_overdue ) %]
646
                                                            Not allowed<span class="renewals">(overdue)</span>
678
                                                            Not allowed<span class="renewals">(overdue)</span>
647
                                                        [% ELSIF ( OVERDUE.onreserve ) %]
679
                                                        [% ELSIF ( OVERDUE.onreserve ) %]
(-)a/misc/cronjobs/automatic_renewals.pl (-1 / +1 lines)
Lines 95-101 while ( my $auto_renew = $auto_renews->next ) { Link Here
95
              $auto_renew->issue_id, $auto_renew->borrowernumber, $auto_renew->itemnumber;
95
              $auto_renew->issue_id, $auto_renew->borrowernumber, $auto_renew->itemnumber;
96
        }
96
        }
97
        if ($confirm){
97
        if ($confirm){
98
            my $date_due = AddRenewal( $auto_renew->borrowernumber, $auto_renew->itemnumber, $auto_renew->branchcode );
98
            my $date_due = AddRenewal( $auto_renew->borrowernumber, $auto_renew->itemnumber, $auto_renew->branchcode, undef, undef, 0 );
99
            $auto_renew->auto_renew_error(undef)->store;
99
            $auto_renew->auto_renew_error(undef)->store;
100
        }
100
        }
101
        push @{ $report{ $auto_renew->borrowernumber } }, $auto_renew;
101
        push @{ $report{ $auto_renew->borrowernumber } }, $auto_renew;
(-)a/offline_circ/download.pl (+1 lines)
Lines 67-72 my $issues_query = q{SELECT Link Here
67
    issues.date_due AS date_due,
67
    issues.date_due AS date_due,
68
    issues.issuedate AS issuedate,
68
    issues.issuedate AS issuedate,
69
    issues.renewals AS renewals,
69
    issues.renewals AS renewals,
70
    issues.unseen_renewals AS unseen_renewals,
70
    borrowers.cardnumber AS cardnumber,
71
    borrowers.cardnumber AS cardnumber,
71
    CONCAT(borrowers.surname, ', ', borrowers.firstname) AS borrower_name
72
    CONCAT(borrowers.surname, ', ', borrowers.firstname) AS borrower_name
72
    FROM issues
73
    FROM issues
(-)a/opac/opac-renew.pl (-1 / +1 lines)
Lines 62-68 else { Link Here
62
        my ( $status, $error ) =
62
        my ( $status, $error ) =
63
          CanBookBeRenewed( $borrowernumber, $itemnumber );
63
          CanBookBeRenewed( $borrowernumber, $itemnumber );
64
        if ( $status == 1 && $opacrenew == 1 ) {
64
        if ( $status == 1 && $opacrenew == 1 ) {
65
            AddRenewal( $borrowernumber, $itemnumber, undef, undef, undef );
65
            AddRenewal( $borrowernumber, $itemnumber, undef, undef, undef, undef, 0 );
66
            push( @renewed, $itemnumber );
66
            push( @renewed, $itemnumber );
67
        }
67
        }
68
        else {
68
        else {
(-)a/opac/opac-user.pl (-1 / +9 lines)
Lines 223-229 if ( $pending_checkouts->count ) { # Useless test Link Here
223
223
224
        # check if item is renewable
224
        # check if item is renewable
225
        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
225
        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
226
        ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
226
        (
227
            $issue->{'renewcount'},
228
            $issue->{'renewsallowed'},
229
            $issue->{'renewsleft'},
230
            $issue->{'unseencount'},
231
            $issue->{'unseenallowed'},
232
            $issue->{'unseenleft'}
233
        ) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
227
        ( $issue->{'renewalfee'}, $issue->{'renewalitemtype'} ) = GetIssuingCharges( $issue->{'itemnumber'}, $borrowernumber );
234
        ( $issue->{'renewalfee'}, $issue->{'renewalitemtype'} ) = GetIssuingCharges( $issue->{'itemnumber'}, $borrowernumber );
228
        $issue->{itemtype_object} = Koha::ItemTypes->find( Koha::Items->find( $issue->{itemnumber} )->effective_itemtype );
235
        $issue->{itemtype_object} = Koha::ItemTypes->find( Koha::Items->find( $issue->{itemnumber} )->effective_itemtype );
229
        if($status && C4::Context->preference("OpacRenewalAllowed")){
236
        if($status && C4::Context->preference("OpacRenewalAllowed")){
Lines 235-240 if ( $pending_checkouts->count ) { # Useless test Link Here
235
242
236
        if ($renewerror) {
243
        if ($renewerror) {
237
            $issue->{'too_many'}       = 1 if $renewerror eq 'too_many';
244
            $issue->{'too_many'}       = 1 if $renewerror eq 'too_many';
245
            $issue->{'too_unseen'}     = 1 if $renewerror eq 'too_unseen';
238
            $issue->{'on_reserve'}     = 1 if $renewerror eq 'on_reserve';
246
            $issue->{'on_reserve'}     = 1 if $renewerror eq 'on_reserve';
239
            $issue->{'norenew_overdue'} = 1 if $renewerror eq 'overdue';
247
            $issue->{'norenew_overdue'} = 1 if $renewerror eq 'overdue';
240
            $issue->{'auto_renew'}     = 1 if $renewerror eq 'auto_renew';
248
            $issue->{'auto_renew'}     = 1 if $renewerror eq 'auto_renew';
(-)a/svc/checkouts (-1 / +11 lines)
Lines 163-169 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
163
      )
163
      )
164
      : undef;
164
      : undef;
165
165
166
    my ( $renewals_count, $renewals_allowed, $renewals_remaining ) =
166
    my (
167
        $renewals_count,
168
        $renewals_allowed,
169
        $renewals_remaining,
170
        $unseen_count,
171
        $unseen_allowed,
172
        $unseen_remaining
173
    ) =
167
      GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} );
174
      GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} );
168
175
169
    my ( $itemtype, $recordtype, $type_for_stat );
176
    my ( $itemtype, $recordtype, $type_for_stat );
Lines 242-247 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
242
        renewals_count      => $renewals_count,
249
        renewals_count      => $renewals_count,
243
        renewals_allowed    => $renewals_allowed,
250
        renewals_allowed    => $renewals_allowed,
244
        renewals_remaining  => $renewals_remaining,
251
        renewals_remaining  => $renewals_remaining,
252
        unseen_count        => $unseen_count,
253
        unseen_allowed      => $unseen_allowed,
254
        unseen_remaining    => $unseen_remaining,
245
255
246
        return_claim_id         => $c->{return_claim_id},
256
        return_claim_id         => $c->{return_claim_id},
247
        return_claim_notes      => $c->{return_claim_notes},
257
        return_claim_notes      => $c->{return_claim_notes},
(-)a/svc/renew (-2 / +2 lines)
Lines 46-51 my $borrowernumber = $input->param('borrowernumber'); Link Here
46
my $override_limit = $input->param('override_limit');
46
my $override_limit = $input->param('override_limit');
47
my $branchcode     = $input->param('branchcode')
47
my $branchcode     = $input->param('branchcode')
48
  || C4::Context->userenv->{'branch'};
48
  || C4::Context->userenv->{'branch'};
49
my $seen           = $input->param('seen');
49
my $date_due;
50
my $date_due;
50
if ( $input->param('date_due') ) {
51
if ( $input->param('date_due') ) {
51
    $date_due = dt_from_string( scalar $input->param('date_due') );
52
    $date_due = dt_from_string( scalar $input->param('date_due') );
Lines 66-72 if ( $data->{error} && $data->{error} eq 'on_reserve' && C4::Context->preference Link Here
66
}
67
}
67
68
68
if ( $data->{renew_okay} ) {
69
if ( $data->{renew_okay} ) {
69
    $date_due = AddRenewal( $borrowernumber, $itemnumber, $branchcode, $date_due );
70
    $date_due = AddRenewal( $borrowernumber, $itemnumber, $branchcode, $date_due, undef, $seen );
70
    $data->{date_due} = output_pref( { dt => $date_due, as_due_date => 1 } );
71
    $data->{date_due} = output_pref( { dt => $date_due, as_due_date => 1 } );
71
}
72
}
72
73
73
- 

Return to bug 24083