X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=c579aad8d831a49292104fd91e2538c40a0d41c4;hb=f9a93e326337ed219de49f575c02e5a8cb36a1b6;hp=e32827f446096e98f0c17c1c6524177e6d8e4eec;hpb=c0ed7d2fa13650cc51cf3ed641aa5cc9afb41d7f;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index e32827f44..c579aad8d 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -519,9 +519,15 @@ sub invoice_details { $form->{nodiscount} = $form->format_amount($myconfig, $nodiscount, 2); $form->{yesdiscount} = $form->format_amount($myconfig, $form->{nodiscount_total} - $nodiscount, 2); - $form->{invtotal} = ($form->{taxincluded}) ? $form->{total} : $form->{total} + $tax; - $form->{total} = $form->format_amount($myconfig, $form->{invtotal} - $form->{paid}, 2); + my $grossamount = ($form->{taxincluded}) ? $form->{total} : $form->{total} + $tax; + $form->{invtotal} = $form->round_amount($grossamount, 2, 1); + $form->{rounding} = $form->round_amount( + $form->{invtotal} - $form->round_amount($grossamount, 2), + 2 + ); + $form->{rounding} = $form->format_amount($myconfig, $form->{rounding}, 2); + $form->{total} = $form->format_amount($myconfig, $form->{invtotal} - $form->{paid}, 2); $form->{invtotal} = $form->format_amount($myconfig, $form->{invtotal}, 2); $form->{paid} = $form->format_amount($myconfig, $form->{paid}, 2);