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

(-)a/C4/Circulation.pm (-7 / +6 lines)
Lines 1424-1430 sub AddIssue { Link Here
1424
                    }
1424
                    }
1425
                )->store;
1425
                )->store;
1426
            }
1426
            }
1427
1428
            if ( $item_object->location eq 'CART' && $item_object->permanent_location ne 'CART'  ) {
1427
            if ( $item_object->location eq 'CART' && $item_object->permanent_location ne 'CART'  ) {
1429
            ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1428
            ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1430
                CartToShelf( $item_object->itemnumber );
1429
                CartToShelf( $item_object->itemnumber );
Lines 1886-1904 sub AddReturn { Link Here
1886
    map { $update_loc_rules->{$_} = $update_loc_rules->{$_}[0] } keys %$update_loc_rules; #We can only move to one location so we flatten the arrays
1885
    map { $update_loc_rules->{$_} = $update_loc_rules->{$_}[0] } keys %$update_loc_rules; #We can only move to one location so we flatten the arrays
1887
    if ($update_loc_rules) {
1886
    if ($update_loc_rules) {
1888
        if (defined $update_loc_rules->{_ALL_}) {
1887
        if (defined $update_loc_rules->{_ALL_}) {
1889
            if ($update_loc_rules->{_ALL_} eq '_PERM_') { $update_loc_rules->{_ALL_} = $item->{permanent_location}; }
1888
            if ($update_loc_rules->{_ALL_} eq '_PERM_') { $update_loc_rules->{_ALL_} = $item->permanent_location; }
1890
            if ($update_loc_rules->{_ALL_} eq '_BLANK_') { $update_loc_rules->{_ALL_} = ''; }
1889
            if ($update_loc_rules->{_ALL_} eq '_BLANK_') { $update_loc_rules->{_ALL_} = ''; }
1891
            if ( $item->{location} ne $update_loc_rules->{_ALL_}) {
1890
            if ( $item->location ne $update_loc_rules->{_ALL_}) {
1892
                $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $update_loc_rules->{_ALL_} };
1891
                $messages->{'ItemLocationUpdated'} = { from => $item->location, to => $update_loc_rules->{_ALL_} };
1893
                ModItem( { location => $update_loc_rules->{_ALL_} }, undef, $itemnumber );
1892
                ModItem( { location => $update_loc_rules->{_ALL_} }, undef, $itemnumber );
1894
            }
1893
            }
1895
        }
1894
        }
1896
        else {
1895
        else {
1897
            foreach my $key ( keys %$update_loc_rules ) {
1896
            foreach my $key ( keys %$update_loc_rules ) {
1898
                if ( $update_loc_rules->{$key} eq '_PERM_' ) { $update_loc_rules->{$key} = $item->{permanent_location}; }
1897
                if ( $update_loc_rules->{$key} eq '_PERM_' ) { $update_loc_rules->{$key} = $item->permanent_location; }
1899
                if ( $update_loc_rules->{$key} eq '_BLANK_') { $update_loc_rules->{$key} = '' ;}
1898
                if ( $update_loc_rules->{$key} eq '_BLANK_') { $update_loc_rules->{$key} = '' ;}
1900
                if ( ($item->{location} eq $key && $item->{location} ne $update_loc_rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $update_loc_rules->{$key} ne '') ) {
1899
                if ( ($item->location eq $key && $item->location ne $update_loc_rules->{$key}) || ($key eq '_BLANK_' && $item->location eq '' && $update_loc_rules->{$key} ne '') ) {
1901
                    $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $update_loc_rules->{$key} };
1900
                    $messages->{'ItemLocationUpdated'} = { from => $item->location, to => $update_loc_rules->{$key} };
1902
                    ModItem( { location => $update_loc_rules->{$key} }, undef, $itemnumber );
1901
                    ModItem( { location => $update_loc_rules->{$key} }, undef, $itemnumber );
1903
                    last;
1902
                    last;
1904
                }
1903
                }
(-)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