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

(-)a/C4/Circulation.pm (-8 / +164 lines)
Lines 2701-2706 sub CanBookBeRenewed { Link Here
2701
                    'no_auto_renewal_after_hard_limit',
2701
                    'no_auto_renewal_after_hard_limit',
2702
                    'lengthunit',
2702
                    'lengthunit',
2703
                    'norenewalbefore',
2703
                    'norenewalbefore',
2704
                    'unseen_renewals_allowed'
2704
                ]
2705
                ]
2705
            }
2706
            }
2706
        );
2707
        );
Lines 2879-2890 sub CanBookBeRenewed { Link Here
2879
2880
2880
    return ( 0, "auto_renew" ) if $auto_renew eq "ok" && !$override_limit; # 0 if auto-renewal should not succeed
2881
    return ( 0, "auto_renew" ) if $auto_renew eq "ok" && !$override_limit; # 0 if auto-renewal should not succeed
2881
2882
2883
    return ( 1, undef ) if $override_limit;
2884
2885
    my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed );
2886
    my $issuing_rule = Koha::CirculationRules->get_effective_rules(
2887
        {
2888
            categorycode => $patron->categorycode,
2889
            itemtype     => $item->effective_itemtype,
2890
            branchcode   => $branchcode,
2891
            rules => [
2892
                'renewalsallowed',
2893
                'no_auto_renewal_after',
2894
                'no_auto_renewal_after_hard_limit',
2895
                'lengthunit',
2896
                'norenewalbefore',
2897
                'unseen_renewals_allowed'
2898
            ]
2899
        }
2900
    );
2901
2902
    return ( 0, "too_many" )
2903
      if not $issuing_rule->{renewalsallowed} or $issuing_rule->{renewalsallowed} <= $issue->renewals;
2904
2905
    return ( 0, "too_unseen" )
2906
      if C4::Context->preference('UnseenRenewals') &&
2907
        $issuing_rule->{unseen_renewals_allowed} &&
2908
        $issuing_rule->{unseen_renewals_allowed} <= $issue->unseen_renewals;
2909
2910
    my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing');
2911
    my $restrictionblockrenewing = C4::Context->preference('RestrictionBlockRenewing');
2912
    $patron         = Koha::Patrons->find($borrowernumber); # FIXME Is this really useful?
2913
    my $restricted  = $patron->is_debarred;
2914
    my $hasoverdues = $patron->has_overdues;
2915
2916
    if ( $restricted and $restrictionblockrenewing ) {
2917
        return ( 0, 'restriction');
2918
    } elsif ( ($hasoverdues and $overduesblockrenewing eq 'block') || ($issue->is_overdue and $overduesblockrenewing eq 'blockitem') ) {
2919
        return ( 0, 'overdue');
2920
    }
2921
2922
    if ( $issue->auto_renew ) {
2923
2924
        if ( $patron->category->effective_BlockExpiredPatronOpacActions and $patron->is_expired ) {
2925
            return ( 0, 'auto_account_expired' );
2926
        }
2927
2928
        if ( defined $issuing_rule->{no_auto_renewal_after}
2929
                and $issuing_rule->{no_auto_renewal_after} ne "" ) {
2930
            # Get issue_date and add no_auto_renewal_after
2931
            # If this is greater than today, it's too late for renewal.
2932
            my $maximum_renewal_date = dt_from_string($issue->issuedate, 'sql');
2933
            $maximum_renewal_date->add(
2934
                $issuing_rule->{lengthunit} => $issuing_rule->{no_auto_renewal_after}
2935
            );
2936
            my $now = dt_from_string;
2937
            if ( $now >= $maximum_renewal_date ) {
2938
                return ( 0, "auto_too_late" );
2939
            }
2940
        }
2941
        if ( defined $issuing_rule->{no_auto_renewal_after_hard_limit}
2942
                      and $issuing_rule->{no_auto_renewal_after_hard_limit} ne "" ) {
2943
            # If no_auto_renewal_after_hard_limit is >= today, it's also too late for renewal
2944
            if ( dt_from_string >= dt_from_string( $issuing_rule->{no_auto_renewal_after_hard_limit} ) ) {
2945
                return ( 0, "auto_too_late" );
2946
            }
2947
        }
2948
2949
        if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) {
2950
            my $fine_no_renewals = C4::Context->preference("OPACFineNoRenewals");
2951
            my $amountoutstanding =
2952
              C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
2953
              ? $patron->account->balance
2954
              : $patron->account->outstanding_debits->total_outstanding;
2955
            if ( $amountoutstanding and $amountoutstanding > $fine_no_renewals ) {
2956
                return ( 0, "auto_too_much_oweing" );
2957
            }
2958
        }
