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

(-)a/C4/Circulation.pm (-2 / +3 lines)
Lines 716-722 sub CanBookBeIssued { Link Here
716
    #
716
    #
717
    # BORROWER STATUS
717
    # BORROWER STATUS
718
    #
718
    #
719
    if ( $borrower->{'category_type'} eq 'X' && (  $item->{barcode}  )) { 
719
    my $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
720
    if ( $patron->category->category_type eq 'X' && (  $item->{barcode}  )) {
720
    	# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
721
    	# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
721
        &UpdateStats({
722
        &UpdateStats({
722
                     branch => C4::Context->userenv->{'branch'},
723
                     branch => C4::Context->userenv->{'branch'},
Lines 810-816 sub CanBookBeIssued { Link Here
810
        $alerts{OTHER_CHARGES} = sprintf( "%.2f", $other_charges );
811
        $alerts{OTHER_CHARGES} = sprintf( "%.2f", $other_charges );
811
    }
812
    }
812
813
813
    my $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
814
    $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
814
    if ( my $debarred_date = $patron->is_debarred ) {
815
    if ( my $debarred_date = $patron->is_debarred ) {
815
         # patron has accrued fine days or has a restriction. $count is a date
816
         # patron has accrued fine days or has a restriction. $count is a date
816
        if ($debarred_date eq '9999-12-31') {
817
        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