<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class AuthController extends AbstractController
{
/**
* @Route("", name="home", methods={"GET"})
* @return Response
*/
public function home(): Response
{
return $this->redirectToRoute('panel');
}
/**
* @Route("/panel", name="panel", methods={"GET"})
* @return Response
*/
public function panel(): Response
{
return $this->render('panel.html.twig');
}
/**
* @Route("/login", name="panel_login", methods={"GET","POST"})
* @param AuthenticationUtils $authenticationUtils
* @return Response
*/
public function login(AuthenticationUtils $authenticationUtils): Response
{
// get the login error if there is one
$error = $authenticationUtils->getLastAuthenticationError();
// last username entered by the user
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render('security/login.html.twig', ['last_username' => $lastUsername, 'error' => $error]);
}
/**
* @Route("/logout", name="panel_logout", methods={"GET"})
*/
public function logoutAction() { }
}
/*
SELECT AR.id AS ID, FAC.fecha_operacion as FECHA, RB.descripcion AS RUBRO, GR.nom_grupo AS GRUPO, CAT.nombre AS CATEGORIA, MP.nombre as MARCA, AR.codigo as CODIGO, AR.descripcion as DESCRIPCION, AR.precio AS PRECIO_1, AR.precio2 AS PRECIO_2, TA.talle AS TALLE, SUM(FL.importe) AS TOTAL FROM `articulo` AS AR LEFT JOIN factulinea as FL ON FL.articulo_id = AR.id LEFT JOIN rubro as RB ON RB.id = AR.rubro_id LEFT JOIN grupo as GR ON GR.id = AR.grupo_id LEFT JOIN categoria AS CAT ON CAT.id = AR.categoria_id LEFT JOIN marca_producto as MP ON MP.id = AR.marca_id LEFT JOIN talle AS TA ON TA.id = AR.talle_id LEFT JOIN facturas as FAC ON FAC.codfactura = FL.codfactura WHERE FL.importe IS NOT NULL GROUP BY AR.id, FAC.fecha_operacion ORDER BY `FECHA` DESC, `RUBRO` ASC, `GRUPO` ASC, `CATEGORIA` ASC, `MARCA` ASC, `DESCRIPCION` ASC
SELECT AR.id AS ID, RB.descripcion AS RUBRO, GR.nom_grupo AS GRUPO, CAT.nombre AS CATEGORIA, MP.nombre as MARCA, AR.codigo as CODIGO, AR.descripcion as DESCRIPCION, AR.precio AS PRECIO_1, AR.precio2 AS PRECIO_2, TA.talle AS TALLE, SUM(FL.importe) AS TOTAL FROM `articulo` AS AR LEFT JOIN factulinea as FL ON FL.articulo_id = AR.id LEFT JOIN rubro as RB ON RB.id = AR.rubro_id LEFT JOIN grupo as GR ON GR.id = AR.grupo_id LEFT JOIN categoria AS CAT ON CAT.id = AR.categoria_id LEFT JOIN marca_producto as MP ON MP.id = AR.marca_id LEFT JOIN talle AS TA ON TA.id = AR.talle_id LEFT JOIN facturas as FAC ON FAC.codfactura = FL.codfactura WHERE FL.importe IS NOT NULL AND FAC.fecha_operacion >= '2021-06-01' AND FAC.fecha_operacion <= '2021-06-30' GROUP BY AR.id ORDER BY `RUBRO` ASC, `GRUPO` ASC, `CATEGORIA` ASC, `MARCA` ASC, `DESCRIPCION` ASC
SELECT AR.id AS ID, RB.descripcion AS RUBRO, GR.nom_grupo AS GRUPO, CAT.nombre AS CATEGORIA, AR.codigo as CODIGO, AR.descripcion as DESCRIPCION, AR.precio AS PRECIO_1, AR.precio2 AS PRECIO_2, TA.talle AS TALLE, AR.stock AS STOCK FROM `articulo` AS AR LEFT JOIN rubro as RB ON RB.id = AR.rubro_id LEFT JOIN grupo as GR ON GR.id = AR.grupo_id LEFT JOIN categoria AS CAT ON CAT.id = AR.categoria_id LEFT JOIN marca_producto as MP ON MP.id = AR.marca_id LEFT JOIN talle AS TA ON TA.id = AR.talle_id WHERE 1 GROUP BY AR.id ORDER BY `RUBRO` ASC, `GRUPO` ASC, `CATEGORIA` ASC, `DESCRIPCION` ASC
*/