From: Niclas Zimmermann Date: Tue, 18 Sep 2012 13:11:05 +0000 (+0200) Subject: Währung in Verkaufs-/Einkaufsrechnungj X-Git-Tag: release-3.0.0beta1~225^2~11^2~3 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;ds=inline;h=bc1bae42d28eafc013947cb42d8794a1685e9479;hp=2725c98d35ca6d7383cfe50f518186b336188547;p=kivitendo-erp.git Währung in Verkaufs-/Einkaufsrechnungj In der Verkaufsrechnung traten noch einige Fehler auf, wenn man ausländische Währungen angegeben hat. Wechselkurse wurden als Null angezeigt und es gab kein Eingabefeld, wenn der Wechselkurs an einem Datum noch nicht in der Datenbank vorhanden war. In Eingabefelder eingegebene Werte wurden ignoriert. In der Einkaufsrechnung traten ähnliche Fehler auf. Hier wurde nicht einmal ein Wechselkurs angezeigt, obwohl Standardwährung und in der Rechnung verwendete Währung nicht übereinstimmen. --- diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 7d5c36ab6..f909d86f6 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -316,7 +316,8 @@ sub form_header { my @values = map { $_ } @{ $form->{ALL_CURRENCIES} }; my %labels = map { $_ => $_ } @{ $form->{ALL_CURRENCIES} }; $form->{currency} = $form->{defaultcurrency} unless $form->{currency}; - $TMPL_VAR{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency}; + # show_exchangerate is also later needed in another template + $form->{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency}; $TMPL_VAR{currencies} = NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"}, '-values' => \@values, '-labels' => \%labels, '-onchange' => "document.getElementById('update_button').click();" diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 4716f60e3..56162d543 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -517,6 +517,9 @@ sub update { for my $i (1 .. $form->{paidaccounts}) { next unless $form->{"paid_$i"}; map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate); + if (!$form->{"forex_$i"}) { #read exchangerate from input field (not hidden) + $form->{exchangerate} = $form->{"exchangerate_$i"}; + } $form->{"forex_$i"} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy'); $form->{"exchangerate_$i"} = $form->{"forex_$i"} if $form->{"forex_$i"}; } diff --git a/templates/webpages/ir/_payments.html b/templates/webpages/ir/_payments.html index 1677219d4..6d7db5ea0 100644 --- a/templates/webpages/ir/_payments.html +++ b/templates/webpages/ir/_payments.html @@ -75,9 +75,9 @@ [% SET forex = 'forex_' _ i %] [% SET exchangerate = 'exchangerate_' _ i %] - [% IF forex %] + [% IF $forex %] - [% LxERP.format_amount(exchangerate, 2) %] + [% LxERP.format_amount($forex, 2) %] [% ELSE %] [% IF $changeable %] @@ -86,7 +86,7 @@ [% LxERP.format_amount($exchangerate, 2, 1) %] [% END %] [% END %] - ; + [% END %] diff --git a/templates/webpages/is/_payments.html b/templates/webpages/is/_payments.html index a87221502..41b018615 100644 --- a/templates/webpages/is/_payments.html +++ b/templates/webpages/is/_payments.html @@ -78,7 +78,7 @@ [% SET forex = 'forex_' _ i %] [% SET exchangerate = 'exchangerate_' _ i %] - [% IF forex %] + [% IF $forex %] [% LxERP.format_amount($forex, 2) %] [% ELSE %]