updates and restart camps
This commit is contained in:
@@ -10,12 +10,31 @@ if ($this->is_id()) {
|
||||
# todo: stat_group-ok és stat_value-k
|
||||
|
||||
if (1 == $this->get_id()) {
|
||||
/* adatok:
|
||||
bevétel kp + utalás
|
||||
kiadás kp + utalás
|
||||
összebevétel
|
||||
összkiadás
|
||||
totál balance
|
||||
*/
|
||||
$in_cash_query = "SELECT sum(mi_sum) FROM money_income WHERE mi_deleted = 0 AND mi_payment_type_pt_id = 1";
|
||||
$in_transfer_query = "SELECT sum(mi_sum) FROM money_income WHERE mi_deleted = 0 AND mi_payment_type_pt_id = 2";
|
||||
|
||||
$out_cash_query = "SELECT sum(mox_sum) FROM money_expense WHERE mox_deleted = 0 AND mox_payment_type_pt_id = 1";
|
||||
$out_transfer_query = "SELECT sum(mox_sum) FROM money_expense WHERE mox_deleted = 0 AND mox_payment_type_pt_id = 2";
|
||||
|
||||
$in_cash = $sql->single_variable($in_cash_query);
|
||||
$out_cash = $sql->single_variable($out_cash_query);
|
||||
|
||||
$in_transfer = $sql->single_variable($in_transfer_query);
|
||||
$out_transfer = $sql->single_variable($out_transfer_query);
|
||||
|
||||
$balance_query = "
|
||||
select
|
||||
(select
|
||||
sum(mod_sum)
|
||||
select
|
||||
(select
|
||||
sum(mi_sum)
|
||||
from
|
||||
money_deposit where mod_deleted = 0) - (select
|
||||
money_income where mi_deleted = 0) - (select
|
||||
sum(mox_sum)
|
||||
from
|
||||
money_expense where mox_deleted = 0) as diff
|
||||
@@ -24,6 +43,10 @@ if ($this->is_id()) {
|
||||
|
||||
$balance = $sql->single_variable($balance_query);
|
||||
|
||||
$smarty->assign('in_cash',$in_cash);
|
||||
$smarty->assign('out_cash',$out_cash);
|
||||
$smarty->assign('in_transfer',$in_transfer);
|
||||
$smarty->assign('out_transfer',$out_transfer);
|
||||
$smarty->assign('balance',$balance);
|
||||
$smarty->display('stat_balance.tpl');
|
||||
}
|
||||
@@ -31,7 +54,7 @@ if ($this->is_id()) {
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
|
||||
# STAT LISTA
|
||||
|
||||
$stat_query = "SELECT * FROM statistics WHERE stat_deleted = 0 ORDER BY stat_order ASC;";
|
||||
@@ -46,11 +69,11 @@ else {
|
||||
|
||||
$smarty->assign('stats',$stats);
|
||||
$smarty->display('stat_list.tpl');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user