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

(-)a/C4/Circulation.pm (-7 / +6 lines)
Lines 1428-1434 sub AddIssue { Link Here
1428
                    }
1428
                    }
1429
                )->store;
1429
                )->store;
1430
            }
1430
            }
1431
1432
            if ( $item_object->location eq 'CART' && $item_object->permanent_location ne 'CART'  ) {
1431
            if ( $item_object->location eq 'CART' && $item_object->permanent_location ne 'CART'  ) {
1433
            ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1432
            ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1434
                CartToShelf( $item_object->itemnumber );
1433
                CartToShelf( $item_object->itemnumber );
Lines 1890-1908 sub AddReturn { Link Here
1890
    map { $update_loc_rules->{$_} = $update_loc_rules->{$_}[0] } keys %$update_loc_rules; #We can only move to one location so we flatten the arrays
1889
    map { $update_loc_rules->{$_} = $update_loc_rules->{$_}[0] } keys %$update_loc_rules; #We can only move to one location so we flatten the arrays
1891
    if ($update_loc_rules) {
1890
    if ($update_loc_rules) {
1892
        if (defined $update_loc_rules->{_ALL_}) {
1891
        if (defined $update_loc_rules->{_ALL_}) {
1893
            if ($update_loc_rules->{_ALL_} eq '_PERM_') { $update_loc_rules->{_ALL_} = $item->{permanent_location}; }
1892
            if ($update_loc_rules->{_ALL_} eq '_PERM_') { $update_loc_rules->{_ALL_} = $item->permanent_location; }
1894
            if ($update_loc_rules->{_ALL_} eq '_BLANK_') { $update_loc_rules->{_ALL_} = ''; }
1893
            if ($update_loc_rules->{_ALL_} eq '_BLANK_') { $update_loc_rules->{_ALL_} = ''; }
1895
            if ( $item->{location} ne $update_loc_rules->{_ALL_}) {
1894
            if ( $item->location ne $update_loc_rules->{_ALL_}) {
1896
                $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $update_loc_rules->{_ALL_} };
1895
                $messages->{'ItemLocationUpdated'} = { from => $item->location, to => $update_loc_rules->{_ALL_} };
1897
                ModItem( { location => $update_loc_rules->{_ALL_} }, undef, $itemnumber );
1896
                ModItem( { location => $update_loc_rules->{_ALL_} }, undef, $itemnumber );
1898
            }
1897
            }
1899
        }
1898
        }
1900
        else {
1899
        else {
1901
            foreach my $key ( keys %$update_loc_rules ) {
1900
            foreach my $key ( keys %$update_loc_rules ) {
1902
                if ( $update_loc_rules->{$key} eq '_PERM_' ) { $update_loc_rules->{$key} = $item->{permanent_location}; }
1901
                if ( $update_loc_rules->{$key} eq '_PERM_' ) { $update_loc_rules->{$key} = $item->permanent_location; }
1903
                if ( $update_loc_rules->{$key} eq '_BLANK_') { $update_loc_rules->{$key} = '' ;}
1902
                if ( $update_loc_rules->{$key} eq '_BLANK_') { $update_loc_rules->{$key} = '' ;}
1904
                if ( ($item->{location} eq $key && $item->{location} ne $update_loc_rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $update_loc_rules->{$key} ne '') ) {
1903
                if ( ($item->location eq $key && $item->location ne $update_loc_rules->{$key}) || ($key eq '_BLANK_' && $item->location eq '' && $update_loc_rules->{$key} ne '') ) {
1905
                    $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $update_loc_rules->{$key} };
1904
                    $messages->{'ItemLocationUpdated'} = { from => $item->location, to => $update_loc_rules->{$key} };
1906
                    ModItem( { location => $update_loc_rules->{$key} }, undef, $itemnumber );
1905
                    ModItem( { location => $update_loc_rules->{$key} }, undef, $itemnumber );
1907
                    last;
1906
                    last;
1908
                }
1907
                }
(-)a/t/db_dependent/Circulation/issue.t (-2 / +1 lines)
Lines 418-424 $item2 = Koha::Items->find( $itemnumber2 ); Link Here
418
ok( $item2->location eq 'PROC' , q{UpdateItemLocationOnCheckin updates location value from '' to 'PROC' with setting "_BLANK_: PROC"} );
418
ok( $item2->location eq 'PROC' , q{UpdateItemLocationOnCheckin updates location value from '' to 'PROC' with setting "_BLANK_: PROC"} );
419
ok( $item2->permanent_location eq '' , q{UpdateItemLocationOnCheckin does not update permanent_location value from '' to 'PROC' with setting "_BLANK_: PROC"} );
419
ok( $item2->permanent_location eq '' , q{UpdateItemLocationOnCheckin does not update permanent_location value from '' to 'PROC' with setting "_BLANK_: PROC"} );
420
AddReturn( 'barcode_4', $branchcode_1 );
420
AddReturn( 'barcode_4', $branchcode_1 );
421
$item2 = Koha::Items( $itemnumber2 );
421
$item2 = Koha::Items->find( $itemnumber2 );
422
ok( $item2->location eq '' , q{UpdateItemLocationOnCheckin updates location value from 'PROC' to '' with setting "PROC: _PERM_" } );
422
ok( $item2->location eq '' , q{UpdateItemLocationOnCheckin updates location value from 'PROC' to '' with setting "PROC: _PERM_" } );
423
ok( $item2->permanent_location eq '' , q{UpdateItemLocationOnCheckin does not update permanent_location from '' with setting "PROC: _PERM_" } );
423
ok( $item2->permanent_location eq '' , q{UpdateItemLocationOnCheckin does not update permanent_location from '' with setting "PROC: _PERM_" } );
424
424
425
- 

Return to bug 14576