According to § 6 para. 1 no. 2 EStG and attached comments, the valuation of sales of foreign currencies (current assets, bank account balances in foreign currency) requires the valuation at the average rate and the recognition of realized exchange rate effects.
No possibility was found in D365FO to value bank account balances in foreign currency at the average price, as well as to automatically book realized exchange rate gains/losses in case of sales/disposals.
Due to the legal basis, a solution/workaround is expected from D365FO without the need to manually determine across all clients, bank accounts, inflows and outflows.