use parent qw(SL::Controller::Base);
use Clone qw(clone);
+use List::UtilsBy qw(partition_by sort_by);
+
+use SL::AM;
use SL::DB::Chart;
use SL::Controller::Helper::GetModels;
use SL::Locale::String qw(t8);
}
}
+sub action_show_report_configuration_overview {
+ my ($self) = @_;
+
+ my @all_charts = sort { $a->accno cmp $b->accno } @{ SL::DB::Manager::Chart->get_all(inject_results => 1) };
+ my @types = qw(bilanz bwa er eur);
+ my %headings = (
+ bilanz => t8('Balance'),
+ bwa => t8('BWA'),
+ er => t8('Erfolgsrechnung'),
+ eur => t8('EUER'),
+ );
+
+ my @data;
+
+ foreach my $type (@types) {
+ my $method = "pos_${type}";
+ my $names = $type eq 'bwa' ? AM->get_bwa_categories(\%::myconfig, $::form)
+ : $type eq 'eur' ? AM->get_eur_categories(\%::myconfig, $::form)
+ : {};
+ my %charts = partition_by { $_->$method // '' } @all_charts;
+ delete $charts{''};
+
+ next if !%charts;
+
+ push @data, {
+ type => $type,
+ heading => $headings{$type},
+ charts => \%charts,
+ positions => [ sort { ($a * 1) <=> ($b * 1) } keys %charts ],
+ names => $names,
+ };
+ }
+
+ $self->render('chart/report_configuration_overview', DATA => \@data);
+}
+
sub init_charts {
# disable pagination when hiding chart details = paginate when showing chart details
'Chart' => 'Buchungskonto',
'Chart Type' => 'Kontentyp',
'Chart balance' => 'Kontensaldo',
+ 'Chart configuration overview regarding reports' => 'Kontenkonfigurationsübersicht bezüglich Berichte',
'Chart list' => 'Kontenliste',
'Chart of Accounts' => 'Kontenübersicht',
'Chart picker' => 'Kontenauswahl',
'Port' => 'Port',
'Portrait' => 'Hochformat',
'Position' => 'Position',
+ 'Position #1' => 'Position #1',
+ 'Position #1: #2' => 'Position #1: #2',
'Position identity fields for fill up?' => 'Felder, die für Abgleich übereinstimmen müssen?',
'Position type in quotation/order' => 'Positionstyp in Angebot/Auftrag',
'Positions' => 'Positionen',
'Report about warehouse contents' => 'Lagerbestand anzeigen',
'Report about warehouse transactions' => 'Lagerbuchungen anzeigen',
'Report and misc. Preferences' => 'Sonstige Einstellungen',
+ 'Report configuration overview' => 'Berichtskonfigurationsübersicht',
'Report date' => 'Berichtsdatum',
'Report for' => 'Bericht für',
'Report separately' => 'Preis separat ausweisen',
module: am.pl
params:
action: list_account
+- parent: system_chart_of_accounts
+ id: system_chart_of_accounts_report_configuration_overview
+ name: Report configuration overview
+ order: 300
+ params:
+ action: Chart/show_report_configuration_overview
- parent: system
id: system_buchungsgruppen
name: Booking groups
--- /dev/null
+[%- USE HTML -%][%- USE LxERP -%][%- USE L -%]<h1>[% LxERP.t8("Chart configuration overview regarding reports") %]</h1>
+
+[% FOREACH data = DATA %]
+ [% UNLESS data.size == 1 %]
+ <div id="[% HTML.escape(data.type) %]">
+ [% LxERP.t8("Jump to") %]:
+ [% FOREACH jump = DATA %]
+ [% IF jump.type != data.type %]
+ [% L.link("#" _ jump.type, jump.heading) %]
+ [% END %]
+ [% END %]
+ </div>
+ [% END %]
+
+ <h2>[% HTML.escape(data.heading) %]</h2>
+
+ [% FOREACH pos = data.positions %]
+ [%- SET name = data.names.item(pos) %]
+ <h3>[% IF name %][% LxERP.t8("Position #1: #2", pos, name) %][% ELSE %][% LxERP.t8("Position #1", pos) %][% END %]</h3>
+
+ [%- SET charts = data.charts.$pos %]
+ <table>
+ <thead>
+ <tr class="listheading">
+ <th>[% LxERP.t8("Account") %]</th>
+ <th>[% LxERP.t8("Description") %]</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ [% FOREACH chart = charts %]
+ <tr>
+ <td>[% L.link("am.pl?action=edit_account&id=" _ chart.id, chart.accno) %]</td>
+ <td>[% HTML.escape(chart.description) %]</td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
+ [% END %]
+[% END %]