@@ -12,9 +12,9 @@ discard block |
||
| 12 | 12 | Route4Me::setApiKey(Constants::API_KEY); |
| 13 | 13 | |
| 14 | 14 | $orderParameters = Order::fromArray([ |
| 15 | - 'day_added_YYMMDD' => date('Y-m-d', strtotime('-1 days')), |
|
| 16 | - 'offset' => 0, |
|
| 17 | - 'limit' => 5, |
|
| 15 | + 'day_added_YYMMDD' => date('Y-m-d', strtotime('-1 days')), |
|
| 16 | + 'offset' => 0, |
|
| 17 | + 'limit' => 5, |
|
| 18 | 18 | ]); |
| 19 | 19 | |
| 20 | 20 | $order = new Order(); |
@@ -22,6 +22,6 @@ discard block |
||
| 22 | 22 | $response = $order->getOrder($orderParameters); |
| 23 | 23 | |
| 24 | 24 | foreach ($response['results'] as $key => $order) { |
| 25 | - Route4Me::simplePrint($order); |
|
| 26 | - echo '<br>'; |
|
| 25 | + Route4Me::simplePrint($order); |
|
| 26 | + echo '<br>'; |
|
| 27 | 27 | } |
@@ -28,10 +28,10 @@ |
||
| 28 | 28 | $body = json_decode($jFile); |
| 29 | 29 | |
| 30 | 30 | $orderParameters = [ |
| 31 | - 'optimization_problem_id' => $optimizationProblemId, |
|
| 32 | - 'redirect' => 0, |
|
| 33 | - 'device_type' => 'web', |
|
| 34 | - 'addresses' => $body->addresses, |
|
| 31 | + 'optimization_problem_id' => $optimizationProblemId, |
|
| 32 | + 'redirect' => 0, |
|
| 33 | + 'device_type' => 'web', |
|
| 34 | + 'addresses' => $body->addresses, |
|
| 35 | 35 | ]; |
| 36 | 36 | |
| 37 | 37 | $order = new Order(); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | // Get an order |
| 25 | 25 | $orderParameters = Order::fromArray([ |
| 26 | - 'order_id' => $orderID, |
|
| 26 | + 'order_id' => $orderID, |
|
| 27 | 27 | ]); |
| 28 | 28 | |
| 29 | 29 | $response = $order->getOrder($orderParameters); |
@@ -14,17 +14,17 @@ |
||
| 14 | 14 | Route4Me::setApiKey(Constants::API_KEY); |
| 15 | 15 | |
| 16 | 16 | $orderParameters = Order::fromArray([ |
| 17 | - 'address_1' => '1358 E Luzerne St, Philadelphia, PA 19124, US', |
|
| 18 | - 'cached_lat' => 48.335991, |
|
| 19 | - 'cached_lng' => 31.18287, |
|
| 20 | - 'day_scheduled_for_YYMMDD' => '2019-10-11', |
|
| 21 | - 'address_alias' => 'Auto test address', |
|
| 22 | - 'custom_user_fields' => [ |
|
| 23 | - OrderCustomField::fromArray([ |
|
| 24 | - 'order_custom_field_id' => 93, |
|
| 25 | - 'order_custom_field_value' => 'false' |
|
| 26 | - ]) |
|
| 27 | - ] |
|
| 17 | + 'address_1' => '1358 E Luzerne St, Philadelphia, PA 19124, US', |
|
| 18 | + 'cached_lat' => 48.335991, |
|
| 19 | + 'cached_lng' => 31.18287, |
|
| 20 | + 'day_scheduled_for_YYMMDD' => '2019-10-11', |
|
| 21 | + 'address_alias' => 'Auto test address', |
|
| 22 | + 'custom_user_fields' => [ |
|
| 23 | + OrderCustomField::fromArray([ |
|
| 24 | + 'order_custom_field_id' => 93, |
|
| 25 | + 'order_custom_field_value' => 'false' |
|
| 26 | + ]) |
|
| 27 | + ] |
|
| 28 | 28 | ]); |
| 29 | 29 | |
| 30 | 30 | $order = new Order(); |
@@ -10,25 +10,25 @@ |
||
| 10 | 10 | Route4Me::setApiKey(Constants::API_KEY); |
| 11 | 11 | |
| 12 | 12 | $orderParameters = Order::fromArray([ |
| 13 | - 'address_1' => '318 S 39th St, Louisville, KY 40212, USA', |
|
| 14 | - 'cached_lat' => 38.259326, |
|
| 15 | - 'cached_lng' => -85.814979, |
|
| 16 | - 'curbside_lat' => 38.259326, |
|
| 17 | - 'curbside_lng' => -85.814979, |
|
| 18 | - 'address_alias' => '318 S 39th St 40212', |
|
| 19 | - 'address_city' => 'Louisville', |
|
| 20 | - 'EXT_FIELD_first_name' => 'Lui', |
|
| 21 | - 'EXT_FIELD_last_name' => 'Carol', |
|
| 22 | - 'EXT_FIELD_email' => '[email protected]', |
|
| 23 | - 'EXT_FIELD_phone' => '897946541', |
|
| 24 | - 'EXT_FIELD_custom_data' => ['order_type' => 'scheduled order'], |
|
| 25 | - 'day_scheduled_for_YYMMDD' => date('Y-m-d'), |
|
| 26 | - 'local_time_window_end' => 39000, |
|
| 27 | - 'local_time_window_end_2' => 46200, |
|
| 28 | - 'local_time_window_start' => 37800, |
|
| 29 | - 'local_time_window_start_2' => 45000, |
|
| 30 | - 'local_timezone_string' => 'America/New_York', |
|
| 31 | - 'order_icon' => 'emoji/emoji-bank', |
|
| 13 | + 'address_1' => '318 S 39th St, Louisville, KY 40212, USA', |
|
| 14 | + 'cached_lat' => 38.259326, |
|
| 15 | + 'cached_lng' => -85.814979, |
|
| 16 | + 'curbside_lat' => 38.259326, |
|
| 17 | + 'curbside_lng' => -85.814979, |
|
| 18 | + 'address_alias' => '318 S 39th St 40212', |
|
| 19 | + 'address_city' => 'Louisville', |
|
| 20 | + 'EXT_FIELD_first_name' => 'Lui', |
|
| 21 | + 'EXT_FIELD_last_name' => 'Carol', |
|
| 22 | + 'EXT_FIELD_email' => '[email protected]', |
|
| 23 | + 'EXT_FIELD_phone' => '897946541', |
|
| 24 | + 'EXT_FIELD_custom_data' => ['order_type' => 'scheduled order'], |
|
| 25 | + 'day_scheduled_for_YYMMDD' => date('Y-m-d'), |
|
| 26 | + 'local_time_window_end' => 39000, |
|
| 27 | + 'local_time_window_end_2' => 46200, |
|
| 28 | + 'local_time_window_start' => 37800, |
|
| 29 | + 'local_time_window_start_2' => 45000, |
|
| 30 | + 'local_timezone_string' => 'America/New_York', |
|
| 31 | + 'order_icon' => 'emoji/emoji-bank', |
|
| 32 | 32 | ]); |
| 33 | 33 | |
| 34 | 34 | $order = new Order(); |
@@ -14,13 +14,13 @@ |
||
| 14 | 14 | Route4Me::setApiKey(Constants::API_KEY); |
| 15 | 15 | |
| 16 | 16 | $orderParameters = Order::fromArray([ |
| 17 | - 'order_id' => 65936, |
|
| 18 | - 'custom_user_fields' => [ |
|
| 19 | - OrderCustomField::fromArray([ |
|
| 20 | - 'order_custom_field_id' => 93, |
|
| 21 | - 'order_custom_field_value' => 'true' |
|
| 22 | - ]) |
|
| 23 | - ] |
|
| 17 | + 'order_id' => 65936, |
|
| 18 | + 'custom_user_fields' => [ |
|
| 19 | + OrderCustomField::fromArray([ |
|
| 20 | + 'order_custom_field_id' => 93, |
|
| 21 | + 'order_custom_field_value' => 'true' |
|
| 22 | + ]) |
|
| 23 | + ] |
|
| 24 | 24 | ]); |
| 25 | 25 | |
| 26 | 26 | $order = new Order(); |
@@ -29,38 +29,38 @@ |
||
| 29 | 29 | $route->parameters = new \stdClass(); |
| 30 | 30 | |
| 31 | 31 | $route->addresses = [Address::fromArray([ |
| 32 | - 'alias' => 'new address alias', |
|
| 33 | - 'first_name' => 'Edi', |
|
| 34 | - 'last_name' => 'Jacobson', |
|
| 35 | - 'address' => '230 Arbor Way Milledgeville GA 31061', |
|
| 36 | - 'is_depot' => false, |
|
| 37 | - 'lat' => 33.129695892334, |
|
| 38 | - 'lng' => -83.24577331543, |
|
| 39 | - 'sequence_no' => 9, |
|
| 40 | - 'is_visited' => true, |
|
| 41 | - 'is_departed' => false, |
|
| 42 | - 'timestamp_last_visited' => 36000, |
|
| 43 | - 'timestamp_last_departed' => null, |
|
| 44 | - 'customer_po' => 'po_131324566', |
|
| 45 | - 'invoice_no' => 'in549874', |
|
| 46 | - 'reference_no' => '7988544', |
|
| 47 | - 'order_no' => 'on654754', |
|
| 48 | - 'order_id' => 4564, |
|
| 49 | - 'weight' => 45, |
|
| 50 | - 'cost' => 55.60, |
|
| 51 | - 'revenue' => 75.80, |
|
| 52 | - 'cube' => 3, |
|
| 53 | - 'pieces' => 30, |
|
| 54 | - 'email' => '[email protected]', |
|
| 55 | - 'phone' => '111-222-333', |
|
| 56 | - 'time_window_start' => 36600, |
|
| 57 | - 'time_window_end' => 37200, |
|
| 58 | - 'time' => 600, |
|
| 59 | - 'priority' => 1, |
|
| 60 | - 'curbside_lat' => 33.129695892334, |
|
| 61 | - 'curbside_lng' => -83.24577331543, |
|
| 62 | - 'time_window_start_2' => 39400, |
|
| 63 | - 'time_window_end_2' => 40000, |
|
| 32 | + 'alias' => 'new address alias', |
|
| 33 | + 'first_name' => 'Edi', |
|
| 34 | + 'last_name' => 'Jacobson', |
|
| 35 | + 'address' => '230 Arbor Way Milledgeville GA 31061', |
|
| 36 | + 'is_depot' => false, |
|
| 37 | + 'lat' => 33.129695892334, |
|
| 38 | + 'lng' => -83.24577331543, |
|
| 39 | + 'sequence_no' => 9, |
|
| 40 | + 'is_visited' => true, |
|
| 41 | + 'is_departed' => false, |
|
| 42 | + 'timestamp_last_visited' => 36000, |
|
| 43 | + 'timestamp_last_departed' => null, |
|
| 44 | + 'customer_po' => 'po_131324566', |
|
| 45 | + 'invoice_no' => 'in549874', |
|
| 46 | + 'reference_no' => '7988544', |
|
| 47 | + 'order_no' => 'on654754', |
|
| 48 | + 'order_id' => 4564, |
|
| 49 | + 'weight' => 45, |
|
| 50 | + 'cost' => 55.60, |
|
| 51 | + 'revenue' => 75.80, |
|
| 52 | + 'cube' => 3, |
|
| 53 | + 'pieces' => 30, |
|
| 54 | + 'email' => '[email protected]', |
|
| 55 | + 'phone' => '111-222-333', |
|
| 56 | + 'time_window_start' => 36600, |
|
| 57 | + 'time_window_end' => 37200, |
|
| 58 | + 'time' => 600, |
|
| 59 | + 'priority' => 1, |
|
| 60 | + 'curbside_lat' => 33.129695892334, |
|
| 61 | + 'curbside_lng' => -83.24577331543, |
|
| 62 | + 'time_window_start_2' => 39400, |
|
| 63 | + 'time_window_end_2' => 40000, |
|
| 64 | 64 | ])]; |
| 65 | 65 | |
| 66 | 66 | $route->httpheaders = 'Content-type: application/json'; |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | assert(!is_null($route_id), "Cannot retrieve a random route ID"); |
| 21 | 21 | |
| 22 | 22 | // Get a random address ID from selected route above |
| 23 | -$addressRand = (array) $route->GetRandomAddressFromRoute($route_id); |
|
| 23 | +$addressRand = (array)$route->GetRandomAddressFromRoute($route_id); |
|
| 24 | 24 | |
| 25 | 25 | $route->route_id = $route_id; |
| 26 | 26 | $route->route_destination_id = $addressRand['route_destination_id']; |
@@ -19,9 +19,9 @@ |
||
| 19 | 19 | |
| 20 | 20 | // Re-sequence all addresses |
| 21 | 21 | $params = [ |
| 22 | - 'route_id' => $route_id, |
|
| 23 | - 'disable_optimization' => 0, |
|
| 24 | - 'optimize' => 'Distance', |
|
| 22 | + 'route_id' => $route_id, |
|
| 23 | + 'disable_optimization' => 0, |
|
| 24 | + 'optimize' => 'Distance', |
|
| 25 | 25 | ]; |
| 26 | 26 | |
| 27 | 27 | $reSequence = $route->resequenceAllAddresses($params); |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | // Set the api key in the Route4Me class |
| 11 | 11 | Route4Me::setApiKey(Constants::API_KEY); |
| 12 | 12 | |
| 13 | -$now = new \DateTime(); |
|
| 13 | +$now = new \DateTime(); |
|
| 14 | 14 | |
| 15 | 15 | $schedCalendarParams = new ScheduleCalendarParameters(); |
| 16 | 16 | |