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