0) { $form_billable = false; // the way back is the same visit - one trip charge } $form_claimed = $form_edit && $form_row['claim_expense_id'] !== null; $form_billed = $form_edit && $form_row['invoice_number'] !== null; $form_locked = $form_claimed || $form_billed; // The way back: from where it went to where it started, one way if ($form_return) { [$form_source, $form_destination] = [$form_destination, $form_source]; $form_location = 0; $form_round = false; $form_purpose = mb_substr('Back from ' . $form_row['trip_destination'] . ($form_purpose !== '' ? " - $form_purpose" : ''), 0, 200); } $form_can_manage = tripCanManage() && !$form_claimed; $form_drivers = tripDrivers($form_row ? $form_row['trip_user_id'] : 0); if (!$form_can_manage) { $form_drivers = array_intersect_key($form_drivers, array_flip(array_filter([intval($session_user_id), $form_edit ? intval($form_row['trip_user_id']) : 0]))); } $form_clients = []; $sql = mysqli_query($mysqli, "SELECT client_id, client_name, client_abbreviation FROM clients WHERE (client_archived_at IS NULL OR client_id = $form_client) " . clientScopeSql('clients.client_id') . " ORDER BY client_name ASC"); while ($row = mysqli_fetch_assoc($sql)) { $form_clients[] = $row; } $form_sites = tripClientSites(0, $form_location); $form_tickets = tripClientTickets(0, $form_ticket); $form_routes = tripKnownRoutes(); $form_places = tripStartPlaces(); $unit = tripUnit(); ?>
Paid back for on a mileage expense - the distance, driver and vehicle stay as they were paid Billed on - the distance and client stay as they were billed. Take it off the invoice to change them.
The way back from - a trip of its own, one way.
You log your own trips.
>
data-trip-round >
The trip is
data-trip-own >
Odometer readings
>
>
With both, the trip is what the odometer says.