Acquire.Accounting._transactionrecord module¶
-
class
TransactionRecord(uid=None, bucket=None)[source]¶ Bases:
objectThis class holds a record of a transaction that has already been written to the accounting ledger. This records a unique ID, the datetime of the entry, the value, the two accounts involved in the transaction (debit account to credit account), a description of what the transaction refers to, and who/how the transaction was authorised. If ‘is_provisional’ then this is a provisional transaction that is recorded as a liability for the debtor and a future income for the creditor. This is confirmed by creating a receipt via “receipt_for” by passing the UID for the transaction this receipts, and the actual ‘value’ of the receipt. Note that the actual value CANNOT exceed the original provisional value that was agreed by the debtor
-
credit_note()[source]¶ Return the credit note for this transaction. This is the note recording that value has been credited to an account. A TransactionRecord is the pairing of a DebitNote with a CreditNote
-
debit_note()[source]¶ Return the debit note for this transaction. This is the note recording that value has been debited to an account. A TransactionRecord is the pairing of a DebitNote with a CreditNote
-
static
from_data(data)[source]¶ Construct and return a new Transaction from the passed json-decoded dictionary
-
is_direct()[source]¶ Return whether or not this transaction was direct (so was not provisional and so didn’t need a receipt)
-
static
load_test_and_set(uid, expected_state, new_state, bucket=None)[source]¶ Static method to load up the Transaction record associated with the passed UID, check that the transaction state matches ‘expected_state’, and if it does, to update the transaction state to ‘new_state’. This returns the loaded (and updated) transaction
-
original_transaction()[source]¶ If this is a receipt or refund transaction then return the original transaction that this is receipting or refunding. Otherwise returns a null Transaction
-
original_transaction_record()[source]¶ If this is a receipt or refund transaction then return the original transaction record that this is receipting or refunding. Otherwise returns a null TransactionRecord
-