diff --git a/hesabixCore/src/Controller/HesabdariController.php b/hesabixCore/src/Controller/HesabdariController.php index c151cf1..29d968c 100644 --- a/hesabixCore/src/Controller/HesabdariController.php +++ b/hesabixCore/src/Controller/HesabdariController.php @@ -685,11 +685,15 @@ class HesabdariController extends AbstractController } if (!array_key_exists('code', $params)) $this->createNotFoundException(); - // استفاده از متد ایمن برای پیدا کردن سند - $doc = $provider->findHesabdariDocSafely($entityManager, [ - 'code' => $params['code'], - 'bid' => $request->headers->get('activeBid') - ]); + // استفاده از query builder برای پیدا کردن سند + $doc = $entityManager->getRepository(HesabdariDoc::class) + ->createQueryBuilder('h') + ->where('h.code = :code') + ->andWhere('h.bid = :bid') + ->setParameter('code', $params['code']) + ->setParameter('bid', $request->headers->get('activeBid')) + ->getQuery() + ->getOneOrNullResult(); if (!$doc) throw $this->createNotFoundException(); $roll = '';