Nach Löschen in ar/ap/gl via DB-Trigger in acc_trans aufräumen
[kivitendo-erp.git] / bin / mozilla / io.pl
index 698758e..0d7601e 100644 (file)
@@ -38,7 +38,7 @@
 
 use Carp;
 use CGI;
-use List::MoreUtils qw(uniq);
+use List::MoreUtils qw(any uniq);
 use List::Util qw(min max first);
 
 use SL::CVar;
@@ -49,6 +49,7 @@ use SL::IO;
 
 use SL::DB::Language;
 use SL::DB::Printer;
+use SL::Helper::Flash;
 
 require "bin/mozilla/common.pl";
 
@@ -802,6 +803,7 @@ sub validate_items {
 
   # check if items are valid
   if ($form->{rowcount} == 1) {
+    flash('warning', $::locale->text('The action you\'ve chosen has not been executed because the document does not contain any item yet.'));
     &update;
     ::end_of_request();
   }
@@ -1087,11 +1089,12 @@ sub print_options {
     opthash("inline",                $form->{SM}{inline},              $locale->text('In-line'))
       if ($form->{media} eq 'email');
 
+  my $printable_templates = any { $::lx_office_conf{print_templates}->{$_} } qw(latex opendocument);
   push @MEDIA, grep $_,
       opthash("screen",              $form->{OP}{screen},              $locale->text('Screen')),
-    ($form->{printers} && scalar @{ $form->{printers} } && $::lx_office_conf{print_templates}->{latex}) ?
+    ($printable_templates && $form->{printers} && scalar @{ $form->{printers} }) ?
       opthash("printer",             $form->{OP}{printer},             $locale->text('Printer')) : undef,
-    ($::lx_office_conf{print_templates}->{latex} && !$options{no_queue}) ?
+    ($printable_templates && !$options{no_queue}) ?
       opthash("queue",               $form->{OP}{queue},               $locale->text('Queue')) : undef
         if ($form->{media} ne 'email');
 
@@ -1468,7 +1471,7 @@ sub print_form {
   reformat_numbers($output_numberformat, 2,
                    qw(invtotal ordtotal quototal subtotal linetotal
                       listprice sellprice netprice discount
-                      tax taxbase total paid),
+                      tax taxbase total paid payment),
                    grep({ /^(?:linetotal|nodiscount_linetotal|listprice|sellprice|netprice|taxbase|discount|p_discount|discount_sub|nodiscount_sub|paid|subtotal|total|tax)_\d+$/ } keys(%{$form})));
 
   reformat_numbers($output_numberformat, undef,