use C4::Biblio;
use C4::Items;
use C4::Context;
+use C4::Circulation;
use C4::Koha; # XXX subfield_is_koha_internal_p
use C4::Branch; # XXX subfield_is_koha_internal_p
use C4::ClassSource;
$record = _increment_barcode($record, $frameworkcode);
}
-
- if (C4::Context->preference('autoBarcode') eq 'incremental') {
- $record = _increment_barcode($record, $frameworkcode);
- }
-
my $addedolditem = TransformMarcToKoha( $dbh, $record );
# If we have to add or add & duplicate, we add the item
ModItemFromMarc($itemtosave,$biblionumber,$itemnumber);
$itemnumber="";
}
+ my $item = GetItem( $itemnumber );
+ my $olditemlost = $item->{'itemlost'};
+
+ my ($lost_tag,$lost_subfield) = GetMarcFromKohaField("items.itemlost",'');
+
+ my $newitemlost = $itemtosave->subfield( $lost_tag, $lost_subfield );
+ if (($olditemlost eq '0' or $olditemlost eq '' ) and $newitemlost ge '1'){
+ LostItem($itemnumber,'MARK RETURNED');
+ }
$nextop="additem";
} elsif ($op eq "delinkitem"){
my $analyticfield = '773';