live stock update

This commit is contained in:
2026-08-27 11:17:17 +05:30
parent ca846f9cd6
commit dc9c049bb9
6 changed files with 548 additions and 2 deletions

View File

@@ -487,9 +487,13 @@ func (r *posRepository) ListPosUsers(tenantID, locationID int, includeInactive b
params := []interface{}{tenantID, locationID, models.PosRoleSupervisor, models.PosRoleCashier}
if !includeInactive {
query += ` AND LOWER(COALESCE(status,'active')) <> 'inactive'`
// `a.status`, qualified. `staffshifts` carries a `status` column too, so
// the bare name made Postgres refuse the whole statement with
// `column reference "status" is ambiguous` (42702) — a 500 on every
// console call, since the console never asks for inactive rows.
query += ` AND LOWER(COALESCE(a.status,'active')) <> 'inactive'`
}
query += ` ORDER BY userid`
query += ` ORDER BY a.userid`
if err := r.db.Raw(query, params...).Scan(&rows).Error; err != nil {
return nil, err