Merge branch 'master' of git@lx-office.linet-services.de:lx-office-erp
[kivitendo-erp.git] / SL / AP.pm
index 245d1ab..e4ff230 100644 (file)
--- a/SL/AP.pm
+++ b/SL/AP.pm
@@ -108,26 +108,14 @@ sub post_transaction {
 
     my ($tax, $diff);
     if ($form->{taxincluded} *= 1) {
-      if (!$form->{"korrektur_$i"}) {
-        $tax =
-          $form->{"amount_$i"} -
-          ($form->{"amount_$i"} / ($form->{"taxrate_$i"} + 1));
-      } else {
-        $tax = $form->{"tax_$i"};
-      }
+      $tax = $form->{"amount_$i"} - ($form->{"amount_$i"} / ($form->{"taxrate_$i"} + 1));
       $amount = $form->{"amount_$i"} - $tax;
       $form->{"amount_$i"} = $form->round_amount($amount, 2);
       $diff += $amount - $form->{"amount_$i"};
       $form->{"tax_$i"} = $form->round_amount($tax, 2);
       $form->{netamount} += $form->{"amount_$i"};
     } else {
-      if (!$form->{"korrektur_$i"}) {
-        $form->{"tax_$i"} = $form->{"amount_$i"} * $form->{"taxrate_$i"};
-      } else {
-        $tax = $form->{"tax_$i"};
-      }
-      $form->{"tax_$i"} =
-        $form->round_amount($form->{"tax_$i"} * $form->{exchangerate}, 2);
+      $form->{"tax_$i"} = $form->{"amount_$i"} * $form->{"taxrate_$i"};
       $form->{netamount} += $form->{"amount_$i"};
     }
     $form->{total_tax} += $form->{"tax_$i"} * -1;
@@ -372,7 +360,7 @@ sub post_transaction {
 sub delete_transaction {
   $main::lxdebug->enter_sub();
 
-  my ($self, $myconfig, $form, $spool) = @_;
+  my ($self, $myconfig, $form) = @_;
 
   # connect to database
   my $dbh = $form->dbconnect_noauto($myconfig);