fix
This commit is contained in:
@@ -265,7 +265,7 @@ class ShowClientes extends Component
|
||||
|
||||
public function renovar($id)
|
||||
{
|
||||
$historiale = Historiale::with('tarifa','cuentas')->find($id);
|
||||
$historiale = Historiale::with('tarifa', 'cuentas')->find($id);
|
||||
|
||||
if (!$historiale) {
|
||||
return;
|
||||
@@ -274,11 +274,11 @@ class ShowClientes extends Component
|
||||
$tarifa = $historiale->tarifa;
|
||||
$diasTarifa = $tarifa->dias;
|
||||
$valorTarifa = $tarifa->valor;
|
||||
|
||||
|
||||
$cuenta = $historiale->cuentas->first();
|
||||
$vencimientoCuenta = Carbon::parse($cuenta->vencimiento);
|
||||
$nuevaFechaVencimiento = $vencimientoCuenta->addDays($diasTarifa);
|
||||
|
||||
|
||||
$newFechaInicio = Carbon::parse($historiale->fecha_inicio)->addDays($diasTarifa);
|
||||
$newFechaFinal = Carbon::parse($historiale->fecha_final)->addDays($diasTarifa);
|
||||
|
||||
@@ -288,17 +288,14 @@ class ShowClientes extends Component
|
||||
$nuevoHistorial->save();
|
||||
|
||||
$pantallas = $cuenta->servicio->completa;
|
||||
//dd($pantallas);
|
||||
for ($i=1; $i <= $pantallas ; $i++) {
|
||||
//dd($pantallas);
|
||||
for ($i = 1; $i <= $pantallas; $i++) {
|
||||
$historial_cuenta = new Historial_cuenta;
|
||||
$historial_cuenta->historial_id = $nuevoHistorial->id;
|
||||
$historial_cuenta->cuenta_id = $cuenta->id;
|
||||
$historial_cuenta->perfil = $i;
|
||||
$historial_cuenta->save();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$cuenta->vencimiento = $nuevaFechaVencimiento;
|
||||
$cuenta->save();
|
||||
|
||||
Reference in New Issue
Block a user