- $supp_amount = exchange_from_to($amount, $bank_account_currency, $supplier_currency, $date_);
- $supp_discount = exchange_from_to($discount, $bank_account_currency, $supplier_currency, $date_);
+ if ($rate == 0)
+ {
+ $supp_amount = exchange_from_to($amount, $bank_account_currency, $supplier_currency, $date_);
+ $supp_discount = exchange_from_to($discount, $bank_account_currency, $supplier_currency, $date_);
+ }
+ else
+ {
+ $supp_amount = $amount / $rate;
+ $supp_discount = $discount / $rate;
+ }
+