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

Currency on transactions #124

Open
mralbu opened this issue Feb 2, 2017 · 2 comments
Open

Currency on transactions #124

mralbu opened this issue Feb 2, 2017 · 2 comments

Comments

@mralbu
Copy link

mralbu commented Feb 2, 2017

I needed to parse CURRENCY tags as well (#100), so I've modified the transaction parser to retrieve transaction currencies other than CURDEF. mralbu/ofxparse@591b6fe
I've added an ofx file to fixtures and a test function for it as well.
Do you think this solution is acceptable? Would you accept it as a pull request?

@heitorpolidoro
Copy link

I had the same problem and fix it. I tried to make a PR but git says that i had no permission to to read from remote repository

ERROR: Permission to jseutter/ofxparse.git denied to heitorpolidoro.
fatal: Could not read from remote repository.

This is my change on ofxparse/ofxparse.py:


class Transaction(object):
    def __init__(self):
        self.payee = ''
        self.type = ''
        self.date = None
        self.amount = None
        self.id = ''
        self.memo = ''
        self.sic = None
        self.mcc = ''
        self.checknum = ''
        self.currate = 1  # New attribute. Default is 1 so I can always use currate * amount


And in parseTransaction() add:

        currate_tag = txn_ofx.find('currate')
        if hasattr(currate_tag, "contents"):
            try:
                transaction.currate = cls.toDecimal(currate_tag)
            except IndexError:
                # Memo can be empty.
                pass
            except TypeError:
                pass

@heliocarbex
Copy link

Thanks for your support @heitorpolidoro.

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

No branches or pull requests

3 participants