Cleanup logs, fixed add Venta, fixed search
This commit is contained in:
@ -100,17 +100,22 @@ class Venta
|
||||
$venta_data[$field] = $forma_pago->{$name}->id;
|
||||
}
|
||||
}
|
||||
$venta = $this->ventaRepository->create($venta_data);
|
||||
$venta = $this->ventaRepository->save($venta);
|
||||
$tipoEstado = $this->tipoEstadoVentaRepository->fetchByDescripcion('vigente');
|
||||
$estado = $this->estadoVentaRepository->create([
|
||||
'venta' => $venta->id,
|
||||
'estado' => $tipoEstado->id,
|
||||
'fecha' => $venta->fecha->format('Y-m-d')
|
||||
]);
|
||||
$this->estadoVentaRepository->save($estado);
|
||||
try {
|
||||
return $this->ventaRepository->fetchByPropietarioAndPropiedad($propietario->rut, $propiedad->id);
|
||||
} catch (Implement\Exception\EmptyResult) {
|
||||
$venta = $this->ventaRepository->create($venta_data);
|
||||
$venta = $this->ventaRepository->save($venta);
|
||||
|
||||
return $venta;
|
||||
$tipoEstado = $this->tipoEstadoVentaRepository->fetchByDescripcion('vigente');
|
||||
$estado = $this->estadoVentaRepository->create([
|
||||
'venta' => $venta->id,
|
||||
'estado' => $tipoEstado->id,
|
||||
'fecha' => $venta->fecha->format('Y-m-d')
|
||||
]);
|
||||
$this->estadoVentaRepository->save($estado);
|
||||
|
||||
return $venta;
|
||||
}
|
||||
}
|
||||
protected function addPropietario(array $data): Model\Venta\Propietario
|
||||
{
|
||||
|
Reference in New Issue
Block a user