From: Thomas Mudrunka Date: Fri, 19 Oct 2012 16:17:09 +0000 (+0200) Subject: Podrobna financni statistika jednotlivych stavu (na zadost Lotka) X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=f3fca77c92e403dfe746a72ab3d24ad326f96de9;p=mirrors%2FSokoMan.git Podrobna financni statistika jednotlivych stavu (na zadost Lotka) --- diff --git a/assistants/stats/financial.inc.php b/assistants/stats/financial.inc.php index fe03f8b..e67e067 100644 --- a/assistants/stats/financial.inc.php +++ b/assistants/stats/financial.inc.php @@ -26,6 +26,8 @@ $queries += array( //TODO: use build_query_select()!!! => 'SELECT COUNT(item_id),SUM(item_price_out),SUM(item_price_in),(SUM(item_price_out)-SUM(item_price_in)) as sale_profit FROM item WHERE item_valid_till=0 AND status_id = 3'.$month_sql_sold, "Skladem celkem $month" => 'SELECT COUNT(item_id),SUM(item_price_in) FROM item WHERE item_valid_till=0 AND status_id = 1'.$month_sql, + "Stavy (podrobně)" + => 'SELECT status_id, status_name, SUM(item_price_in), SUM(item_price_out) FROM status LEFT JOIN item USING(status_id) WHERE item_valid_till=0 GROUP BY status_id;', "Bilance celkem =(prodej - všechny nákupy) $month" => "SELECT ( SUM(item_price_out)