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
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.
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?
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.