up
This commit is contained in:
@@ -4,26 +4,51 @@ $op = \App\Models\OrdenProduccion::find($opId);
|
||||
$events = [];
|
||||
|
||||
if ($op) {
|
||||
$confecciones = $op->confeccions()->orderBy('fecha_recepcion')->get();
|
||||
$confecciones = $op->confeccions()->get();
|
||||
foreach ($confecciones as $c) {
|
||||
// Evento principal de la confección (creación/envío)
|
||||
$events[] = [
|
||||
'tipo' => 'Confección',
|
||||
'id' => $c->id,
|
||||
'fecha' => $c->fecha_recepcion ?? $c->created_at,
|
||||
'detalle' => "Enviado: {$c->cantidad_enviada} - Recibido: {$c->cantidad_recibida} - Defectos: {$c->prendas_defectuosas}",
|
||||
'fecha' => $c->fecha_envio ?? $c->created_at,
|
||||
'detalle' => "Enviado: {$c->cantidad_enviada} - Recibido total: {$c->cantidad_recibida} - Defectos: {$c->prendas_defectuosas}",
|
||||
'link' => route('filament.admin.resources.confeccions.edit', ['record' => $c->id]),
|
||||
];
|
||||
|
||||
// Eventos por cada recepción
|
||||
$recepciones = $c->recepciones()->orderBy('fecha_recepcion')->get();
|
||||
foreach ($recepciones as $r) {
|
||||
$events[] = [
|
||||
'tipo' => 'Recepción (Confección)',
|
||||
'id' => $r->id,
|
||||
'fecha' => $r->fecha_recepcion ?? $r->created_at,
|
||||
'detalle' => "Recibido: {$r->cantidad} - Notas: " . ($r->notas ?? '—'),
|
||||
'link' => route('filament.admin.resources.confeccions.edit', ['record' => $c->id]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$tints = $op->tintorerias()->orderBy('fecha_recepcion')->get();
|
||||
$tints = $op->tintorerias()->get();
|
||||
foreach ($tints as $t) {
|
||||
$events[] = [
|
||||
'tipo' => 'Tintorería',
|
||||
'id' => $t->id,
|
||||
'fecha' => $t->fecha_recepcion ?? $t->created_at,
|
||||
'detalle' => "Enviado: {$t->cantidad_enviada} - Recibido: {$t->cantidad_recibida} - Perdidas: {$t->perdidas}",
|
||||
'fecha' => $t->fecha_envio ?? $t->created_at,
|
||||
'detalle' => "Enviado: {$t->cantidad_enviada} - Recibido total: {$t->cantidad_recibida} - Perdidas: {$t->perdidas}",
|
||||
'link' => route('filament.admin.resources.tintorerias.edit', ['record' => $t->id]),
|
||||
];
|
||||
|
||||
// Eventos por cada recepción
|
||||
$recepciones = $t->recepciones()->orderBy('fecha_recepcion')->get();
|
||||
foreach ($recepciones as $r) {
|
||||
$events[] = [
|
||||
'tipo' => 'Recepción (Tintorería)',
|
||||
'id' => $r->id,
|
||||
'fecha' => $r->fecha_recepcion ?? $r->created_at,
|
||||
'detalle' => "Recibido: {$r->cantidad} - Notas: " . ($r->notas ?? '—'),
|
||||
'link' => route('filament.admin.resources.tintorerias.edit', ['record' => $t->id]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$acabados = $op->procesosAcabado()->orderBy('fecha_recepcion')->get();
|
||||
@@ -89,6 +114,11 @@ if ($op) {
|
||||
<p class="mb-4 text-base font-normal text-gray-500 dark:text-gray-300">{{ $e['detalle'] }}</p>
|
||||
|
||||
{{-- Acciones rápidas --}}
|
||||
@if(in_array($e['tipo'], ['Confección','Tintorería']))
|
||||
<div class="flex gap-2">
|
||||
<a href="{{ $e['link'] }}#recepciones" class="inline-flex items-center px-2 py-1 bg-blue-600 text-white rounded text-sm">Agregar recepción</a>
|
||||
</div>
|
||||
@endif
|
||||
@if($e['tipo'] === 'Traslado')
|
||||
@php $tr = \App\Models\TrasladoPrenda::find($e['id']); @endphp
|
||||
<div class="flex gap-2">
|
||||
|
||||
Reference in New Issue
Block a user