FIX: Escritura no grababa valor

This commit is contained in:
Juan Pablo Vial
2025-02-24 16:53:12 -03:00
parent b8af053c43
commit ab3c8da4f6
4 changed files with 35 additions and 11 deletions

View File

@ -175,6 +175,18 @@ class Pago
return false;
}
}
public function updateEstado(Model\Venta\Pago $pago, array $data): Model\Venta\Pago
{
if ($pago->currentEstado->tipoEstadoPago->id === $data['estado']) {
return $pago;
}
$data['pago'] = $pago->id;
$estado = $this->estadoPagoRepository->create($data);
$this->estadoPagoRepository->save($estado);
return $this->process($this->pagoRepository->fetchById($pago->id));
}
protected function process($pago): Model\Venta\Pago
{