diff --git a/app/Http/Controllers/Repuve/RecordController.php b/app/Http/Controllers/Repuve/RecordController.php index 7730283..85dafe9 100644 --- a/app/Http/Controllers/Repuve/RecordController.php +++ b/app/Http/Controllers/Repuve/RecordController.php @@ -482,7 +482,7 @@ private function cancellationData(Tag $tag) // Buscar log de vehículo (tag asignado y luego cancelado) $vehicleTagLog = $tag->vehicleTagLogs() - ->where('action_type', 'cancelacion') + ->where('action_type', ['cancelacion', 'sustitucion']) ->with(['cancellationReason', 'cancelledBy', 'vehicle']) ->latest() ->first(); diff --git a/database/seeders/RoleSeeder.php b/database/seeders/RoleSeeder.php index 66cea52..366d4c7 100644 --- a/database/seeders/RoleSeeder.php +++ b/database/seeders/RoleSeeder.php @@ -89,7 +89,7 @@ public function run(): void ); $devices = PermissionType::firstOrCreate([ //Dispositivos - 'name' => 'Dispositivos' + 'name' => 'Dispositivos Móviles' ]); [ @@ -100,7 +100,7 @@ public function run(): void ] = $this->onCRUD('devices', $devices, 'api'); $inscriptions = PermissionType::firstOrCreate([ // Inscripciones de vehículos - 'name' => 'Inscripciones' + 'name' => 'Proceso de Sustitución por primera vez' ]); $inscriptionVehicle = $this->onPermission( @@ -136,7 +136,7 @@ public function run(): void ); $updates = PermissionType::firstOrCreate([ - 'name' => 'Actualizaciones' + 'name' => 'Actualizar Registro' ]); $updateVehicleData = $this->onPermission( @@ -154,7 +154,7 @@ public function run(): void ); $records = PermissionType::firstOrCreate([ - 'name' => 'Expedientes' + 'name' => 'Generar Formatos' ]); $recordGeneratePdf = $this->onPermission( @@ -178,15 +178,22 @@ public function run(): void 'api' ); - $recordGeneratePdfImages = $this->onPermission( - 'records.generate-pdf-images', - 'Generar PDF de imágenes', + $recordGeneratePdfSubtitution = $this->onPermission( + 'records.generate-pdf-substitution', + 'Generar PDF constancia sustitución', + $records, + 'api' + ); + + $recordGeneratePdfDamaged = $this->onPermission( + 'records.generate-pdf-damaged', + 'Generar PDF constancia dañada', $records, 'api' ); $packages = PermissionType::firstOrCreate([ - 'name' => 'Paquetes' + 'name' => 'Cajas' ]); [ @@ -197,7 +204,7 @@ public function run(): void ] = $this->onCRUD('packages', $packages, 'api'); $tags = PermissionType::firstOrCreate([ - 'name' => 'Etiquetas' + 'name' => 'Constancias de Inscripción' ]); [ @@ -233,13 +240,10 @@ public function run(): void $userEdit, $userDestroy, $userSettings, - $userOnline, $roleIndex, $roleCreate, $roleEdit, $roleDestroy, - $systemPulse, - $activityIndex, $moduleIndex, //Módulos $moduleCreate, @@ -259,7 +263,8 @@ public function run(): void $recordGeneratePdf, //Expedientes $recordGeneratePdfVerification, $recordGeneratePdfConstancia, - $recordGeneratePdfImages, + $recordGeneratePdfSubtitution, + $recordGeneratePdfDamaged, $packageIndex, //Paquetes $packageCreate, $packageEdit, @@ -278,10 +283,7 @@ public function run(): void 'guard_name' => 'api' ])->syncPermissions( $userIndex, - $userOnline, $roleIndex, - $systemPulse, - $activityIndex, $deviceIndex, //Dispositivos $deviceCreate, @@ -296,7 +298,8 @@ public function run(): void $recordGeneratePdf, //Expedientes $recordGeneratePdfVerification, $recordGeneratePdfConstancia, - $recordGeneratePdfImages, + $recordGeneratePdfSubtitution, + $recordGeneratePdfDamaged, $packageIndex, //Paquetes $packageCreate, $packageEdit, diff --git a/resources/views/pdfs/tag.blade.php b/resources/views/pdfs/tag.blade.php index cf6155e..1839458 100644 --- a/resources/views/pdfs/tag.blade.php +++ b/resources/views/pdfs/tag.blade.php @@ -124,6 +124,14 @@