cambia al fecha del historial

This commit is contained in:
Felipe
2024-04-29 14:41:39 -05:00
parent 09050275c2
commit 82710bf517
4 changed files with 35 additions and 5 deletions
+15 -1
View File
@@ -225,6 +225,20 @@ class ShowServicios extends Component
{
$this->validate();
if ($this->cantidad_tarjetaPlan == 0) {
$this->alert('error', 'La cantidad debe ser mayor a 0', [
'position' => 'top'
]);
return;
}
if (auth()->user()->saldo->valor < $this->valor_tarjetaPlan * $this->cantidad_tarjetaPlan) {
$this->alert('error', 'Saldo insuficiente', [
'position' => 'top'
]);
return;
}
$cantidad_solicitada = (int) $this->cantidad_tarjetaPlan * (int) $this->pantallas_tarjetaPlan;
$total_valor = (int) $this->valor_tarjetaPlan * (int) $this->cantidad_tarjetaPlan;
$utilidad_total = (int) $this->utilidad * (int) $this->cantidad_tarjetaPlan;
@@ -352,7 +366,7 @@ class ShowServicios extends Component
$this->credenciales($historial);
} else {
$eliminar = Historial_cuenta::where('historial_id',$historial->id)->delete();
$eliminar = Historial_cuenta::where('historial_id', $historial->id)->delete();
$this->alert('warning', 'Error en el cobro, comuniquese con soporte!', [
'position' => 'top'
]);