Mejoras en Facturacion

This commit is contained in:
2023-11-30 18:40:15 -03:00
parent f2efb41977
commit 04478afa2f
14 changed files with 310 additions and 24 deletions

View File

@ -83,4 +83,19 @@ class Unidades
}
return $this->withJson($response, $output);
}
public function prorrateo(ServerRequestInterface $request, ResponseInterface $response, Repository\Venta\Unidad $unidadRepository, int $unidad_id): ResponseInterface
{
$body = $request->getParsedBody();
$output = [
'unidad_id' => $unidad_id,
'input' => $body,
'edited' => false
];
try {
$unidad = $unidadRepository->fetchById($unidad_id);
$unidadRepository->editProrrateo($unidad, $body);
$output['edited'] = true;
} catch (EmptyResult) {}
return $this->withJson($response, $output);
}
}