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

tracing issue of transaction price and precision of currency #61

Closed
5 tasks
Kilerd opened this issue Jun 6, 2022 · 1 comment · Fixed by #63
Closed
5 tasks

tracing issue of transaction price and precision of currency #61

Kilerd opened this issue Jun 6, 2022 · 1 comment · Fixed by #63
Milestone

Comments

@Kilerd
Copy link
Collaborator

Kilerd commented Jun 6, 2022

currently while parsing the beancount example file into zhang, there are lots of error thrown by balance check system, there are two main cause of it:

one is precision issue

2015-04-13 * "Investing 60% of cash in RGAGX"
  Assets:US:Vanguard:RGAGX                          8.605 RGAGX {83.67 USD, 2015-04-13}
  Assets:US:Vanguard:Cash                         -719.98 USD

8.605 * 83.67 = 719.98035, which is not equals to 719.98. if we have the default 2 decimal place precision for this commodity, then it will round down as 719.98, then the transaction is balanced

the second one is the price calculator, for now though zhang parser can accept the syntax Assets:US:ETrade:VEA -4 VEA {148.59 USD, 2017-03-19} @ 145.72 USD, but the calculator did not use the cost and single price info to calculate the final cost.

we should allow use to modify currency/commodity's precision and round direction via commodity directive's meta

and should calculate the transaction postings' price presentation, there are some scenario of posting's price

NO Posting directive unit cost single price total price
1 Account
2 Account 10 USD 10 USD
3 Account 10 USD { 7 CNY } 10 USD 7 CNY
4 Account 10 USD { 7 CNY, 2022-06-02 } 10 USD 7 CNY, 2022-06-02
5 Account 10 USD @ 7 CNY 10 USD 7 CNY
6 Account 10 USD @@ 70 CNY 10 USD 70 CNY
7 Account 10 USD { 7 CNY } @ 6.9 CNY 10 USD 7 CNY 6.9 CNY
8 Account 10 USD { 7 CNY, 2022-06-02 } @ 6.9 CNY 10 USD 7 CNY, 2022-06-02 6.9 CNY

so the issue need to handle

  • commodity list
  • comodity's precision and round way
  • parsing posting into structural posting object and return them via GraphQL
  • transaction balance logic based on round way and precision
  • frontend UI change
@Kilerd Kilerd linked a pull request Jun 7, 2022 that will close this issue
@Kilerd Kilerd added this to the VERSION 0.1 milestone Jun 8, 2022
@Kilerd
Copy link
Collaborator Author

Kilerd commented Jun 10, 2022

need to include the issue #65

@Kilerd Kilerd closed this as completed in #63 Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant