FIX: Pie cuotas vigentes

This commit is contained in:
2023-12-22 14:15:09 -03:00
parent 0829d338a9
commit 675b3843ea
7 changed files with 12 additions and 13 deletions

View File

@ -83,13 +83,14 @@ class Cuotas
});
return $view->render($response, 'ventas.pies.cuotas.add', compact('pie', 'venta', 'bancos'));
}
public function doAdd(ServerRequestInterface $request, ResponseInterface $response, Service\Venta\Pie $pieService, Repository\Venta $ventaRepository, int $pie_id): ResponseInterface
public function doAdd(ServerRequestInterface $request, ResponseInterface $response, Service\Venta\Pie $pieService,
Repository\Venta $ventaRepository, int $pie_id): ResponseInterface
{
$body = $request->getParsedBody();
$pie = $pieService->getById($pie_id);
$venta = $ventaRepository->fetchByPie($pie_id);
$total = $pie->cuotas - count($pie->cuotas());
$start = count($pie->cuotas());
$start = count($pie->cuotas(vigentes: true));
$total = $pie->cuotas;
for ($i = $start; $i < $total; $i ++) {
$data = [
'pie' => $pie->id,