biweeklybudget.models.ofx_transaction module

class biweeklybudget.models.ofx_transaction.OFXTransaction(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base, biweeklybudget.models.base.ModelAsDict

_sa_class_manager = {'account': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8004a447d0>, 'account_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8004a44c50>, 'amount': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e3050>, 'checknum': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e3410>, 'date_posted': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8004a44f50>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e34d0>, 'fitid': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8004a44dd0>, 'is_interest_charge': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e37d0>, 'is_interest_payment': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e3950>, 'is_late_fee': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e3710>, 'is_other_fee': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e3890>, 'is_payment': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e3650>, 'mcc': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e3350>, 'memo': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e31d0>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e3110>, 'notes': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e3590>, 'reconcile_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e3a10>, 'sic': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f80049e3290>, 'statement': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8004a44b90>, 'statement_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8004a44d10>, 'trans_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8004a44e90>}
account

Account this transaction is associated with

account_amount

Return the amount of the transaction, appropriately negated if the Account for this transaction has negate_ofx_amounts True.

Returns:amount, negated as appropriate
Return type:decimal.Decimal
account_id

Account ID this transaction is associated with

amount

OFX - Amount

checknum

OFX - Checknum

date_posted

OFX - Date Posted

description

Description

first_statement_by_date

Return the first OFXStatement on or after self.date_posted.

Returns:first OFXStatement on or after self.date_posted
Return type:biweeklybudget.models.ofx_statement.OFXStatement
fitid

OFX - FITID

is_interest_charge

Account’s re_interest_charge matched

is_interest_payment

Account’s re_interest_paid matched

is_late_fee

Account’s re_late_fee matched

is_other_fee

Account’s re_fee matched

is_payment

Account’s re_payment matched

mcc

OFX - MCC

memo

OFX - Memo

name

OFX - Name

notes

Notes

static params_from_ofxparser_transaction(t, acct_id, stmt, cat_memo=False)[source]

Given an ofxparser.ofxparser.Transaction object, generate and return a dict of kwargs to create a new OFXTransaction.

Parameters:
Returns:

dict of kwargs to create an OFXTransaction

Return type:

dict

reconcile_id

The reconcile_id for the OFX Transaction

sic

OFX - SIC

statement

OFXStatement this transaction was last seen in

statement_id

OFXStatement ID this transaction was last seen in

trans_type

OFX - Transaction Type

static unreconciled(db)[source]

Return a query to match all unreconciled OFXTransactions.

Parameters:db (sqlalchemy.orm.session.Session) – active database session to use for queries
Returns:query to match all unreconciled OFXTransactions
Return type:sqlalchemy.orm.query.Query