<th align=right colspan=4>|
       . $locale->text('Decimalplaces')
       . qq|</th>
-             <td><input name=decimalplaces size=3></td>
+             <td><input name=decimalplaces size=3 value="2"></td>
          </tr>
                                     
 $jsscript
        </tr>
        <tr>
          <th align=right>| . $locale->text('Decimalplaces') . qq|</th>
-         <td><input name=decimalplaces size=3></td>
+         <td><input name=decimalplaces size=3 value="2"></td>
        </tr>
       </table>
     </td>
     $longfromdate  = $locale->date(\%myconfig, $form->{fromdate}, 1);
     $shortfromdate = $locale->date(\%myconfig, $form->{fromdate}, 0);
 
-    $form->{this_period} = "$shortfromdate<br>\n$shorttodate";
+    $form->{this_period} = "$shortfromdate\n$shorttodate";
     $form->{period}      =
         $locale->text('for Period')
-      . qq|<br>\n$longfromdate |
+      . qq|\n$longfromdate |
       . $locale->text('Bis')
       . qq| $longtodate|;
   }
     $longcomparetodate  = $locale->date(\%myconfig, $form->{comparetodate}, 1);
     $shortcomparetodate = $locale->date(\%myconfig, $form->{comparetodate}, 0);
 
-    $form->{last_period} = "$shortcomparefromdate<br>\n$shortcomparetodate";
+    $form->{last_period} = "$shortcomparefromdate\n$shortcomparetodate";
     $form->{period} .=
-        "<br>\n$longcomparefromdate "
+        "\n$longcomparefromdate "
       . $locale->text('Bis')
       . qq| $longcomparetodate|;
   }
   # setup variables for the form
   @a = qw(company address businessnumber);
   map { $form->{$_} = $myconfig{$_} } @a;
-  $form->{address} =~ s/\\n/<br>/g;
 
   $form->{templates} = $myconfig{templates};
 
   $form->{IN} = "balance_sheet.html";
 
   # setup company variables for the form
-  map { $form->{$_} = $myconfig{$_} }
+  map { $form->{$_} = $myconfig{$_};
+        $form->{$_} =~ s/\\n/\n/g; }
     (qw(company address businessnumber nativecurr));
-  $form->{address} =~ s/\\n/<br>/g;
 
   $form->{templates} = $myconfig{templates};
 
 
     $ml = ($ref->{category} =~ /(A|C|E)/) ? -1 : 1;
 
-    $debit  = $form->format_amount(\%myconfig, $ref->{debit},  2, " ");
-    $credit = $form->format_amount(\%myconfig, $ref->{credit}, 2, " ");
+    $debit  = ($ref->{debit} != 0) ? $form->format_amount(\%myconfig, $ref->{debit},  2, " ") : " ";
+    $credit = ($ref->{credit} != 0) ? $form->format_amount(\%myconfig, $ref->{credit}, 2, " ") : " ";
     $begbalance =
       $form->format_amount(\%myconfig, $ref->{balance} * $ml, 2, " ");
     $endbalance =
       $i++;
 
       if ($subtotal) {
-        $c0subtotal =
-          $form->format_amount(\%myconfig, $c0subtotal, 2, " ");
-        $c30subtotal =
-          $form->format_amount(\%myconfig, $c30subtotal, 2, " ");
-        $c60subtotal =
-          $form->format_amount(\%myconfig, $c60subtotal, 2, " ");
-        $c90subtotal =
-          $form->format_amount(\%myconfig, $c90subtotal, 2, " ");
+        $c0subtotal = ($c0subtotal != 0) ? 
+          $form->format_amount(\%myconfig, $c0subtotal, 2, " ") : "";
+        $c30subtotal = ($c30subtotal != 0) ?
+          $form->format_amount(\%myconfig, $c30subtotal, 2, " ") : "";
+        $c60subtotal = ($c60subtotal != 0) ?
+          $form->format_amount(\%myconfig, $c60subtotal, 2, " ") : "";
+        $c90subtotal = ($c90subtotal != 0) ?
+          $form->format_amount(\%myconfig, $c90subtotal, 2, " ") : "";
       }
 
       $column_data{ct}        = qq|<th> </th>|;
     $c60total += $ref->{c60};
     $c90total += $ref->{c90};
 
