- foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
- # check for reserves
- my ( $restype, $res, undef ) = CheckReserves( $issue->{'itemnumber'} );
- if ( $restype ) {
- $issue->{'reserved'} = 1;
- }
-
- my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
- my $charges = 0;
- foreach my $ac (@$accts) {
- if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) {
- $charges += $ac->{'amountoutstanding'}
- if $ac->{'accounttype'} eq 'F';
- $charges += $ac->{'amountoutstanding'}
- if $ac->{'accounttype'} eq 'L';
- }
- }
- $issue->{'charges'} = $charges;
-
- # get publictype for icon
-
- my $publictype = $issue->{'publictype'};
- $issue->{$publictype} = 1;
-
- # check if item is renewable
- my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
- ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
+ foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
+ # check for reserves
+ my $restype = GetReserveStatus( $issue->{'itemnumber'} );
+ if ( $restype ) {
+ $issue->{'reserved'} = 1;
+ }
+
+ my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
+ my $charges = 0;
+ foreach my $ac (@$accts) {
+ if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) {
+ $charges += $ac->{'amountoutstanding'}
+ if $ac->{'accounttype'} eq 'F';
+ $charges += $ac->{'amountoutstanding'}
+ if $ac->{'accounttype'} eq 'FU';
+ $charges += $ac->{'amountoutstanding'}
+ if $ac->{'accounttype'} eq 'L';
+ }
+ }
+ $issue->{'charges'} = $charges;
+ $issue->{'subtitle'} = GetRecordValue('subtitle', GetMarcBiblio($issue->{'biblionumber'}), GetFrameworkCode($issue->{'biblionumber'}));
+ # check if item is renewable
+ my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
+ ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});