From 2743db65b0d49282927874793bf45d3ee4b5b09e Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 2 Nov 2017 10:15:12 +0100 Subject: [PATCH] Bug 19562: Do not mark convolute items without barcode as problematic Content-Type: text/plain; charset=utf-8 Convolute items are bound together (belong to different biblio records) and only one item has a barcode. All items are marked with a phrase like Convolute (see regex below) in itemnotes. This patch skips the convolute items without barcode and does not mark them as problematic during inventory when the item notes contain the phrase. The regex used is: $item->{itemnotes} =~ /convoluu?t/i; This regex will cover at least the following languages: Danish, Dutch, English, Finnish, French, Italian, Norwegian, Portuguese, Spanish, Swedish and probably other languages too. And can be easily extended if needed. Note: Since the item hash does not contain itemnotes, we need to call Koha::Items->find. We will only do so when the item does not have a barcode. Test plan: [1] Update an item so that it has no barcode, callnumber is X and item notes contain Convolute. [2] Upload a barcode file (contents may even be empty), filter on callnumber X. Compare should not report the updated convolute. [3] Remove the Convolute note. Repeat step 2. Inventory should report the item now. Signed-off-by: Marcel de Rooy --- tools/inventory.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/inventory.pl b/tools/inventory.pl index 8df02ab..d080f29 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -292,6 +292,8 @@ if ( $compareinv2barcd ) { for my $item ( @$inventorylist ) { my $barcode = $item->{barcode}; if( !$barcode ) { + $item->{itemnotes} = Koha::Items->find( $item->{itemnumber} )->itemnotes; + next if $item->{itemnotes} =~ /convoluu?t/i; $item->{problems}->{no_barcode} = 1; } elsif ( grep /^$barcode$/, @scanned_barcodes ) { next; -- 2.1.4