planes +30 dias

This commit is contained in:
Felipe
2024-04-30 10:00:57 -05:00
parent 4cb5f33cce
commit 2043acc81c
2 changed files with 25 additions and 39 deletions
+5 -5
View File
@@ -204,8 +204,6 @@ class ShowPlanes extends Component
}
public function openRenovar()
{
$this->renovar = true;
$id = $this->id_cuentaVer;
$renovarCuenta = Cuentas::findOrFail($id);
@@ -217,14 +215,16 @@ class ShowPlanes extends Component
$this->fecha_final_renovar_old = $renovarCuenta->vencimiento;
$this->fecha_final_renovar = $renovarCuenta->vencimiento;
$this->estado = $renovarCuenta->estado;
$this->renovar = true;
}
public function calcularFechas()
{
$this->fecha_inicial_renovar = Carbon::now()->format('Y-m-d');
$this->fecha_final_renovar = Carbon::now()->addDays(30)->format('Y-m-d');
$this->fecha_final_renovar = Carbon::parse($this->fecha_final_renovar)->addDays(30)->format('Y-m-d');
}
public function getListeners()
{
return [
@@ -277,7 +277,7 @@ class ShowPlanes extends Component
{
$id = $this->id_cuentaVer;
$historial = Historial_cuenta::where('cuenta_id', $id)->first();
$historial = Historial_cuenta::where('cuenta_id', $id)->get();
Historiale::where('id', $historial->historiale_id)->update([
'fecha_final' => date('Y-m-d', strtotime(strval($this->fecha_final_renovar))),