Lines 51-61
use Koha::Authorities;
Link Here
|
51 |
|
51 |
|
52 |
{ |
52 |
{ |
53 |
if ( C4::Context->preference('item-level_itypes') ) { |
53 |
if ( C4::Context->preference('item-level_itypes') ) { |
54 |
my $items_without_itype = Koha::Items->search( { itype => undef } ); |
54 |
my $items_without_itype = Koha::Items->search( { -or => [itype => undef,itype => ''] } ); |
55 |
if ( $items_without_itype->count ) { |
55 |
if ( $items_without_itype->count ) { |
56 |
new_section("Items do not have itype defined"); |
56 |
new_section("Items do not have itype defined"); |
57 |
while ( my $item = $items_without_itype->next ) { |
57 |
while ( my $item = $items_without_itype->next ) { |
58 |
if (defined $item->biblioitem->itemtype) { |
58 |
if (defined $item->biblioitem->itemtype && $item->biblioitem->itemtype ne '' ) { |
59 |
new_item( |
59 |
new_item( |
60 |
sprintf "Item with itemnumber=%s does not have a itype value, biblio's item type will be used (%s)", |
60 |
sprintf "Item with itemnumber=%s does not have a itype value, biblio's item type will be used (%s)", |
61 |
$item->itemnumber, $item->biblioitem->itemtype |
61 |
$item->itemnumber, $item->biblioitem->itemtype |
Lines 86-92
use Koha::Authorities;
Link Here
|
86 |
|
86 |
|
87 |
my @itemtypes = Koha::ItemTypes->search->get_column('itemtype'); |
87 |
my @itemtypes = Koha::ItemTypes->search->get_column('itemtype'); |
88 |
if ( C4::Context->preference('item-level_itypes') ) { |
88 |
if ( C4::Context->preference('item-level_itypes') ) { |
89 |
my $items_with_invalid_itype = Koha::Items->search( { itype => { not_in => \@itemtypes } } ); |
89 |
my $items_with_invalid_itype = Koha::Items->search( { -and => [itype => { not_in => \@itemtypes }, itype => { '!=' => '' }] } ); |
90 |
if ( $items_with_invalid_itype->count ) { |
90 |
if ( $items_with_invalid_itype->count ) { |
91 |
new_section("Items have invalid itype defined"); |
91 |
new_section("Items have invalid itype defined"); |
92 |
while ( my $item = $items_with_invalid_itype->next ) { |
92 |
while ( my $item = $items_with_invalid_itype->next ) { |
93 |
- |
|
|