Acquire.Accounting._account module

class Account(name=None, description=None, uid=None, bucket=None)[source]

Bases: object

This class represents a single account in the ledger. It has a balance, and a record of the set of transactions that have been applied.

The account really holds two accounts: the liability account and actual capital account. We combine both together into a single account to ensure that updates occur atomically

All data for this account is stored in the object store

assert_valid_authorisation(authorisation)[source]

Assert that the passed authorisation is valid for this account

available_balance(bucket=None)[source]

Return the available balance of this account. This is the amount of value that can be spent (e.g. includes overdraft and fixed daily spend limits, and except any outstanding liabilities)

balance(bucket=None)[source]

Return the current balance of this account

balance_status(bucket=None)[source]

Return the overall balance status as a dictionary with keys ‘balance’, ‘liability’, ‘receivable’ and ‘spent_today’

description()[source]

Return the description of this account

static from_data(data)[source]

Construct and return an Account from the passed dictionary that has been decoded from json

get_overdraft_limit()[source]

Return the overdraft limit of this account

is_beyond_overdraft_limit(bucket=None)[source]

Return whether or not the current balance is beyond the overdraft limit

is_null()[source]

Return whether or not this is a null account

last_update_datetime()[source]

Return the last time the balance was updated, as a datetime object

liability(bucket=None)[source]

Return the current total liability of this account

name()[source]

Return the name of this account

receivable(bucket=None)[source]

Return the current total accounts receivable of this account

set_overdraft_limit(limit, bucket=None)[source]

Set the overdraft limit of this account to ‘limit’

spent_today(bucket=None)[source]

Return the current amount spent today on this account

to_data()[source]

Return a dictionary that can be encoded to json from this object

uid()[source]

Return the UID for this account.