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>, 'account_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'amount': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'checknum': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'date_posted': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'fitid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'is_interest_charge': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'is_interest_payment': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'is_late_fee': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'is_other_fee': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'is_payment': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'mcc': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'memo': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'notes': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'reconcile': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'reconcile_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'sic': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'statement': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'statement_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'trans_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
account
¶ Account this transaction is associated with
-
account_amount
¶ Return the amount of the transaction, appropriately negated if the
Account
for this transaction hasnegate_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: - t (
ofxparser.ofxparser.Transaction
) – ofxparser transaction - acct_id (int) – OFXAccount ID
- stmt (biweeklybudget.models.ofx_statement.OFXStatement) – OFXStatement this transaction was on
- cat_memo (bool) – whether or not to concatenate OFX Memo to Name
Returns: dict of kwargs to create an OFXTransaction
Return type: - t (
-
reconcile
¶
-
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
-