-
- my $itemtypes = GetItemTypes;
- my @itemtypesloop;
- foreach my $thisitemtype (sort keys %$itemtypes) {
- my %row = (
- value => $thisitemtype,
- description => $itemtypes->{$thisitemtype}->{'description'},
- );
- push @itemtypesloop, \%row;
- }
-
- $template->param(itemtypeloop => \@itemtypesloop);
-
-
- my $locations = GetKohaAuthorisedValues( 'items.location' );
- if ($locations) {
- my @location_codes = keys %$locations;
- my $CGIlocation = CGI::scrolling_list(
- -name => 'location',
- -id => 'location',
- -values => \@location_codes,
- -default => $results[0]->{'itemtype'},
- -labels => $locations,
- -size => 1,
- -tabindex => '',
- -multiple => 0
- );
- $template->param( CGIlocation => $CGIlocation );
- }
- my $onlymine=C4::Context->preference('IndependantBranches') &&
- C4::Context->userenv &&
- C4::Context->userenv->{flags} !=1 &&
- C4::Context->userenv->{branch};
- my $branches = GetBranches($onlymine);
- my @branchloop;
- foreach my $thisbranch ( sort keys %$branches ) {
- my %row = (
- value => $thisbranch,
- branchname => $branches->{$thisbranch}->{'branchname'},
- );
- push @branchloop, \%row;
- }
-
- my $auto_barcode = C4::Context->boolean_preference("autoBarcode") || 0;
-
- # See whether barcodes should be automatically allocated.
- # Defaults to 0, meaning "no".
- my $barcode;
- if ( $auto_barcode ) {
- my $sth = $dbh->prepare("Select max(barcode) from items");
- $sth->execute;
- my $data = $sth->fetchrow_hashref;
- $barcode = $results[0]->{'barcode'} + 1;
- $sth->finish;
+ if (C4::Context->preference('AcqCreateItem') eq 'receiving') {
+ # prepare empty item form
+ my $cell = PrepareItemrecordDisplay('','','','ACQ');
+ unless ($cell) {
+ $cell = PrepareItemrecordDisplay('','','','');
+ $template->param('NoACQframework' => 1);
+ }
+ my @itemloop;
+ push @itemloop,$cell;
+
+ $template->param(items => \@itemloop);