If you do not specify an exchange rate when importing a document in a foreign currency, ABRA Flexi will automatically download it (e.g., from the CNB or ECB). However, the rate may differ by small amounts (hundredths/thousandths) from the official rate. This is intentional behavior.
The amount in the foreign currency, the amount in the domestic currency, and the exchange rate must always be "in balance" (multiplying or dividing any two of them must yield the third). The problem is that amounts are rounded to two decimal places, which introduces a certain degree of imprecision.
Let's say I have an amount of 1.4 EUR and an exchange rate of 25.265. Multiplying them gives 35.371 CZK, which rounds to 35.37. However, 35.37 / 25.265 is no longer 1.4, but 1.39996041955. We handle this by ensuring the amounts always match, and we therefore adjust ("sacrifice") the exchange rate, which we round to up to six decimal places (and can therefore store more precisely). In this case, we recalculate it as 35.37 / 1.4 = 25.264286.
Since the imprecision is different each time, the resulting exchange rate also varies slightly (for example, for an amount of 5.95 EUR, the domestic currency amount after rounding is 150.33, and the exchange rate that makes the amounts balance comes out to 25.265546).
In most cases these are small differences where rounding the amounts would even everything out again, but we have also encountered cases where the difference was 1 CZK (e.g., the foreign currency amount was 2599.0 and the exchange rate was 0.0038), which is unacceptable. That is why we do this. We could perhaps be smarter about it and only apply this logic when it is truly necessary, but for now this is how it works.
