Eliminar desistimiento y loading en editar desistimiento
This commit is contained in:
@ -384,7 +384,7 @@ class Venta
|
||||
{
|
||||
try {
|
||||
if ($this->validarData($data, ['fecha', 'devolucion'])) {
|
||||
$pago = $this->pagoService->add(['fecha' => $data['fecha'], 'valor' => $data['devolucion']]);
|
||||
$pago = $this->pagoService->add(['fecha' => $data['fecha'], 'valor' => str_replace(['.', ','], ['', '.'], $data['devolucion'])]);
|
||||
$this->ventaRepository->edit($venta, ['resciliacion' => $pago->id]);
|
||||
}
|
||||
$tipoEstado = $this->tipoEstadoVentaRepository->fetchByDescripcion('desistida');
|
||||
@ -394,4 +394,18 @@ class Venta
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function insistir(Model\Venta $venta): bool
|
||||
{
|
||||
try {
|
||||
$pago = $venta->resciliacion();
|
||||
$this->pagoService->delete($pago);
|
||||
$estado = $venta->currentEstado();
|
||||
error_log(var_export($estado,true));
|
||||
$this->estadoVentaRepository->remove($estado);
|
||||
$this->ventaRepository->edit($venta, ['resciliacion' => null]);
|
||||
return true;
|
||||
} catch (Implement\Exception\EmptyResult) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user