Lines 25-31
use JSON qw(to_json);
Link Here
|
25 |
|
25 |
|
26 |
use C4::Auth qw(check_cookie_auth haspermission get_session); |
26 |
use C4::Auth qw(check_cookie_auth haspermission get_session); |
27 |
use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue ); |
27 |
use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue ); |
28 |
use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate); |
28 |
use C4::Circulation qw(CanBookBeRenewed GetRenewCount GetSoonestRenewDate); |
29 |
use C4::Overdues qw(GetFine); |
29 |
use C4::Overdues qw(GetFine); |
30 |
use C4::Context; |
30 |
use C4::Context; |
31 |
|
31 |
|
Lines 63-69
binmode STDOUT, ":encoding(UTF-8)";
Link Here
|
63 |
print $input->header( -type => 'text/plain', -charset => 'UTF-8' ); |
63 |
print $input->header( -type => 'text/plain', -charset => 'UTF-8' ); |
64 |
|
64 |
|
65 |
my @parameters; |
65 |
my @parameters; |
66 |
my $sql = ' |
66 |
my $sql = <<EOQ; |
67 |
SELECT |
67 |
SELECT |
68 |
issuedate, |
68 |
issuedate, |
69 |
date_due, |
69 |
date_due, |
Lines 100-105
my $sql = '
Link Here
|
100 |
location, |
100 |
location, |
101 |
items.enumchron, |
101 |
items.enumchron, |
102 |
|
102 |
|
|
|
103 |
acc.amountoutstanding, |
104 |
|
103 |
DATEDIFF( issuedate, CURRENT_DATE() ) AS not_issued_today |
105 |
DATEDIFF( issuedate, CURRENT_DATE() ) AS not_issued_today |
104 |
FROM issues |
106 |
FROM issues |
105 |
LEFT JOIN items USING ( itemnumber ) |
107 |
LEFT JOIN items USING ( itemnumber ) |
Lines 108-115
my $sql = '
Link Here
|
108 |
LEFT JOIN borrowers USING ( borrowernumber ) |
110 |
LEFT JOIN borrowers USING ( borrowernumber ) |
109 |
LEFT JOIN branches ON ( issues.branchcode = branches.branchcode ) |
111 |
LEFT JOIN branches ON ( issues.branchcode = branches.branchcode ) |
110 |
LEFT JOIN branches branches2 ON ( items.homebranch = branches2.branchcode ) |
112 |
LEFT JOIN branches branches2 ON ( items.homebranch = branches2.branchcode ) |
|
|
113 |
LEFT OUTER JOIN ( |
114 |
SELECT borrowernumber, itemnumber, SUM(amountoutstanding) AS amountoutstanding |
115 |
FROM accountlines WHERE accounttype = 'Rent' |
116 |
GROUP BY borrowernumber, itemnumber |
117 |
) acc USING ( borrowernumber, itemnumber ) |
111 |
WHERE borrowernumber |
118 |
WHERE borrowernumber |
112 |
'; |
119 |
EOQ |
113 |
|
120 |
|
114 |
if ( @borrowernumber == 1 ) { |
121 |
if ( @borrowernumber == 1 ) { |
115 |
$sql .= '= ?'; |
122 |
$sql .= '= ?'; |
Lines 130-136
my $item_level_itypes = C4::Context->preference('item-level_itypes');
Link Here
|
130 |
my @checkouts_today; |
137 |
my @checkouts_today; |
131 |
my @checkouts_previous; |
138 |
my @checkouts_previous; |
132 |
while ( my $c = $sth->fetchrow_hashref() ) { |
139 |
while ( my $c = $sth->fetchrow_hashref() ) { |
133 |
my ($charge) = GetIssuingCharges( $c->{itemnumber}, $c->{borrowernumber} ); |
|
|
134 |
my $fine = GetFine( $c->{itemnumber}, $c->{borrowernumber} ); |
140 |
my $fine = GetFine( $c->{itemnumber}, $c->{borrowernumber} ); |
135 |
|
141 |
|
136 |
my ( $can_renew, $can_renew_error ) = |
142 |
my ( $can_renew, $can_renew_error ) = |
Lines 178-184
while ( my $c = $sth->fetchrow_hashref() ) {
Link Here
|
178 |
branchcode => $c->{branchcode}, |
184 |
branchcode => $c->{branchcode}, |
179 |
branchname => $c->{branchname}, |
185 |
branchname => $c->{branchname}, |
180 |
itemcallnumber => $c->{itemcallnumber} || q{}, |
186 |
itemcallnumber => $c->{itemcallnumber} || q{}, |
181 |
charge => $charge, |
187 |
charge => $c->{amountoutstanding} || 0.00, |
182 |
fine => $fine, |
188 |
fine => $fine, |
183 |
price => $c->{replacementprice} || q{}, |
189 |
price => $c->{replacementprice} || q{}, |
184 |
can_renew => $can_renew, |
190 |
can_renew => $can_renew, |
185 |
- |
|
|