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

(-)a/C4/Circulation.pm (-8 / +164 lines)
Lines 2690-2695 sub CanBookBeRenewed { Link Here
2690
                    'no_auto_renewal_after_hard_limit',
2690
                    'no_auto_renewal_after_hard_limit',
2691
                    'lengthunit',
2691
                    'lengthunit',
2692
                    'norenewalbefore',
2692
                    'norenewalbefore',
2693
                    'unseen_renewals_allowed'
2693
                ]
2694
                ]
2694
            }
2695
            }
2695
        );
2696
        );
Lines 2868-2879 sub CanBookBeRenewed { Link Here
2868
2869
2869
    return ( 0, "auto_renew" ) if $auto_renew eq "ok" && !$override_limit; # 0 if auto-renewal should not succeed
2870
    return ( 0, "auto_renew" ) if $auto_renew eq "ok" && !$override_limit; # 0 if auto-renewal should not succeed
2870
2871
2872
    return ( 1, undef ) if $override_limit;
2873
2874
    my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed );
2875
    my $issuing_rule = Koha::CirculationRules->get_effective_rules(
2876
        {
2877
            categorycode => $patron->categorycode,
2878
            itemtype     => $item->effective_itemtype,
2879
            branchcode   => $branchcode,
2880
            rules => [
2881
                'renewalsallowed',
2882
                'no_auto_renewal_after',
2883
                'no_auto_renewal_after_hard_limit',
2884
                'lengthunit',
2885
                'norenewalbefore',
2886
                'unseen_renewals_allowed'
2887
            ]
2888
        }
2889
    );
2890
2891
    return ( 0, "too_many" )
2892
      if not $issuing_rule->{renewalsallowed} or $issuing_rule->{renewalsallowed} <= $issue->renewals;
2893
2894
    return ( 0, "too_unseen" )
2895
      if C4::Context->preference('UnseenRenewals') &&
2896
        $issuing_rule->{unseen_renewals_allowed} &&
2897
        $issuing_rule->{unseen_renewals_allowed} <= $issue->unseen_renewals;
2898
2899
    my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing');
2900
    my $restrictionblockrenewing = C4::Context->preference('RestrictionBlockRenewing');
2901
    $patron         = Koha::Patrons->find($borrowernumber); # FIXME Is this really useful?
2902
    my $restricted  = $patron->is_debarred;
2903
    my $hasoverdues = $patron->has_overdues;
2904
2905
    if ( $restricted and $restrictionblockrenewing ) {
2906
        return ( 0, 'restriction');
2907
    } elsif ( ($hasoverdues and $overduesblockrenewing eq 'block') || ($issue->is_overdue and $overduesblockrenewing eq 'blockitem') ) {
2908
        return ( 0, 'overdue');
2909
    }
2910
2911
    if ( $issue->auto_renew ) {
2912
2913
        if ( $patron->category->effective_BlockExpiredPatronOpacActions and $patron->is_expired ) {
2914
            return ( 0, 'auto_account_expired' );
2915
        }
2916
2917
        if ( defined $issuing_rule->{no_auto_renewal_after}
2918
                and $issuing_rule->{no_auto_renewal_after} ne "" ) {
2919
            # Get issue_date and add no_auto_renewal_after
2920
            # If this is greater than today, it's too late for renewal.
2921
            my $maximum_renewal_date = dt_from_string($issue->issuedate, 'sql');
2922
            $maximum_renewal_date->add(
2923
                $issuing_rule->{lengthunit} => $issuing_rule->{no_auto_renewal_after}
2924
            );
2925
            my $now = dt_from_string;
2926
            if ( $now >= $maximum_renewal_date ) {
2927
                return ( 0, "auto_too_late" );
2928
            }
2929
        }
2930
        if ( defined $issuing_rule->{no_auto_renewal_after_hard_limit}
2931
                      and $issuing_rule->{no_auto_renewal_after_hard_limit} ne "" ) {
2932
            # If no_auto_renewal_after_hard_limit is >= today, it's also too late for renewal
2933
            if ( dt_from_string >= dt_from_string( $issuing_rule->{no_auto_renewal_after_hard_limit} ) ) {
2934
                return ( 0, "auto_too_late" );
2935
            }
2936
        }
2937
2938
        if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) {
2939
            my $fine_no_renewals = C4::Context->preference("OPACFineNoRenewals");
2940
            my $amountoutstanding =
2941
              C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
2942
              ? $patron->account->balance
2943
              : $patron->account->outstanding_debits->total_outstanding;
2944
            if ( $amountoutstanding and $amountoutstanding > $fine_no_renewals ) {
2945
                return ( 0, "auto_too_much_oweing" );
2946
            }
2947
        }
