some progress

This commit is contained in:
Hesabix 2024-04-09 07:32:07 +00:00
parent d451893bc7
commit edff50d39d
3 changed files with 23 additions and 1 deletions

View file

@ -6,6 +6,7 @@
/../public_html/bundles/ /../public_html/bundles/
/../public_html/cdn/ /../public_html/cdn/
/var/ /var/
/templates/
/vendor/ /vendor/
/../hesabixArchive/ /../hesabixArchive/
###< symfony/framework-bundle ### ###< symfony/framework-bundle ###

View file

@ -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')] #[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 public function app_cheque_info(string $id, Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,Jdate $jdate): JsonResponse
{ {

View file

@ -210,6 +210,9 @@ class Explore{
if(!$cheque) if(!$cheque)
return null; return null;
$jdate = new Jdate; $jdate = new Jdate;
$label = '';
if($cheque->getType() == 'input')
$label = 'چک شماره ' . $cheque->getNumber() . ' مربوط به ' . $cheque->getPerson()->getNikename() . ' با مبلغ ' . $cheque->getAmount();
return [ return [
'id' => $cheque->getId(), 'id' => $cheque->getId(),
'number'=> $cheque->getNumber(), 'number'=> $cheque->getNumber(),
@ -224,7 +227,8 @@ class Explore{
'status'=>$cheque->getStatus(), 'status'=>$cheque->getStatus(),
'date'=>$cheque->getDate(), 'date'=>$cheque->getDate(),
'locked'=>$cheque->isLocked(), 'locked'=>$cheque->isLocked(),
'rejected'=>$cheque->isRejected() 'rejected'=>$cheque->isRejected(),
'label' => $label
]; ];
} }