diff --git a/cli/OverheadAccounts.py b/cli/OverheadAccounts.py index 8bd2adf..0525372 100644 --- a/cli/OverheadAccounts.py +++ b/cli/OverheadAccounts.py @@ -1,3 +1,4 @@ +import typing_extensions from db import dbGetMany import datetime from loguru import logger @@ -13,6 +14,24 @@ def perform(dbh, params): # get flat tenants by object and timespan with paid overhead and due overhead +select t.id as tenant_id, + t.firstname as tenant_firstname, + t.lastname as tenant_lastname, + f.id as flat_id, + f.description as flat, + p.id as house_id, + p.description as house, + ty.startdate as startdate, + ty.enddate as enddate + from tenant_t t, + premise_t p, + flat_t f, + tenancy_t ty + where ty.tenant = t.id and + ty.flat = f.id and + f.premise = p.id + order by house_id, tenant_id; + # get overhead sums by object, category and timespan