2948
    }
2949
2950
    if ( defined $issuing_rule->{norenewalbefore}
2951
        and $issuing_rule->{norenewalbefore} ne "" )
2952
    {
2953
2954
        # Calculate soonest renewal by subtracting 'No renewal before' from due date
2955
        my $soonestrenewal = dt_from_string( $issue->date_due, 'sql' )->subtract(
2956
            $issuing_rule->{lengthunit} => $issuing_rule->{norenewalbefore} );
2957
2958
        # Depending on syspref reset the exact time, only check the date
2959
        if ( C4::Context->preference('NoRenewalBeforePrecision') eq 'date'
2960
            and $issuing_rule->{lengthunit} eq 'days' )
2961
        {
2962
            $soonestrenewal->truncate( to => 'day' );
2963
        }
2964
2965
        if ( $soonestrenewal > DateTime->now( time_zone => C4::Context->tz() ) )
2966
        {
2967
            return ( 0, "auto_too_soon" ) if $issue->auto_renew;
2968
            return ( 0, "too_soon" );
2969
        }
2970
        elsif ( $issue->auto_renew ) {
2971
            return ( 0, "auto_renew" );
2972
        }
2973
    }
2974
2975
    # Fallback for automatic renewals:
2976
    # If norenewalbefore is undef, don't renew before due date.
2977
    if ( $issue->auto_renew ) {
2978
        my $now = dt_from_string;
2979
        return ( 0, "auto_renew" )
2980
          if $now >= dt_from_string( $issue->date_due, 'sql' );
2981
        return ( 0, "auto_too_soon" );
2982
    }
2983
2871
    return ( 1, undef );
2984
    return ( 1, undef );
2872
}
2985
}
2873
2986
2874
=head2 AddRenewal
2987
=head2 AddRenewal
2875
2988
2876
  &AddRenewal($borrowernumber, $itemnumber, $branch, [$datedue], [$lastreneweddate]);
2989
  &AddRenewal($borrowernumber, $itemnumber, $branch, [$datedue], [$lastreneweddate], [$seen]);
2877
2990
2878
Renews a loan.
2991
Renews a loan.
2879
2992
Lines 2898-2903 syspref) Link Here
2898
If C<$datedue> is the empty string, C<&AddRenewal> will calculate the due date automatically
3011
If C<$datedue> is the empty string, C<&AddRenewal> will calculate the due date automatically
2899
from the book's item type.
3012
from the book's item type.
2900
3013
3014
C<$seen> is a boolean flag indicating if the item was seen or not during the renewal. This
3015
informs the incrementing of the unseen_renewals column. If this flag is not supplied, we
3016
fallback to a true value
3017
2901
=cut
3018
=cut
2902
3019
2903
sub AddRenewal {
3020
sub AddRenewal {
Lines 2907-2912 sub AddRenewal { Link Here
2907
    my $datedue         = shift;
3024
    my $datedue         = shift;
2908
    my $lastreneweddate = shift || dt_from_string();
3025
    my $lastreneweddate = shift || dt_from_string();
2909
    my $skipfinecalc    = shift;
3026
    my $skipfinecalc    = shift;
3027
    my $seen            = shift;
3028
3029
    # Fallback on a 'seen' renewal
3030
    $seen = defined $seen && $seen == 0 ? 0 : 1;
2910
3031
2911
    my $item_object   = Koha::Items->find($itemnumber) or return;
3032
    my $item_object   = Koha::Items->find($itemnumber) or return;
2912
    my $biblio = $item_object->biblio;
3033
    my $biblio = $item_object->biblio;
Lines 2959-2973 sub AddRenewal { Link Here
2959
            }
3080
            }
2960
        );
3081
        );
2961
3082
3083
        # Increment the unseen renewals, if appropriate
3084
        # We only do so if the syspref is enabled and
