]> wagnertech.de Git - mfinanz.git/blobdiff - SL/AR.pm
Probleme mit mehreren Währungen und Wechselkursen behoben.
[mfinanz.git] / SL / AR.pm
index 410ac99aa113180df77268af5b677d6a822d8d6c..b6c04f7303f16bde972edc97432b4552bb62e552 100644 (file)
--- 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 =