2959
    }
2960
2961
    if ( defined $issuing_rule->{norenewalbefore}
2962
        and $issuing_rule->{norenewalbefore} ne "" )
2963
    {
2964
2965
        # Calculate soonest renewal by subtracting 'No renewal before' from due date
2966
        my $soonestrenewal = dt_from_string( $issue->date_due, 'sql' )->subtract(
2967
            $issuing_rule->{lengthunit} => $issuing_rule->{norenewalbefore} );
2968
2969
        # Depending on syspref reset the exact time, only check the date
2970
        if ( C4::Context->preference('NoRenewalBeforePrecision') eq 'date'
2971
            and $issuing_rule->{lengthunit} eq 'days' )
2972
        {
2973
            $soonestrenewal->truncate( to => 'day' );
2974
        }
2975
2976
        if ( $soonestrenewal > DateTime->now( time_zone => C4::Context->tz() ) )
2977
        {
2978
            return ( 0, "auto_too_soon" ) if $issue->auto_renew;
2979
            return ( 0, "too_soon" );
2980
        }
2981
        elsif ( $issue->auto_renew ) {
2982
            return ( 0, "auto_renew" );
2983
        }
2984
    }
2985
2986
    # Fallback for automatic renewals:
2987
    # If norenewalbefore is undef, don't renew before due date.
2988
    if ( $issue->auto_renew ) {
2989
        my $now = dt_from_string;
2990
        return ( 0, "auto_renew" )
2991
          if $now >= dt_from_string( $issue->date_due, 'sql' );
2992
        return ( 0, "auto_too_soon" );
2993
    }
2994
2882
    return ( 1, undef );
2995
    return ( 1, undef );
2883
}
2996
}
2884
2997
2885
=head2 AddRenewal
2998
=head2 AddRenewal
2886
2999
2887
  &AddRenewal($borrowernumber, $itemnumber, $branch, [$datedue], [$lastreneweddate]);
3000
  &AddRenewal($borrowernumber, $itemnumber, $branch, [$datedue], [$lastreneweddate], [$seen]);
2888
3001
2889
Renews a loan.
3002
Renews a loan.
2890
3003
Lines 2909-2914 syspref) Link Here
2909
If C<$datedue> is the empty string, C<&AddRenewal> will calculate the due date automatically
3022
If C<$datedue> is the empty string, C<&AddRenewal> will calculate the due date automatically
2910
from the book's item type.
3023
from the book's item type.
2911
3024
3025
C<$seen> is a boolean flag indicating if the item was seen or not during the renewal. This
3026
informs the incrementing of the unseen_renewals column. If this flag is not supplied, we
3027
fallback to a true value
3028
2912
=cut
3029
=cut
2913
3030
2914
sub AddRenewal {
3031
sub AddRenewal {
Lines 2918-2923 sub AddRenewal { Link Here
2918
    my $datedue         = shift;
3035
    my $datedue         = shift;
2919
    my $lastreneweddate = shift || dt_from_string();
3036
    my $lastreneweddate = shift || dt_from_string();
2920
    my $skipfinecalc    = shift;
3037
    my $skipfinecalc    = shift;
3038
    my $seen            = shift;
3039
3040
    # Fallback on a 'seen' renewal
3041
    $seen = defined $seen && $seen == 0 ? 0 : 1;
2921
3042
2922
    my $item_object   = Koha::Items->find($itemnumber) or return;
3043
    my $item_object   = Koha::Items->find($itemnumber) or return;
2923
    my $biblio = $item_object->biblio;
3044
    my $biblio = $item_object->biblio;
Lines 2970-2984 sub AddRenewal { Link Here
2970
            }
3091
            }
2971
        );
3092
        );
2972
3093
3094
        # Increment the unseen renewals, if appropriate
3095
        # We only do so if the syspref is enabled and
3096
        # a maximum value has been set in the circ rules
3097
        my $unseen_renewals = $issue->unseen_renewals;
3098
        if (C4::Context->preference('UnseenRenewals')) {
3099
            my $rule = Koha::CirculationRules->get_effective_rule(
3100
                {   categorycode => $patron->categorycode,
3101
                    itemtype     => $item_object->effective_itemtype,
3102
                    branchcode   => $circ_library->branchcode,
3103
                    rule_name    => 'unseen_renewals_allowed'
3104
                }
3105
            );
3106
            if (!$seen && $rule && $rule->rule_value) {
3107
                $unseen_renewals++;
3108
            } else {
3109
                # If the renewal is seen, unseen should revert to 0
3110
                $unseen_renewals = 0;
3111
            }
3112
        }