3085
        # a maximum value has been set in the circ rules
3086
        my $unseen_renewals = $issue->unseen_renewals;
3087
        if (C4::Context->preference('UnseenRenewals')) {
3088
            my $rule = Koha::CirculationRules->get_effective_rule(
3089
                {   categorycode => $patron->categorycode,
3090
                    itemtype     => $item_object->effective_itemtype,
3091
                    branchcode   => $circ_library->branchcode,
3092
                    rule_name    => 'unseen_renewals_allowed'
3093
                }
3094
            );
3095
            if (!$seen && $rule && $rule->rule_value) {
3096
                $unseen_renewals++;
3097
            } else {
3098
                # If the renewal is seen, unseen should revert to 0
3099
                $unseen_renewals = 0;
3100
            }
3101
        }
3102
2962
        # Update the issues record to have the new due date, and a new count
3103
        # Update the issues record to have the new due date, and a new count
2963
        # of how many times it has been renewed.
3104
        # of how many times it has been renewed.
2964
        my $renews = ( $issue->renewals || 0 ) + 1;
3105
        my $renews = ( $issue->renewals || 0 ) + 1;
2965
        my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, lastreneweddate = ?
3106
        my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, unseen_renewals = ?, lastreneweddate = ?
2966
                                WHERE borrowernumber=?
3107
                                WHERE borrowernumber=?
2967
                                AND itemnumber=?"
3108
                                AND itemnumber=?"
2968
        );
3109
        );
2969
3110
2970
        $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $lastreneweddate, $borrowernumber, $itemnumber );
3111
        $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $unseen_renewals, $lastreneweddate, $borrowernumber, $itemnumber );
2971
3112
2972
        # Update the renewal count on the item, and tell zebra to reindex
3113
        # Update the renewal count on the item, and tell zebra to reindex
2973
        $renews = ( $item_object->renewals || 0 ) + 1;
3114
        $renews = ( $item_object->renewals || 0 ) + 1;
Lines 3054-3061 sub GetRenewCount { Link Here
3054
    my ( $bornum, $itemno ) = @_;
3195
    my ( $bornum, $itemno ) = @_;
3055
    my $dbh           = C4::Context->dbh;
3196
    my $dbh           = C4::Context->dbh;
3056
    my $renewcount    = 0;
3197
    my $renewcount    = 0;
3198
    my $unseencount    = 0;
3057
    my $renewsallowed = 0;
3199
    my $renewsallowed = 0;
3200
    my $unseenallowed = 0;
3058
    my $renewsleft    = 0;
3201
    my $renewsleft    = 0;
3202
    my $unseenleft    = 0;
3059
3203
3060
    my $patron = Koha::Patrons->find( $bornum );
3204
    my $patron = Koha::Patrons->find( $bornum );
3061
    my $item   = Koha::Items->find($itemno);
3205
    my $item   = Koha::Items->find($itemno);
Lines 3074-3095 sub GetRenewCount { Link Here
3074
    $sth->execute( $bornum, $itemno );
3218
    $sth->execute( $bornum, $itemno );
3075
    my $data = $sth->fetchrow_hashref;
3219
    my $data = $sth->fetchrow_hashref;
3076
    $renewcount = $data->{'renewals'} if $data->{'renewals'};
3220
    $renewcount = $data->{'renewals'} if $data->{'renewals'};
3221
    $unseencount = $data->{'unseen_renewals'} if $data->{'unseen_renewals'};
3077
    # $item and $borrower should be calculated
3222
    # $item and $borrower should be calculated
3078
    my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed);
3223
    my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed);
3079
3224
3080
    my $rule = Koha::CirculationRules->get_effective_rule(
3225
    my $rules = Koha::CirculationRules->get_effective_rules(
3081
        {
3226
        {
3082
            categorycode => $patron->categorycode,
3227
            categorycode => $patron->categorycode,
3083
            itemtype     => $item->effective_itemtype,
3228
            itemtype     => $item->effective_itemtype,
3084
            branchcode   => $branchcode,
3229
            branchcode   => $branchcode,
3085
            rule_name    => 'renewalsallowed',
3230
            rules        => [ 'renewalsallowed', 'unseen_renewals_allowed' ]
3086
        }
3231
        }
3087
    );
3232
    );
