Steuersatz/taxzone aus Masken nicht überschreiben.
[kivitendo-erp.git] / SL / Form.pm
index e44f397..68b1681 100644 (file)
@@ -251,6 +251,7 @@ sub new {
 
   my $self = {};
 
+  no warnings 'once';
   if ($LXDebug::watch_form) {
     require SL::Watchdog;
     tie %{ $self }, 'SL::Watchdog';
@@ -845,8 +846,8 @@ sub _prepare_html_template {
   $additional_params->{"conf_payments_changeable"}    = $::lx_office_conf{features}->{payments_changeable};
   $additional_params->{"INSTANCE_CONF"}               = $::instance_conf;
 
-  if (%main::debug_options) {
-    map { $additional_params->{'DEBUG_' . uc($_)} = $main::debug_options{$_} } keys %main::debug_options;
+  if (my $debug_options = $::lx_office_conf{debug}{options}) {
+    map { $additional_params->{'DEBUG_' . uc($_)} = $debug_options->{$_} } keys %$debug_options;
   }
 
   if ($main::auth && $main::auth->{RIGHTS} && $main::auth->{RIGHTS}->{$self->{login}}) {
@@ -1117,8 +1118,7 @@ sub format_amount_units {
     return '';
   }
 
-  AM->retrieve_all_units();
-  my $all_units        = $main::all_units;
+  my $all_units        = AM->retrieve_all_units;
 
   if (('' eq ref $conv_units) && ($conv_units =~ /convertible/)) {
     $conv_units = AM->convertible_units($all_units, $part_unit_name, $conv_units eq 'convertible_not_smaller');
@@ -1410,6 +1410,7 @@ sub parse_template {
         if ($self->{OUT}) {
           open OUT, '>', $self->{OUT} or $self->error($self->cleanup . "$self->{OUT} : $!");
           print OUT while <IN>;
+          close OUT;
           seek IN, 0, 0;
 
         } else {
@@ -1424,10 +1425,8 @@ Content-Length: $numbytes
 
 |;
 
-          open(OUT, ">&", \*STDOUT) or $self->error($self->cleanup . "$!: STDOUT");
-          $::locale->with_raw_io(*OUT, sub { print while <IN> });
+          $::locale->with_raw_io(\*STDOUT, sub { print while <IN> });
         }
-        close OUT;
       }
 
       close(IN);