-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/financial#184 Fix currency name for Ghana and Belarus #21751
Conversation
(Standard links)
|
rebased |
I did some But one thing seems off to me --
The list is long, but I think all of those tables store the currency-symbol. So doesn't it need to rename the symbol on all of those tables? |
Or are these actually different currencies with different valuations? (From the description, it sounds like Ghana actually issued a new currency, and Belarus simply changed the symbol.) I guess the difference is this:
|
Alternatively, if it's something quite subjective - then maybe it's fair to take a best-guess at what transition will be needed most often, and add an upgrade-message to alert anyone who might have a funny case. |
@totten Thanks for that grep & And agree on the subjectivity - considering those currencies have been in circulation since 2007 (Ghana) and 2016 (Belarus), I think it's safe to assume that CiviCRM installations have already converted, and that those who were using the old currencies were doing so assuming it was the new currency. Otherwise I would have suggested to introduce a new currency and phase out the old one. It's also a slight concern to keep in mind with the Brick/Money library: they do not keep currencies that have been removed from circulation. |
(I squashed the commits because I did a mistake in an |
The column is inconsistently named fee_currency for civicrm_participant. So this fails |
@yashodha Thanks! Should be fixed. |
@mlutfy it looks like you have addressed feedback - but in the meantime 5.43 was cut so you need to move the upgrade to 5.44 |
@mlutfy actually now it's 5.45. If the feedback is all addressed then we can go ahead and merge this once it's rebased onto the latest version. |
@mlutfy looks good, can be merged after upgrade version fixed to 5.45. |
Rebased on master, and moved the upgrade to FiveFortyFive.php |
test fail is unrelated - failing elsewhere=, date based |
Overview
https://lab.civicrm.org/dev/financial/-/issues/184
To reproduce:
Result:
The ISO code for Ghana is "GHS", which is what Brick/Money uses.
https://en.wikipedia.org/wiki/Ghanaian_cedi
Technical Details
The problem surfaced when upgrading to the Brick/Money library. The old values were not technically wrong, in the year when CiviCRM was first created.
The proper thing to do would have been to add a new currency and phase out the old one, but in this specific case, I think it's safe to say that most CiviCRM installations, if they are using those currencies, probably have already converted their accounting to the newer currencies.
I wrote a generic-ish function, knowing it might not be used very often, but I figure that my clients are pretty good at using currencies that not many people are using, so if we find any, I will re-use that function. In the situations I encountered, they did not have any financial transactions in the CRM.