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

(-)a/circ/renew.pl (-6 / +4 lines)
Lines 23-29 use CGI qw ( -utf8 ); Link Here
23
use C4::Context;
23
use C4::Context;
24
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
25
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
26
use C4::Circulation qw( barcodedecode CanBookBeRenewed GetSoonestRenewDate GetLatestAutoRenewDate AddRenewal );
26
use C4::Circulation qw( barcodedecode CanBookBeRenewed GetLatestAutoRenewDate AddRenewal );
27
use Koha::DateUtils qw( dt_from_string output_pref );
27
use Koha::DateUtils qw( dt_from_string output_pref );
28
use Koha::Database;
28
use Koha::Database;
29
use Koha::BiblioFrameworks;
29
use Koha::BiblioFrameworks;
Lines 67-73 if ($barcode) { Link Here
67
            
67
            
68
            if ( ( $borrower->debarred() || q{} ) lt dt_from_string()->ymd() ) {
68
            if ( ( $borrower->debarred() || q{} ) lt dt_from_string()->ymd() ) {
69
                my $can_renew;
69
                my $can_renew;
70
                ( $can_renew, $error ) =
70
                my $info;
71
                ( $can_renew, $error, $info ) =
71
                  CanBookBeRenewed( $borrower->borrowernumber(),
72
                  CanBookBeRenewed( $borrower->borrowernumber(),
72
                    $item->itemnumber(), $override_limit );
73
                    $item->itemnumber(), $override_limit );
73
74
Lines 82-91 if ($barcode) { Link Here
82
                }
83
                }
83
84
84
                if ( $error && ($error eq 'too_soon' or $error eq 'auto_too_soon') ) {
85
                if ( $error && ($error eq 'too_soon' or $error eq 'auto_too_soon') ) {
85
                    $soonest_renew_date = C4::Circulation::GetSoonestRenewDate(
86
                    $soonest_renew_date = $info;
86
                        $borrower->borrowernumber(),
87
                        $item->itemnumber(),
88
                    );
89
                }
87
                }
90
                if ( $error && ( $error eq 'auto_too_late' ) ) {
88
                if ( $error && ( $error eq 'auto_too_late' ) ) {
91
                    $latest_auto_renew_date = C4::Circulation::GetLatestAutoRenewDate(
89
                    $latest_auto_renew_date = C4::Circulation::GetLatestAutoRenewDate(
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-1 / +1 lines)
Lines 407-413 Link Here
407
                                                                [% END %]
407
                                                                [% END %]
408
                                                            )</span>
408
                                                            )</span>
409
                                                        [% ELSIF ( ISSUE.too_soon ) %]
409
                                                        [% ELSIF ( ISSUE.too_soon ) %]
410
                                                            <span class="usr-msg no-renewal-before">No renewal before [% ISSUE.soonestrenewdate | html %]</span>
410
                                                            <span class="usr-msg no-renewal-before">No renewal before [% ISSUE.soonestrenewdate | $KohaDates  as_due_date => 1 %]</span>
411
                                                            <span class="renewals">(
411
                                                            <span class="renewals">(
412
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
412
                                                                [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
413
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
413
                                                                [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
(-)a/opac/opac-user.pl (-8 / +3 lines)
Lines 27-33 use C4::Koha qw( Link Here
27
    GetNormalizedISBN
27
    GetNormalizedISBN
28
    GetNormalizedUPC
28
    GetNormalizedUPC
29
);
29
);
30
use C4::Circulation qw( CanBookBeRenewed GetRenewCount GetIssuingCharges GetSoonestRenewDate );
30
use C4::Circulation qw( CanBookBeRenewed GetRenewCount GetIssuingCharges );
31
use C4::External::BakerTaylor qw( image_url link_url );
31
use C4::External::BakerTaylor qw( image_url link_url );
32
use C4::Reserves qw( GetReserveStatus );
32
use C4::Reserves qw( GetReserveStatus );
33
use C4::Members;
33
use C4::Members;
Lines 223-229 if ( $pending_checkouts->count ) { # Useless test Link Here
223
        $issue->{rentalfines} = $rental_fines->total_outstanding;
223
        $issue->{rentalfines} = $rental_fines->total_outstanding;
224
224
225
        # check if item is renewable
225
        # check if item is renewable
226
        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
226
        my ($status,$renewerror,$info) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
227
        (
227
        (
228
            $issue->{'renewcount'},
228
            $issue->{'renewcount'},
229
            $issue->{'renewsallowed'},
229
            $issue->{'renewsallowed'},
Lines 254-265 if ( $pending_checkouts->count ) { # Useless test Link Here
254
254
255
            if ( $renewerror eq 'too_soon' ) {
255
            if ( $renewerror eq 'too_soon' ) {
256
                $issue->{'too_soon'}         = 1;
256
                $issue->{'too_soon'}         = 1;
257
                $issue->{'soonestrenewdate'} = output_pref(
257
                $issue->{'soonestrenewdate'} = $info;
258
                    C4::Circulation::GetSoonestRenewDate(
259
                        $issue->{borrowernumber},
260
                        $issue->{itemnumber}
261
                    )
262
                );
263
            }
258
            }
264
        }
259
        }
265
260
(-)a/svc/checkouts (-4 / +3 lines)
Lines 23-29 use CGI; Link Here
23
use JSON qw(to_json);
23
use JSON qw(to_json);
24
24
25
use C4::Auth qw(check_cookie_auth haspermission);
25
use C4::Auth qw(check_cookie_auth haspermission);
26
use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate);
26
use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount );
27
use C4::Overdues qw(GetFine);
27
use C4::Overdues qw(GetFine);
28
use C4::Context;
28
use C4::Context;
29
29
Lines 154-166 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
154
    my ($charge) = GetIssuingCharges( $c->{itemnumber}, $c->{borrowernumber} );
154
    my ($charge) = GetIssuingCharges( $c->{itemnumber}, $c->{borrowernumber} );
155
    my $fine = GetFine( $c->{itemnumber}, $c->{borrowernumber} );
155
    my $fine = GetFine( $c->{itemnumber}, $c->{borrowernumber} );
156
156
157
    my ( $can_renew, $can_renew_error ) =
157
    my ( $can_renew, $can_renew_error, $info ) =
158
      CanBookBeRenewed( $c->{borrowernumber}, $c->{itemnumber} );
158
      CanBookBeRenewed( $c->{borrowernumber}, $c->{itemnumber} );
159
    my $can_renew_date =
159
    my $can_renew_date =
160
      $can_renew_error && $can_renew_error eq 'too_soon'
160
      $can_renew_error && $can_renew_error eq 'too_soon'
161
      ? output_pref(
161
      ? output_pref(
162
        {
162
        {
163
            dt => GetSoonestRenewDate( $c->{borrowernumber}, $c->{itemnumber} ),
163
            dt => $info,
164
            as_due_date => 1
164
            as_due_date => 1
165
        }
165
        }
166
      )
166
      )
167
- 

Return to bug 30167