some progress
This commit is contained in:
parent
d451893bc7
commit
edff50d39d
1
hesabixCore/.gitignore
vendored
1
hesabixCore/.gitignore
vendored
|
@ -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 ###
|
||||||
|
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
@ -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
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue