Update validacionCompra.php
This commit is contained in:
@@ -154,6 +154,8 @@ class validacionCompra extends Command
|
|||||||
$historial_actual->estado = 'cancelado';
|
$historial_actual->estado = 'cancelado';
|
||||||
$historial_actual->save();
|
$historial_actual->save();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$cuentahistorial = Historial_cuenta::where('historial_id', $historial_actual->id)->get();
|
$cuentahistorial = Historial_cuenta::where('historial_id', $historial_actual->id)->get();
|
||||||
// Eliminar cuentas asociadas
|
// Eliminar cuentas asociadas
|
||||||
if (!$cuentahistorial->isEmpty()) {
|
if (!$cuentahistorial->isEmpty()) {
|
||||||
@@ -162,6 +164,11 @@ class validacionCompra extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log_general::where('historial_id', $actual)
|
||||||
|
->where('tipo', 'compra')
|
||||||
|
->update(['tipo' => 'revertida']);
|
||||||
|
|
||||||
|
|
||||||
DB::commit(); // Confirmar la transacción
|
DB::commit(); // Confirmar la transacción
|
||||||
|
|
||||||
return true; //
|
return true; //
|
||||||
|
|||||||
Reference in New Issue
Block a user