X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAR.pm;h=76cea5579c729edf75a3f8c0ccd44e89b2ab3e5e;hb=0e8bee9c801106ae8c348a4fb8d7fa0b0fd392af;hp=e3e363191f7a7eb7e7881ee585f8af56f8e01f09;hpb=8e53eafd1ab02a8d310691c245279c732031df3b;p=kivitendo-erp.git diff --git a/SL/AR.pm b/SL/AR.pm index e3e363191..76cea5579 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -84,7 +84,8 @@ sub post_transaction { $form->{amount} = $form->{netamount}; $form->{tax} = 0; - + $form->{netamount} = 0; + $form->{total_tax} = 0; # taxincluded doesn't make sense if there is no amount $form->{taxincluded} = 0 if ($form->{amount} == 0); @@ -113,8 +114,8 @@ sub post_transaction { $form->{netamount} += $form->{"amount_$i"}; } else { $form->{"tax_$i"} = $form->{"amount_$i"} * $form->{"taxrate_$i"}; - $form->{"tax_$i"} = - $form->round_amount($form->{"tax_$i"} * $form->{exchangerate}, 2); + $form->{"tax_$i"} = $form->round_amount($form->{"tax_$i"} * $form->{exchangerate}, 2); + $form->{netamount} += $form->{"amount_$i"}; } } $form->{total_tax} += $form->{"tax_$i"};