optimize tenant with saldo query, fix

This commit is contained in:
Wolfgang Hottgenroth 2021-09-14 14:31:42 +02:00
parent 76255efbe9
commit 97dfcbe2fb
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F

View File

@ -36,10 +36,10 @@ def get_account_saldo(user, token_info, accountId=None):
def get_tenant_with_saldo(user, token_info): def get_tenant_with_saldo(user, token_info):
return dbGetMany(user, token_info, { return dbGetMany(user, token_info, {
"statement": """ "statement": """
SELECT t.firstname, t.lastname, t.address1, sum(a.amount) AS saldo SELECT t.id, t.firstname, t.lastname, t.address1, sum(a.amount) AS saldo
FROM tenant_t t, account_entry_t a FROM tenant_t t, account_entry_t a
WHERE a.account = t.account WHERE a.account = t.account
GROUP BY t.firstname, t.lastname, t.address1 GROUP BY t.id, t.firstname, t.lastname, t.address1
""", """,
"params": () "params": ()
} }