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

(-)a/t/db_dependent/Circulation/issue.t (-1 / +53 lines)
Lines 33-38 use Koha::Database; Link Here
33
use Koha::DateUtils;
33
use Koha::DateUtils;
34
use Koha::Library;
34
use Koha::Library;
35
35
36
use Test::More tests => 44;
37
36
BEGIN {
38
BEGIN {
37
    require_ok('C4::Circulation');
39
    require_ok('C4::Circulation');
38
}
40
}
Lines 363-368 AddReturn( 'barcode_3', $branchcode_1 ); Link Here
363
$item = GetItem( $itemnumber );
365
$item = GetItem( $itemnumber );
364
ok( $item->{notforloan} eq 9, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 9 with setting "1: 9"} );
366
ok( $item->{notforloan} eq 9, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 9 with setting "1: 9"} );
365
367
368
my $itemnumber2;
369
($biblionumber, $biblioitemnumber, $itemnumber2) = C4::Items::AddItem(
370
    {
371
        barcode        => 'barcode_4',
372
        itemcallnumber => 'callnumber4',
373
        homebranch     => $samplebranch1->{branchcode},
374
        holdingbranch  => $samplebranch1->{branchcode},
375
        location => 'FIC',
376
    },
377
    $biblionumber
378
);
379
380
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', q{} );
381
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
382
my $item2 = GetItem( $itemnumber2 );
383
ok( $item2->{location} eq 'FIC', 'UpdateItemLocationOnCheckin does not modify value when not enabled' );
384
385
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', 'FIC: GEN' );
386
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
387
$item2 = GetItem( $itemnumber2 );
388
ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin updates location value from 'FIC' to 'GEN' with setting "FIC: GEN"} );
389
ok( $item2->{permanent_location} eq 'GEN', q{UpdateItemLocationOnCheckin updates permanent_location value from 'FIC' to 'GEN' with setting "FIC: GEN"} );
390
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
391
$item2 = GetItem( $itemnumber2 );
392
ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin does not update location value from 'GEN' with setting "FIC: GEN"} );
393
394
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', '_ALL_: CART' );
395
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
396
$item2 = GetItem( $itemnumber2 );
397
ok( $item2->{location} eq 'CART', q{UpdateItemLocationOnCheckin updates location value from 'GEN' with setting "_ALL_: CART"} );
398
ok( $item2->{permanent_location} eq 'GEN', q{UpdateItemLocationOnCheckin does not update permanent_location value from 'GEN' with setting "_ALL_: CART"} );
399
AddIssue( $borrower_1, 'barcode_4', $daysago10,0, $today, '' );
400
$item2 = GetItem( $itemnumber2 );
401
ok( $item2->{location} eq 'GEN', q{Location updates from 'CART' to permanent location on issue} );
402
403
C4::Context->set_preference( 'UpdateItemLocationOnCheckin', "GEN: _BLANK_\n_BLANK_: PROC\nPROC: _PERM_" );
404
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
405
$item2 = GetItem( $itemnumber2 );
406
ok( $item2->{location} eq '', q{UpdateItemLocationOnCheckin updates location value from 'GEN' to '' with setting "GEN: _BLANK_"} );
407
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
408
$item2 = GetItem( $itemnumber2 );
409
ok( $item2->{location} eq 'PROC' , q{UpdateItemLocationOnCheckin updates location value from '' to 'PROC' with setting "_BLANK_: PROC"} );
410
ok( $item2->{permanent_location} eq '' , q{UpdateItemLocationOnCheckin does not update permanent_location value from '' to 'PROC' with setting "_BLANK_: PROC"} );
411
AddReturn( 'barcode_4', $samplebranch1->{branchcode} );
412
$item2 = GetItem( $itemnumber2 );
413
ok( $item2->{location} eq '' , q{UpdateItemLocationOnCheckin updates location value from 'PROC' to '' with setting "PROC: _PERM_" } );
414
ok( $item2->{permanent_location} eq '' , q{UpdateItemLocationOnCheckin does not update permanent_location from '' with setting "PROC: _PERM_" } );
415
416
417
418
366
# Bug 14640 - Cancel the hold on checking out if asked
419
# Bug 14640 - Cancel the hold on checking out if asked
367
my $reserve_id = AddReserve($branchcode_1, $borrower_id1, $biblionumber,
420
my $reserve_id = AddReserve($branchcode_1, $borrower_id1, $biblionumber,
368
    undef,  1, undef, undef, "a note", "a title", undef, '');
421
    undef,  1, undef, undef, "a note", "a title", undef, '');
369
- 

Return to bug 14576