From 1ee0a24734aefd23212f06419289980366fa3803 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Mon, 9 Jan 2012 16:11:10 +0100 Subject: [PATCH] Bug 1756 - Ertrag in Bruttorechnung gefixed Bei Rechnungen mit "Steuer im Preis inbegriffen": Ertrag wurde berechnet als ob sellprice netto und lastcost netto war. Sellprice wird jetzt erst auf den Nettobetrag umgerechnet, bevor der Ertrag berechnet wird. --- bin/mozilla/io.pl | 14 +++++++++++++- locale/de/all | 2 ++ templates/webpages/ir/form_footer.html | 4 ++-- templates/webpages/is/form_footer.html | 4 ++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index f73c17974..18058437f 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -341,7 +341,19 @@ sub display_row { $form->{"marge_percent_$i"} = 0; my $marge_color; - my $real_sellprice = $linetotal; + my $real_sellprice; + if ( $form->{taxincluded} and $form->{"qty_$i"} * 1 and $form->{$form->{"taxaccounts_$i"} . "_rate"} * 1) { + # if we use taxincluded we need to calculate the marge from the net_value + # all the marge calculations are based on linetotal which we need to + # convert to net first + + # there is no direct form value for the tax_rate of the item, but + # form->{taxaccounts_$i} gives the tax account (e.g. 3806) and 3806_rate + # gives the tax percentage (e.g. 0.19) + $real_sellprice = $linetotal / (1 + $form->{$form->{"taxaccounts_$i"} . "_rate"}); + } else { + $real_sellprice = $linetotal; + }; my $real_lastcost = $form->{"lastcost_$i"} * $form->{"qty_$i"} / ( $form->{"marge_price_factor_$i"} || 1 ); my $marge_percent_warn = $myconfig{marge_percent_warn} * 1 || 15; my $marge_adjust_credit_note = $form->{type} eq 'credit_note' ? -1 : 1; diff --git a/locale/de/all b/locale/de/all index a4e06fecd..81ffffc74 100644 --- a/locale/de/all +++ b/locale/de/all @@ -931,6 +931,7 @@ $self->{texts} = { 'Include in Report' => 'In Bericht aufnehmen', 'Include in drop-down menus' => 'In Aufklappmenü aufnehmen', 'Includeable in reports' => 'In Berichten anzeigbar', + 'Including' => 'Enthaltene', 'Income Statement' => 'GuV', 'Income accno' => 'Erlöskonto', 'Incoming Payments' => 'Zahlungseingänge', @@ -1143,6 +1144,7 @@ $self->{texts} = { 'National' => 'Inand', 'National Expenses' => 'Aufwand Inland', 'National Revenues' => 'Erlöse Inland', + 'Net amount' => 'Nettobetrag', 'Netto Terms' => 'Zahlungsziel netto', 'New Buchungsgruppe #1' => 'Neue Buchungsgruppe #1', 'New Templates' => 'Erzeuge Vorlagen, Name', diff --git a/templates/webpages/ir/form_footer.html b/templates/webpages/ir/form_footer.html index 1a414551d..c82f1ab81 100644 --- a/templates/webpages/ir/form_footer.html +++ b/templates/webpages/ir/form_footer.html @@ -51,12 +51,12 @@ [% SET total_ref = item _ '_total' %] [% SET netto_ref = item _ '_netto' %] - Enthaltene [% $description_ref | html %] [% $rate_ref * 100 %]% + [% 'Including' | $T8 %] [% $description_ref | html %] [% $rate_ref * 100 %]% [% LxERP.format_amount($total_ref, 2) %] [%- IF taxincluded %] - Nettobetrag + [% 'Net amount' | $T8 %] [% LxERP.format_amount($netto_ref, 2) %] [%- END %] diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html index a97a4d039..6314c21cd 100644 --- a/templates/webpages/is/form_footer.html +++ b/templates/webpages/is/form_footer.html @@ -79,12 +79,12 @@ [% SET total_ref = item _ '_total' %] [% SET netto_ref = item _ '_netto' %] - Enthaltene [% $description_ref | html %] [% $rate_ref * 100 %]% + [% 'Including' | $T8 %] [% $description_ref | html %] [% $rate_ref * 100 %]% [% LxERP.format_amount($total_ref, 2) %] [%- IF taxincluded %] - Nettobetrag + [% 'Net amount' | $T8 %] [% LxERP.format_amount($netto_ref, 2) %] [%- END %] -- 2.20.1