epogrebnyak / abacus

A small yet valid double-entry accounting system in Python and command line.
https://epogrebnyak.github.io/abacus/
GNU General Public License v3.0
59 stars 4 forks source link

Change Netting class and ContraAccount class using `name_after_netting` and `counterpart` fields #20

Closed epogrebnyak closed 1 year ago

epogrebnyak commented 1 year ago

https://github.com/epogrebnyak/abacus/blob/1f3030c49e3541f0f0a5cf3447296fcfbc82aa04/abacus/accounts.py#L73-L81

class NettableAccount(Account):
    """`NettableAccount` is an account that may have associated contra accounts.
    If an account has associated contra accounts, the account name will 
    need to change to *resulting_name* after netting of associated contra accounts is complete.
    For exasmple `sales` account name may change to comething like `net_sales`.
    If *resulting_name* is `None`, then there are no contra accounts to be netted. 
    """
    resulting_name: Optional[AccountName] 

class ContraAccount(Account):
    counterpart_name: AccountName