From: Sven Schöling Date: Mon, 6 Jan 2014 14:37:52 +0000 (+0100) Subject: all_parts: Warnung wenn versucht wird l_soldtotal ohne bsooqr aufzurufen X-Git-Tag: release-3.1.0beta1~22^2~53^2~4 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0cbac4f7706f3e24f98d6f320278c25878ef4b9b;p=kivitendo-erp.git all_parts: Warnung wenn versucht wird l_soldtotal ohne bsooqr aufzurufen --- diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index c7cb71b07..da20bf59f 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1194,6 +1194,8 @@ sub generate_report { # soldtotal doesn't make sense with more than one bsooqr option. # so reset it to sold (the most common option), and issue a warning + # ... + # also it doesn't make sense without bsooqr. disable and issue a warning too my @bsooqr = qw(sold bought onorder ordered rfq quoted); if ($form->{l_subtotal} && 1 < grep { $form->{$_} } @bsooqr) { my $enabled = first { $form->{$_} } @bsooqr; @@ -1202,6 +1204,11 @@ sub generate_report { push @options, $::locale->text('Subtotal cannot distinguish betweens record types. Only one of the selected record types will be displayed: #1', $optiontexts{$enabled}); } + if ($form->{l_soldtotal} && !grep { $form->{$_} } @bsooqr) { + delete $form->{l_soldtotal}; + + flash('warning', $::locale->text('Soldtotal does not make sense without any bsooqr options')); + } IC->all_parts(\%myconfig, \%$form); @@ -1266,7 +1273,7 @@ sub generate_report { 'assembly' => $locale->text('assembly_list'), ); - $report->set_options('top_info_text' => $locale->text('Options') . ': ' . join(', ', grep $_, @options), + $report->set_options('raw_top_info_text' => $form->parse_html_template('ic/generate_report_top', { options => \@options }), 'raw_bottom_info_text' => $form->parse_html_template('ic/generate_report_bottom'), 'output_format' => 'HTML', 'title' => $form->{title}, diff --git a/locale/de/all b/locale/de/all index 038ed2896..6d60fb809 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1948,6 +1948,7 @@ $self->{texts} = { 'Skonto Terms' => 'Zahlungsziel Skonto', 'So far you could use one partnumber for severel parts, for example a service and an article.' => 'Bisher war es möglich eine Artikelnummer für mehrere Artikel zu verwenden, zum Beispiel eine Artikelnummer für eine Dienstleistung, eine Ware und ein Erzeugnis.', 'Sold' => 'Verkauft', + 'Soldtotal does not make sense without any bsooqr options' => 'Option "Menge in gewählten Belegen" ohne gewählte Belege wird ignoriert.', 'Solution' => 'Lösung', 'Sort By' => 'Sortiert nach', 'Source' => 'Beleg', diff --git a/templates/webpages/ic/generate_report_top.html b/templates/webpages/ic/generate_report_top.html new file mode 100644 index 000000000..3e757a59f --- /dev/null +++ b/templates/webpages/ic/generate_report_top.html @@ -0,0 +1,6 @@ +[%- USE HTML %] +[%- USE T8 %] +[%- USE L %] +[%- PROCESS 'common/flash.html' %] + +[% 'Options' | $T8 %]: [% options.join(', ') %]