Revision f9e1fa33
Von Bernd Bleßmann vor fast 2 Jahren hinzugefügt
SL/Controller/CustomerVendorTurnover.pm | ||
---|---|---|
223 | 223 |
$self->{turnover_statistic} = \@new_stats; |
224 | 224 |
} |
225 | 225 |
|
226 |
if (@{$self->{turnover_statistic}} > 1) { |
|
227 |
my $query = <<SQL; |
|
228 |
SELECT $date_part_select as date_part, |
|
229 |
count(id) as count, |
|
230 |
sum(amount) as amount, |
|
231 |
sum(netamount) as netamount, |
|
232 |
sum(paid) as paid |
|
233 |
FROM $db WHERE $cv_type IS NOT NULL |
|
234 |
GROUP BY $group_by |
|
235 |
ORDER BY $order_by |
|
236 |
SQL |
|
237 |
my $overall_turnover = selectall_hashref_query($::form, $dbh, $query); |
|
238 |
foreach my $stat (@{$self->{turnover_statistic}}) { |
|
239 |
my $overall_stat = first { $_->{date_part} eq $stat->{date_part} } @$overall_turnover; |
|
240 |
$stat->{overall_netamount} = 0; |
|
241 |
$stat->{'overall_' . $_} = $overall_stat->{$_} for keys %$overall_stat; |
|
242 |
} |
|
243 |
} |
|
226 | 244 |
|
227 | 245 |
if ($::request->type eq 'json') { |
228 | 246 |
$self->render(\ SL::JSON::to_json($self->{turnover_statistic}), { layout => 0, type => 'json', process => 0 }); |
Auch abrufbar als: Unified diff
Umsatzstatistik-Chart mit Linie aller Umsätze zum Vergleichen