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

Handle additional types of investment transactions #273

Merged
merged 5 commits into from
Mar 5, 2024

Conversation

edwagner
Copy link
Contributor

@edwagner edwagner commented Mar 4, 2024

I'm in the process of building a plugin to convert Charles Schwab JSON exports to OFX, and need to write out some additional types of investment transactions in a way that is consumable by Gnucash.

Hopefully most if this is additive (i.e. shouldn't negatively impact current behavior) with the exception of limiting the precision of the total to 2 decimal places. IIRC, more than two decimal places on the total caused a problem importing into Gnucash.

For some investment transactions (e.g. INTEREST) there is no security,
so don't add a blank <STOCKINFO> that will get rejected by Gnucash.
Total doesn't need more than 2 decimal places.
@edwagner edwagner changed the title Handle additional types of investment transaction Handle additional types of investment transactions Mar 4, 2024
Copy link
Owner

@kedder kedder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thank you! Could you please fix the tests? It will be good to go then.

@edwagner edwagner force-pushed the invest-statement-enhancements branch from 6ff1d3a to 95a601f Compare March 4, 2024 23:33
For INTEREST, XFER, and other cash transactions that are not
associated with a security, INVBANKTRAN is the appropriate
transaction type.

The body is like a bank transaction (STMTTRN), not an INVTRAN.
For share transfers, TRANSFER is the appropriate type with no
trntype_detailed, no amount and an optional unit_price.
@edwagner edwagner force-pushed the invest-statement-enhancements branch from 95a601f to 8c1112c Compare March 4, 2024 23:42
@edwagner
Copy link
Contributor Author

edwagner commented Mar 4, 2024

It looks like it was a mypy error. I'm pretty new to Python and I hadn't looked at the various checks your actions run. I've pushed an update that should pass both mypy and black.

@edwagner edwagner requested a review from kedder March 4, 2024 23:45
@coveralls
Copy link

Coverage Status

coverage: 96.033% (+0.5%) from 95.514%
when pulling 8c1112c on edwagner:invest-statement-enhancements
into cfd9002 on kedder:master.

@kedder kedder merged commit 15f8c23 into kedder:master Mar 5, 2024
6 checks passed
@edwagner edwagner deleted the invest-statement-enhancements branch March 5, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants