From fe146cf9a5b89ab5a83791ff4015419c9d91296d Mon Sep 17 00:00:00 2001 From: Ricsi Date: Wed, 2 Oct 2019 11:55:59 +0200 Subject: [PATCH] show mod sum --- _class/class_money_deposit.php | 17 +++++++++++++++++ _css/default.css | 5 +++++ template/templates/money_deposit.tpl | 2 ++ 3 files changed, 24 insertions(+) diff --git a/_class/class_money_deposit.php b/_class/class_money_deposit.php index 78a3f7f..4d2af75 100644 --- a/_class/class_money_deposit.php +++ b/_class/class_money_deposit.php @@ -227,6 +227,23 @@ class money_deposit { return $expireDate; } + public static function get_month_mod_sum($_year, $_month) { + global $sql; + + return $sql->single_variable(" + SELECT + SUM(mi_sum) + FROM + money_deposit + JOIN + money_income ON mi_id = mod_money_income_mi_id + WHERE + mi_date LIKE '%{$_year}-{$_month}%' + AND mi_deleted = 0 + AND mod_deleted = 0 + "); + } + } ?> diff --git a/_css/default.css b/_css/default.css index 5075b67..b03ba76 100644 --- a/_css/default.css +++ b/_css/default.css @@ -748,6 +748,11 @@ form#auto_filters > div > label { background-color: #f6625c; } +.mod_sum { + float: right; + margin-right: 4vw; +} + @media (min-width: 680px) { .categories { diff --git a/template/templates/money_deposit.tpl b/template/templates/money_deposit.tpl index d6c3800..991a7f0 100644 --- a/template/templates/money_deposit.tpl +++ b/template/templates/money_deposit.tpl @@ -18,6 +18,8 @@ {$mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:0:4}. {$months[$mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:5:2]} + {assign var="sum" value=money_deposit::get_month_mod_sum($mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:0:4, $mod_array[$mod@index]->get_mod_money_income()->get_mi_date()|substr:5:2)} + {if sum != null}{$sum|number_format:0:'':' '}{else}0{/if} Ft