From: Janusz Dobrowolski Date: Sun, 25 Aug 2013 18:39:41 +0000 (+0200) Subject: Fixed problem with customer payment allocations (invalid exrate stored in debtor_tran... X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=754118e132311fa121e3f30f2ab403b15dc25aba;p=textcart.git Fixed problem with customer payment allocations (invalid exrate stored in debtor_trans record). --- diff --git a/sales/includes/db/payment_db.inc b/sales/includes/db/payment_db.inc index 9e0e4b1..e7c5729 100644 --- a/sales/includes/db/payment_db.inc +++ b/sales/includes/db/payment_db.inc @@ -42,11 +42,10 @@ function write_customer_payment($trans_no, $customer_id, $branch_id, $bank_accou $bank = get_bank_account($bank_account); if (!$rate) - $rate = get_exchange_rate_from_to(get_customer_currency($customer_id), - $bank['bank_curr_code'], $date_ ); + $rate = get_exchange_rate_from_home_currency($bank['bank_curr_code'], $date_ ); + if (!$bank_amount) // backward compatibility workaround { - $bank_amount = $amount/$rate; }