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

(-)a/C4/Circulation.pm (-8 / +164 lines)
Lines 2671-2676 sub CanBookBeRenewed { Link Here
2671
                    'no_auto_renewal_after_hard_limit',
2671
                    'no_auto_renewal_after_hard_limit',
2672
                    'lengthunit',
2672
                    'lengthunit',
2673
                    'norenewalbefore',
2673
                    'norenewalbefore',
2674
                    'unseen_renewals_allowed'
2674
                ]
2675
                ]
2675
            }
2676
            }
2676
        );
2677
        );
Lines 2849-2860 sub CanBookBeRenewed { Link Here
2849
2850
2850
    return ( 0, "auto_renew" ) if $auto_renew eq "ok" && !$override_limit; # 0 if auto-renewal should not succeed
2851
    return ( 0, "auto_renew" ) if $auto_renew eq "ok" && !$override_limit; # 0 if auto-renewal should not succeed
2851
2852
2853
    return ( 1, undef ) if $override_limit;
2854
2855
    my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed );
2856
    my $issuing_rule = Koha::CirculationRules->get_effective_rules(
2857
        {
2858
            categorycode => $patron->categorycode,
2859
            itemtype     => $item->effective_itemtype,
2860
            branchcode   => $branchcode,
2861
            rules => [
2862
                'renewalsallowed',
2863
                'no_auto_renewal_after',
2864
                'no_auto_renewal_after_hard_limit',
2865
                'lengthunit',
2866
                'norenewalbefore',
2867
                'unseen_renewals_allowed'
2868
            ]
2869
        }
2870
    );
2871
2872
    return ( 0, "too_many" )
2873
      if not $issuing_rule->{renewalsallowed} or $issuing_rule->{renewalsallowed} <= $issue->renewals;
2874
2875
    return ( 0, "too_unseen" )
2876
      if C4::Context->preference('UnseenRenewals') &&
2877
        $issuing_rule->{unseen_renewals_allowed} &&
2878
        $issuing_rule->{unseen_renewals_allowed} <= $issue->unseen_renewals;
2879
2880
    my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing');
2881
    my $restrictionblockrenewing = C4::Context->preference('RestrictionBlockRenewing');
2882
    $patron         = Koha::Patrons->find($borrowernumber); # FIXME Is this really useful?
2883
    my $restricted  = $patron->is_debarred;
2884
    my $hasoverdues = $patron->has_overdues;
2885
2886
    if ( $restricted and $restrictionblockrenewing ) {
2887
        return ( 0, 'restriction');
2888
    } elsif ( ($hasoverdues and $overduesblockrenewing eq 'block') || ($issue->is_overdue and $overduesblockrenewing eq 'blockitem') ) {
2889
        return ( 0, 'overdue');
2890
    }
2891
2892
    if ( $issue->auto_renew ) {
2893
2894
        if ( $patron->category->effective_BlockExpiredPatronOpacActions and $patron->is_expired ) {
2895
            return ( 0, 'auto_account_expired' );
2896
        }
2897
2898
        if ( defined $issuing_rule->{no_auto_renewal_after}
2899
                and $issuing_rule->{no_auto_renewal_after} ne "" ) {
2900
            # Get issue_date and add no_auto_renewal_after
2901
            # If this is greater than today, it's too late for renewal.
2902
            my $maximum_renewal_date = dt_from_string($issue->issuedate, 'sql');
2903
            $maximum_renewal_date->add(
2904
                $issuing_rule->{lengthunit} => $issuing_rule->{no_auto_renewal_after}
2905
            );
2906
            my $now = dt_from_string;
2907
            if ( $now >= $maximum_renewal_date ) {
2908
                return ( 0, "auto_too_late" );
2909
            }
2910
        }
2911
        if ( defined $issuing_rule->{no_auto_renewal_after_hard_limit}
2912
                      and $issuing_rule->{no_auto_renewal_after_hard_limit} ne "" ) {
2913
            # If no_auto_renewal_after_hard_limit is >= today, it's also too late for renewal
2914
            if ( dt_from_string >= dt_from_string( $issuing_rule->{no_auto_renewal_after_hard_limit} ) ) {
2915
                return ( 0, "auto_too_late" );
2916
            }
2917
        }
2918
2919
        if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) {
2920
            my $fine_no_renewals = C4::Context->preference("OPACFineNoRenewals");
2921
            my $amountoutstanding =
2922
              C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
2923
              ? $patron->account->balance
2924
              : $patron->account->outstanding_debits->total_outstanding;
2925
            if ( $amountoutstanding and $amountoutstanding > $fine_no_renewals ) {
2926
                return ( 0, "auto_too_much_oweing" );
2927
            }
2928
        }
