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

(-)a/cataloguing/additem.pl (-12 / +7 lines)
Lines 687-706 if ($op eq "additem") { Link Here
687
    # check that the barcode don't exist already
687
    # check that the barcode don't exist already
688
    my $addedolditem = TransformMarcToKoha($itemtosave);
688
    my $addedolditem = TransformMarcToKoha($itemtosave);
689
    my $exist_itemnumber = get_item_from_barcode($addedolditem->{'barcode'});
689
    my $exist_itemnumber = get_item_from_barcode($addedolditem->{'barcode'});
690
    my $item = GetItem( $itemnumber );
691
    if ($exist_itemnumber && $exist_itemnumber != $itemnumber) {
690
    if ($exist_itemnumber && $exist_itemnumber != $itemnumber) {
692
        push @errors,"barcode_not_unique";
691
        push @errors,"barcode_not_unique";
693
    } else {
692
    } else {
694
        ModItemFromMarc($itemtosave,$biblionumber,$itemnumber);
693
        my $item = GetItem( $itemnumber );
695
        $itemnumber="";
694
        my $newitem = ModItemFromMarc($itemtosave, $biblionumber, $itemnumber);
696
    }
695
        $itemnumber = q{};
697
    my $olditemlost =  $item->{'itemlost'};
696
        my $olditemlost = $item->{itemlost};
698
697
        my $newitemlost = $newitem->{itemlost};
699
   my ($lost_tag,$lost_subfield) = GetMarcFromKohaField("items.itemlost",'');
698
        LostItem( $item->{itemnumber} )
700
699
            if $newitemlost && $newitemlost ge '1' && !$olditemlost;
701
   my $newitemlost = $itemtosave->subfield( $lost_tag, $lost_subfield );
702
    if (($olditemlost eq '0' or $olditemlost eq '' ) and $newitemlost ge '1'){
703
        LostItem( $item->{itemnumber} );
704
    }
700
    }
705
    $nextop="additem";
701
    $nextop="additem";
706
} elsif ($op eq "delinkitem"){
702
} elsif ($op eq "delinkitem"){
707
- 

Return to bug 19974