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

(-)a/C4/Circulation.pm (-2 / +3 lines)
Lines 720-726 sub CanBookBeIssued { Link Here
720
    #
720
    #
721
    # BORROWER STATUS
721
    # BORROWER STATUS
722
    #
722
    #
723
    if ( $borrower->{'category_type'} eq 'X' && (  $item->{barcode}  )) { 
723
    my $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
724
    if ( $patron->category->category_type eq 'X' && (  $item->{barcode}  )) {
724
    	# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
725
    	# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
725
        &UpdateStats({
726
        &UpdateStats({
726
                     branch => C4::Context->userenv->{'branch'},
727
                     branch => C4::Context->userenv->{'branch'},
Lines 814-820 sub CanBookBeIssued { Link Here
814
        $alerts{OTHER_CHARGES} = sprintf( "%.2f", $other_charges );
815
        $alerts{OTHER_CHARGES} = sprintf( "%.2f", $other_charges );
815
    }
816
    }
816
817
817
    my $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
818
    $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
818
    if ( my $debarred_date = $patron->is_debarred ) {
819
    if ( my $debarred_date = $patron->is_debarred ) {
819
         # patron has accrued fine days or has a restriction. $count is a date
820
         # patron has accrued fine days or has a restriction. $count is a date
820
        if ($debarred_date eq '9999-12-31') {
821
        if ($debarred_date eq '9999-12-31') {
(-)a/t/db_dependent/Circulation.t (-2 / +45 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 100;
20
use Test::More tests => 101;
21
21
22
use DateTime;
22
use DateTime;
23
23
Lines 1360-1365 subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { Link Here
1360
    is( $error->{USERBLOCKEDNOENDDATE},    '9999-12-31', 'USERBLOCKEDNOENDDATE should be 9999-12-31 for unlimited debarments' );
1360
    is( $error->{USERBLOCKEDNOENDDATE},    '9999-12-31', 'USERBLOCKEDNOENDDATE should be 9999-12-31 for unlimited debarments' );
1361
};
1361
};
1362
1362
1363
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
1364
    plan tests => 1;
1365
1366
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
1367
    my $patron_category = $builder->build_object(
1368
        {
1369
            class => 'Koha::Patron::Categories',
1370
            value => { category_type => 'X' }
1371
        }
1372
    );
1373
    my $patron = $builder->build_object(
1374
        {
1375
            class => 'Koha::Patrons',
1376
            value => {
1377
                categorycode  => $patron_category->categorycode,
1378
                gonenoaddress => undef,
1379
                lost          => undef,
1380
                debarred      => undef,
1381
                borrowernotes => ""
1382
            }
1383
        }
1384
    );
1385
    my $biblioitem_1 = $builder->build( { source => 'Biblioitem' } );
1386
    my $item_1 = $builder->build(
1387
        {
1388
            source => 'Item',
1389
            value  => {
1390
                homebranch    => $library->branchcode,
1391
                holdingbranch => $library->branchcode,
1392
                notforloan    => 0,
1393
                itemlost      => 0,
1394
                withdrawn     => 0,
1395
                restricted    => 0,
1396
                biblionumber  => $biblioitem_1->{biblionumber}
1397
            }
1398
        }
1399
    );
1400
1401
    my ( $error, $question, $alerts ) = CanBookBeIssued( $patron->unblessed, $item_1->{barcode} );
1402
    is( $error->{STATS}, 1, '"Error" flag "STATS" must be set if CanBookBeIssued is called with a statistic patron (category_type=X)' );
1403
1404
    # TODO There are other tests to provide here
1405
};
1406
1363
subtest 'MultipleReserves' => sub {
1407
subtest 'MultipleReserves' => sub {
1364
    plan tests => 3;
1408
    plan tests => 3;
1365
1409
1366
- 

Return to bug 19276