Undefined chart bei taxkey 0 und 1
[kivitendo-erp.git] / SL / Form.pm
index 99fe818..f946606 100644 (file)
@@ -539,7 +539,7 @@ sub footer {
   print $::request->{layout}->post_content;
 
   if (my @inline_scripts = $::request->{layout}->javascripts_inline) {
-    print "<script type='text/javascript'>@inline_scripts</script>\n";
+    print "<script type='text/javascript'>" . join("; ", @inline_scripts) . "</script>\n";
   }
 
   print <<EOL
@@ -3474,9 +3474,9 @@ sub calculate_arap {
     if ( $selected_tax ) {
 
       if ( $buysell eq 'sell' ) {
-        $self->{AR_amounts}{"tax_$i"} = $selected_tax->chart->accno unless $selected_tax->taxkey == 0;
+        $self->{AR_amounts}{"tax_$i"} = $selected_tax->chart->accno if defined $selected_tax->chart;
       } else {
-        $self->{AP_amounts}{"tax_$i"} = $selected_tax->chart->accno unless $selected_tax->taxkey == 0;
+        $self->{AP_amounts}{"tax_$i"} = $selected_tax->chart->accno if defined $selected_tax->chart;
       };
 
       $self->{"taxkey_$i"} = $selected_tax->taxkey;