Lines 55-68
my $query = <<EOQ;
Link Here
|
55 |
SELECT |
55 |
SELECT |
56 |
aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber, |
56 |
aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber, |
57 |
quantity-quantityreceived AS tleft, |
57 |
quantity-quantityreceived AS tleft, |
58 |
ecost, budgetdate, entrydate, |
58 |
budgetdate, entrydate, |
59 |
aqbasket.booksellerid, |
59 |
aqbasket.booksellerid, |
60 |
itype, |
60 |
itype, |
61 |
title, |
61 |
title, |
62 |
aqorders.invoiceid, |
62 |
aqorders.invoiceid, |
63 |
aqinvoices.invoicenumber, |
63 |
aqinvoices.invoicenumber, |
64 |
quantityreceived, |
64 |
quantityreceived, |
65 |
unitprice, |
65 |
unitprice_tax_included, |
66 |
datereceived |
66 |
datereceived |
67 |
FROM (aqorders, aqbasket) |
67 |
FROM (aqorders, aqbasket) |
68 |
LEFT JOIN biblio ON |
68 |
LEFT JOIN biblio ON |
Lines 91-99
my @spent;
Link Here
|
91 |
while ( my $data = $sth->fetchrow_hashref ) { |
91 |
while ( my $data = $sth->fetchrow_hashref ) { |
92 |
my $recv = $data->{'quantityreceived'}; |
92 |
my $recv = $data->{'quantityreceived'}; |
93 |
if ( $recv > 0 ) { |
93 |
if ( $recv > 0 ) { |
94 |
my $rowtotal = $recv * $data->{'unitprice'}; |
94 |
my $rowtotal = $recv * $data->{'unitprice_tax_included'}; |
95 |
$data->{'rowtotal'} = sprintf( "%.2f", $rowtotal ); |
95 |
$data->{'rowtotal'} = sprintf( "%.2f", $rowtotal ); |
96 |
$data->{'unitprice'} = sprintf( "%.2f", $data->{'unitprice'} ); |
96 |
$data->{'unitprice'} = sprintf( "%.2f", $data->{'unitprice_tax_included'} ); |
97 |
$subtotal += $rowtotal; |
97 |
$subtotal += $rowtotal; |
98 |
push @spent, $data; |
98 |
push @spent, $data; |
99 |
} |
99 |
} |