Topic: Devel - SimpleAPI module UTF8 problem

Hi,
I use SimpleAPI module for my POS  app, every thing is fine but I have a problem , which is when the currency Abbreviation is in Arabic language, the API does not read it correctly but instead it gives it as question marks like ???,

and this effect the sales invoice saving and gives error like this:
Message: Cannot retrieve exchange rate for currency \u0631.\u064a as of 10\/18\/2020. Please add exchange rate manually on Exchange Rates page.
because it tried to retrieve the exchange rate like this get_exchange_rate_from_home_currency('??.??', '10\/18\/2020')


any solution for this issue, will be appreciated.

Thanks

Re: Devel - SimpleAPI module UTF8 problem

Can you post your api call parameters and function you handle it from your server side.? It will help us to explain you it

Subscription service based on FA
HRM CRM POS batch Themes

3 (edited by trainer2008 10/20/2020 05:12:01 pm)

Re: Devel - SimpleAPI module UTF8 problem

Hi, Actually I did not have online server i do it locally using XAMPP, but the API call is

http://localhost:8080/frontaccounting/modules/api/sales

with post method and I send the needed JSON parameters.

If you want me to upload it to an online server, then I can do it?

Re: Devel - SimpleAPI module UTF8 problem

Currency abbreviation must be in English only.

Re: Devel - SimpleAPI module UTF8 problem

Hi apmuthu,

in frontaccounting itself the Arabic abbreviation is working fine without errors.

Only error appear in calling the API, there should be a solution for this but I could not figure it out because I have little knowledge in slim, so people who are experience in slim may help in this regards.

Thanks

Re: Devel - SimpleAPI module UTF8 problem

It is possible that the Arabic abbreviation works in the FA UI but will need to be in English (IMHO) as it is a parameter to the appropriate function through the SlimAPI (probably the way it is implemented as there is no language/theme info in the API) and not a direct variable from a translatable form.

Re: Devel - SimpleAPI module UTF8 problem

The currency code is expected to be an ISO4217 currency code. This is what FA expects "under the hood" when used with the third party currency conversion api's. e.g. SAR for Saudi Riyal.

Cambell https://github.com/cambell-prince