3088
3233
    $renewsallowed = $rules ? $rules->{renewalsallowed} : 0;
3089
    $renewsallowed = $rule ? $rule->rule_value : 0;
3234
    $unseenallowed = $rules->{unseen_renewals_allowed} ?
3235
        $rules->{unseen_renewals_allowed} :
3236
        0;
3090
    $renewsleft    = $renewsallowed - $renewcount;
3237
    $renewsleft    = $renewsallowed - $renewcount;
3238
    $unseenleft    = $unseenallowed - $unseencount;
3091
    if($renewsleft < 0){ $renewsleft = 0; }
3239
    if($renewsleft < 0){ $renewsleft = 0; }
3092
    return ( $renewcount, $renewsallowed, $renewsleft );
3240
    if($unseenleft < 0){ $unseenleft = 0; }
3241
    return (
3242
        $renewcount,
3243
        $renewsallowed,
3244
        $renewsleft,
3245
        $unseencount,
3246
        $unseenallowed,
3247
        $unseenleft
3248
    );
3093
}
3249
}
3094
3250
3095
=head2 GetSoonestRenewDate
3251
=head2 GetSoonestRenewDate
(-)a/C4/ILSDI/Services.pm (-1 / +1 lines)
Lines 655-661 sub RenewLoan { Link Here
655
655
656
    # Add renewal if possible
656
    # Add renewal if possible
657
    my @renewal = CanBookBeRenewed( $borrowernumber, $itemnumber );
657
    my @renewal = CanBookBeRenewed( $borrowernumber, $itemnumber );
658
    if ( $renewal[0] ) { AddRenewal( $borrowernumber, $itemnumber ); }
658
    if ( $renewal[0] ) { AddRenewal( $borrowernumber, $itemnumber, undef, undef, undef, 0 ); }
659
659
660
    my $issue = $item->checkout;
660
    my $issue = $item->checkout;
661
    return unless $issue; # FIXME should be handled
661
    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 35-40 Link Here
35
      "type": ["integer", "null"],
35
      "type": ["integer", "null"],
36
      "description": "Number of renewals"
36
      "description": "Number of renewals"
37
    },
37
    },
38
    "unseen_renewals": {
39
      "type": ["integer", "null"],
40
      "description": "Number of consecutive unseen renewals"
41
    },
