fix: actualizar lógica de cancelación y agregar campos de placas y NIV en la vista de constancia

This commit is contained in:
Juan Felipe Zapata Moreno 2026-02-07 13:58:54 -06:00
parent d65711106f
commit 23ba2a03f9
3 changed files with 29 additions and 18 deletions

View File

@ -482,7 +482,7 @@ private function cancellationData(Tag $tag)
// Buscar log de vehículo (tag asignado y luego cancelado) // Buscar log de vehículo (tag asignado y luego cancelado)
$vehicleTagLog = $tag->vehicleTagLogs() $vehicleTagLog = $tag->vehicleTagLogs()
->where('action_type', 'cancelacion') ->where('action_type', ['cancelacion', 'sustitucion'])
->with(['cancellationReason', 'cancelledBy', 'vehicle']) ->with(['cancellationReason', 'cancelledBy', 'vehicle'])
->latest() ->latest()
->first(); ->first();

View File

@ -89,7 +89,7 @@ public function run(): void
); );
$devices = PermissionType::firstOrCreate([ //Dispositivos $devices = PermissionType::firstOrCreate([ //Dispositivos
'name' => 'Dispositivos' 'name' => 'Dispositivos Móviles'
]); ]);
[ [
@ -100,7 +100,7 @@ public function run(): void
] = $this->onCRUD('devices', $devices, 'api'); ] = $this->onCRUD('devices', $devices, 'api');
$inscriptions = PermissionType::firstOrCreate([ // Inscripciones de vehículos $inscriptions = PermissionType::firstOrCreate([ // Inscripciones de vehículos
'name' => 'Inscripciones' 'name' => 'Proceso de Sustitución por primera vez'
]); ]);
$inscriptionVehicle = $this->onPermission( $inscriptionVehicle = $this->onPermission(
@ -136,7 +136,7 @@ public function run(): void
); );
$updates = PermissionType::firstOrCreate([ $updates = PermissionType::firstOrCreate([
'name' => 'Actualizaciones' 'name' => 'Actualizar Registro'
]); ]);
$updateVehicleData = $this->onPermission( $updateVehicleData = $this->onPermission(
@ -154,7 +154,7 @@ public function run(): void
); );
$records = PermissionType::firstOrCreate([ $records = PermissionType::firstOrCreate([
'name' => 'Expedientes' 'name' => 'Generar Formatos'
]); ]);
$recordGeneratePdf = $this->onPermission( $recordGeneratePdf = $this->onPermission(
@ -178,15 +178,22 @@ public function run(): void
'api' 'api'
); );
$recordGeneratePdfImages = $this->onPermission( $recordGeneratePdfSubtitution = $this->onPermission(
'records.generate-pdf-images', 'records.generate-pdf-substitution',
'Generar PDF de imágenes', 'Generar PDF constancia sustitución',
$records,
'api'
);
$recordGeneratePdfDamaged = $this->onPermission(
'records.generate-pdf-damaged',
'Generar PDF constancia dañada',
$records, $records,
'api' 'api'
); );
$packages = PermissionType::firstOrCreate([ $packages = PermissionType::firstOrCreate([
'name' => 'Paquetes' 'name' => 'Cajas'
]); ]);
[ [
@ -197,7 +204,7 @@ public function run(): void
] = $this->onCRUD('packages', $packages, 'api'); ] = $this->onCRUD('packages', $packages, 'api');
$tags = PermissionType::firstOrCreate([ $tags = PermissionType::firstOrCreate([
'name' => 'Etiquetas' 'name' => 'Constancias de Inscripción'
]); ]);
[ [
@ -233,13 +240,10 @@ public function run(): void
$userEdit, $userEdit,
$userDestroy, $userDestroy,
$userSettings, $userSettings,
$userOnline,
$roleIndex, $roleIndex,
$roleCreate, $roleCreate,
$roleEdit, $roleEdit,
$roleDestroy, $roleDestroy,
$systemPulse,
$activityIndex,
$moduleIndex, //Módulos $moduleIndex, //Módulos
$moduleCreate, $moduleCreate,
@ -259,7 +263,8 @@ public function run(): void
$recordGeneratePdf, //Expedientes $recordGeneratePdf, //Expedientes
$recordGeneratePdfVerification, $recordGeneratePdfVerification,
$recordGeneratePdfConstancia, $recordGeneratePdfConstancia,
$recordGeneratePdfImages, $recordGeneratePdfSubtitution,
$recordGeneratePdfDamaged,
$packageIndex, //Paquetes $packageIndex, //Paquetes
$packageCreate, $packageCreate,
$packageEdit, $packageEdit,
@ -278,10 +283,7 @@ public function run(): void
'guard_name' => 'api' 'guard_name' => 'api'
])->syncPermissions( ])->syncPermissions(
$userIndex, $userIndex,
$userOnline,
$roleIndex, $roleIndex,
$systemPulse,
$activityIndex,
$deviceIndex, //Dispositivos $deviceIndex, //Dispositivos
$deviceCreate, $deviceCreate,
@ -296,7 +298,8 @@ public function run(): void
$recordGeneratePdf, //Expedientes $recordGeneratePdf, //Expedientes
$recordGeneratePdfVerification, $recordGeneratePdfVerification,
$recordGeneratePdfConstancia, $recordGeneratePdfConstancia,
$recordGeneratePdfImages, $recordGeneratePdfSubtitution,
$recordGeneratePdfDamaged,
$packageIndex, //Paquetes $packageIndex, //Paquetes
$packageCreate, $packageCreate,
$packageEdit, $packageEdit,

View File

@ -124,6 +124,14 @@
<td class="data-label">ID CONSTANCIA (CHIP):</td> <td class="data-label">ID CONSTANCIA (CHIP):</td>
<td class="data-value">{{ $cancellation['tag_number'] ?? 'N/A' }}</td> <td class="data-value">{{ $cancellation['tag_number'] ?? 'N/A' }}</td>
</tr> </tr>
<tr class="data-row">
<td class="data-label">PLACAS</td>
<td class="data-value">{{ $cancellation['placa'] ?? 'N/A' }}</td>
</tr>
<tr class="data-row">
<td class="data-label">NIV</td>
<td class="data-value">{{ $cancellation['niv'] ?? 'N/A' }}</td>
</tr>
<tr class="data-row"> <tr class="data-row">
<td class="data-label">MOTIVO:</td> <td class="data-label">MOTIVO:</td>
<td class="data-value">{{ mb_strtoupper($cancellation['motivo'] ?? '') }}</td> <td class="data-value">{{ mb_strtoupper($cancellation['motivo'] ?? '') }}</td>