Ir al contenido

Listar mano de obra de costo unitario

GET/api/unit-cost-workforce

Devuelve la lista paginada de ítems de mano de obra. Usa BaseControllerHelper::index y agrega el filtro unit_cost_id. Los parámetros comunes (search, status, trashed, ids, fechas, per_page…) se describen en Paginación y filtros.

per_pageinteger

Registros por página. Por defecto 20.

unit_cost_idinteger

Devuelve solo los ítems de ese costo unitario.

orderstring

Campo y sentido, por ejemplo name|ASC. Campos permitidos: id, name, created_at, updated_at, status. Por defecto id|DESC.

relationsstring

Relaciones a cargar. Ver Resumen.

No exige un permiso del módulo: UnitCostWorkforcePolicy::viewAny devuelve verdadero para cualquier usuario autenticado.

Ventana de terminal
curl -G \
"https://servererp.allendostmen.app/api/unit-cost-workforce" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json" \
--data-urlencode "unit_cost_id=12" \
--data-urlencode "relations=workforce"
Lista de ítems de mano de obra200
{
"current_page": 1,
"data": [
{
"id": 21,
"unit_cost_id": 12,
"workforce_id": 4,
"measurement_unit_id": 6,
"name": "OFICIAL ALBAÑIL",
"description": null,
"original_price": "18.50000000",
"original_coin_id": 1,
"original_coin_value": "1.00000000",
"index": 1,
"yield": null,
"cost": 18.5,
"cost_utility": 1.85,
"cost_utility_percentage": 10.0,
"price": 20.35,
"resource": 1.0,
"quantity": 0.6667,
"total_cost": 12.3333,
"total_cost_utility": 1.2333,
"total": 13.5667,
"status": "activo",
"previous_status": null,
"status_update_comment": null,
"status_update_date": null,
"status_update_user_id": null,
"create_user_id": 1,
"update_user_id": null,
"delete_user_id": null,
"restore_user_id": null,
"created_at": "2026-11-19T10:40:15.000000Z",
"updated_at": "2026-11-19T10:40:15.000000Z",
"deleted_at": null
}
],
"first_page_url": "https://servererp.allendostmen.app/api/unit-cost-workforce?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://servererp.allendostmen.app/api/unit-cost-workforce?page=1",
"next_page_url": null,
"path": "https://servererp.allendostmen.app/api/unit-cost-workforce",
"per_page": 20,
"prev_page_url": null,
"to": 1,
"total": 1
}
Sin permiso403
{
"message": "This action is unauthorized."
}