Bug 22392: Allow barcode to be passed to build_sample_item

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2019-02-21 17:26:33 +00:00 committed by Nick Clemens
parent 417e132253
commit 3189df3ac9
1 changed files with 6 additions and 1 deletions

View File

@ -175,11 +175,16 @@ sub build_sample_item {
my $itype = delete $args->{itype}
|| $self->build_object( { class => 'Koha::ItemTypes' } )->itemtype;
my $barcode =
exists( $args->{barcode} )
? $args->{barcode}
: $self->_gen_text( { info => { size => SIZE_BARCODE } } );
my ( undef, undef, $itemnumber ) = C4::Items::AddItem(
{
homebranch => $library,
holdingbranch => $library,
barcode => $self->_gen_text( { info => { size => SIZE_BARCODE } } ),
barcode => $barcode,
itype => $itype,
%$args,
},