2929
    }
2930
2931
    if ( defined $issuing_rule->{norenewalbefore}
2932
        and $issuing_rule->{norenewalbefore} ne "" )
2933
    {
2934
2935
        # Calculate soonest renewal by subtracting 'No renewal before' from due date
2936
        my $soonestrenewal = dt_from_string( $issue->date_due, 'sql' )->subtract(
2937
            $issuing_rule->{lengthunit} => $issuing_rule->{norenewalbefore} );
2938
2939
        # Depending on syspref reset the exact time, only check the date
2940
        if ( C4::Context->preference('NoRenewalBeforePrecision') eq 'date'
2941
            and $issuing_rule->{lengthunit} eq 'days' )
2942
        {
2943
            $soonestrenewal->truncate( to => 'day' );
2944
        }
2945
2946
        if ( $soonestrenewal > DateTime->now( time_zone => C4::Context->tz() ) )
2947
        {
2948
            return ( 0, "auto_too_soon" ) if $issue->auto_renew;
2949
            return ( 0, "too_soon" );
2950
        }
2951
        elsif ( $issue->auto_renew ) {
2952
            return ( 0, "auto_renew" );
2953
        }
2954
    }
2955
2956
    # Fallback for automatic renewals:
2957
    # If norenewalbefore is undef, don't renew before due date.
2958
    if ( $issue->auto_renew ) {
2959
        my $now = dt_from_string;
2960
        return ( 0, "auto_renew" )
2961
          if $now >= dt_from_string( $issue->date_due, 'sql' );
2962
        return ( 0, "auto_too_soon" );
2963
    }
2964
2852
    return ( 1, undef );
2965
    return ( 1, undef );
2853
}
2966
}
2854
2967
2855
=head2 AddRenewal
2968
=head2 AddRenewal
2856
2969
2857
  &AddRenewal($borrowernumber, $itemnumber, $branch, [$datedue], [$lastreneweddate]);
2970
  &AddRenewal($borrowernumber, $itemnumber, $branch, [$datedue], [$lastreneweddate], [$seen]);
2858
2971
2859
Renews a loan.
2972
Renews a loan.
2860
2973
Lines 2879-2884 syspref) Link Here
2879
If C<$datedue> is the empty string, C<&AddRenewal> will calculate the due date automatically
2992
If C<$datedue> is the empty string, C<&AddRenewal> will calculate the due date automatically
2880
from the book's item type.
2993
from the book's item type.
2881
2994
2995
C<$seen> is a boolean flag indicating if the item was seen or not during the renewal. This
2996
informs the incrementing of the unseen_renewals column. If this flag is not supplied, we
2997
fallback to a true value
2998
2882
=cut
2999
=cut
2883
3000
2884
sub AddRenewal {
3001
sub AddRenewal {
Lines 2888-2893 sub AddRenewal { Link Here
2888
    my $datedue         = shift;
3005
    my $datedue         = shift;
2889
    my $lastreneweddate = shift || dt_from_string();
3006
    my $lastreneweddate = shift || dt_from_string();
2890
    my $skipfinecalc    = shift;
3007
    my $skipfinecalc    = shift;
3008
    my $seen            = shift;
3009
3010
    # Fallback on a 'seen' renewal
3011
    $seen = defined $seen && $seen == 0 ? 0 : 1;
2891
3012
2892
    my $item_object   = Koha::Items->find($itemnumber) or return;
3013
    my $item_object   = Koha::Items->find($itemnumber) or return;
2893
    my $biblio = $item_object->biblio;
3014
    my $biblio = $item_object->biblio;
Lines 2940-2954 sub AddRenewal { Link Here
2940
            }
3061
            }
2941
        );
3062
        );
