catalogo
This commit is contained in:
@@ -153,10 +153,10 @@ class ShowConfiguracion extends Component
|
||||
$nombreCatalogo = Str::random(10) . '.pdf';
|
||||
$urlCatalogo = $this->catalogo->storeAs('storage', $nombreCatalogo);
|
||||
} else {
|
||||
$urlCatalogo = $configuracion->catalogoPDF;
|
||||
$urlCatalogo = $configuracion->catalogo;
|
||||
}
|
||||
|
||||
$configuracion->catalogoPDF = $urlCatalogo;
|
||||
$configuracion->catalogo = $urlCatalogo;
|
||||
$configuracion->save();
|
||||
|
||||
$this->alert('success', 'Catalogo actualizados correctamente!', [
|
||||
|
||||
@@ -209,7 +209,7 @@ class ShowPromociones extends Component
|
||||
{
|
||||
$this->validate();
|
||||
|
||||
if ($this->cantidad_comprarPromo == 0){
|
||||
if ($this->cantidad_comprarPromo == 0) {
|
||||
$this->alert('error', 'La cantidad debe ser mayor a 0', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
@@ -331,21 +331,23 @@ class ShowPromociones extends Component
|
||||
'confirmButtonText' => 'Sí, comprar.',
|
||||
]);
|
||||
}
|
||||
}else{
|
||||
$descuento = Saldo::where('usuario_id', Auth::user()->id)->first();
|
||||
$saldo_anterior = $descuento->valor;
|
||||
$nuevo_saldo = $saldo_anterior - ($this->precioAhora *$this->cantidad_comprarPromo);
|
||||
$cobro = $descuento->update(['valor' => $nuevo_saldo]);
|
||||
if ($cobro) {
|
||||
$historial->update(['estado' => 'activo']);
|
||||
$this->modalComprarPromo = false;
|
||||
$this->credenciales($historial);
|
||||
} else {
|
||||
$eliminar = Historial_cuenta::whereIn('id',$this->n)->delete();
|
||||
} else {
|
||||
$descuento = Saldo::where('usuario_id', Auth::user()->id)->first();
|
||||
$saldo_anterior = $descuento->valor;
|
||||
$nuevo_saldo = $saldo_anterior - ($this->precioAhora * $this->cantidad_comprarPromo);
|
||||
$cobro = $descuento->update(['valor' => $nuevo_saldo]);
|
||||
|
||||
if ($cobro) {
|
||||
$historial->update(['estado' => 'activo']);
|
||||
$this->modalComprarPromo = false;
|
||||
$this->credenciales($historial);
|
||||
} else {
|
||||
$eliminar = Historial_cuenta::whereIn('id', $this->n)->delete();
|
||||
|
||||
$this->alert('warning', 'Error en el cobro, comuniquese con soporte!', [
|
||||
'position' => 'top']);
|
||||
}
|
||||
$this->alert('warning', 'Error en el cobro, comuniquese con soporte!', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user