Update ShowServicios.php

This commit is contained in:
Lizandro Guarnizo
2024-10-11 15:40:15 -05:00
parent 6b85c9a88a
commit 7454087a9c
+11 -5
View File
@@ -163,7 +163,12 @@ class ShowServicios extends Component
->whereDate('vencimiento', '<=', $this->fecha_final_2) ->whereDate('vencimiento', '<=', $this->fecha_final_2)
->where('servicio_id', $servicio_tarifa->id) ->where('servicio_id', $servicio_tarifa->id)
->where('estado', 'pendiente') ->where('estado', 'pendiente')
->doesntHave('perfil') ->where(function ($query) {
$query->doesntHave('perfil')
->orWhereHas('perfil', function ($query) {
$query->whereNull('historial_id');
});
})
->count(); ->count();
} else { } else {
@@ -208,7 +213,8 @@ class ShowServicios extends Component
$this->tarjetaPlan = true; $this->tarjetaPlan = true;
} }
public function cerrartarjetaPlan(){ public function cerrartarjetaPlan()
{
$this->cantidad_tarjetaPlan = 1; $this->cantidad_tarjetaPlan = 1;
$this->tarjetaPlan = false; $this->tarjetaPlan = false;
$this->tarifa_id = ''; $this->tarifa_id = '';
@@ -393,7 +399,7 @@ class ShowServicios extends Component
$eliminar = Historial_cuenta::where('historial_id', $historial->id)->delete(); $eliminar = Historial_cuenta::where('historial_id', $historial->id)->delete();
$logsGeneral = new Log_general(); $logsGeneral = new Log_general();
$logsGeneral->user_id = Auth::user()->id; $logsGeneral->user_id = Auth::user()->id;
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Tuvo error de "No hay cuentas disponibles" Comprando el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor.' Se desligaron todas las cuentas.'; $logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Tuvo error de "No hay cuentas disponibles" Comprando el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor . ' Se desligaron todas las cuentas.';
$logsGeneral->save(); $logsGeneral->save();
$this->alert('warning', 'No hay cuentas disponibles!', [ $this->alert('warning', 'No hay cuentas disponibles!', [
'position' => 'top' 'position' => 'top'
@@ -413,7 +419,7 @@ class ShowServicios extends Component
$logsGeneral = new Log_general(); $logsGeneral = new Log_general();
$logsGeneral->user_id = Auth::user()->id; $logsGeneral->user_id = Auth::user()->id;
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha comprado el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor .', Saldo anterior: $'.$saldo_anterior.', Nuevo saldo disponible: $'.$nuevo_saldo; $logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha comprado el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor . ', Saldo anterior: $' . $saldo_anterior . ', Nuevo saldo disponible: $' . $nuevo_saldo;
$logsGeneral->save(); $logsGeneral->save();
@@ -436,7 +442,7 @@ class ShowServicios extends Component
$eliminar = Historial_cuenta::where('historial_id', $historial->id)->delete(); $eliminar = Historial_cuenta::where('historial_id', $historial->id)->delete();
$logsGeneral = new Log_general(); $logsGeneral = new Log_general();
$logsGeneral->user_id = Auth::user()->id; $logsGeneral->user_id = Auth::user()->id;
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Tuvo error de "No hay cuentas disponibles" Comprando el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor.' No se desconto el saldo, ni se asignaron cuentas.'; $logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Tuvo error de "No hay cuentas disponibles" Comprando el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor . ' No se desconto el saldo, ni se asignaron cuentas.';
$logsGeneral->save(); $logsGeneral->save();
$this->alert('warning', 'No hay cuentas disponibles!', [ $this->alert('warning', 'No hay cuentas disponibles!', [
'position' => 'top' 'position' => 'top'