2942
3063
3064
        # Increment the unseen renewals, if appropriate
3065
        # We only do so if the syspref is enabled and
3066
        # a maximum value has been set in the circ rules
3067
        my $unseen_renewals = $issue->unseen_renewals;
3068
        if (C4::Context->preference('UnseenRenewals')) {
3069
            my $rule = Koha::CirculationRules->get_effective_rule(
3070
                {   categorycode => $patron->categorycode,
3071
                    itemtype     => $item_object->effective_itemtype,
3072
                    branchcode   => $circ_library->branchcode,
3073
                    rule_name    => 'unseen_renewals_allowed'
3074
                }
3075
            );
3076
            if (!$seen && $rule && $rule->rule_value) {
3077
                $unseen_renewals++;
3078
            } else {
3079
                # If the renewal is seen, unseen should revert to 0
3080
                $unseen_renewals = 0;
3081
            }
3082
        }
3083
2943
        # Update the issues record to have the new due date, and a new count
3084
        # Update the issues record to have the new due date, and a new count
2944
        # of how many times it has been renewed.
3085
        # of how many times it has been renewed.
2945
        my $renews = ( $issue->renewals || 0 ) + 1;
3086
        my $renews = ( $issue->renewals || 0 ) + 1;
2946
        my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, lastreneweddate = ?
3087
        my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, unseen_renewals = ?, lastreneweddate = ?
2947
                                WHERE borrowernumber=?
3088
                                WHERE borrowernumber=?
2948
                                AND itemnumber=?"
3089
                                AND itemnumber=?"
2949
        );
3090
        );
2950
3091
2951
        $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $lastreneweddate, $borrowernumber, $itemnumber );
3092
        $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $unseen_renewals, $lastreneweddate, $borrowernumber, $itemnumber );
2952
3093
2953
        # Update the renewal count on the item, and tell zebra to reindex
3094
        # Update the renewal count on the item, and tell zebra to reindex
2954
        $renews = ( $item_object->renewals || 0 ) + 1;
3095
        $renews = ( $item_object->renewals || 0 ) + 1;
Lines 3035-3042 sub GetRenewCount { Link Here
3035
    my ( $bornum, $itemno ) = @_;
3176
    my ( $bornum, $itemno ) = @_;
3036
    my $dbh           = C4::Context->dbh;
3177
    my $dbh           = C4::Context->dbh;
3037
    my $renewcount    = 0;
3178
    my $renewcount    = 0;
3179
    my $unseencount    = 0;
3038
    my $renewsallowed = 0;
3180
    my $renewsallowed = 0;
3181
    my $unseenallowed = 0;
3039
    my $renewsleft    = 0;
3182
    my $renewsleft    = 0;
3183
    my $unseenleft    = 0;
3040
3184
3041
    my $patron = Koha::Patrons->find( $bornum );
3185
    my $patron = Koha::Patrons->find( $bornum );
3042
    my $item   = Koha::Items->find($itemno);
3186
    my $item   = Koha::Items->find($itemno);
Lines 3055-3076 sub GetRenewCount { Link Here
3055
    $sth->execute( $bornum, $itemno );
3199
    $sth->execute( $bornum, $itemno );
3056
    my $data = $sth->fetchrow_hashref;
3200
    my $data = $sth->fetchrow_hashref;
3057
    $renewcount = $data->{'renewals'} if $data->{'renewals'};
3201
    $renewcount = $data->{'renewals'} if $data->{'renewals'};
3202
    $unseencount = $data->{'unseen_renewals'} if $data->{'unseen_renewals'};
3058
    # $item and $borrower should be calculated
3203
    # $item and $borrower should be calculated
3059
    my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed);
3204
    my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed);
