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