X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FOE.pm;h=8e0cfb955dba14fb2ca6817048ddf4313132f65c;hb=84bed7a655edfe816ad2a04b5549b6bd6a968c79;hp=c1cf1879c843efafefacbf860cbdea37025f3623;hpb=9d0ebf2831c46d1be13fb79cb3627a05f6681376;p=kivitendo-erp.git diff --git a/SL/OE.pm b/SL/OE.pm index c1cf1879c..8e0cfb955 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -870,10 +870,6 @@ sub retrieve { Common::webdav_folder($form) if ($main::webdav); - # get tax zones - $query = qq|SELECT id, description FROM tax_zones|; - $form->{TAXZONE} = selectall_hashref_query($form, $dbh, $query); - my $rc = $dbh->commit; $dbh->disconnect; @@ -1141,14 +1137,18 @@ sub order_details { $form->format_amount($myconfig, $form->{"${item}_rate"} * 100)); push(@{ $form->{taxnumber} }, $form->{"${item}_taxnumber"}); } - $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); $form->{nodiscount} = $form->format_amount($myconfig, $nodiscount, 2); $form->{yesdiscount} = $form->format_amount($myconfig, $yesdiscount, 2); - $form->{subtotal} = $form->format_amount($myconfig, $form->{ordtotal}, 2); + if($form->{taxincluded}) { + $form->{subtotal} = $form->format_amount($myconfig, $form->{ordtotal} - $tax, 2); + } + else { + $form->{subtotal} = $form->format_amount($myconfig, $form->{ordtotal}, 2); + } $form->{ordtotal} = ($form->{taxincluded}) ? $form->{ordtotal} : $form->{ordtotal} + $tax;