Add get_scheduled_pickups to optimize_routes API

This commit is contained in:
Westech Admin
2026-05-21 01:47:24 +00:00
parent 7d8d1b1376
commit 8f8cf5d78d
5 changed files with 18 additions and 0 deletions
Binary file not shown.
Binary file not shown.
+18
View File
@@ -107,3 +107,21 @@ def _calculate_slots(gaylord_sizes_text):
slots = size_map.get(size, 1)
total += int(count) * slots
return total or 1
@frappe.whitelist()
def get_scheduled_pickups(pickup_date=None):
"""Get scheduled pickups for a given date."""
if not pickup_date:
pickup_date = frappe.utils.today()
pickups = frappe.get_list("Scheduled Pickup",
filters={"pickup_date": pickup_date},
fields=["name", "customer_number", "company_name", "estimated_items",
"estimated_weight", "gaylord_count", "gaylord_sizes", "slots_needed",
"latitude", "longitude", "stop_order", "truck_profile", "status",
"contact_name", "contact_phone", "address_line", "city", "state", "zip_code"],
order_by="stop_order asc"
)
return pickups