3060
3205
3061
    my $rule = Koha::CirculationRules->get_effective_rule(
3206
    my $rules = Koha::CirculationRules->get_effective_rules(
3062
        {
3207
        {
3063
            categorycode => $patron->categorycode,
3208
            categorycode => $patron->categorycode,
3064
            itemtype     => $item->effective_itemtype,
3209
            itemtype     => $item->effective_itemtype,
3065
            branchcode   => $branchcode,
3210
            branchcode   => $branchcode,
3066
            rule_name    => 'renewalsallowed',
3211
            rules        => [ 'renewalsallowed', 'unseen_renewals_allowed' ]
3067
        }
3212
        }
3068
    );
3213
    );
3069
3214
    $renewsallowed = $rules ? $rules->{renewalsallowed} : 0;
3070
    $renewsallowed = $rule ? $rule->rule_value : 0;
3215
    $unseenallowed = $rules->{unseen_renewals_allowed} ?
3216
        $rules->{unseen_renewals_allowed} :
3217
        0;
3071
    $renewsleft    = $renewsallowed - $renewcount;
3218
    $renewsleft    = $renewsallowed - $renewcount;
3219
    $unseenleft    = $unseenallowed - $unseencount;
3072
    if($renewsleft < 0){ $renewsleft = 0; }
3220
    if($renewsleft < 0){ $renewsleft = 0; }
3073
    return ( $renewcount, $renewsallowed, $renewsleft );
3221
    if($unseenleft < 0){ $unseenleft = 0; }
3222
    return (
3223
        $renewcount,
3224
        $renewsallowed,
3225
        $renewsleft,
3226
        $unseencount,
3227
        $unseenallowed,
3228
        $unseenleft
3229
    );
3074
}
3230
}
3075
3231
3076
=head2 GetSoonestRenewDate
3232
=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 148-153 our $RULE_KINDS = { Link Here
148
    renewalsallowed => {
148
    renewalsallowed => {
149
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
149
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
150
    },
150
    },
151
    unseen_renewals_allowed => {
152
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
153
    },
151
    rentaldiscount => {
154
    rentaldiscount => {
152
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
155
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
153
    },
156
    },
(-)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 2481-2486 li { Link Here
2481
    position: relative;
2485
    position: relative;
2482
}
2486
}
2483
2487
2488
#renew_as_unseen_label {
2489
    margin-left: 1em;
2490
}
2491
2492
#renew_as_unseen_checkbox {
2493
    margin-right: 1em;
2494
}
2495
2484
#clearscreen {
2496
#clearscreen {
2485
    position: absolute;
2497
    position: absolute;
2486
    right: 0;
2498
    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 1063-1068 Link Here
1063
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1063
        var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1064
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1064
        var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1065
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
1065
        var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
1066
        var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
1066
        var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
1067
        var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
1067
        var interface = "[% interface | html %]";
1068
        var interface = "[% interface | html %]";
1068
        var theme = "[% theme | html %]";
1069
        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 %] ( [% item.barcode | html %] ) cannot be renewed before [% soonestrenewdate | $KohaDates %]. </p>
69
                                <p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio %] ( [% 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 364-370 Link Here
364
                                                            [% IF ISSUE.itemtype_object.rentalcharge_hourly > 0 %]
366
                                                            [% IF ISSUE.itemtype_object.rentalcharge_hourly > 0 %]
365
                                                                <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_hourly | $Price %] per hour</span>
367
                                                                <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_hourly | $Price %] per hour</span>
366
                                                            [% END %]
368
                                                            [% END %]
367
                                                            <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
369
                                                            <span class="renewals">(
370
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
371
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
372
                                                                    / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
373
                                                                [% END %]
374
                                                            )</span>