-    $ref->{c0}  = $form->format_amount(\%myconfig, $ref->{c0},  2, " ");
-    $ref->{c30} = $form->format_amount(\%myconfig, $ref->{c30}, 2, " ");
-    $ref->{c60} = $form->format_amount(\%myconfig, $ref->{c60}, 2, " ");
-    $ref->{c90} = $form->format_amount(\%myconfig, $ref->{c90}, 2, " ");
+    $ref->{c0}  = ($ref->{c0} != 0) ? $form->format_amount(\%myconfig, $ref->{c0},  2, " ") : "";
+    $ref->{c30} = ($ref->{c30} != 0) ? $form->format_amount(\%myconfig, $ref->{c30}, 2, " ") : "";
+    $ref->{c60} = ($ref->{c60} != 0) ?  $form->format_amount(\%myconfig, $ref->{c60}, 2, " ") : "";
+    $ref->{c90} = ($ref->{c90} != 0) ?  $form->format_amount(\%myconfig, $ref->{c90}, 2, " ") : "";
 
     $href =
       qq|$ref->{module}.pl?path=$form->{path}&action=edit&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=|
       . $locale->text('Print') . qq|">
 <input class=submit type=submit name=action value="|
       . $locale->text('E-mail') . qq|">
-|;
-  }
 
-  if ($form->{menubar}) {
-    require "$form->{path}/menu.pl";
-    &menubar;
-  }
-
-  print qq|
 </form>
 
 </body>
 
   $form->{templates} = "$myconfig{templates}";
 
-  # setup variables for the form
-  @a = qw(company address businessnumber tel fax);
-  map { $form->{$_} = $myconfig{$_} } @a;
-  $form->format_string(@a);
-
   $form->{IN} = "$form->{type}.html";
 
   if ($form->{format} eq 'postscript') {
           (name, street, zipcode, city, country, contact, email,
            "$form->{ct}phone", "$form->{ct}fax");
         map { $form->{$_} = $ref->{$_} } @a;
-        $form->format_string(@a);
 
         $form->{ $form->{ct} } = $form->{name};
         $form->{"$form->{ct}_id"} = $ref->{ctid};
   $lxdebug->enter_sub();
 
   $form->{sendmode} = "attachment";
-  $form->{copies}   = 2 unless $form->{copies};
+
+  $form->{"format"} =
+    $form->{"format"} ? $form->{"format"} :
+    $myconfig{"template_format"} ? $myconfig{"template_format"} :
+    "pdf";
+
+  $form->{"copies"} =
+    $form->{"copies"} ? $form->{"copies"} :
+    $myconfig{"copies"} ? $myconfig{"copies"} :
+    2;
 
   $form->{PD}{ $form->{type} }     = "selected";
   $form->{DF}{ $form->{format} }   = "selected";
     $longfromdate  = $locale->date(\%germandate, $form->{fromdate}, 1);
     $shortfromdate = $locale->date(\%germandate, $form->{fromdate}, 0);
 
-    $form->{this_period} = "$shortfromdate<br>\n$shorttodate";
+    $form->{this_period} = "$shortfromdate\n$shorttodate";
     $form->{period}      =
         $locale->text('for Period')
-      . qq|<br>\n$longfromdate |
+      . qq|\n$longfromdate |
       . $locale->text('bis')
       . qq| $longtodate|;
   }
   # setup variables for the form
   @a = qw(company address businessnumber);
   map { $form->{$_} = $myconfig{$_} } @a;
-  $form->{address} =~ s/\\n/<br>/g;
   $form->{templates} = $myconfig{templates};
 
   $form->{IN} = "bwa.html";
     $longfromdate  = $locale->date(\%myconfig, $form->{fromdate}, 1);
     $shortfromdate = $locale->date(\%myconfig, $form->{fromdate}, 0);
 
-    $form->{this_period} = "$shortfromdate<br>\n$shorttodate";
+    $form->{this_period} = "$shortfromdate\n$shorttodate";
     $form->{period}      =
         $locale->text('for Period')
       . qq|<br>\n$longfromdate |
     $longcomparetodate  = $locale->date(\%myconfig, $form->{comparetodate}, 1);
     $shortcomparetodate = $locale->date(\%myconfig, $form->{comparetodate}, 0);
 
-    $form->{last_period} = "$shortcomparefromdate<br>\n$shortcomparetodate";
+    $form->{last_period} = "$shortcomparefromdate\n$shortcomparetodate";
     $form->{period} .=
-        "<br>\n$longcomparefromdate "
+        "\n$longcomparefromdate "
       . $locale->text('bis')
       . qq| $longcomparetodate|;
   }