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

(-)a/t/db_dependent/Circulation_issue.t (-2 / +27 lines)
Lines 10-16 use C4::Circulation; Link Here
10
use C4::Items;
10
use C4::Items;
11
use C4::Context;
11
use C4::Context;
12
12
13
use Test::More tests => 27;
13
use Test::More tests => 30;
14
14
15
BEGIN {
15
BEGIN {
16
    use_ok('C4::Circulation');
16
    use_ok('C4::Circulation');
Lines 342-346 AddReturn('barcode_1', undef, undef, undef, '2014-04-01 23:42'); Link Here
342
$return = $dbh->selectrow_hashref("SELECT * FROM old_issues LIMIT 1" );
342
$return = $dbh->selectrow_hashref("SELECT * FROM old_issues LIMIT 1" );
343
ok( $return->{returndate} eq '2014-04-01 23:42:00', "Item returned with a return date of '2014-04-01 23:42' has that return date" );
343
ok( $return->{returndate} eq '2014-04-01 23:42:00', "Item returned with a return date of '2014-04-01 23:42' has that return date" );
344
344
345
my ($biblionumber, $biblioitemnumber, $itemnumber) = C4::Items::AddItem(
346
    {
347
        barcode        => 'barcode_3',
348
        itemcallnumber => 'callnumber3',
349
        homebranch     => $samplebranch1->{branchcode},
350
        holdingbranch  => $samplebranch1->{branchcode},
351
        notforloan => 1,
352
    },
353
    $biblionumber
354
);
355
356
C4::Context->set_preference( 'UpdateNotForLoanStatusOnCheckin', q{} );
357
AddReturn( 'barcode_3', $samplebranch1->{branchcode} );
358
my $item = GetItem( $itemnumber );
359
ok( $item->{notforloan} eq 1, 'UpdateNotForLoanStatusOnCheckin does not modify value when not enabled' );
360
361
C4::Context->set_preference( 'UpdateNotForLoanStatusOnCheckin', '1: 9' );
362
AddReturn( 'barcode_3', $samplebranch1->{branchcode} );
363
$item = GetItem( $itemnumber );
364
ok( $item->{notforloan} eq 9, q{UpdateNotForLoanStatusOnCheckin updates notforloan value from 1 to 9 with setting "1: 9"} );
365
366
AddReturn( 'barcode_3', $samplebranch1->{branchcode} );
367
$item = GetItem( $itemnumber );
368
ok( $item->{notforloan} eq 9, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 9 with setting "1: 9"} );
369
370
345
#End transaction
371
#End transaction
346
$dbh->rollback;
372
$dbh->rollback;
347
- 

Return to bug 11629