SELECT
aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber,
quantity-quantityreceived AS tleft,
- ecost, budgetdate, entrydate,
+ ecost_tax_included, budgetdate, entrydate,
aqbasket.booksellerid,
aqbooksellers.name as vendorname,
itype,
(datecancellationprinted IS NULL OR
datecancellationprinted='0000-00-00') AND
(quantity > quantityreceived OR quantityreceived IS NULL)
- GROUP BY aqorders.ordernumber
+ GROUP BY aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber,
+ tleft,
+ ecost, budgetdate, entrydate,
+ aqbasket.booksellerid,
+ aqbooksellers.name,
+ itype,
+ title
EOQ
my $sth = $dbh->prepare($query);
$left = $data->{'quantity'};
}
if ( $left && $left > 0 ) {
- my $subtotal = $left * $data->{'ecost'};
+ my $subtotal = $left * $data->{'ecost_tax_included'};
$data->{subtotal} = sprintf( "%.2f", $subtotal );
$data->{'left'} = $left;
push @ordered, $data;