From 97dfcbe2fbe65da0cf1fe7ccfc61b643cac76d6f Mon Sep 17 00:00:00 2001 From: Wolfgang Ludger Hottgenroth Date: Tue, 14 Sep 2021 14:31:42 +0200 Subject: [PATCH] optimize tenant with saldo query, fix --- api/additional_methods.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/additional_methods.py b/api/additional_methods.py index a2ca323..1c2c262 100644 --- a/api/additional_methods.py +++ b/api/additional_methods.py @@ -36,10 +36,10 @@ def get_account_saldo(user, token_info, accountId=None): def get_tenant_with_saldo(user, token_info): return dbGetMany(user, token_info, { "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 WHERE a.account = t.account - GROUP BY t.firstname, t.lastname, t.address1 + GROUP BY t.id, t.firstname, t.lastname, t.address1 """, "params": () }