diff --git a/hesabixCore/.gitignore b/hesabixCore/.gitignore index 3e7b04d..cc1b591 100644 --- a/hesabixCore/.gitignore +++ b/hesabixCore/.gitignore @@ -6,6 +6,7 @@ /../public_html/bundles/ /../public_html/cdn/ /var/ +/templates/ /vendor/ /../hesabixArchive/ ###< symfony/framework-bundle ### diff --git a/hesabixCore/src/Controller/ChequeController.php b/hesabixCore/src/Controller/ChequeController.php index 7b6c7f2..b7dca0e 100644 --- a/hesabixCore/src/Controller/ChequeController.php +++ b/hesabixCore/src/Controller/ChequeController.php @@ -42,6 +42,23 @@ class ChequeController extends AbstractController ]); } + #[Route('/api/cheque/list/forpay', name: 'app_cheque_list_for_pay')] + public function app_cheque_list_for_pay(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,Jdate $jdate): JsonResponse + { + $acc = $access->hasRole('cheque'); + if(!$acc) + throw $this->createAccessDeniedException(); + $cheques = $entityManager->getRepository(Cheque::class)->findBy([ + 'bid'=>$acc['bid'], + 'type'=>'input', + 'locked'=>false, + ]); + + return $this->json( + Explore::SerializeCheques(array_reverse($cheques)), + ); + } + #[Route('/api/cheque/info/{id}', name: 'app_cheque_info')] public function app_cheque_info(string $id, Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,Jdate $jdate): JsonResponse { diff --git a/hesabixCore/src/Service/Explore.php b/hesabixCore/src/Service/Explore.php index 7ceb8e1..4680eaa 100644 --- a/hesabixCore/src/Service/Explore.php +++ b/hesabixCore/src/Service/Explore.php @@ -210,6 +210,9 @@ class Explore{ if(!$cheque) return null; $jdate = new Jdate; + $label = ''; + if($cheque->getType() == 'input') + $label = 'چک شماره ' . $cheque->getNumber() . ' مربوط به ' . $cheque->getPerson()->getNikename() . ' با مبلغ ' . $cheque->getAmount(); return [ 'id' => $cheque->getId(), 'number'=> $cheque->getNumber(), @@ -224,7 +227,8 @@ class Explore{ 'status'=>$cheque->getStatus(), 'date'=>$cheque->getDate(), 'locked'=>$cheque->isLocked(), - 'rejected'=>$cheque->isRejected() + 'rejected'=>$cheque->isRejected(), + 'label' => $label ]; }