X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/583f1f0fb395147c5e6459d9c6569bdf8735ec3f..3ca17b1b1db28ea6b1ddbb90b68d6a580f5fee87:/SL/OE.pm diff --git a/SL/OE.pm b/SL/OE.pm index c4e768be0..31b3067f5 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -1576,9 +1576,15 @@ sub order_details { $form->{subtotal_nofmt} = $form->{ordtotal}; } - $form->{ordtotal} = ($form->{taxincluded}) ? $form->{ordtotal} : $form->{ordtotal} + $tax; + my $grossamount = ($form->{taxincluded}) ? $form->{ordtotal} : $form->{ordtotal} + $tax; + $form->{ordtotal} = $form->round_amount( $grossamount, 2, 1); + $form->{rounding} = $form->round_amount( + $form->{ordtotal} - $form->round_amount($grossamount, 2), + 2 + ); # format amounts + $form->{rounding} = $form->format_amount($myconfig, $form->{rounding}, 2); $form->{quototal} = $form->{ordtotal} = $form->format_amount($myconfig, $form->{ordtotal}, 2); $form->set_payment_options($myconfig, $form->{$form->{type} =~ /_quotation/ ? 'quodate' : 'orddate'}, $form->{type});