src\Controller\EirsaliyeController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Eirsaliye;
  4. use App\Repository\EirsaliyeRepository;
  5. use Doctrine\Common\Collections\Criteria;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. /**
  10.  * @Route("/eirsaliye", name="eirsaliye-")
  11.  */
  12. class EirsaliyeController extends AbstractFoodsoftController
  13. {
  14.     /**
  15.      * @Route("/", name="index")
  16.      */
  17.     public function index(Request $request): Response
  18.     {
  19.         $this->checkDisabled($request);
  20.         $config $this->getParameter('foodsoft');
  21.         $criteria Criteria::create();
  22.         $criteria->where($criteria->expr()->eq('IrsTuru''SATIŞ İRSALİYESİ'));
  23.         $criteria->andWhere($criteria->expr()->eq('CariKodu'$this->getUser()->getCari()->getAktifFirma()));
  24.         $criteria->andWhere($criteria->expr()->gte('Tarih', new \DateTime(date('Y-m-d',
  25.             time() - $config['eirsaliye']['eirsaliye_limit'] * 24 3600))));
  26.         $criteria->orderBy(['SevkTarih' => 'DESC']);
  27.         /** @var EirsaliyeRepository $rep */
  28.         $rep $this->getdoctrine()->getmanager()->getrepository(Eirsaliye::class);
  29.         $liste $rep->matching($criteria);
  30. //        $rep->setConfig($config);
  31. //        $liste = $rep->findBy([
  32. //            'IrsTuru' => 'SATIŞ İRSALİYESİ',
  33. //            'CariKodu' => $this->getUser()->getCari()->getFirmaKodu(),
  34. //            //-'TARIH' => date('Y-m-d', time()-$this->cfg['eirsaliye_limit']*24*3600)
  35. //            'Tarih' => new \DateTime(date('Y-m-d', time()-30*24*3600))
  36. //            ],
  37. //            ['Tarih' => 'DESC']);
  38.         return $this->render('eirsaliye/index.html.twig', [
  39.             'liste' => $liste,
  40.             'eirsaliye_url' => $config['eirsaliye']['eirsaliye_url'],
  41.         ]);
  42.     }
  43. }