def account_balance_before(self):
<EOL>transaction_date = self.transaction.date<EOL>return self.account.balance(<EOL>leg_query=(<EOL>models.Q(transaction__date__lt=transaction_date)<EOL>| (<EOL>models.Q(transaction__date=transaction_date)<EOL>& models.Q(transaction_id__lt=self.transaction_id)<EOL>)<EOL>)<EOL>)<EOL>
Get the balance of the account associated with this leg before the transaction