Technical Routes Overview
Manage technical service routes for field technicians, including visit scheduling, client information, and route status tracking.List Technical Routes
Retrieve technical routes accessible to the authenticated user.Authentication & Permissions
Valid session or Sanctum token
rutas-tecnicas.verpermission
Authorization Behavior
Regular Users:- See only routes where they are the vendor (
CodVendedor) - See routes of shared technical users
- Users with
rutas-tecnicas.ver-todospermission - Roles:
super-admin,AsistenteVentas,Gerencia,supervisor - Can see all routes in the system
Query Parameters
Filter routes starting from this date
Filter routes ending on or before this date
Response
Returns Inertia view with:Array of route objects grouped by NumeroRuta
Applied filters
User permissions for routes
Route Object Structure
Unique route identifier
Route start date (formatted: YYYY-MM-DD Day)
Route end date (formatted: YYYY-MM-DD Day)
Vendor/sales representative code
Whether route is closed
Total number of visits in route
Array of visit objects
Get Route Details
Retrieve detailed information about a specific route.Path Parameters
Route number
Response
Returns Inertia view with:Route details with all visits
Visit Object Structure
Visit ID
Route number
Client NIT/document
Client name
Complete client address
Scheduled visit date (YYYY-MM-DD Day)
Contact person name
Contact phone number
Vendor code
Technician code
Visit observations
Create Technical Route
Create a new technical route with visits.Permissions
Requires:rutas-tecnicas.crearpermission
Request Body
Route start date
Route end date (must be >= fecha_inicio)
Array of visit objects
Visit Object
Client NIT (max 50 chars)
Client name (max 200 chars)
Complete address (max 500 chars)
Visit date (must be within route date range)
Technician code (max 50 chars)
Contact name (max 200 chars)
Contact phone (max 50 chars)
Visit observations (max 500 chars)
Example Request
Response
Redirects to create page with success message:Route Merging Behavior
If an open route exists with overlapping dates:- User is redirected to edit the existing route
- Routes are shared among advisors and their technical users
Update Technical Route
Update an existing technical route.Permissions
Requires:rutas-tecnicas.editarpermission- OR ownership of the route
Path Parameters
Route number to update
Request Body
Same structure as create, plus:Existing visit ID (omit for new visits)
Ownership Rules
- Users can only modify their own visits
- Supervisors can modify all visits
- Deleting visits: only owner or supervisor
Example Request
Response
Redirects to route show page with success message.Client Search API
Search for clients to add to routes.Query Parameters
Search term (min 2 characters)
Response
Array of matching clients (max 10)
Client ID
Client NIT
Client name
Advisor code
Advisor name
Client zone
Example Request
Get Client Addresses
Retrieve all addresses for a specific client.Path Parameters
Client NIT/ID
Response
Array of client addresses
Address Object
Address ID (NIT-Sede format)
Client NIT
Branch/location code
Complete address with complement
City
Department/state
Contact person name
Get Recommended Contact Data
Get contact suggestions based on previous visits to this address.Query Parameters
Address to search for
Response
Array of suggested contacts (max 10)
Contact name
Contact phone
Date of previous visit
Formatted label for display
Implementation Notes
Source:app/Http/Controllers/RutaTecnicaController.php
Route Auto-Close
Routes are automatically closed on Friday after 2:00 PM viaRutaTecnica::cerrarRutasVencidas().
Route Number Generation
Route numbers are generated usingRutaTecnica::generarNumeroRuta().
Data Sources
Client data is retrieved from SQL Server database connectionsqlsrv:
- Clients:
V_360_tec_clientesview - Addresses:
V_360_tec_clientes_sedesview
Date Formatting
Dates are formatted with Spanish day names:- Format:
YYYY-MM-DD Day - Example:
2026-03-10 Lun
RutaTecnicaController.php:26-44