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() != "":
|
if val is not None and str(val).strip() != "":
|
||||||
updates[db_col] = str(val).strip()
|
updates[db_col] = str(val).strip()
|
||||||
|
|
||||||
# Handle numeric fields
|
# Handle numeric fields (exclude GPS — comes only from real check-ins)
|
||||||
for num_field in ("latitude", "longitude", "geofence_radius_meters"):
|
for num_field in ("geofence_radius_meters",):
|
||||||
val = item.get(num_field)
|
val = item.get(num_field)
|
||||||
if val is not None and str(val).strip() != "":
|
if val is not None and str(val).strip() != "":
|
||||||
try:
|
try:
|
||||||
@@ -948,8 +948,8 @@ def approve_batch(
|
|||||||
cust_id,
|
cust_id,
|
||||||
loc_id,
|
loc_id,
|
||||||
1 if cust_name and cust_name.startswith("D-") else 0,
|
1 if cust_name and cust_name.startswith("D-") else 0,
|
||||||
_safe_float(item.get("latitude")),
|
None, # GPS only from real check-ins
|
||||||
_safe_float(item.get("longitude")),
|
None, # GPS only from real check-ins
|
||||||
_safe_int(item.get("geofence_radius_meters"), 50),
|
_safe_int(item.get("geofence_radius_meters"), 50),
|
||||||
str(item.get("dex_report_date", "")).strip() or "",
|
str(item.get("dex_report_date", "")).strip() or "",
|
||||||
str(item.get("deployed", "")).strip() or "",
|
str(item.get("deployed", "")).strip() or "",
|
||||||
|
|||||||
Reference in New Issue
Block a user