- push @temp, $itm if $itm->{'itemtype'};
-}
-@items = @temp;
-my $itemcount = @items;
-$template->param( itemcount => $itemcount );
-
-my %types;
-my %itemtypes;
-my @duedates;
-foreach my $itm (@items) {
- push @duedates, { date_due => format_date( $itm->{'date_due'} ) }
- if defined $itm->{'date_due'};
- $itm->{ $itm->{'publictype'} } = 1;
- my $fee = GetReserveFee( undef, $borrowernumber, $itm->{'biblionumber'},
- 'a', ( $itm->{'biblioitemnumber'} ) );
- $fee = sprintf "%.02f", $fee;
- $itm->{'reservefee'} = $fee;
- my $pty = $itm->{'publictype'};
- $itemtypes{ $itm->{'itemtype'} } = $itm;
- unless ( $types{$pty} ) {
- $types{$pty}->{'count'} = 1;
- $types{$pty}->{ $itm->{'itemtype'} } = 1;
- push @{ $types{$pty}->{'items'} }, $itm;
- }
- else {
- unless ( $types{$pty}->{ $itm->{'itemtype'} } ) {
- $types{$pty}->{'count'}++;
- $types{$pty}->{ $itm->{'itemtype'} } = 1;
- push @{ $types{$pty}->{'items'} }, $itm;
- }
- }
-}
-
-$template->param( ITEMS => \@duedates );
-
-my $width = keys %types;
-my @publictypes = sort { $b->{'count'} <=> $a->{'count'} } values %types;
-my $typecount;
-foreach my $pt (@publictypes) {
- $typecount += $pt->{'count'};
-}
-$template->param( onlyone => 1 ) if $typecount == 1;
-
-my @typerows;
-for ( my $rownum = 0 ; $rownum < $publictypes[0]->{'count'} ; $rownum++ ) {
- my @row;
- foreach my $pty (@publictypes) {
- my @items = @{ $pty->{'items'} };
- push @row, $items[$rownum] if defined $items[$rownum];
+ $debug and warn $itm->{'notforloan'};
+ my $fee = GetReserveFee( undef, $borrowernumber, $itm->{'biblionumber'}, 'a', ( $itm->{'biblioitemnumber'} ) );
+ $itm->{'reservefee'} = sprintf "%.02f", $fee;
+ # pass itype to itemtype for display purposes.
+ $itm->{'itemtype'} = $itm->{'itype'} if(C4::Context->preference('item-level_itypes'));
+ $itemhash{$itm->{'itemnumber'}}=$itm;
+ if (!$itm->{'notforloan'} && !($itm->{'itemnotforloan'} > 0)){
+ $forloan=1;