Compare commits
No commits in common. "cb16c0b91c4a5b95c1281738e8e2550ebb060475" and "0be583a088d5b23d3ee7f3ff82a3ad4e85c7c9b2" have entirely different histories.
cb16c0b91c
...
0be583a088
@ -17,17 +17,11 @@ public function handle()
|
|||||||
{
|
{
|
||||||
$filename = 'backup-' . date('Y-m-d_H-i-s') . '.sql';
|
$filename = 'backup-' . date('Y-m-d_H-i-s') . '.sql';
|
||||||
$containerPath = '/tmp/' . $filename;
|
$containerPath = '/tmp/' . $filename;
|
||||||
$finalPath = storage_path('app/backup/' . $filename);
|
$hostPath = storage_path('app/backup/' . $filename);
|
||||||
|
|
||||||
// Asegurar que existe el directorio de backup
|
// Crear backup dentro del contenedor MySQL
|
||||||
$backupDir = storage_path('app/backup');
|
|
||||||
if (!file_exists($backupDir)) {
|
|
||||||
mkdir($backupDir, 0755, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Crear backup ejecutando mysqldump dentro del contenedor MySQL
|
|
||||||
$dumpCommand = sprintf(
|
$dumpCommand = sprintf(
|
||||||
'docker exec repuve-backend-v1-mysql-1 sh -c "mysqldump --no-tablespaces -u%s -p%s %s > %s" 2>&1',
|
'docker exec repuve-backend-v1-mysql-1 sh -c "mysqldump --no-tablespaces -u%s -p%s %s > %s"',
|
||||||
env('DB_USERNAME'),
|
env('DB_USERNAME'),
|
||||||
env('DB_PASSWORD'),
|
env('DB_PASSWORD'),
|
||||||
env('DB_DATABASE'),
|
env('DB_DATABASE'),
|
||||||
@ -35,61 +29,17 @@ public function handle()
|
|||||||
);
|
);
|
||||||
exec($dumpCommand, $output, $returnCode);
|
exec($dumpCommand, $output, $returnCode);
|
||||||
|
|
||||||
if ($returnCode !== 0) {
|
// Copiar del contenedor al host
|
||||||
$this->error('Error al crear el backup en MySQL');
|
|
||||||
$this->error('Código: ' . $returnCode);
|
|
||||||
if (!empty($output)) {
|
|
||||||
$this->error('Salida: ' . implode("\n", $output));
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copiar del contenedor MySQL a /tmp del host
|
|
||||||
$tempHostPath = '/tmp/' . $filename;
|
|
||||||
$copyCommand = sprintf(
|
$copyCommand = sprintf(
|
||||||
'docker cp repuve-backend-v1-mysql-1:%s %s 2>&1',
|
'docker cp repuve-backend-v1-mysql-1:%s %s',
|
||||||
$containerPath,
|
$containerPath,
|
||||||
$tempHostPath
|
$hostPath
|
||||||
);
|
);
|
||||||
exec($copyCommand, $copyOutput, $copyReturnCode);
|
exec($copyCommand);
|
||||||
|
|
||||||
if ($copyReturnCode !== 0) {
|
// Limpiar archivo temporal del contenedor
|
||||||
$this->error('Error al copiar el backup');
|
exec("docker exec repuve-backend-v1-mysql-1 rm " . $containerPath);
|
||||||
if (!empty($copyOutput)) {
|
|
||||||
$this->error('Salida: ' . implode("\n", $copyOutput));
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mover de /tmp a storage y establecer permisos
|
$this->info('Backup creado: ' . $filename);
|
||||||
if (file_exists($tempHostPath)) {
|
|
||||||
rename($tempHostPath, $finalPath);
|
|
||||||
chmod($finalPath, 0644);
|
|
||||||
|
|
||||||
// Limpiar archivo temporal del contenedor MySQL
|
|
||||||
exec('docker exec repuve-backend-v1-mysql-1 rm ' . $containerPath);
|
|
||||||
|
|
||||||
$size = filesize($finalPath);
|
|
||||||
$this->info('Backup creado exitosamente: ' . $filename);
|
|
||||||
$this->info('Tamaño: ' . $this->formatBytes($size));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
$this->error('Error: el archivo temporal no se creó');
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Formatear bytes a tamaño legible
|
|
||||||
*/
|
|
||||||
private function formatBytes($bytes, $precision = 2)
|
|
||||||
{
|
|
||||||
$units = ['B', 'KB', 'MB', 'GB'];
|
|
||||||
$bytes = max($bytes, 0);
|
|
||||||
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
|
|
||||||
$pow = min($pow, count($units) - 1);
|
|
||||||
$bytes /= pow(1024, $pow);
|
|
||||||
return round($bytes, $precision) . ' ' . $units[$pow];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,7 +130,7 @@ public function constanciasSustituidas(Request $request)
|
|||||||
// Fila 3: PERIODO A INFORMAR (empieza en B, fecha completa con año)
|
// Fila 3: PERIODO A INFORMAR (empieza en B, fecha completa con año)
|
||||||
$sheet->setCellValue('B' . $row, 'PERIODO A INFORMAR:');
|
$sheet->setCellValue('B' . $row, 'PERIODO A INFORMAR:');
|
||||||
$sheet->mergeCells('C' . $row . ':K' . $row);
|
$sheet->mergeCells('C' . $row . ':K' . $row);
|
||||||
$sheet->setCellValue('C' . $row, $fechaInicio->format('d/m/Y') . ' al ' . $fechaFin->format('d/m/Y'));
|
$sheet->setCellValue('C' . $row, 'del ' . $fechaInicio->format('d') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaInicio->translatedFormat('F') . ' de ' . $fechaInicio->year);
|
||||||
$sheet->getStyle('B' . $row)->getFont()->setBold(true)->setSize(11);
|
$sheet->getStyle('B' . $row)->getFont()->setBold(true)->setSize(11);
|
||||||
$sheet->getStyle('B' . $row . ':K' . $row)->applyFromArray($borderStyle);
|
$sheet->getStyle('B' . $row . ':K' . $row)->applyFromArray($borderStyle);
|
||||||
$sheet->getStyle('B' . $row . ':K' . $row)->getAlignment()->setWrapText(true);
|
$sheet->getStyle('B' . $row . ':K' . $row)->getAlignment()->setWrapText(true);
|
||||||
@ -341,7 +341,7 @@ public function constanciasCanceladas(Request $request)
|
|||||||
// PERIODO
|
// PERIODO
|
||||||
$sheet->setCellValue('B' . $row, 'PERIODO A INFORMAR:');
|
$sheet->setCellValue('B' . $row, 'PERIODO A INFORMAR:');
|
||||||
$sheet->mergeCells('C' . $row . ':K' . $row);
|
$sheet->mergeCells('C' . $row . ':K' . $row);
|
||||||
$sheet->setCellValue('C' . $row, $fechaInicio->format('d/m/Y') . ' al ' . $fechaFin->format('d/m/Y'));
|
$sheet->setCellValue('C' . $row, 'del ' . $fechaInicio->format('d') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaInicio->translatedFormat('F') . ' de ' . $fechaInicio->year);
|
||||||
$sheet->getStyle('B' . $row)->getFont()->setBold(true)->setSize(11);
|
$sheet->getStyle('B' . $row)->getFont()->setBold(true)->setSize(11);
|
||||||
$sheet->getStyle('B' . $row . ':K' . $row)->applyFromArray($borderStyle);
|
$sheet->getStyle('B' . $row . ':K' . $row)->applyFromArray($borderStyle);
|
||||||
$sheet->getStyle('B' . $row . ':K' . $row)->getAlignment()->setWrapText(true);
|
$sheet->getStyle('B' . $row . ':K' . $row)->getAlignment()->setWrapText(true);
|
||||||
@ -434,300 +434,6 @@ public function constanciasCanceladas(Request $request)
|
|||||||
return response()->download($filePath, $fileName)->deleteFileAfterSend(true);
|
return response()->download($filePath, $fileName)->deleteFileAfterSend(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function excelGeneral(Request $request)
|
|
||||||
{
|
|
||||||
$request->validate([
|
|
||||||
'fecha_inicio' => 'required|date',
|
|
||||||
'fecha_fin' => 'required|date|after_or_equal:fecha_inicio',
|
|
||||||
'module_id' => 'nullable|exists:modules,id',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$fechaInicio = Carbon::parse($request->fecha_inicio)->startOfDay();
|
|
||||||
$fechaFin = Carbon::parse($request->fecha_fin)->endOfDay();
|
|
||||||
$moduleId = $request->module_id;
|
|
||||||
|
|
||||||
// Obtener información del módulo
|
|
||||||
$module = $moduleId ? Module::find($moduleId) : null;
|
|
||||||
|
|
||||||
// Obtener logs de cancelación en el rango de fechas
|
|
||||||
$logs = VehicleTagLog::with([
|
|
||||||
'vehicle.records.module',
|
|
||||||
'tag',
|
|
||||||
'cancellationReason'
|
|
||||||
])
|
|
||||||
->whereIn('action_type', ['inscripcion', 'sustitucion', 'cancelacion'])
|
|
||||||
->when($moduleId, function ($query) use ($moduleId) {
|
|
||||||
$query->whereHas('vehicle.records', function ($q) use ($moduleId) {
|
|
||||||
$q->where('module_id', $moduleId);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
->where(function ($query) use ($fechaInicio, $fechaFin) {
|
|
||||||
$query->where(function ($q) use ($fechaInicio, $fechaFin) {
|
|
||||||
$q->whereIn('action_type', ['inscripcion', 'sustitucion'])
|
|
||||||
->whereBetween('created_at', [$fechaInicio, $fechaFin]);
|
|
||||||
})
|
|
||||||
->orWhere(function ($q) use ($fechaInicio, $fechaFin) {
|
|
||||||
$q->where('action_type', 'cancelacion')
|
|
||||||
->whereBetween('cancellation_at', [$fechaInicio, $fechaFin]);
|
|
||||||
});
|
|
||||||
})->get();
|
|
||||||
|
|
||||||
$logsT = TagCancellationLog::with([
|
|
||||||
'tag.module',
|
|
||||||
'tag.vehicle',
|
|
||||||
'cancellationReason'
|
|
||||||
])->when($moduleId, function ($query) use ($moduleId) {
|
|
||||||
$query->whereHas('tag', function ($q) use ($moduleId) {
|
|
||||||
$q->where('module_id', $moduleId);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
->whereBetween('cancellation_at', [$fechaInicio, $fechaFin])
|
|
||||||
->get();
|
|
||||||
|
|
||||||
if ($logs->isEmpty() && $logsT->isEmpty()) {
|
|
||||||
return ApiResponse::NOT_FOUND->response([
|
|
||||||
'message' => 'No se encontraron constancias canceladas en el periodo especificado',
|
|
||||||
'fecha_inicio' => $fechaInicio->format('Y-m-d'),
|
|
||||||
'fecha_fin' => $fechaFin->format('Y-m-d'),
|
|
||||||
'module_id' => $moduleId,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$allLogs = collect();
|
|
||||||
|
|
||||||
foreach ($logs as $log) {
|
|
||||||
$log->sort_date = $log->action_type == 'cancelacion' ? $log->cancellation_at : $log->created_at;
|
|
||||||
$allLogs->push($log);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($logsT as $log) {
|
|
||||||
$log->sort_date = $log->cancellation_at;
|
|
||||||
$allLogs->push($log);
|
|
||||||
}
|
|
||||||
|
|
||||||
$allLogs = $allLogs->sortBy('sort_date');
|
|
||||||
|
|
||||||
$data = $this->prepareExcelDataGeneral($allLogs);
|
|
||||||
|
|
||||||
$fileName = 'Reporte_General_' . $fechaInicio->format('Ymd') . '_' . $fechaFin->format('Ymd') . '.xlsx';
|
|
||||||
$filePath = storage_path('app/temp/' . $fileName);
|
|
||||||
|
|
||||||
if (!file_exists(storage_path('app/temp'))) {
|
|
||||||
mkdir(storage_path('app/temp'), 0755, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
$spreadsheet = new Spreadsheet();
|
|
||||||
$sheet = $spreadsheet->getActiveSheet();
|
|
||||||
|
|
||||||
$logoPath = storage_path('app/images/logo-seguridad.png');
|
|
||||||
if (file_exists($logoPath)) {
|
|
||||||
$drawing = new Drawing();
|
|
||||||
$drawing->setName('Logo Seguridad');
|
|
||||||
$drawing->setPath($logoPath);
|
|
||||||
$drawing->setHeight(100);
|
|
||||||
$drawing->setCoordinates('B1');
|
|
||||||
$drawing->setWorksheet($sheet);
|
|
||||||
$sheet->getRowDimension(1)->setRowHeight(45);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Definir estilo de bordes
|
|
||||||
$borderStyle = [
|
|
||||||
'borders' => [
|
|
||||||
'allBorders' => [
|
|
||||||
'borderStyle' => PhpSpreadsheetBorder::BORDER_THIN,
|
|
||||||
'color' => ['rgb' => '000000'],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
$row = 5;
|
|
||||||
|
|
||||||
// ENTIDAD
|
|
||||||
$sheet->setCellValue('B' . $row, 'ENTIDAD:');
|
|
||||||
$sheet->mergeCells('C' . $row . ':M' . $row);
|
|
||||||
$sheet->setCellValue('C' . $row, 'TABASCO');
|
|
||||||
$sheet->getStyle('B' . $row)->getFont()->setBold(true)->setSize(11);
|
|
||||||
$sheet->getStyle('B' . $row . ':M' . $row)->applyFromArray($borderStyle);
|
|
||||||
$sheet->getStyle('B' . $row . ':M' . $row)->getAlignment()->setWrapText(true);
|
|
||||||
$row++;
|
|
||||||
|
|
||||||
// MÓDULO
|
|
||||||
$sheet->setCellValue('B' . $row, 'MÓDULO:');
|
|
||||||
$sheet->mergeCells('C' . $row . ':M' . $row);
|
|
||||||
$sheet->setCellValue('C' . $row, $module?->name ?? 'TODOS LOS MÓDULOS');
|
|
||||||
$sheet->getStyle('B' . $row)->getFont()->setBold(true)->setSize(11);
|
|
||||||
$sheet->getStyle('B' . $row . ':M' . $row)->applyFromArray($borderStyle);
|
|
||||||
$sheet->getStyle('B' . $row . ':M' . $row)->getAlignment()->setWrapText(true);
|
|
||||||
$row++;
|
|
||||||
|
|
||||||
// PERIODO
|
|
||||||
$sheet->setCellValue('B' . $row, 'PERIODO A INFORMAR:');
|
|
||||||
$sheet->mergeCells('C' . $row . ':M' . $row);
|
|
||||||
$sheet->setCellValue('C' . $row, $fechaInicio->format('d/m/Y') . ' al ' . $fechaFin->format('d/m/Y'));
|
|
||||||
$sheet->getStyle('B' . $row)->getFont()->setBold(true)->setSize(11);
|
|
||||||
$sheet->getStyle('B' . $row . ':M' . $row)->applyFromArray($borderStyle);
|
|
||||||
$sheet->getStyle('B' . $row . ':M' . $row)->getAlignment()->setWrapText(true);
|
|
||||||
$row++;
|
|
||||||
|
|
||||||
$row++;
|
|
||||||
|
|
||||||
// Título
|
|
||||||
$sheet->mergeCells('B' . $row . ':M' . $row);
|
|
||||||
$sheet->setCellValue('B' . $row, 'REPORTE GENERAL DE CONSTANCIAS');
|
|
||||||
$sheet->getStyle('B' . $row)->getFont()->setBold(true)->setSize(12);
|
|
||||||
$sheet->getStyle('B' . $row)->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER)->setWrapText(true);
|
|
||||||
$sheet->getStyle('B' . $row . ':M' . $row)->applyFromArray($borderStyle);
|
|
||||||
$row++;
|
|
||||||
|
|
||||||
$row++;
|
|
||||||
|
|
||||||
// Encabezados (12 columnas: A-L)
|
|
||||||
$headers = [
|
|
||||||
'No.',
|
|
||||||
'MÓDULO',
|
|
||||||
'TIPO DE ACCIÓN',
|
|
||||||
'NIV DEL VEHÍCULO',
|
|
||||||
'NRPV/NCI',
|
|
||||||
'MARCA DEL VEHÍCULO',
|
|
||||||
'PLACA',
|
|
||||||
'AÑO MODELO',
|
|
||||||
'FOLIO',
|
|
||||||
'ID DE LA CONSTANCIA (CHIP)',
|
|
||||||
'FECHA',
|
|
||||||
'MOTIVO/RAZÓN',
|
|
||||||
'OBSERVACIONES',
|
|
||||||
];
|
|
||||||
|
|
||||||
$col = 'A';
|
|
||||||
foreach ($headers as $header) {
|
|
||||||
$sheet->setCellValue($col . $row, $header);
|
|
||||||
$col++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sheet->getStyle('A' . $row . ':M' . $row)->applyFromArray([
|
|
||||||
'font' => ['bold' => true, 'color' => ['rgb' => 'FFFFFF'], 'size' => 10],
|
|
||||||
'fill' => ['fillType' => Fill::FILL_SOLID, 'startColor' => ['rgb' => '8B0000']],
|
|
||||||
'alignment' => ['horizontal' => Alignment::HORIZONTAL_CENTER, 'wrapText' => true],
|
|
||||||
'borders' => [
|
|
||||||
'allBorders' => [
|
|
||||||
'borderStyle' => PhpSpreadsheetBorder::BORDER_THIN,
|
|
||||||
'color' => ['rgb' => '000000'],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
$row++;
|
|
||||||
|
|
||||||
// Agregar datos
|
|
||||||
foreach ($data as $rowData) {
|
|
||||||
$col = 'A';
|
|
||||||
foreach ($rowData as $value) {
|
|
||||||
$sheet->setCellValue($col . $row, $value);
|
|
||||||
$col++;
|
|
||||||
}
|
|
||||||
$sheet->getStyle('A' . $row . ':M' . $row)->applyFromArray([
|
|
||||||
'font' => ['size' => 10],
|
|
||||||
'alignment' => ['wrapText' => true],
|
|
||||||
'borders' => [
|
|
||||||
'allBorders' => [
|
|
||||||
'borderStyle' => PhpSpreadsheetBorder::BORDER_THIN,
|
|
||||||
'color' => ['rgb' => '000000'],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
$row++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ajustar anchos de columnas
|
|
||||||
$sheet->getColumnDimension('A')->setWidth(6); // No.
|
|
||||||
$sheet->getColumnDimension('B')->setWidth(25); // MÓDULO
|
|
||||||
$sheet->getColumnDimension('C')->setWidth(18); // TIPO DE ACCIÓN
|
|
||||||
$sheet->getColumnDimension('D')->setWidth(25); // NIV
|
|
||||||
$sheet->getColumnDimension('E')->setWidth(15); // NRPV/NCI
|
|
||||||
$sheet->getColumnDimension('F')->setWidth(20); // MARCA
|
|
||||||
$sheet->getColumnDimension('G')->setWidth(12); // PLACA
|
|
||||||
$sheet->getColumnDimension('H')->setWidth(12); // AÑO MODELO
|
|
||||||
$sheet->getColumnDimension('I')->setWidth(25); // FOLIO
|
|
||||||
$sheet->getColumnDimension('J')->setWidth(30); // CHIP
|
|
||||||
$sheet->getColumnDimension('K')->setWidth(20); // FECHA
|
|
||||||
$sheet->getColumnDimension('L')->setWidth(35); // MOTIVO/RAZÓN
|
|
||||||
$sheet->getColumnDimension('M')->setWidth(50); // OBSERVACIONES
|
|
||||||
|
|
||||||
// Guardar archivo
|
|
||||||
$writer = new Xlsx($spreadsheet);
|
|
||||||
$writer->save($filePath);
|
|
||||||
|
|
||||||
// Descargar archivo y eliminarlo después
|
|
||||||
return response()->download($filePath, $fileName)->deleteFileAfterSend(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function prepareExcelDataGeneral($logs)
|
|
||||||
{
|
|
||||||
$data = [];
|
|
||||||
$no = 1;
|
|
||||||
|
|
||||||
foreach($logs as $log){
|
|
||||||
$isVehicleTagLog = isset($log->action_type);
|
|
||||||
|
|
||||||
if($isVehicleTagLog){
|
|
||||||
$vehicle = $log->vehicle;
|
|
||||||
$tag = $log->tag;
|
|
||||||
$actionType = strtoupper($log->action_type);
|
|
||||||
|
|
||||||
$moduleName = $vehicle->records->first()?->module?->name ?? 'SIN MODULO ASIGNADO';
|
|
||||||
|
|
||||||
$fecha = $log->action_type == 'cancelacion'
|
|
||||||
? $log->cancellation_at?->format('d/m/Y')
|
|
||||||
: $log->created_at->format('d/m/Y');
|
|
||||||
|
|
||||||
$motivo = match($log->action_type){
|
|
||||||
'inscripcion' => 'INSCRIPCIÓN',
|
|
||||||
'sustitucion' => 'SUSTITUCIÓN DE CONSTANCIA',
|
|
||||||
'cancelacion' => $log->cancellationReason?->name ?? 'N/A',
|
|
||||||
default => 'N/A',
|
|
||||||
};
|
|
||||||
|
|
||||||
$data[] = [
|
|
||||||
$no,
|
|
||||||
$moduleName,
|
|
||||||
$actionType,
|
|
||||||
$vehicle->niv ?? 'N/A',
|
|
||||||
$vehicle->nrpv ?? 'N/A',
|
|
||||||
strtoupper($vehicle->marca ?? 'N/A'),
|
|
||||||
strtoupper($vehicle->placa ?? 'N/A'),
|
|
||||||
$vehicle->modelo ?? 'N/A',
|
|
||||||
$tag->folio ?? 'N/A',
|
|
||||||
$tag->tag_number ?? 'N/A',
|
|
||||||
$fecha,
|
|
||||||
$motivo,
|
|
||||||
$log->cancellation_observations ?? 'N/A',
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$vehicle = $log->tag->vehicle;
|
|
||||||
$tag = $log->tag;
|
|
||||||
$moduleName = $tag->module?->name ?? 'SIN MODULO ASIGNADO';
|
|
||||||
|
|
||||||
$data[] = [
|
|
||||||
$no,
|
|
||||||
$moduleName,
|
|
||||||
'CANCELACION',
|
|
||||||
$vehicle->niv ?? 'N/A',
|
|
||||||
$vehicle->nrpv ?? 'N/A',
|
|
||||||
strtoupper($vehicle->marca ?? 'N/A'),
|
|
||||||
strtoupper($vehicle->placa ?? 'N/A'),
|
|
||||||
$vehicle->modelo ?? 'N/A',
|
|
||||||
$tag->folio ?? 'N/A',
|
|
||||||
$tag->tag_number ?? 'N/A',
|
|
||||||
$log->cancellation_at ? $log->cancellation_at->format('d/m/Y') : 'N/A',
|
|
||||||
$log->cancellationReason?->name ?? 'CANCELACIÓN',
|
|
||||||
$log->cancellation_observations ?? 'N/A',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
$no++;
|
|
||||||
}
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function prepareExcelData($logs)
|
private function prepareExcelData($logs)
|
||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|||||||
@ -14,7 +14,6 @@ RUN apk add --no-cache \
|
|||||||
nano \
|
nano \
|
||||||
openssl \
|
openssl \
|
||||||
bash \
|
bash \
|
||||||
mysql-client \
|
|
||||||
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip
|
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip
|
||||||
|
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|||||||
@ -46,7 +46,7 @@
|
|||||||
Route::get('RecordErrors', [RecordController::class, 'errors']);
|
Route::get('RecordErrors', [RecordController::class, 'errors']);
|
||||||
|
|
||||||
//Rutas de Actualización
|
//Rutas de Actualización
|
||||||
Route::post('sustitucion', [UpdateController::class, 'tagSubstitution']);
|
Route::get('consulta', [UpdateController::class, 'vehicleData']);
|
||||||
Route::post('actualizar', [UpdateController::class, 'vehicleUpdate']);
|
Route::post('actualizar', [UpdateController::class, 'vehicleUpdate']);
|
||||||
Route::post('actualizar-expediente/{id}', [UpdateController::class, 'updateData']);
|
Route::post('actualizar-expediente/{id}', [UpdateController::class, 'updateData']);
|
||||||
Route::post('/repuve/resend/{id}', [UpdateController::class, 'resendToRepuve']);
|
Route::post('/repuve/resend/{id}', [UpdateController::class, 'resendToRepuve']);
|
||||||
@ -57,7 +57,6 @@
|
|||||||
Route::post('tags/cancelar', [CancellationController::class, 'cancelarTagNoAsignado']);
|
Route::post('tags/cancelar', [CancellationController::class, 'cancelarTagNoAsignado']);
|
||||||
Route::get('excel/constancias-sustituidas', [ExcelController::class, 'constanciasSustituidas']);
|
Route::get('excel/constancias-sustituidas', [ExcelController::class, 'constanciasSustituidas']);
|
||||||
Route::get('excel/constancias-canceladas', [ExcelController::class, 'constanciasCanceladas']);
|
Route::get('excel/constancias-canceladas', [ExcelController::class, 'constanciasCanceladas']);
|
||||||
Route::get('excel/constancias-general', [ExcelController::class, 'excelGeneral']);
|
|
||||||
|
|
||||||
//Rutas de Modulos
|
//Rutas de Modulos
|
||||||
Route::patch('module/{id}/toggle-status', [ModuleController::class, 'toggleStatus']);
|
Route::patch('module/{id}/toggle-status', [ModuleController::class, 'toggleStatus']);
|
||||||
@ -88,3 +87,5 @@
|
|||||||
|
|
||||||
/** Rutas públicas */
|
/** Rutas públicas */
|
||||||
// Tus rutas públicas
|
// Tus rutas públicas
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user