|
Lines 87-92
my $sql = '
Link Here
|
| 87 |
issues.branchcode, |
87 |
issues.branchcode, |
| 88 |
branches.branchname, |
88 |
branches.branchname, |
| 89 |
|
89 |
|
|
|
90 |
items.ccode, |
| 90 |
items.itype, |
91 |
items.itype, |
| 91 |
biblioitems.itemtype, |
92 |
biblioitems.itemtype, |
| 92 |
|
93 |
|
|
Lines 148-154
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
| 148 |
my ( $renewals_count, $renewals_allowed, $renewals_remaining ) = |
149 |
my ( $renewals_count, $renewals_allowed, $renewals_remaining ) = |
| 149 |
GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); |
150 |
GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); |
| 150 |
|
151 |
|
| 151 |
my $itemtype = Koha::ItemTypes->find( $item_level_itypes ? $c->{itype} : $c->{itemtype} ); |
152 |
my $itemtypes; |
|
|
153 |
foreach my $key (qw(itemtype itype)) { |
| 154 |
if ($c->{$key}) { |
| 155 |
my $itemtype = Koha::ItemTypes->find($c->{$key}); |
| 156 |
if ($itemtype) { |
| 157 |
$itemtypes->{$key} = $itemtype->TO_JSON; |
| 158 |
$itemtypes->{$key}->{translated_description} = $itemtype->translated_description; |
| 159 |
} |
| 160 |
} |
| 161 |
} |
| 152 |
my $location; |
162 |
my $location; |
| 153 |
if ( $c->{location} ) { |
163 |
if ( $c->{location} ) { |
| 154 |
my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} }); |
164 |
my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} }); |
|
Lines 164-176
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
| 164 |
my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} }); |
174 |
my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} }); |
| 165 |
$damaged = $av->count ? $av->next->lib : ''; |
175 |
$damaged = $av->count ? $av->next->lib : ''; |
| 166 |
} |
176 |
} |
|
|
177 |
my $ccode; |
| 178 |
if ($c->{ccode}) { |
| 179 |
my $av = Koha::AuthorisedValues->search({ category => 'CCODE', authorised_value => $c->{ccode} }); |
| 180 |
$ccode = $av->count ? $av->next->lib : $c->{ccode}; |
| 181 |
} |
| 167 |
my $checkout = { |
182 |
my $checkout = { |
| 168 |
DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, |
183 |
DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, |
| 169 |
title => $c->{title}, |
184 |
title => $c->{title}, |
| 170 |
author => $c->{author}, |
185 |
author => $c->{author}, |
| 171 |
barcode => $c->{barcode}, |
186 |
barcode => $c->{barcode}, |
| 172 |
itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, |
187 |
itemtypes => $itemtypes, |
| 173 |
itemtype_description => $itemtype ? $itemtype->translated_description : q{}, |
188 |
ccode => $ccode, |
| 174 |
location => $location, |
189 |
location => $location, |
| 175 |
homebranch => $c->{homebranch}, |
190 |
homebranch => $c->{homebranch}, |
| 176 |
itemnotes => $c->{itemnotes}, |
191 |
itemnotes => $c->{itemnotes}, |
| 177 |
- |
|
|