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 ); |
690 |
if ($exist_itemnumber && $exist_itemnumber != $itemnumber) { |
691 |
if ($exist_itemnumber && $exist_itemnumber != $itemnumber) { |
691 |
push @errors,"barcode_not_unique"; |
692 |
push @errors,"barcode_not_unique"; |
692 |
} else { |
693 |
} else { |
693 |
ModItemFromMarc($itemtosave,$biblionumber,$itemnumber); |
694 |
ModItemFromMarc($itemtosave,$biblionumber,$itemnumber); |
694 |
$itemnumber=""; |
695 |
$itemnumber=""; |
695 |
} |
696 |
} |
696 |
my $item = GetItem( $itemnumber ); |
|
|
697 |
my $olditemlost = $item->{'itemlost'}; |
697 |
my $olditemlost = $item->{'itemlost'}; |
698 |
|
698 |
|
699 |
my ($lost_tag,$lost_subfield) = GetMarcFromKohaField("items.itemlost",''); |
699 |
my ($lost_tag,$lost_subfield) = GetMarcFromKohaField("items.itemlost",''); |
700 |
|
700 |
|
701 |
my $newitemlost = $itemtosave->subfield( $lost_tag, $lost_subfield ); |
701 |
my $newitemlost = $itemtosave->subfield( $lost_tag, $lost_subfield ); |
702 |
if (($olditemlost eq '0' or $olditemlost eq '' ) and $newitemlost ge '1'){ |
702 |
if (($olditemlost eq '0' or $olditemlost eq '' ) and $newitemlost ge '1'){ |
703 |
LostItem($itemnumber); |
703 |
LostItem( $item->{itemnumber} ); |
704 |
} |
704 |
} |
705 |
$nextop="additem"; |
705 |
$nextop="additem"; |
706 |
} elsif ($op eq "delinkitem"){ |
706 |
} elsif ($op eq "delinkitem"){ |
707 |
- |
|
|