fix: GPS only from real check-ins — never from Cantaloupe import
GPS coordinates from Cantaloupe are address-geocoded estimates, not real field data. Both UPDATE and INSERT paths now set latitude/longitude to None — GPS comes exclusively from tech check-ins via the main app.
This commit is contained in:
+4
-4
@@ -869,8 +869,8 @@ def approve_batch(
|
||||
if val is not None and str(val).strip() != "":
|
||||
updates[db_col] = str(val).strip()
|
||||
|
||||
# Handle numeric fields
|
||||
for num_field in ("latitude", "longitude", "geofence_radius_meters"):
|
||||
# Handle numeric fields (exclude GPS — comes only from real check-ins)
|
||||
for num_field in ("geofence_radius_meters",):
|
||||
val = item.get(num_field)
|
||||
if val is not None and str(val).strip() != "":
|
||||
try:
|
||||
@@ -948,8 +948,8 @@ def approve_batch(
|
||||
cust_id,
|
||||
loc_id,
|
||||
1 if cust_name and cust_name.startswith("D-") else 0,
|
||||
_safe_float(item.get("latitude")),
|
||||
_safe_float(item.get("longitude")),
|
||||
None, # GPS only from real check-ins
|
||||
None, # GPS only from real check-ins
|
||||
_safe_int(item.get("geofence_radius_meters"), 50),
|
||||
str(item.get("dex_report_date", "")).strip() or "",
|
||||
str(item.get("deployed", "")).strip() or "",
|
||||
|
||||
Reference in New Issue
Block a user