Add compact live-filter client lists for partners
This commit is contained in:
@@ -228,7 +228,7 @@ def _load_tasks(db: Session, tenant_id: int | None, branch_id: int | None, curre
|
||||
|
||||
def _load_clients(db: Session, tenant_id: int | None, branch_id: int | None, current_user, roles: set[str]) -> list[dict[str, Any]]:
|
||||
stmt = _client_scope(select(Client), tenant_id, branch_id, current_user, roles)
|
||||
clients = db.execute(stmt.order_by(Client.client_name.asc()).limit(100)).scalars().all()
|
||||
clients = db.execute(stmt.order_by(Client.client_name.asc()).limit(5000)).scalars().all()
|
||||
out: list[dict[str, Any]] = []
|
||||
for client in clients:
|
||||
task_count = _count(db, _task_scope(select(func.count(ClientServiceTaskInstance.id)), tenant_id, branch_id, current_user, roles).where(ClientServiceTaskInstance.client_id == client.id))
|
||||
@@ -246,6 +246,7 @@ def _load_clients(db: Session, tenant_id: int | None, branch_id: int | None, cur
|
||||
"gstin": client.gstin,
|
||||
"email": client.email,
|
||||
"mobile": client.mobile,
|
||||
"status": client.status or ("active" if client.is_active else "inactive"),
|
||||
"service_count": service_count,
|
||||
"task_count": task_count,
|
||||
"overdue_count": overdue_count,
|
||||
|
||||
Reference in New Issue
Block a user