368
                                                        [% ELSIF ( ISSUE.on_reserve ) %]
375
                                                        [% ELSIF ( ISSUE.on_reserve ) %]
369
                                                            Not renewable <span class="renewals">(on hold)</span>
376
                                                            Not renewable <span class="renewals">(on hold)</span>
370
                                                        [% ELSIF ( ISSUE.too_many ) %]
377
                                                        [% ELSIF ( ISSUE.too_many ) %]
Lines 375-390 Link Here
375
                                                            No longer renewable
382
                                                            No longer renewable
376
                                                        [% ELSIF ISSUE.auto_too_much_oweing %]
383
                                                        [% ELSIF ISSUE.auto_too_much_oweing %]
377
                                                            Automatic renewal failed, you have unpaid fines.
384
                                                            Automatic renewal failed, you have unpaid fines.
378
                                                            <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
385
                                                            <span class="renewals">(
386
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
387
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
388
                                                                    / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
389
                                                                [% END %]
390
                                                            )</span>
379
                                                        [% ELSIF ISSUE.auto_account_expired %]
391
                                                        [% ELSIF ISSUE.auto_account_expired %]
380
                                                            Automatic renewal failed, your account is expired.
392
                                                            Automatic renewal failed, your account is expired.
381
                                                            <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
393
                                                            <span class="renewals">(
394
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
395
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
396
                                                                    / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
397
                                                                [% END %]
398
                                                            )</span>
382
                                                        [% ELSIF ( ISSUE.too_soon ) %]
399
                                                        [% ELSIF ( ISSUE.too_soon ) %]
383
                                                            No renewal before [% ISSUE.soonestrenewdate | html %]
400
                                                            No renewal before [% ISSUE.soonestrenewdate | html %]
384
                                                            <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
401
                                                            <span class="renewals">(
402
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
403
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
404
                                                                    / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
405
                                                                [% END %]
406
                                                            )</span>
385
                                                        [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
407
                                                        [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
386
                                                            Automatic renewal
408
                                                            Automatic renewal
387
                                                            <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
409
                                                            <span class="renewals">(
410
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
411
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
412
                                                                    / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
413
                                                                [% END %]
414
                                                            )</span>
388
                                                        [% ELSIF ( ISSUE.item_denied_renewal ) %]
415
                                                        [% ELSIF ( ISSUE.item_denied_renewal ) %]
389
                                                            Renewal not allowed
416
                                                            Renewal not allowed
390
                                                        [% END %]
417
                                                        [% END %]
Lines 639-645 Link Here
639
                                                            [% IF ( canrenew ) %]
666
                                                            [% IF ( canrenew ) %]
640
                                                                <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber | uri %]&amp;bornum=[% OVERDUE.borrowernumber | uri %]">Renew</a>
667
                                                                <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber | uri %]&amp;bornum=[% OVERDUE.borrowernumber | uri %]">Renew</a>
641
                                                            [% END %]
668
                                                            [% END %]
642
                                                                <span class="renewals">([% OVERDUE.renewsleft | html %] of [% OVERDUE.renewsallowed | html %] renewals remaining)</span>
669
                                                                <span class="renewals">(
670
                                                                    [% OVERDUE.renewsleft | html %] of [% OVERDUE.renewsallowed | html %] renewals remaining
671
                                                                    [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
672
                                                                        / [% OVERDUE.unseenleft | html %] of [% OVERDUE.unseenallowed | html %] renewals left before the item must be seen by the library
673
                                                                    [% END %]
674
                                                                )</span>
643
                                                        [% ELSIF ( OVERDUE.norenew_overdue ) %]
675
                                                        [% ELSIF ( OVERDUE.norenew_overdue ) %]
644
                                                            Not allowed<span class="renewals">(overdue)</span>
676
                                                            Not allowed<span class="renewals">(overdue)</span>
645
                                                        [% ELSIF ( OVERDUE.onreserve ) %]
677
                                                        [% 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