auxi.modelling.business.basic module

This module provides class and functions for basic business activities.

class auxi.modelling.business.basic.BasicActivity(name, dt_account, cr_account, amount=0, start=datetime.datetime(1, 1, 1, 0, 0), end=datetime.datetime(9999, 12, 31, 23, 59, 59, 999999), interval=1, description=None)

Bases: auxi.modelling.business.structure.Activity

An activity class that provides the most basic activity functionality: periodically create a transaction between two specified accounts.

Parameters:
  • name – The name.
  • dt_account – The debit account.
  • cr_account – The credit account.
  • amount – The amount of an activity.
  • start – The datetime the activity should be started.
  • end – The datetime the activity should be run until.
  • interval – The interval of the activity.
  • description – The description.
get_referenced_accounts()

Retrieve the general ledger accounts referenced in this instance.

Returns:The referenced accounts.
run(clock, generalLedger)

Execute the activity at the current clock cycle.

Parameters:
  • clock – The clock containing the current execution time and period information.
  • generalLedger – The general ledger into which to create the transactions.
class auxi.modelling.business.basic.BasicLoanActivity(name, bank_account, loan_account, interest_account, amount=0, interest_rate=0.0, start=datetime.datetime(1, 1, 1, 0, 0), duration=60, interval=1, description=None)

Bases: auxi.modelling.business.structure.Activity

An activity class that provides the most basic activity functionality for a loan: Creates a loan transaction and periodically create transactions to consider the interest and to pay the interest.

Parameters:
  • name – The name.
  • description – The description.
  • bank_account – The asset account that is increased.
  • loan_account – The liability account that is decreased.
  • interest_account – The expense account the interest is added to.
  • amount – The loan amount. The default amount is 0
  • interest_rate – The interest rate as a fraction of the whole (e.g. 0.15 = 15%). The default value is 0.0
  • start – The datetime the activity should be started.
  • duration – The duration of the loan in months.
  • interval – The interval of the activity.
amount
get_referenced_accounts()

Retrieve the general ledger accounts referenced in this instance.

Returns:The referenced accounts.
interest_rate
prepare_to_run(clock, period_count)

Prepare the activity for execution.

Parameters:
  • clock – The clock containing the execution start time and execution period information.
  • period_count – The total amount of periods this activity will be requested to be run for.
run(clock, generalLedger)

Execute the activity at the current clock cycle.

Parameters:
  • clock – The clock containing the current execution time and period information.
  • generalLedger – The general ledger into which to create the transactions.