X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fvk.pl;h=c6296e90bafad4958493a5c04819170f5579ce71;hb=7321146cf5a08364a9db2ddddbb0b74a5d3fc4c9;hp=70c0482078572c6fab2c667bd6657e3ce001f39e;hpb=8d8d1aab328b1c47d7983aca59c1c99592336eff;p=kivitendo-erp.git diff --git a/bin/mozilla/vk.pl b/bin/mozilla/vk.pl index 70c048207..c6296e90b 100644 --- a/bin/mozilla/vk.pl +++ b/bin/mozilla/vk.pl @@ -304,8 +304,8 @@ sub invoice_transactions { # discount was already accounted for in db sellprice $ar->{sellprice} = $ar->{sellprice} / $ar->{price_factor} / $basefactor; $ar->{lastcost} = $ar->{lastcost} / $ar->{price_factor} / $basefactor; - $ar->{sellprice_total} = $ar->{qty} * ( $ar->{fxsellprice} * ( 1 - $ar->{discount} ) ) / $ar->{price_factor}; - $ar->{lastcost_total} = $ar->{qty} * $ar->{lastcost} * $basefactor; + $ar->{sellprice_total} = $form->round_amount( $ar->{qty} * ( $ar->{fxsellprice} * ( 1 - $ar->{discount} ) ) / $ar->{price_factor}, $form->{"decimalplaces"}); + $ar->{lastcost_total} = $form->round_amount( $ar->{qty} * $ar->{lastcost} * $basefactor, $form->{"decimalplaces"}); # marge_percent wird neu berechnet, da Wert in invoice leer ist (Bug) $ar->{marge_percent} = $ar->{sellprice_total} ? (($ar->{sellprice_total}-$ar->{lastcost_total}) / $ar->{sellprice_total} * 100) : 0; # marge_total neu berechnen @@ -389,9 +389,9 @@ sub invoice_transactions { # wird laufend bei jeder Position neu berechnet $totals{marge_percent} = $totals{sellprice_total} ? ( ($totals{sellprice_total} - $totals{lastcost_total}) / $totals{sellprice_total} ) * 100 : 0; - map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 2) } qw(marge_total marge_percent qty); + map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 2) } qw(marge_percent qty); map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 3) } qw(weight); - map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, $form->{"decimalplaces"} )} qw(lastcost sellprice sellprice_total lastcost_total); + map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, $form->{"decimalplaces"} )} qw(lastcost sellprice sellprice_total lastcost_total marge_total); # Einzelzeilen nur zeigen wenn l_parts gesetzt ist, nützlich, wenn man nur # Subtotals und Totals sehen möchte