From: Moritz Bunkus Date: Fri, 27 Oct 2017 10:38:33 +0000 (+0200) Subject: Konten: Berichtskonfigurationsübersicht X-Git-Tag: release-3.5.4~667 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c577184c1d4b43ce281948016c1c4de16d095b5f;p=kivitendo-erp.git Konten: Berichtskonfigurationsübersicht Listet für die Berichte EÜR, BWA, Bilanz und Erfolgsrechnung alle Konten gruppiert nach ihrer Position im Bericht auf. --- diff --git a/SL/Controller/Chart.pm b/SL/Controller/Chart.pm index 0e3e2b6fc..eb2b4739a 100644 --- a/SL/Controller/Chart.pm +++ b/SL/Controller/Chart.pm @@ -4,6 +4,9 @@ use strict; 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); @@ -82,6 +85,42 @@ sub action_show { } } +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 diff --git a/locale/de/all b/locale/de/all index 0d025a904..5a0b28bd2 100755 --- a/locale/de/all +++ b/locale/de/all @@ -575,6 +575,7 @@ $self->{texts} = { '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', @@ -2259,6 +2260,8 @@ $self->{texts} = { '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', @@ -2508,6 +2511,7 @@ $self->{texts} = { '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', diff --git a/menus/user/00-erp.yaml b/menus/user/00-erp.yaml index 64d17d15e..281aeb11b 100644 --- a/menus/user/00-erp.yaml +++ b/menus/user/00-erp.yaml @@ -1071,6 +1071,12 @@ 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 diff --git a/templates/webpages/chart/report_configuration_overview.html b/templates/webpages/chart/report_configuration_overview.html new file mode 100644 index 000000000..5178ba6e8 --- /dev/null +++ b/templates/webpages/chart/report_configuration_overview.html @@ -0,0 +1,40 @@ +[%- USE HTML -%][%- USE LxERP -%][%- USE L -%]

[% LxERP.t8("Chart configuration overview regarding reports") %]

+ +[% FOREACH data = DATA %] + [% UNLESS data.size == 1 %] +
+ [% LxERP.t8("Jump to") %]: + [% FOREACH jump = DATA %] + [% IF jump.type != data.type %] + [% L.link("#" _ jump.type, jump.heading) %] + [% END %] + [% END %] +
+ [% END %] + +

[% HTML.escape(data.heading) %]

+ + [% FOREACH pos = data.positions %] + [%- SET name = data.names.item(pos) %] +

[% IF name %][% LxERP.t8("Position #1: #2", pos, name) %][% ELSE %][% LxERP.t8("Position #1", pos) %][% END %]

+ + [%- SET charts = data.charts.$pos %] + + + + + + + + + + [% FOREACH chart = charts %] + + + + + [% END %] + +
[% LxERP.t8("Account") %][% LxERP.t8("Description") %]
[% L.link("am.pl?action=edit_account&id=" _ chart.id, chart.accno) %][% HTML.escape(chart.description) %]
+ [% END %] +[% END %]