15 dias de margen

This commit is contained in:
Felipe
2024-02-28 16:16:06 -05:00
parent 69d5004b69
commit 377bfabdfb
+5 -12
View File
@@ -137,27 +137,21 @@ class ShowServicios extends Component
->pluck('id')) ->pluck('id'))
->count(); ->count();
//$prueba1 = $this->cuentas_creadas->count() * $this->servicio_t->pantallas ;
//$prueba2 = $this->cuentas_tomadas ;
$this->servicio_id = $this->servicio_t->id; $this->servicio_id = $this->servicio_t->id;
$this->tarifa_id = $id; $this->tarifa_id = $id;
$this->servicio_tarjetaPlan = $this->servicio_t->nombre; $this->servicio_tarjetaPlan = $this->servicio_t->nombre;
$this->tiempo_tarjetaPlan = $this->servicio_t->por_tiempo; $this->tiempo_tarjetaPlan = $this->servicio_t->por_tiempo;
$this->pantallas_tarjetaPlan = $this->tarifas->pantallas; $this->pantallas_tarjetaPlan = $this->tarifas->pantallas;
$this->dias_tarjetaPlan = $this->tarifas->dias; $this->dias_tarjetaPlan = $this->tarifas->dias;
$this->fecha_final_1 = $today = Carbon::now(); $this->fecha_final_1 = Carbon::now()->addDays($this->tarifas->dias - 15);
$this->fecha_final_2 = $today = Carbon::now(); $this->fecha_final_2 = Carbon::now()->addDays($this->tarifas->dias + 15);
$this->mensaje = $this->servicio_t->mensaje; $this->mensaje = $this->servicio_t->mensaje;
//Servicio por cuenta completa //Servicio por cuenta completa
$this->cuentas_completas = Cuentas::whereDate('inicio', '>=', $this->fecha) $this->cuentas_completas = Cuentas::whereDate('inicio', '>=', $this->fecha)
->whereDate('vencimiento', '>=', $this->fecha_final_1->addDays($this->tarifas->dias - 20)) ->whereDate('vencimiento', '>=', $this->fecha_final_1)
->whereDate('vencimiento', '<=', $this->fecha_final_2->addDays($this->tarifas->dias + 20)) ->whereDate('vencimiento', '<=', $this->fecha_final_2)
->where('servicio_id', $this->tarifas->servicio->id) ->where('servicio_id', $this->tarifas->servicio->id)
->where('estado', 'pendiente') ->where('estado', 'pendiente')
->get(); ->get();
@@ -300,7 +294,6 @@ class ShowServicios extends Component
$cantidad_necesaria = null; $cantidad_necesaria = null;
} }
for ($h = 0; $h < (int) $cantidad_necesaria; $h++) { for ($h = 0; $h < (int) $cantidad_necesaria; $h++) {
if (!empty($cuenta)) { if (!empty($cuenta)) {