Beim Anlegen von Buchungsgruppen die in den Benutzereinstellungen ausgewählten Standa...
[kivitendo-erp.git] / bin / mozilla / ca.pl
index 3d52198..e499abe 100644 (file)
@@ -92,7 +92,7 @@ sub chart_of_accounts {
 
   print qq|
 <body>
-  
+
 <table border=0 width=100%>
   <tr><th class=listtop colspan=$colspan>$form->{title}</th></tr>
   <tr height="5"></tr>
@@ -125,14 +125,21 @@ sub chart_of_accounts {
         "<td><a href=$href&accounttype=gifi>$ca->{gifi_accno}</a>&nbsp;</td>";
       $column_data{description} = "<td>$ca->{description}</td>";
     }
-
+    my $debit = "";
+    my $credit = "";
+    if ($ca->{debit}) {
+      $debit = $form->format_amount(\%myconfig, $ca->{debit}, 2, "&nbsp;");
+    }
+    if ($ca->{credit}) {
+      $credit = $form->format_amount(\%myconfig, $ca->{credit}, 2, "&nbsp;");
+    }
     $column_data{debit} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ca->{debit}, 2, "&nbsp;")
+      . $debit
       . "</td>\n";
     $column_data{credit} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ca->{credit}, 2, "&nbsp;")
+      . $credit
       . "</td>\n";
 
     $totaldebit  += $ca->{debit};
@@ -235,8 +242,7 @@ sub list {
          <th align=right>| . $locale->text('Include in Report') . qq|</th>
          <td colspan=3>
          <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|
-    . $locale->text('Subtotal')
-    . qq|</td>
+    . $locale->text('Subtotal') . qq|</td>
        </tr>
       </table>
     </td>
@@ -407,13 +413,12 @@ sub list_transactions {
     # construct link to source
     $href =
       "<a href=$ca->{module}.pl?path=$form->{path}&action=edit&id=$ca->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{reference}</a>";
-
+    my $debit = ($ca->{debit} != 0) ? $form->format_amount(\%myconfig, $ca->{debit}, 2, "&nbsp;") : "&nbsp;";
     $column_data{debit} =
-      "<td align=right>"
-      . $form->format_amount(\%myconfig, $ca->{debit}, 2, "&nbsp;") . "</td>";
+      "<td align=right>$debit</td>";
+    my $credit = ($ca->{credit} != 0) ? $form->format_amount(\%myconfig, $ca->{credit}, 2, "&nbsp;") : "&nbsp;";
     $column_data{credit} =
-      "<td align=right>"
-      . $form->format_amount(\%myconfig, $ca->{credit}, 2, "&nbsp;") . "</td>";
+      "<td align=right>$credit</td>";
 
     $form->{balance} += $ca->{amount};
     $column_data{balance} =
@@ -513,4 +518,3 @@ sub ca_subtotal {
 
   $lxdebug->leave_sub();
 }
-