X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/2e07a0cdb14d031d325b20f05e916105f385ac19..fb37acdc4c87cf9bc4ef6abb54e486c1b3829d6c:/SL/AR.pm diff --git a/SL/AR.pm b/SL/AR.pm index 410ac99aa..b6c04f730 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -50,6 +50,7 @@ sub post_transaction { my @values; my $dbh = $provided_dbh ? $provided_dbh : $form->dbconnect_noauto($myconfig); + $form->{defaultcurrency} = $form->get_default_currency($myconfig); # set exchangerate $form->{exchangerate} = ($form->{currency} eq $form->{defaultcurrency}) ? 1 : @@ -147,7 +148,7 @@ sub post_transaction { # update exchangerate $form->update_exchangerate($dbh, $form->{currency}, $form->{transdate}, $form->{exchangerate}, 0) - if ($form->{currency} ne $form->{defaultcurrency}) && $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, 'buy'); + if ($form->{currency} ne $form->{defaultcurrency}) && !$form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, 'buy'); if (!$payments_only) { $query =