Lines 140-145
$sth->execute(@parameters);
Link Here
|
140 |
my $item_level_itypes = C4::Context->preference('item-level_itypes'); |
140 |
my $item_level_itypes = C4::Context->preference('item-level_itypes'); |
141 |
my $claims_returned_lost_value = C4::Context->preference('ClaimReturnedLostValue'); |
141 |
my $claims_returned_lost_value = C4::Context->preference('ClaimReturnedLostValue'); |
142 |
|
142 |
|
|
|
143 |
my $itemtypes = { map { $_->{itemtype} => $_->{translated_description} } @{ Koha::ItemTypes->search_with_localization->unblessed } }; |
144 |
|
143 |
my @checkouts_today; |
145 |
my @checkouts_today; |
144 |
my @checkouts_previous; |
146 |
my @checkouts_previous; |
145 |
while ( my $c = $sth->fetchrow_hashref() ) { |
147 |
while ( my $c = $sth->fetchrow_hashref() ) { |
Lines 161-190
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
161 |
my ( $renewals_count, $renewals_allowed, $renewals_remaining ) = |
163 |
my ( $renewals_count, $renewals_allowed, $renewals_remaining ) = |
162 |
GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); |
164 |
GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); |
163 |
|
165 |
|
164 |
my $type_for_stat = Koha::ItemTypes->find( $item_level_itypes ? $c->{itype} : $c->{itemtype} ); |
166 |
my $itemtype = $itemtypes->{ $c->{itype} } if $c->{itype}; |
165 |
my $itemtype = Koha::ItemTypes->find( $c->{itype} ); |
167 |
my $recordtype = $itemtypes->{ $c->{itemtype} } if $c->{itemtype}; |
166 |
my $recordtype = Koha::ItemTypes->find( $c->{itemtype} ); |
168 |
my $type_for_stat = $item_level_itypes ? $itemtype : $recordtype; |
167 |
my $location; |
169 |
my $location; |
168 |
if ( $c->{location} ) { |
170 |
if ( $c->{location} ) { |
169 |
my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} }); |
171 |
my $av = Koha::AuthorisedValues->get_description_by_koha_field( |
170 |
$location = $av->count ? $av->next->lib : ''; |
172 |
{ kohafield => 'items.location', authorised_value => $c->{location} } ); |
|
|
173 |
$location = $av->{lib} ? $av->{lib} : ''; |
171 |
} |
174 |
} |
172 |
my $collection; |
175 |
my $collection; |
173 |
if ( $c->{collection} ) { |
176 |
if ( $c->{collection} ) { |
174 |
my $av = Koha::AuthorisedValues->search({ category => 'CCODE', authorised_value => $c->{collection} }); |
177 |
my $av = Koha::AuthorisedValues->get_description_by_koha_field( |
175 |
$collection = $av->count ? $av->next->lib : ''; |
178 |
{ kohafield => 'items.ccode', authorised_value => $c->{collection} } ); |
|
|
179 |
$collection = $av->{lib} ? $av->{lib} : ''; |
176 |
} |
180 |
} |
177 |
my $lost; |
181 |
my $lost; |
178 |
my $claims_returned; |
182 |
my $claims_returned; |
179 |
if ( $c->{itemlost} ) { |
183 |
if ( $c->{itemlost} ) { |
180 |
my $av = Koha::AuthorisedValues->search({ category => 'LOST', authorised_value => $c->{itemlost} }); |
184 |
my $av = Koha::AuthorisedValues->get_description_by_koha_field( |
181 |
$lost = $av->count ? $av->next->lib : ''; |
185 |
{ kohafield => 'items.itemlost', authorised_value => $c->{itemlost} } ); |
|
|
186 |
$lost = $av->{lib} ? $av->{lib} : ''; |
182 |
$claims_returned = $c->{itemlost} eq $claims_returned_lost_value; |
187 |
$claims_returned = $c->{itemlost} eq $claims_returned_lost_value; |
183 |
} |
188 |
} |
184 |
my $damaged; |
189 |
my $damaged; |
185 |
if ( $c->{damaged} ) { |
190 |
if ( $c->{damaged} ) { |
186 |
my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} }); |
191 |
my $av = Koha::AuthorisedValues->get_description_by_koha_field( |
187 |
$damaged = $av->count ? $av->next->lib : ''; |
192 |
{ kohafield => 'items.damaged', authorised_value => $c->{damaged} } ); |
|
|
193 |
$damaged = $av->{lib} ? $av->{lib} : ''; |
188 |
} |
194 |
} |
189 |
my @subtitles = split(/ \| /, $c->{'subtitle'} // '' ); |
195 |
my @subtitles = split(/ \| /, $c->{'subtitle'} // '' ); |
190 |
my $checkout = { |
196 |
my $checkout = { |
Lines 196-204
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
196 |
part_name => $c->{part_name} // '', |
202 |
part_name => $c->{part_name} // '', |
197 |
author => $c->{author}, |
203 |
author => $c->{author}, |
198 |
barcode => $c->{barcode}, |
204 |
barcode => $c->{barcode}, |
199 |
type_for_stat => $type_for_stat ? $type_for_stat->translated_description : q{}, |
205 |
type_for_stat => $type_for_stat || q{}, |
200 |
itemtype_description => $itemtype ? $itemtype->translated_description : q{}, |
206 |
itemtype_description => $itemtype || q{}, |
201 |
recordtype_description => $recordtype ? $recordtype->translated_description : q{}, |
207 |
recordtype_description => $recordtype || q{}, |
202 |
collection => $collection, |
208 |
collection => $collection, |
203 |
location => $location, |
209 |
location => $location, |
204 |
homebranch => $c->{homebranch}, |
210 |
homebranch => $c->{homebranch}, |
205 |
- |
|
|