Mostrar correctamente venta desistida

This commit is contained in:
2023-12-21 19:15:11 -03:00
parent 80a6bf1535
commit d7d17a3051
5 changed files with 23 additions and 5 deletions

View File

@ -14,13 +14,13 @@ class Venta
protected Repository\Venta\TipoEstadoVenta $tipoEstadoVentaRepository,
protected Repository\Venta\Credito $creditoRepository,
protected Repository\Venta\Escritura $escrituraRepository,
protected Repository\Venta\Pago $pagoRepository,
protected Venta\Propietario $propietarioService,
protected Venta\Propiedad $propiedadService,
protected Venta\Pie $pieService,
protected Venta\Subsidio $subsidioService,
protected Venta\Credito $creditoService,
protected Venta\BonoPie $bonoPieService,
protected Venta\Pago $pagoService,
protected Money $moneyService
) {}
@ -384,8 +384,7 @@ class Venta
{
try {
if ($this->validarData($data, ['fecha', 'devolucion'])) {
$pago = $this->pagoRepository->create(['fecha' => $data['fecha'], 'valor' => $data['devolucion']]);
$pago = $this->pagoRepository->save($pago);
$pago = $this->pagoService->add(['fecha' => $data['fecha'], 'valor' => $data['devolucion']]);
$this->ventaRepository->edit($venta, ['resciliacion' => $pago->id]);
}
$tipoEstado = $this->tipoEstadoVentaRepository->fetchByDescripcion('desistida');