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

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 3121-3127 sub CanBookBeRenewed { Link Here
3121
    }
3121
    }
3122
3122
3123
    # CHECK FOR BOOKINGS
3123
    # CHECK FOR BOOKINGS
3124
    if( $item->bookings->count ){
3124
    if ( $item->bookings->count ) {
3125
        my $startdate =
3125
        my $startdate =
3126
            ( C4::Context->preference('RenewalPeriodBase') eq 'date_due' )
3126
            ( C4::Context->preference('RenewalPeriodBase') eq 'date_due' )
3127
            ? dt_from_string( $issue->date_due, 'sql' )
3127
            ? dt_from_string( $issue->date_due, 'sql' )
(-)a/C4/SIP/ILS/Transaction/Renew.pm (-6 / +6 lines)
Lines 51-62 sub do_renew_for { Link Here
51
        $self->{due} = $self->duedatefromissue($issue, $self->{item}->{itemnumber});
51
        $self->{due} = $self->duedatefromissue($issue, $self->{item}->{itemnumber});
52
        $self->renewal_ok(1);
52
        $self->renewal_ok(1);
53
    } else {
53
    } else {
54
        $renewerror=~s/on_reserve/Item unavailable due to outstanding holds/;
54
        $renewerror =~ s/on_reserve/Item unavailable due to outstanding holds/;
55
        $renewerror=~s/booked/Item is booked for another borrower/;
55
        $renewerror =~ s/booked/Item is booked for another borrower/;
56
        $renewerror=~s/too_many/Item has reached maximum renewals/;
56
        $renewerror =~ s/too_many/Item has reached maximum renewals/;
57
        $renewerror=~s/too_unseen/Item has reached maximum consecutive renewals without being seen/;
57
        $renewerror =~ s/too_unseen/Item has reached maximum consecutive renewals without being seen/;
58
        $renewerror=~s/item_denied_renewal/Item renewal is not allowed/;
58
        $renewerror =~ s/item_denied_renewal/Item renewal is not allowed/;
59
        $renewerror=~s/item_issued_to_other_patron/Item already issued to other borrower/;
59
        $renewerror =~ s/item_issued_to_other_patron/Item already issued to other borrower/;
60
        $self->screen_msg($renewerror);
60
        $self->screen_msg($renewerror);
61
        $self->renewal_ok(0);
61
        $self->renewal_ok(0);
62
    }
62
    }
(-)a/t/db_dependent/Circulation.t (-3 / +2 lines)
Lines 1739-1745 subtest "CanBookBeRenewed | bookings" => sub { Link Here
1739
    my $schema = Koha::Database->schema;
1739
    my $schema = Koha::Database->schema;
1740
    $schema->storage->txn_begin;
1740
    $schema->storage->txn_begin;
1741
1741
1742
    t::lib::Mocks::mock_preference('RenewalPeriodBase', 'date_due');
1742
    t::lib::Mocks::mock_preference( 'RenewalPeriodBase', 'date_due' );
1743
1743
1744
    my $renewing_patron = $builder->build_object( { class => 'Koha::Patrons' } );
1744
    my $renewing_patron = $builder->build_object( { class => 'Koha::Patrons' } );
1745
    my $booked_patron   = $builder->build_object( { class => 'Koha::Patrons' } );
1745
    my $booked_patron   = $builder->build_object( { class => 'Koha::Patrons' } );
Lines 1763-1769 subtest "CanBookBeRenewed | bookings" => sub { Link Here
1763
1763
1764
    # Proposed renewal would encroach on booking
1764
    # Proposed renewal would encroach on booking
1765
    my ( $renewok, $error ) = CanBookBeRenewed( $renewing_patron, $issue, 0 );
1765
    my ( $renewok, $error ) = CanBookBeRenewed( $renewing_patron, $issue, 0 );
1766
    is( $renewok, 0,  "Renewal not allowed as it would mean the item was not returned before the next booking" );
1766
    is( $renewok, 0,        "Renewal not allowed as it would mean the item was not returned before the next booking" );
1767
    is( $error,   'booked', "Error is 'booked'" );
1767
    is( $error,   'booked', "Error is 'booked'" );
1768
1768
1769
    $schema->storage->txn_rollback;
1769
    $schema->storage->txn_rollback;
1770
- 

Return to bug 35944