This commit is contained in:
Lizandro Guarnizo
2026-01-29 23:28:33 -05:00
parent 07c54f6bca
commit 1bb9fa0548
3 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -42,8 +42,8 @@ class Ojal extends Model
$opId = $p->orden_produccion_id;
$totalRecibido = \App\Models\Confeccion::where('orden_produccion_id', $opId)
->sum(\DB::raw('COALESCE(cantidad_recibida, 0)'));
$totalArreglos = \App\Models\Ajuste::where('ajustable_type', \App\Models\Confeccion::class)
->whereHas('ajustable', function($q) use ($opId) {
$totalArreglos = \App\Models\Ajuste::where('referencia_type', \App\Models\Confeccion::class)
->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)
+2 -2
View File
@@ -40,8 +40,8 @@ class Prensilla extends Model
$opId = $p->orden_produccion_id;
$totalRecibido = \App\Models\Confeccion::where('orden_produccion_id', $opId)
->sum(\DB::raw('COALESCE(cantidad_recibida, 0)'));
$totalArreglos = \App\Models\Ajuste::where('ajustable_type', \App\Models\Confeccion::class)
->whereHas('ajustable', function($q) use ($opId) {
$totalArreglos = \App\Models\Ajuste::where('referencia_type', \App\Models\Confeccion::class)
->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)