Language and Balance account

I verified that if the system language is English, the balance of the accounts are with correct values, but if I change the language to any other, the account balance is totally wrong.

Ex
Account balance in English = 11.91
I changed to Spanish, the balance goes to 1191.00
I changed to Portuguese, the balance goes to 1191.00
I went back to English, the balance shows correct 11.91

Have you tried that in ASTPP 5.0?

My version is 4.0.1, I can’t test it in the beta version

Does anybody know how to solve this?

Help to fix this in V4!!!

I confirmed this is an issue on 4.0.1 on multiple installations.

I appreciate the appeal to use 5.0 is less than remaining with 4.0.1 because of the lack of simple upgrade process and less features on community since a few have been moved to enterprise.

I’ll have a look at this now and report back soon with my findings.

I’ve traced it back to the function calculate_currency_customer in /opt/ASTPP/web_interface/astpp/application/models/common_model.php

A quick fix if you don’t use multiple currencies, would be to return $amount rather than $cal_amount

I’ll see if I get time to fix it properly and I’ll publish a patch, but at least for now those of you using a single currency setup can now use multiple languages without the incorrect formatting of the number.

Perfect, actually moving from version 4 to version 5 is not very good, as they are forcing the community to move to the enterprise version.

If you can somehow help, I’m grateful.

@rgazetta, are you using multiple currencies on your ASTPP installation or are you just using 1?

@jmurraysolutions now only 1, but need multiple in future

for now, if you:

vi /opt/ASTPP/web_interface/astpp/application/models/common_model.php

Then on the line that says

return $cal_amount;

within the function “calculate_currency_customer”, change it to

return $amount;

The issue will be gone but it will break currency conversion. It seems the wrong values are getting passed to the currency rates when the language is not English which is causing the issue.

I haven’t had much time to look into it further than that yet due to other commitments, but perhaps @smrdoshi or @hemdip.badani can help out here to find a proper fix for this issue?

Thanks for the help, doing this works, however it adds two more 00 to the account balance.

I just had a look at Jira (https://jira.astppbilling.org/browse/ASTPPCOM-777) for this issue and can see there was a note that v5 was to have this fixed but no updates since. Can anyone confirm if this is still the case in v5? If it is fixed there, I will backport the fix to v4 and post a PR on github and link to it here.

Hello @jmurraysolutions ,

I just checked and it persist in v5, if you have already fix then you can share PR else we have to wait for update.

I applied the changes and still have errors.

Example Balance
In English 102.140
In Portuguese 102,000
In Spanish 102.00

Example Costs
In Portuguese
2021-07-21 19:52:11 xxx DID National 44 0.215
2021-07-20 18:34:04 xxx National DID 470 1,720

In Portuguese
2021-07-21 19:52:11 xxx National DID 44 0.000
2021-07-20 18:34:04 xxx National DID 470 1,000

In Spanish
2021-07-21 19:52:11 xxx National DID 44 0.000
2021-07-20 18:34:04 xxx National DID 470 1,000

someone to help?

Communication is going on the issue you have logged. below is the link of issue.

https://jira.astppbilling.org/browse/ASTPPCOM-777