up
This commit is contained in:
+2
-2
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user