Revision c577184c
Von Moritz Bunkus vor mehr als 6 Jahren hinzugefügt
SL/Controller/Chart.pm | ||
---|---|---|
4 | 4 |
use parent qw(SL::Controller::Base); |
5 | 5 |
|
6 | 6 |
use Clone qw(clone); |
7 |
use List::UtilsBy qw(partition_by sort_by); |
|
8 |
|
|
9 |
use SL::AM; |
|
7 | 10 |
use SL::DB::Chart; |
8 | 11 |
use SL::Controller::Helper::GetModels; |
9 | 12 |
use SL::Locale::String qw(t8); |
... | ... | |
82 | 85 |
} |
83 | 86 |
} |
84 | 87 |
|
88 |
sub action_show_report_configuration_overview { |
|
89 |
my ($self) = @_; |
|
90 |
|
|
91 |
my @all_charts = sort { $a->accno cmp $b->accno } @{ SL::DB::Manager::Chart->get_all(inject_results => 1) }; |
|
92 |
my @types = qw(bilanz bwa er eur); |
|
93 |
my %headings = ( |
|
94 |
bilanz => t8('Balance'), |
|
95 |
bwa => t8('BWA'), |
|
96 |
er => t8('Erfolgsrechnung'), |
|
97 |
eur => t8('EUER'), |
|
98 |
); |
|
99 |
|
|
100 |
my @data; |
|
101 |
|
|
102 |
foreach my $type (@types) { |
|
103 |
my $method = "pos_${type}"; |
|
104 |
my $names = $type eq 'bwa' ? AM->get_bwa_categories(\%::myconfig, $::form) |
|
105 |
: $type eq 'eur' ? AM->get_eur_categories(\%::myconfig, $::form) |
|
106 |
: {}; |
|
107 |
my %charts = partition_by { $_->$method // '' } @all_charts; |
|
108 |
delete $charts{''}; |
|
109 |
|
|
110 |
next if !%charts; |
|
111 |
|
|
112 |
push @data, { |
|
113 |
type => $type, |
|
114 |
heading => $headings{$type}, |
|
115 |
charts => \%charts, |
|
116 |
positions => [ sort { ($a * 1) <=> ($b * 1) } keys %charts ], |
|
117 |
names => $names, |
|
118 |
}; |
|
119 |
} |
|
120 |
|
|
121 |
$self->render('chart/report_configuration_overview', DATA => \@data); |
|
122 |
} |
|
123 |
|
|
85 | 124 |
sub init_charts { |
86 | 125 |
|
87 | 126 |
# disable pagination when hiding chart details = paginate when showing chart details |
Auch abrufbar als: Unified diff
Konten: Berichtskonfigurationsübersicht
Listet für die Berichte EÜR, BWA, Bilanz und Erfolgsrechnung alle
Konten gruppiert nach ihrer Position im Bericht auf.