Informe escritura

This commit is contained in:
2024-01-18 16:41:16 -03:00
parent 01af47fba1
commit ca83472012
5 changed files with 107 additions and 4 deletions

View File

@ -8,9 +8,16 @@ use Incoviba\Service;
class Escrituras
{
public function show(ServerRequestInterface $request, ResponseInterface $response, View $view, Service\Venta $ventaService, int $venta_id): ResponseInterface
public function show(ServerRequestInterface $request, ResponseInterface $response, View $view,
Service\Venta $ventaService, int $venta_id): ResponseInterface
{
$venta = $ventaService->getById($venta_id);
return $view->render($response, 'ventas.escrituras.show', compact('venta'));
}
public function informe(ServerRequestInterface $request, ResponseInterface $response, View $view,
Service\Venta $ventaService, int $venta_id): ResponseInterface
{
$venta = $ventaService->getById($venta_id);
return $view->render($response, 'ventas.escrituras.informe', compact('venta'));
}
}

View File

@ -21,12 +21,16 @@ class Format
{
return number_format($number, $decimal_places, ',', '.');
}
public function percent(float|string $number, int $decimal_places = 2): string
{
return "{$this->number($number, $decimal_places)}%";
}
public function pesos(string $valor): string
{
return '$ ' . $this->number($valor);
return "$ {$this->number($valor)}";
}
public function ufs(string $valor): string
{
return $this->number($valor, 2) . ' UF';
return "{$this->number($valor, 2)} UF";
}
}