diff --git a/SL/DB/Helper/Payment.pm b/SL/DB/Helper/Payment.pm
index ae7fa53..957df96 100644
--- a/SL/DB/Helper/Payment.pm
+++ b/SL/DB/Helper/Payment.pm
@@ -160,19 +160,7 @@ sub pay_invoice {
 
       # deal with fxtransaction
       if ( $self->currency_id != $::instance_conf->get_currency_id ) {
-        my $fxamount = _round($amount - ($amount * $exchangerate));
-        $new_acc_trans = SL::DB::AccTransaction->new(trans_id       => $self->id,
-                                                     chart_id       => $account_bank->id,
-                                                     chart_link     => $account_bank->link,
-                                                     amount         => $fxamount * -1,
-                                                     transdate      => $transdate_obj,
-                                                     source         => $source,
-                                                     memo           => $memo,
-                                                     taxkey         => 0,
-                                                     fx_transaction => 1,
-                                                     tax_id         => SL::DB::Manager::Tax->find_by(taxkey => 0)->id);
-        $new_acc_trans->save;
-        # if invoice exchangerate differs from exchangerate of payment
+       # if invoice exchangerate differs from exchangerate of payment
         # deal with fxloss and fxamount
         if ($self->exchangerate and $self->exchangerate != 1 and $self->exchangerate != $exchangerate) {
           my $fxgain_chart = SL::DB::Manager::Chart->find_by(id => $::instance_conf->get_fxgain_accno_id) || die "Can't determine fxgain chart";
@@ -192,7 +180,18 @@ sub pay_invoice {
                                                        fx_transaction => 0,
                                                        tax_id         => SL::DB::Manager::Tax->find_by(taxkey => 0)->id);
           $new_acc_trans->save;
-
+          my $fxamount = _round($amount - ($amount * $exchangerate));
+          $new_acc_trans = SL::DB::AccTransaction->new(trans_id       => $self->id,
+                                                       chart_id       => $account_bank->id,
+                                                       chart_link     => $account_bank->link,
+                                                       amount         => $fxamount * -1,
+                                                       transdate      => $transdate_obj,
+                                                       source         => $source,
+                                                       memo           => $memo,
+                                                       taxkey         => 0,
+                                                       fx_transaction => 1,
+                                                       tax_id         => SL::DB::Manager::Tax->find_by(taxkey => 0)->id);
+          $new_acc_trans->save;
         };
       };
     };
@@ -261,7 +260,7 @@ sub pay_invoice {
     my $arap_booking= SL::DB::AccTransaction->new(trans_id   => $self->id,
                                                   chart_id   => $reference_account->id,
                                                   chart_link => $reference_account->link,
-                                                  amount     => _round($arap_amount * $mult * $exchangerate - $fx_gain_loss_amount),
+                                                  amount     => _round($arap_amount * $mult),
                                                   transdate  => $transdate_obj,
                                                   source     => '', #$params{source},
                                                   taxkey     => 0,


