fix: actualizar tipos de acción a 'sustitución' en InscriptionController
This commit is contained in:
parent
2411ff1eab
commit
ea4e3fc607
@ -182,7 +182,20 @@ public function constanciasSustituidas(Request $request)
|
|||||||
$sheet->getStyle('B9')->getFont()->setBold(false)->setSize(14);
|
$sheet->getStyle('B9')->getFont()->setBold(false)->setSize(14);
|
||||||
|
|
||||||
Carbon::setLocale('es');
|
Carbon::setLocale('es');
|
||||||
|
// Formato completo para manejar diferentes meses/años
|
||||||
|
if ($fechaInicio->format('m/Y') === $fechaFin->format('m/Y')) {
|
||||||
|
// Mismo mes y año
|
||||||
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
||||||
|
$anioTexto = $fechaFin->format('Y');
|
||||||
|
} elseif ($fechaInicio->format('Y') === $fechaFin->format('Y')) {
|
||||||
|
// Diferente mes, mismo año
|
||||||
|
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' de ' . $fechaInicio->translatedFormat('F') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
||||||
|
$anioTexto = $fechaFin->format('Y');
|
||||||
|
} else {
|
||||||
|
// Diferente año
|
||||||
|
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' de ' . $fechaInicio->translatedFormat('F') . ' ' . $fechaInicio->format('Y') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
||||||
|
$anioTexto = $fechaFin->format('Y');
|
||||||
|
}
|
||||||
|
|
||||||
// Fechas
|
// Fechas
|
||||||
$sheet->mergeCells('C9:F9');
|
$sheet->mergeCells('C9:F9');
|
||||||
@ -197,7 +210,7 @@ public function constanciasSustituidas(Request $request)
|
|||||||
|
|
||||||
// Año
|
// Año
|
||||||
$sheet->mergeCells('H9:I9');
|
$sheet->mergeCells('H9:I9');
|
||||||
$sheet->setCellValue('H9', $fechaFin->format('Y'));
|
$sheet->setCellValue('H9', $anioTexto);
|
||||||
$sheet->getStyle('H9:I9')->applyFromArray($styleBox);
|
$sheet->getStyle('H9:I9')->applyFromArray($styleBox);
|
||||||
$sheet->getStyle('H9')->getFont()->setSize(14);
|
$sheet->getStyle('H9')->getFont()->setSize(14);
|
||||||
|
|
||||||
@ -448,7 +461,20 @@ public function constanciasCanceladas(Request $request)
|
|||||||
$sheet->getStyle('A9')->getFont()->setBold(false)->setSize(14);
|
$sheet->getStyle('A9')->getFont()->setBold(false)->setSize(14);
|
||||||
|
|
||||||
Carbon::setLocale('es');
|
Carbon::setLocale('es');
|
||||||
|
// Formato completo para manejar diferentes meses/años
|
||||||
|
if ($fechaInicio->format('m/Y') === $fechaFin->format('m/Y')) {
|
||||||
|
// Mismo mes y año
|
||||||
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
||||||
|
$anioTexto = $fechaFin->format('Y');
|
||||||
|
} elseif ($fechaInicio->format('Y') === $fechaFin->format('Y')) {
|
||||||
|
// Diferente mes, mismo año
|
||||||
|
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' de ' . $fechaInicio->translatedFormat('F') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
||||||
|
$anioTexto = $fechaFin->format('Y');
|
||||||
|
} else {
|
||||||
|
// Diferente año
|
||||||
|
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' de ' . $fechaInicio->translatedFormat('F') . ' ' . $fechaInicio->format('Y') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
||||||
|
$anioTexto = $fechaFin->format('Y');
|
||||||
|
}
|
||||||
|
|
||||||
// Fechas (Movemos a D-G)
|
// Fechas (Movemos a D-G)
|
||||||
$sheet->mergeCells('D9:G9');
|
$sheet->mergeCells('D9:G9');
|
||||||
@ -463,7 +489,7 @@ public function constanciasCanceladas(Request $request)
|
|||||||
|
|
||||||
// Año (Movemos a I-J)
|
// Año (Movemos a I-J)
|
||||||
$sheet->mergeCells('I9:J9');
|
$sheet->mergeCells('I9:J9');
|
||||||
$sheet->setCellValue('I9', $fechaFin->format('Y'));
|
$sheet->setCellValue('I9', $anioTexto);
|
||||||
$sheet->getStyle('I9:J9')->applyFromArray($styleBox);
|
$sheet->getStyle('I9:J9')->applyFromArray($styleBox);
|
||||||
$sheet->getStyle('I9')->getFont()->setSize(14);
|
$sheet->getStyle('I9')->getFont()->setSize(14);
|
||||||
|
|
||||||
@ -750,7 +776,20 @@ public function excelGeneral(Request $request)
|
|||||||
$sheet->getStyle('A9')->applyFromArray($styleLabel);
|
$sheet->getStyle('A9')->applyFromArray($styleLabel);
|
||||||
|
|
||||||
Carbon::setLocale('es');
|
Carbon::setLocale('es');
|
||||||
|
// Formato completo para manejar diferentes meses/años
|
||||||
|
if ($fechaInicio->format('m/Y') === $fechaFin->format('m/Y')) {
|
||||||
|
// Mismo mes y año
|
||||||
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
||||||
|
$anioTexto = $fechaFin->format('Y');
|
||||||
|
} elseif ($fechaInicio->format('Y') === $fechaFin->format('Y')) {
|
||||||
|
// Diferente mes, mismo año
|
||||||
|
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' de ' . $fechaInicio->translatedFormat('F') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
||||||
|
$anioTexto = $fechaFin->format('Y');
|
||||||
|
} else {
|
||||||
|
// Diferente año
|
||||||
|
$periodoTexto = 'del ' . $fechaInicio->format('d') . ' de ' . $fechaInicio->translatedFormat('F') . ' ' . $fechaInicio->format('Y') . ' al ' . $fechaFin->format('d') . ' de ' . $fechaFin->translatedFormat('F');
|
||||||
|
$anioTexto = $fechaFin->format('Y');
|
||||||
|
}
|
||||||
|
|
||||||
// Fechas (D-G)
|
// Fechas (D-G)
|
||||||
$sheet->mergeCells('D9:G9');
|
$sheet->mergeCells('D9:G9');
|
||||||
@ -765,7 +804,7 @@ public function excelGeneral(Request $request)
|
|||||||
|
|
||||||
// Año (I-J)
|
// Año (I-J)
|
||||||
$sheet->mergeCells('I9:J9');
|
$sheet->mergeCells('I9:J9');
|
||||||
$sheet->setCellValue('I9', $fechaFin->format('Y'));
|
$sheet->setCellValue('I9', $anioTexto);
|
||||||
$sheet->getStyle('I9:J9')->applyFromArray($styleBox);
|
$sheet->getStyle('I9:J9')->applyFromArray($styleBox);
|
||||||
$sheet->getStyle('I9')->getFont()->setSize(14);
|
$sheet->getStyle('I9')->getFont()->setSize(14);
|
||||||
|
|
||||||
@ -1169,6 +1208,7 @@ public function exportSearchRecords(Request $request)
|
|||||||
$sheet->getStyle("A{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
$sheet->getStyle("A{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||||
$sheet->getStyle("D{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
$sheet->getStyle("D{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||||
$sheet->getStyle("I{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
$sheet->getStyle("I{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||||
|
$sheet->getStyle("J{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||||
$sheet->getStyle("K{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
$sheet->getStyle("K{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||||
$sheet->getStyle("L{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
$sheet->getStyle("L{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||||
$sheet->getStyle("M{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
$sheet->getStyle("M{$row}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||||
|
|||||||
@ -167,7 +167,7 @@ public function vehicleInscription(VehicleStoreRequest $request)
|
|||||||
VehicleTagLog::create([
|
VehicleTagLog::create([
|
||||||
'vehicle_id' => $vehicle->id,
|
'vehicle_id' => $vehicle->id,
|
||||||
'tag_id' => $tag->id,
|
'tag_id' => $tag->id,
|
||||||
'action_type' => 'inscripcion',
|
'action_type' => 'sustitucion',
|
||||||
'performed_by' => Auth::id(),
|
'performed_by' => Auth::id(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ public function searchRecord(Request $request)
|
|||||||
'created_at' => $record->created_at,
|
'created_at' => $record->created_at,
|
||||||
|
|
||||||
// TIPO DE TRÁMITE
|
// TIPO DE TRÁMITE
|
||||||
'action_type' => $latestLog?->action_type ?? 'inscripcion',
|
'action_type' => $latestLog?->action_type ?? 'sustitución',
|
||||||
'action_date' => $latestLog?->created_at ?? $record->created_at,
|
'action_date' => $latestLog?->created_at ?? $record->created_at,
|
||||||
|
|
||||||
// HISTORIAL DE TAGS
|
// HISTORIAL DE TAGS
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user