|
Lines 71-78
if (!$orderby || $orderby =~ m/ORDER BY issued_today desc\s*$/) {
Link Here
|
| 71 |
}; |
71 |
}; |
| 72 |
} |
72 |
} |
| 73 |
|
73 |
|
|
|
74 |
my $item_level_itypes = C4::Context->preference('item-level_itypes'); |
| 75 |
my $itemtype_field = $item_level_itypes ? 'items.itype' : 'biblioitems.itemtype'; |
| 76 |
|
| 74 |
my @parameters; |
77 |
my @parameters; |
| 75 |
my $sql = ' |
78 |
my $sql = qq{ |
| 76 |
SELECT SQL_CALC_FOUND_ROWS |
79 |
SELECT SQL_CALC_FOUND_ROWS |
| 77 |
issuedate, |
80 |
issuedate, |
| 78 |
date_due, |
81 |
date_due, |
|
Lines 96-103
my $sql = '
Link Here
|
| 96 |
issues.branchcode, |
99 |
issues.branchcode, |
| 97 |
branches.branchname, |
100 |
branches.branchname, |
| 98 |
|
101 |
|
| 99 |
items.itype, |
102 |
$itemtype_field AS itemtype, |
| 100 |
biblioitems.itemtype, |
|
|
| 101 |
|
103 |
|
| 102 |
items.ccode AS collection, |
104 |
items.ccode AS collection, |
| 103 |
|
105 |
|
|
Lines 120-126
my $sql = '
Link Here
|
| 120 |
LEFT JOIN branches ON ( issues.branchcode = branches.branchcode ) |
122 |
LEFT JOIN branches ON ( issues.branchcode = branches.branchcode ) |
| 121 |
LEFT JOIN branches branches2 ON ( items.homebranch = branches2.branchcode ) |
123 |
LEFT JOIN branches branches2 ON ( items.homebranch = branches2.branchcode ) |
| 122 |
WHERE |
124 |
WHERE |
| 123 |
'; |
125 |
}; |
| 124 |
|
126 |
|
| 125 |
my $borrowernumber_sql = 'borrowernumber'; |
127 |
my $borrowernumber_sql = 'borrowernumber'; |
| 126 |
if ( @borrowernumber == 1 ) { |
128 |
if ( @borrowernumber == 1 ) { |
|
Lines 148-155
my $sth = $dbh->prepare($sql);
Link Here
|
| 148 |
$sth->execute(@parameters); |
150 |
$sth->execute(@parameters); |
| 149 |
my ($iTotalDisplayRecords) = $dbh->selectrow_array('SELECT FOUND_ROWS()'); |
151 |
my ($iTotalDisplayRecords) = $dbh->selectrow_array('SELECT FOUND_ROWS()'); |
| 150 |
|
152 |
|
| 151 |
my $item_level_itypes = C4::Context->preference('item-level_itypes'); |
|
|
| 152 |
|
| 153 |
my @checkouts; |
153 |
my @checkouts; |
| 154 |
while ( my $c = $sth->fetchrow_hashref() ) { |
154 |
while ( my $c = $sth->fetchrow_hashref() ) { |
| 155 |
my ($charge) = GetIssuingCharges( $c->{itemnumber}, $c->{borrowernumber} ); |
155 |
my ($charge) = GetIssuingCharges( $c->{itemnumber}, $c->{borrowernumber} ); |
|
Lines 170-176
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
| 170 |
my ( $renewals_count, $renewals_allowed, $renewals_remaining ) = |
170 |
my ( $renewals_count, $renewals_allowed, $renewals_remaining ) = |
| 171 |
GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); |
171 |
GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); |
| 172 |
|
172 |
|
| 173 |
my $itemtype = Koha::ItemTypes->find( $item_level_itypes ? $c->{itype} : $c->{itemtype} ); |
173 |
my $itemtype = Koha::ItemTypes->find( $c->{itemtype} ); |
| 174 |
my $location; |
174 |
my $location; |
| 175 |
if ( $c->{location} ) { |
175 |
if ( $c->{location} ) { |
| 176 |
my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} }); |
176 |
my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} }); |
|
Lines 196-202
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
| 196 |
title => $c->{title}, |
196 |
title => $c->{title}, |
| 197 |
author => $c->{author}, |
197 |
author => $c->{author}, |
| 198 |
barcode => $c->{barcode}, |
198 |
barcode => $c->{barcode}, |
| 199 |
itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, |
199 |
itemtype => $c->{itemtype}, |
| 200 |
itemtype_description => $itemtype ? $itemtype->translated_description : q{}, |
200 |
itemtype_description => $itemtype ? $itemtype->translated_description : q{}, |
| 201 |
collection => $collection, |
201 |
collection => $collection, |
| 202 |
location => $location, |
202 |
location => $location, |
| 203 |
- |
|
|