Skip to content
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

BYN currency support not stable #635

Closed
shrddr opened this issue Jan 3, 2017 · 9 comments
Closed

BYN currency support not stable #635

shrddr opened this issue Jan 3, 2017 · 9 comments
Assignees
Labels
Milestone

Comments

@shrddr
Copy link

shrddr commented Jan 3, 2017

Cases in which it fails

  1. Export xml, add a BYN account with desktop gnucash 2.6.13, in gnucash-android open the .gnca file
  2. Create default accounts with USD currency, manually create an account with BYN currency in Assets, go to Assets
  3. Set default currency to BYN and create default accounts, go to main screen

Expected behaviour in each case

  1. Import success
  2. Show the list of Asset accounts
  3. Show parent accounts

Actual behaviour in each case

  1. Import fails with message "Unsupported ISO 4217 currency code: BYN"
  2. Crash
  3. Crash immediately, and then at every startup. Have to uninstall

Software specifications

  • GnuCash Android version: 2.1.3
  • System Android version: 5.0.2
  • Device type: Redmi Note 2
@rivaldi8 rivaldi8 added the bug label Jan 7, 2017
@rivaldi8
Copy link
Collaborator

rivaldi8 commented Jan 7, 2017

This currency isn't supported by Java until the latests releases (see this OpenJDK bug report). It seems it's possible to add new currencies, but only from Java 7 onwards.

One possibility would be to use Joda-Money. It supports BYN and can be easily extended to support any new currency. It's not API stable yet, so we should check other alternatives first.

We should also avoid crashes in these situations.

By the way, Joda-Money also provides a Money class which we could evaluate to replace ours.

@codinguser
Copy link
Owner

This is can (and probably should) be fixable. We now use our own commodities and if I recall correctly, @rivaldi8 you once did some cleanup to use only our Commodities instead of java Currency.

Maybe there is some place where Currency is still used. If we change it to commodity, this issue should be fixed. BYN was added to the commodities a while back I think, although I don't recall if only to new installations or also for existing ones. The latter case can easily be fixed with a database migration.

@codinguser
Copy link
Owner

About Joda-Money, well, it is still evolving. If they get to a 1.0 at some point we can evaluate it.

Although I'm beginning to have increasing inertia to new libraries as we have quite a few already. Build time keeps going up and the apk is starting to hit the 65k method limit in the develop branch.

@rivaldi8
Copy link
Collaborator

Ok, I was convinced that Commodity worked on top of Currency internally. Now I see that's not the case. After quick look at uses of Currency, it seems they could be handled by Commodity. I'll work then on finishing the migration.

@rivaldi8 rivaldi8 self-assigned this Jan 14, 2017
@codinguser
Copy link
Owner

codinguser commented Apr 12, 2017

@shrddr @rivaldi8 is this issue fixed in v2.1.5?
I recall having to make some adjustments for BYN in that release

@seriyps
Copy link

seriyps commented Apr 12, 2017

@codinguser I have v2.1.5 and it seems that BYN is supported now (at least for importing data from gnucash for desktop)

@rivaldi8
Copy link
Collaborator

@codinguser The issues reported here seem to be fixed now. There are still a few uses of Currency which may make the application crash, though. I hope to finish the migration to Commodity shortly.

@codinguser
Copy link
Owner

codinguser commented Apr 12, 2017 via email

@rivaldi8
Copy link
Collaborator

I've just finished the migration to Commodity.

@codinguser codinguser added this to the v2.2.0 milestone Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants