Add get_scheduled_pickups to optimize_routes API
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -107,3 +107,21 @@ def _calculate_slots(gaylord_sizes_text):
|
|||||||
slots = size_map.get(size, 1)
|
slots = size_map.get(size, 1)
|
||||||
total += int(count) * slots
|
total += int(count) * slots
|
||||||
return total or 1
|
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
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user