38
    "auto_renew": {
42
    "auto_renew": {
39
      "type": "boolean",
43
      "type": "boolean",
40
      "description": "Auto renewal"
44
      "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 81-89 Link Here
81
      "x-mojo-to": "Checkouts#renew",
81
      "x-mojo-to": "Checkouts#renew",
82
      "operationId": "renewCheckout",
82
      "operationId": "renewCheckout",
83
      "tags": ["patrons", "checkouts"],
83
      "tags": ["patrons", "checkouts"],
84
      "parameters": [{
84
      "parameters": [
85
        "$ref": "../parameters.json#/checkout_id_pp"
85
        { "$ref": "../parameters.json#/checkout_id_pp" },
86
      }],
86
        { "$ref": "../parameters.json#/seen_pp" }
87
      ],
87
      "produces": ["application/json"],
88
      "produces": ["application/json"],
88
      "responses": {
89
      "responses": {
89
        "201": {
90
        "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 2483-2488 li { Link Here
2483
    position: relative;
2487
    position: relative;
2484
}
2488
}
2485
2489
2490
#renew_as_unseen_label {
2491
    margin-left: 1em;
2492
}
2493
2494
#renew_as_unseen_checkbox {
2495
    margin-right: 1em;
2496
}
2497
2486
#clearscreen {
2498
#clearscreen {
2487
    position: absolute;
2499
    position: absolute;
2488
    right: 0;
2500
    right: 0;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc (+4 lines)
Lines 48-53 Link Here
48
                        [% END %]
48
                        [% END %]
49
                    [% END %]
49
                    [% END %]
50
                    [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
50
                    [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
51
                        [% IF Koha.Preference( 'UnseenRenewals' ) %]
52
                            <label id="renew_as_unseen_label" for="override_limit">Renew as &quot;unseen&quot; if appropriate:</label>
53
                            <input type="checkbox" name="renew_as_unseen" id="renew_as_unseen_checkbox" value="1" />
54
                        [% END %]
51
                        <button class="btn btn-default" id="RenewCheckinChecked"><i class="fa fa-check"></i> Renew or check in selected items</button>
55
                        <button class="btn btn-default" id="RenewCheckinChecked"><i class="fa fa-check"></i> Renew or check in selected items</button>
52
                        <button class="btn btn-default" id="RenewAll"><i class="fa fa-book"></i> Renew all</button>
56
                        <button class="btn btn-default" id="RenewAll"><i class="fa fa-book"></i> Renew all</button>
53
                    [% END %]
57
                    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 1079-1084 Link Here
1079
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1079
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1080
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1080
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1081
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
1081
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
1082
        var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
1082
        var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
1083
        var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
1083
        var interface = "[% interface | html %]";
1084
        var interface = "[% interface | html %]";
1084
        var theme = "[% theme | html %]";
1085
        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 924-929 Link Here
924
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
924
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
925
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
925
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
926
        var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
926
        var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
927
        var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
927
        var interface = "[% interface | html %]";
928
        var interface = "[% interface | html %]";
928
        var theme = "[% theme | html %]";
929
        var theme = "[% theme | html %]";
929
        var borrowernumber = "[% patron.borrowernumber | html %]";
930
        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 440-445 $(document).ready(function() { Link Here
440
                                    + __("Not renewable")
448
                                    + __("Not renewable")
441
                                    + "</span>";
449
                                    + "</span>";
442
450
451
                            span_style = "display: none";
452
                            span_class = "renewals-allowed";
453
                        } else if ( oObj.can_renew_error == "too_unseen" ) {
454
                            msg += "<span class='renewals-disabled'>"
455
                                    + __("Must be renewed at the library")
456
                                    + "</span>";
457
443
                            span_style = "display: none";
458
                            span_style = "display: none";
444
                            span_class = "renewals-allowed";
459
                            span_class = "renewals-allowed";
445
                        } else if ( oObj.can_renew_error == "restriction" ) {
460
                        } else if ( oObj.can_renew_error == "restriction" ) {
Lines 536-543 $(document).ready(function() { Link Here
536
                        }
551
                        }
537
                        content += msg;
552
                        content += msg;
538
                        if ( can_renew || can_force_renew ) {
553
                        if ( can_renew || can_force_renew ) {
539
                            content += "<span class='renewals'>("
554
                            content += "<span class='renewals'>(";
540
                                    + __("%s of %s renewals remaining").format(oObj.renewals_remaining, oObj.renewals_allowed)
555
                            content + __("%s of %s renewals remaining").format(oObj.renewals_remaining, oObj.renewals_allowed);
556
                            if (UnseenRenewals && oObj.unseen_allowed) {
557
                                content += __(" / %s of %s unseen renewals remaining").format(oObj.unseen_remaining, oObj.unseen_allowed);
558
                            }
541
                                    + ")</span>";
559
                                    + ")</span>";
542
                        }
560
                        }
543
561
(-)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 162-168 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
162
      )
162
      )
163
      : undef;
163
      : undef;
164
164
165
    my ( $renewals_count, $renewals_allowed, $renewals_remaining ) =
165
    my (
166
        $renewals_count,
167
        $renewals_allowed,
168
        $renewals_remaining,
169
        $unseen_count,
170
        $unseen_allowed,
171
        $unseen_remaining
172
    ) =
166
      GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} );
173
      GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} );
167
174
168
    my ( $itemtype, $recordtype, $type_for_stat );
175
    my ( $itemtype, $recordtype, $type_for_stat );
Lines 240-245 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
240
        renewals_count      => $renewals_count,
247
        renewals_count      => $renewals_count,
241
        renewals_allowed    => $renewals_allowed,
248
        renewals_allowed    => $renewals_allowed,
242
        renewals_remaining  => $renewals_remaining,
249
        renewals_remaining  => $renewals_remaining,
250
        unseen_count        => $unseen_count,
251
        unseen_allowed      => $unseen_allowed,
252
        unseen_remaining    => $unseen_remaining,
243
253
244
        return_claim_id         => $c->{return_claim_id},
254
        return_claim_id         => $c->{return_claim_id},
245
        return_claim_notes      => $c->{return_claim_notes},
255
        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