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

(-)a/C4/Circulation.pm (+1 lines)
Lines 1985-1990 sub AddReturn { Link Here
1985
1985
1986
        if ( $issue and $issue->is_overdue ) {
1986
        if ( $issue and $issue->is_overdue ) {
1987
        # fix fine days
1987
        # fix fine days
1988
            $today = $return_date if $return_date;
1988
            $today = $dropboxdate if $dropbox;
1989
            $today = $dropboxdate if $dropbox;
1989
            my ($debardate,$reminder) = _debar_user_on_return( $patron_unblessed, $item, dt_from_string($issue->date_due), $today );
1990
            my ($debardate,$reminder) = _debar_user_on_return( $patron_unblessed, $item, dt_from_string($issue->date_due), $today );
1990
            if ($reminder){
1991
            if ($reminder){
(-)a/t/db_dependent/Circulation.t (-3 / +13 lines)
Lines 1764-1770 subtest 'AddReturn + CumulativeRestrictionPeriods' => sub { Link Here
1764
};
1764
};
1765
1765
1766
subtest 'AddReturn + suspension_chargeperiod' => sub {
1766
subtest 'AddReturn + suspension_chargeperiod' => sub {
1767
    plan tests => 12;
1767
    plan tests => 14;
1768
1768
1769
    my $library = $builder->build( { source => 'Branch' } );
1769
    my $library = $builder->build( { source => 'Branch' } );
1770
    my $patron  = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } );
1770
    my $patron  = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } );
Lines 1915-1920 subtest 'AddReturn + suspension_chargeperiod' => sub { Link Here
1915
            expiration_date => $expected_expiration_dt->clone->add( days => 1 ),
1915
            expiration_date => $expected_expiration_dt->clone->add( days => 1 ),
1916
        }
1916
        }
1917
    );
1917
    );
1918
1919
    test_debarment_on_checkout(
1920
        {
1921
            item            => $item_1,
1922
            library         => $library,
1923
            patron          => $patron,
1924
            return_date     => dt_from_string->add(days => 5),
1925
            expiration_date => dt_from_string->add(days => 5 + (5 * 2 - 1) ),
1926
        }
1927
    );
1918
};
1928
};
1919
1929
1920
subtest 'AddReturn | is_overdue' => sub {
1930
subtest 'AddReturn | is_overdue' => sub {
Lines 2261-2266 sub test_debarment_on_checkout { Link Here
2261
    my $library  = $params->{library};
2271
    my $library  = $params->{library};
2262
    my $patron   = $params->{patron};
2272
    my $patron   = $params->{patron};
2263
    my $due_date = $params->{due_date} || dt_from_string;
2273
    my $due_date = $params->{due_date} || dt_from_string;
2274
    my $return_date = $params->{return_date} || dt_from_string;
2264
    my $expected_expiration_date = $params->{expiration_date};
2275
    my $expected_expiration_date = $params->{expiration_date};
2265
2276
2266
    $expected_expiration_date = output_pref(
2277
    $expected_expiration_date = output_pref(
Lines 2275-2281 sub test_debarment_on_checkout { Link Here
2275
    AddIssue( $patron, $item->{barcode}, $due_date );
2286
    AddIssue( $patron, $item->{barcode}, $due_date );
2276
2287
2277
    AddReturn( $item->{barcode}, $library->{branchcode},
2288
    AddReturn( $item->{barcode}, $library->{branchcode},
2278
        undef, undef, dt_from_string );
2289
        undef, undef, $return_date );
2279
    my $debarments = Koha::Patron::Debarments::GetDebarments(
2290
    my $debarments = Koha::Patron::Debarments::GetDebarments(
2280
        { borrowernumber => $patron->{borrowernumber}, type => 'SUSPENSION' } );
2291
        { borrowernumber => $patron->{borrowernumber}, type => 'SUSPENSION' } );
2281
    is( scalar(@$debarments), 1, 'Test at line ' . $line_number );
2292
    is( scalar(@$debarments), 1, 'Test at line ' . $line_number );
2282
- 

Return to bug 20660