exceptions
Provides exceptions arising from accounting operations.
Package Contents
- exception exceptions.AccountingExeption
Bases:
ExceptionBase accounting exception
- msg
Human readable string describing the exception.
- Type:
str
- message: str
- __str__() str
Return str(self).
- exception exceptions.AdjustingReportingPeriodError(reporting_period)
Bases:
AccountingExeptionOnly Journal Entry Transactions can be recorded for adjusting status Reporting Periods.
- Parameters:
reporting_period (ReportingPeriod) – The Reporting Period in question.
- exception exceptions.ClosedReportingPeriodError(reporting_period)
Bases:
AccountingExeptionTransactions cannot be recorded for closed reporting periods.
- Parameters:
reporting_period (ReportingPeriod) – The Reporting Period in question.
- exception exceptions.DuplicateReportingPeriodError
Bases:
AccountingExeptionAn Entity can only have one reporting period per calendar year.
- exception exceptions.InvalidAccountTypeError(message: str)
Bases:
AccountingExeptionThe account type must be one of those given in the list.
- Parameters:
message (str) – A string containing the list of allowed Account Types.
- exception exceptions.HangingTransactionsError(model)
Bases:
AccountingExeptionThe account cannot be deleted because it has Transactions in the current reporting period.
- Parameters:
model (DeclarativeBase) – The model to be deleted.
- exception exceptions.InvalidBalanceAccountError
Bases:
AccountingExeptionIncome Statement Accounts cannot have an opening balance.
- exception exceptions.InvalidBalanceDateError
Bases:
AccountingExeptionUnless the Entity allows for mid year balances, the balance date must be earlier than its reporting period’s start.
- exception exceptions.InvalidBalanceTransactionError
Bases:
AccountingExeptionBalance Transaction must be one of Client Invoice, Supplier Bill or Journal Entry.
- exception exceptions.InvalidCategoryAccountTypeError(account_type, category_account_type)
Bases:
AccountingExeptionThe account type must the same as the category account type.
- Parameters:
account_type (Account.AccountType) – The account type of the Account.
category_account_type (Account.AccountType) – The account type of the Category.
- exception exceptions.InvalidLineItemAccountError(classname, account_types: list)
Bases:
AccountingExeptionThe Line Item main Account type must be one of those given in the list.
- Parameters:
classname (Transaction.TransactionType) – The type of the Transaction.
account_types (list) – The list of allowed Account types for the Transaction.
- exception exceptions.InvalidMainAccountError(classname, account_type: str)
Bases:
AccountingExeptionThe account type of the transaction must be of the type given.
- Parameters:
classname (Transaction.TransactionType) – The type of the Transaction.
account_type (str) – The allowed Account type for the Transaction.
- exception exceptions.InvalidTaxAccountError
Bases:
AccountingExeptionA Tax account must be of type Control.
- exception exceptions.InvalidTaxChargeError(classname)
Bases:
AccountingExeptionA Contra Entry Transaction cannot be charged Tax.
- Parameters:
classname (Transaction.TransactionType) – The type of the Transaction.
- exception exceptions.InvalidTransactionDateError
Bases:
AccountingExeptionThe Transaction date cannot be the exact beginning of the reporting period.
- exception exceptions.InvalidTransactionTypeError
Bases:
AccountingExeptionThe Transaction type cannot be changed as this would bypass subclass validations.
- exception exceptions.MissingEntityError
Bases:
AccountingExeptionAccounting objects must all be associated with an Entity.
- exception exceptions.MissingLineItemError
Bases:
AccountingExeptionA Transaction must have at least one Line Item to be posted.
- exception exceptions.MissingMainAccountAmountError
Bases:
AccountingExeptionA Compound Journal Entry Transaction must have a main account amount.
- exception exceptions.MissingReportingPeriodError(entity, year)
Bases:
AccountingExeptionThe Entity does not have a reporting period for the given date.
- exception exceptions.MissingTaxAccountError
Bases:
AccountingExeptionA non Zero Rate Tax must have an associated control account.
- exception exceptions.MultipleOpenPeriodsError
Bases:
AccountingExeptionAn Entity can only have one reporting period open at a time.
- exception exceptions.NegativeValueError(classname, attribute='amount')
Bases:
AccountingExeptionAccounting amounts should not be negative.
- Parameters:
classname (DeclarativeBase) – The model in question.
attribute – The model attribute that must be greater than zero.
- exception exceptions.PostedTransactionError(message)
Bases:
AccountingExeptionChanges are not allowed for a posted Transaction.
- Parameters:
message (str) – The changes that are not allowed for a posted Transaction.
- exception exceptions.RedundantTransactionError(line_item)
Bases:
AccountingExeptionA Transaction main account cannot be used as the account for any of its Line Items.
- Parameters:
line_item (LineItem) – The line item in question.
- exception exceptions.SessionEntityError
Bases:
AccountingExeptionThe Session Entity should not be deleted.
- exception exceptions.UnbalancedTransactionError
Bases:
AccountingExeptionTotal Debit amounts do not match total Credit amounts.
- exception exceptions.UnassignableTransactionError(classname, transaction_types: list)
Bases:
AccountingExeptionThe Transaction type must be one of those given in the list.
- Parameters:
line_item (LineItem) – The line item in question.
- exception exceptions.UnclearableTransactionError(classname, transaction_types: list)
Bases:
AccountingExeptionThe Transaction type must be one of those given in the list.
- Parameters:
classname (Transaction.TransactionType) – The type of the Transaction.
transaction_types (list) – The list of allowed Transactiom types for the Assignment.
- exception exceptions.UnpostedAssignmentError
Bases:
AccountingExeptionAn unposted Transaction cannot be cleared or assigned.
- exception exceptions.SelfClearanceError
Bases:
AccountingExeptionA Transaction cannot clear/be assigned to itself.
- exception exceptions.InvalidAssignmentAccountError
Bases:
AccountingExeptionThe main account for the cleared and clearing Transaction must be the same.
- exception exceptions.InvalidClearanceEntryTypeError(entry_type: str)
Bases:
AccountingExeptionTransaction Entry increases the Main Account outstanding balance instead of reducing it.
- Parameters:
entry_type (Balance.BalanceType) – The type of the Transaction entry.
- exception exceptions.CompoundTransactionAssignmentError
Bases:
AccountingExeptionA compound Transaction cannot be cleared or assigned.
- exception exceptions.InsufficientBalanceError(assigning: str, amount: float, assigned: str)
Bases:
AccountingExeptionAssigning Transaction does not have suffecient balance to clear the amount specified of the assigned.
- Parameters:
assigning (str) – The type of the Transaction to be assigned.
amount (Decimal) – The amount to be assigned.
assigned (str) – The type of the Transaction to be cleared.
- exception exceptions.OverclearanceError(assigned: str)
Bases:
AccountingExeptionThe assigned Transaction has already been completely cleared.
- Parameters:
assigned (str) – The type of the Transaction to be cleared.
- exception exceptions.MixedAssignmentError(previous: str, current: str)
Bases:
AccountingExeptionAn assigned/cleared cannot be cleared/assigned.
- Parameters:
previous (str) – The role played by the Transaction in a previous Assignment.
current (str) – The role played by the Transaction in the current Assignment.