methods change pipeline.entries:
pipeline.add_entries()
pipeline.close_contra_accounts(related_to=Income)
pipeline.close_contra_accounts(related_to=Expense)
pipeline.close_temporary_contra_accounts() # equivalent to two above
# --- at this point income statement can be calcultaed
# income and expense will need calculation of ledger
pipeline.close_income() # raise error if balance of contraccount for income not zero
pipeline.close_expense() # raise error if balance of contraccount for expenses not zero
pipeline.close_income_and_expense() # raise error if isa balance not zero
pipeline.close_income_summary_account()
pipeline.close_contra_accounts(related_to=Asset)
pipeline.close_contra_accounts(related_to=Liability)
pipeline.close_contra_accounts(related_to=Capital)
pipeline.close_permanent_contra_accounts() # equivalent to three above
ledger.is_closed() # all permanent contra accounts are zero, income, expense and isa are zero
ledger.is_neeted() # is closed and permanent contraccounts are closed
# --- at this point balance sheet statement can be calcultaed
@dataclass
class Pipeline:
"""Construct a list of postings to a ledger using add_entries() method and methods for closing temporarily accounts or netting contraccounts."""
start_ledger: Ledger
entries: List[Entry] #= ...
def run(self):
return process_entries(self.start_ledger, self.entries)