reconcile changes
This commit is contained in:
Binary file not shown.
@@ -1044,13 +1044,17 @@ class RouteOptimizer:
|
||||
order["previouskms"] = int(round(step_dist)) # Bug fix: was hardcoded 0 for step 1
|
||||
order["cumulativekms"] = int(round(cumulative_dist))
|
||||
|
||||
# actualkms = direct pickup-to-door distance (for billing)
|
||||
plat, plon = start_lat, start_lon
|
||||
# actualkms = direct pickup-to-door distance (for billing).
|
||||
# Always the order's own kitchen, never the routing depot: when
|
||||
# start_coords is the rider's current position (e.g. reconcile
|
||||
# mid-route) rather than the kitchen, start_lat/start_lon no
|
||||
# longer equals the pickup location.
|
||||
plat, plon = (
|
||||
_to_float(order.get("pickuplat")),
|
||||
_to_float(order.get("pickuplon") or order.get("pickuplong")),
|
||||
)
|
||||
if plat == 0:
|
||||
plat, plon = (
|
||||
_to_float(order.get("pickuplat")),
|
||||
_to_float(order.get("pickuplon") or order.get("pickuplong")),
|
||||
)
|
||||
plat, plon = start_lat, start_lon
|
||||
dlat, dlon = locations[solver_idx]
|
||||
true_dist = self.haversine_distance(plat, plon, dlat, dlon) * 1.3
|
||||
|
||||
|
||||
Reference in New Issue
Block a user