Hallo zusammen.
In der "/admin/start.php" kann ich hinterlegen, welche Statistik mir ausgegeben werden soll.
$turnover_query = xtc_db_query("SELECT round(coalesce(sum(if(date(o.date_purchased) = current_date, ot.value/o.currency_value, null)), 0), 2) today,
round(coalesce(sum(if(date(o.date_purchased) = current_date - interval 1 day, ot.value/o.currency_value, null)), 0), 2) yesterday,
round(coalesce(sum(if(extract(year_month from o.date_purchased) = extract(year_month from current_date), ot.value/o.currency_value, null)), 0), 2) this_month,
round(coalesce(sum(if(extract(year_month from o.date_purchased) = extract(year_month from current_date - interval 1 year), ot.value/o.currency_value, null)), 0), 2) this_month_last_year,
round(coalesce(sum(if(extract(year_month from o.date_purchased) = extract(year_month from current_date - interval 1 year_month), ot.value/o.currency_value, null)), 0), 2) last_month,
round(coalesce(sum(if(extract(year_month from o.date_purchased) = extract(year_month from current_date - interval 1 year_month - interval 1 year), ot.value/o.currency_value, null)), 0), 2) last_month_last_year,
round(coalesce(sum(if(extract(year_month from o.date_purchased) = extract(year_month from current_date - interval 1 year_month) and o.orders_status <> 1, ot.value/o.currency_value, null)), 0), 2) last_month_paid,
round(coalesce(sum(if(extract(year from o.date_purchased) = extract(year from current_date - interval 1 year), ot.value/o.currency_value, null)), 0), 2) last_year,
round(coalesce(sum(if(extract(year from o.date_purchased) = extract(year from current_date), ot.value/o.currency_value, null)), 0), 2) this_year,
round(coalesce(sum(ot.value/o.currency_value), 0), 2) total
FROM " . TABLE_ORDERS . " o
JOIN " . TABLE_ORDERS_TOTAL . " ot
ON ot.orders_id = o.orders_id
WHERE ot.class = 'ot_total'
".$where);
$turnover = xtc_db_fetch_array($turnover_query);
Ich möchte, dass mir der Umsatz ohne Umsatzsteuer angezeigt wird.
Ich bin soweit gekommen, das aus der Order_total sich den Wert ot_total zieht.
Diesen benötige ich Minus dem Wert aus der ot_tax, welche auch inder Order_Total vorhanden ist.
Nur wie ich es umsetzen muss, dazu fehlt mir die Kenntnis.
Daher wäre ich für eine Hilfe dankbar.
Gruß Heiko
Linkback: https://www.modified-shop.org/forum/index.php?topic=41515.0