Lines 2182-2192
sub GetLateOrders {
Link Here
|
2182 |
AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00') |
2182 |
AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00') |
2183 |
"; |
2183 |
"; |
2184 |
my $having = ""; |
2184 |
my $having = ""; |
2185 |
my ($round_sql_start,$round_sql_end) = _get_rounding_sql(); |
|
|
2186 |
if ($dbdriver eq "mysql") { |
2185 |
if ($dbdriver eq "mysql") { |
2187 |
$select .= " |
2186 |
$select .= " |
2188 |
aqorders.quantity - COALESCE(aqorders.quantityreceived,0) AS quantity, |
2187 |
aqorders.quantity - COALESCE(aqorders.quantityreceived,0) AS quantity, |
2189 |
(aqorders.quantity - COALESCE(aqorders.quantityreceived,0)) * $round_sql_start aqorders.rrp $round_sql_end AS subtotal, |
2188 |
(aqorders.quantity - COALESCE(aqorders.quantityreceived,0)) * " . _get_rounding_sql("aqorders.rrp") . " AS subtotal, |
2190 |
DATEDIFF(CAST(now() AS date),closedate) AS latesince |
2189 |
DATEDIFF(CAST(now() AS date),closedate) AS latesince |
2191 |
"; |
2190 |
"; |
2192 |
if ( defined $delay ) { |
2191 |
if ( defined $delay ) { |
Lines 2198-2204
sub GetLateOrders {
Link Here
|
2198 |
# FIXME: account for IFNULL as above |
2197 |
# FIXME: account for IFNULL as above |
2199 |
$select .= " |
2198 |
$select .= " |
2200 |
aqorders.quantity AS quantity, |
2199 |
aqorders.quantity AS quantity, |
2201 |
aqorders.quantity * $round_sql_start aqorders.rrp $round_sql_end AS subtotal, |
2200 |
aqorders.quantity * "._get_rounding_sql("aqorders.rrp")." AS subtotal, |
2202 |
(CAST(now() AS date) - closedate) AS latesince |
2201 |
(CAST(now() AS date) - closedate) AS latesince |
2203 |
"; |
2202 |
"; |
2204 |
if ( defined $delay ) { |
2203 |
if ( defined $delay ) { |
2205 |
- |
|
|