3113
2973
        # Update the issues record to have the new due date, and a new count
3114
        # Update the issues record to have the new due date, and a new count
2974
        # of how many times it has been renewed.
3115
        # of how many times it has been renewed.
2975
        my $renews = ( $issue->renewals || 0 ) + 1;
3116
        my $renews = ( $issue->renewals || 0 ) + 1;
2976
        my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, lastreneweddate = ?
3117
        my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, unseen_renewals = ?, lastreneweddate = ?
2977
                                WHERE borrowernumber=?
3118
                                WHERE borrowernumber=?
2978
                                AND itemnumber=?"
3119
                                AND itemnumber=?"
2979
        );
3120
        );
2980
3121
2981
        $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $lastreneweddate, $borrowernumber, $itemnumber );
3122
        $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $unseen_renewals, $lastreneweddate, $borrowernumber, $itemnumber );
2982
3123
2983
        # Update the renewal count on the item, and tell zebra to reindex
3124
        # Update the renewal count on the item, and tell zebra to reindex
2984
        $renews = ( $item_object->renewals || 0 ) + 1;
3125
        $renews = ( $item_object->renewals || 0 ) + 1;
Lines 3065-3072 sub GetRenewCount { Link Here
3065
    my ( $bornum, $itemno ) = @_;
3206
    my ( $bornum, $itemno ) = @_;
3066
    my $dbh           = C4::Context->dbh;
3207
    my $dbh           = C4::Context->dbh;
3067
    my $renewcount    = 0;
3208
    my $renewcount    = 0;
3209
    my $unseencount    = 0;
3068
    my $renewsallowed = 0;
3210
    my $renewsallowed = 0;
3211
    my $unseenallowed = 0;
3069
    my $renewsleft    = 0;
3212
    my $renewsleft    = 0;
3213
    my $unseenleft    = 0;
3070
3214
3071
    my $patron = Koha::Patrons->find( $bornum );
3215
    my $patron = Koha::Patrons->find( $bornum );
3072
    my $item   = Koha::Items->find($itemno);
3216
    my $item   = Koha::Items->find($itemno);
Lines 3085-3106 sub GetRenewCount { Link Here
3085
    $sth->execute( $bornum, $itemno );
3229
    $sth->execute( $bornum, $itemno );
3086
    my $data = $sth->fetchrow_hashref;
3230
    my $data = $sth->fetchrow_hashref;
3087
    $renewcount = $data->{'renewals'} if $data->{'renewals'};
3231
    $renewcount = $data->{'renewals'} if $data->{'renewals'};
3232
    $unseencount = $data->{'unseen_renewals'} if $data->{'unseen_renewals'};
3088
    # $item and $borrower should be calculated
3233
    # $item and $borrower should be calculated
3089
    my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed);
3234
    my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed);
3090
3235
3091
    my $rule = Koha::CirculationRules->get_effective_rule(
3236
    my $rules = Koha::CirculationRules->get_effective_rules(
3092
        {
3237
        {
3093
            categorycode => $patron->categorycode,
3238
            categorycode => $patron->categorycode,
3094
            itemtype     => $item->effective_itemtype,
3239
            itemtype     => $item->effective_itemtype,
3095
            branchcode   => $branchcode,
3240
            branchcode   => $branchcode,
3096
            rule_name    => 'renewalsallowed',
3241
            rules        => [ 'renewalsallowed', 'unseen_renewals_allowed' ]
3097
        }
3242
        }
3098
    );
3243
    );
3099
3244
    $renewsallowed = $rules ? $rules->{renewalsallowed} : 0;
3100
    $renewsallowed = $rule ? $rule->rule_value : 0;
3245
    $unseenallowed = $rules->{unseen_renewals_allowed} ?
3246
        $rules->{unseen_renewals_allowed} :
3247
        0;
3101
    $renewsleft    = $renewsallowed - $renewcount;
3248
    $renewsleft    = $renewsallowed - $renewcount;
3249
    $unseenleft    = $unseenallowed - $unseencount;
3102
    if($renewsleft < 0){ $renewsleft = 0; }
3250
    if($renewsleft < 0){ $renewsleft = 0; }
3103
    return ( $renewcount, $renewsallowed, $renewsleft );
3251
    if($unseenleft < 0){ $unseenleft = 0; }
3252
    return (
3253
        $renewcount,
3254
        $renewsallowed,
3255
        $renewsleft,
3256
        $unseencount,
3257
        $unseenallowed,
3258
        $unseenleft
3259
    );
3104
}
3260
}
3105
3261
3106
=head2 GetSoonestRenewDate
3262
=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 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 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