From 8c631911652fc80207574af605a3e03d0e5bb6e2 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Thu, 29 Jan 2026 23:29:48 -0500 Subject: [PATCH] up --- app/Filament/Resources/OjalPresillaResource.php | 8 ++++---- app/Models/Ojal.php | 4 ++-- app/Models/Prensilla.php | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Filament/Resources/OjalPresillaResource.php b/app/Filament/Resources/OjalPresillaResource.php index 004307e..88ba9ad 100644 --- a/app/Filament/Resources/OjalPresillaResource.php +++ b/app/Filament/Resources/OjalPresillaResource.php @@ -43,8 +43,8 @@ class OjalPresillaResource extends Resource ->whereHas('referencia', function($q) use ($op) { $q->where('orden_produccion_id', $op->id); })->where('tipo', 'arreglo')->sum('cantidad'); - $cobros = \App\Models\Cobro::where('cobreable_type', \App\Models\Confeccion::class) - ->whereHas('cobreable', function($q) use ($op) { + $cobros = \App\Models\Cobro::where('referencia_type', \App\Models\Confeccion::class) + ->whereHas('referencia', function($q) use ($op) { $q->where('orden_produccion_id', $op->id); })->sum('cantidad'); $cantidadConfecciones = $cantidadRecibida - $arreglos - $cobros; @@ -76,8 +76,8 @@ class OjalPresillaResource extends Resource ->whereHas('referencia', function($q) use ($state) { $q->where('orden_produccion_id', $state); })->where('tipo', 'arreglo')->sum('cantidad'); - $cobros = \App\Models\Cobro::where('cobreable_type', \App\Models\Confeccion::class) - ->whereHas('cobreable', function($q) use ($state) { + $cobros = \App\Models\Cobro::where('referencia_type', \App\Models\Confeccion::class) + ->whereHas('referencia', function($q) use ($state) { $q->where('orden_produccion_id', $state); })->sum('cantidad'); $cantidadConfecciones = $cantidadRecibida - $arreglos - $cobros; diff --git a/app/Models/Ojal.php b/app/Models/Ojal.php index 489fda2..f2b83ca 100644 --- a/app/Models/Ojal.php +++ b/app/Models/Ojal.php @@ -46,8 +46,8 @@ class Ojal extends Model ->whereHas('referencia', function($q) use ($opId) { $q->where('orden_produccion_id', $opId); })->where('tipo', 'arreglo')->sum('cantidad'); - $totalCobros = \App\Models\Cobro::where('cobreable_type', \App\Models\Confeccion::class) - ->whereHas('cobreable', function($q) use ($opId) { + $totalCobros = \App\Models\Cobro::where('referencia_type', \App\Models\Confeccion::class) + ->whereHas('referencia', function($q) use ($opId) { $q->where('orden_produccion_id', $opId); })->sum('cantidad'); $totalProducido = $totalRecibido - $totalArreglos - $totalCobros; diff --git a/app/Models/Prensilla.php b/app/Models/Prensilla.php index 39c9cc9..2581e98 100644 --- a/app/Models/Prensilla.php +++ b/app/Models/Prensilla.php @@ -44,8 +44,8 @@ class Prensilla extends Model ->whereHas('referencia', function($q) use ($opId) { $q->where('orden_produccion_id', $opId); })->where('tipo', 'arreglo')->sum('cantidad'); - $totalCobros = \App\Models\Cobro::where('cobreable_type', \App\Models\Confeccion::class) - ->whereHas('cobreable', function($q) use ($opId) { + $totalCobros = \App\Models\Cobro::where('referencia_type', \App\Models\Confeccion::class) + ->whereHas('referencia', function($q) use ($opId) { $q->where('orden_produccion_id', $opId); })->sum('cantidad'); $totalProducido = $totalRecibido - $totalArreglos - $totalCobros;