Nettobeträge bei taxincluded auf Druckvorschau angepasst (Bug 576)
authorThomas Kasulke <t.kasulke@linet-services.de>
Tue, 3 Apr 2007 11:43:18 +0000 (11:43 +0000)
committerThomas Kasulke <t.kasulke@linet-services.de>
Tue, 3 Apr 2007 11:43:18 +0000 (11:43 +0000)
SL/IS.pm

index cd90a85..6971f9f 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -382,8 +382,12 @@ sub invoice_details {
       $form->{paid} += $form->parse_amount($myconfig, $form->{"paid_$i"});
     }
   }
-
-  $form->{subtotal} = $form->format_amount($myconfig, $form->{total}, 2);
+  if($form->{taxincluded}) {
+    $form->{subtotal} = $form->format_amount($myconfig, $form->{total} - $tax, 2);
+  }
+  else {
+    $form->{subtotal} = $form->format_amount($myconfig, $form->{total}, 2);
+  }
   $yesdiscount = $form->{nodiscount_total} - $nodiscount;
   $form->{nodiscount_subtotal} = $form->format_amount($myconfig, $form->{nodiscount_total}, 2);
   $form->{discount_total} = $form->format_amount($myconfig, $form->{discount_total}, 2);