foreach $item (@categories_cent) {
$form->{$item} =
- $form->format_amount($myconfig, $form->round_amount($form->{$item}, 2),
- 2, '0');
+ $form->format_amount($myconfig, $form->{$item}, '2', '0');
}
foreach $item (@categories_euro) {
$form->{$item} =
- $form->format_amount($myconfig, $form->round_amount($form->{$item}, 0),
- 0, '0');
+ $form->format_amount($myconfig, $form->{$item}, '0', '0');
}
$dbh->disconnect;
my $glwhere = "";
my $subwhere = "";
my $ARwhere = "";
+ my $APwhere = '';
my $arwhere = "";
my $item;
$subwhere .= " AND transdate >= '$fromdate'";
$glwhere = " AND ac.transdate >= '$fromdate'";
$ARwhere .= " AND acc.transdate >= '$fromdate'";
+ $APwhere .= " AND AP.transdate >= '$fromdate'";
}
$where .= " AND ac.transdate >= '$fromdate'";
}
$where .= " AND ac.transdate <= '$todate'";
$ARwhere .= " AND acc.transdate <= '$todate'";
$subwhere .= " AND transdate <= '$todate'";
+ $APwhere .= " AND AP.transdate <= '$todate'";
}
if ($department_id) {
UNION -- alle Ausgaben AP erfassen
- SELECT sum(ac.amount) AS amount, c.$category
- FROM acc_trans ac
- JOIN chart c ON (c.id = ac.chart_id)
- $dpt_join
- WHERE
- $where
- AND c.link LIKE '%AP_amount%'
- $dpt_where
- $project
- GROUP BY c.$category
-
- UNION -- alle Ausgaben und Einnahmen direkter gl Buchungen erfassen
+ SELECT
+ sum(ac.amount) AS amount, pos_ustva
+ FROM acc_trans ac
+ JOIN AP ON (AP.id = ac.trans_id )
+ JOIN chart c ON (c.id = ac.chart_id AND pos_ustva NOT LIKE '')
+ WHERE
+ 1=1
+ $APwhere
+ $dpt_where
+ $project
+ GROUP BY pos_ustva
+
+ UNION -- alle Ausgaben und Einnahmen direkter gl Buchungen erfassen
SELECT sum
(