bug fix in avatar controller for not exist files
This commit is contained in:
parent
f1c1c4a593
commit
492b601255
|
@ -24,7 +24,7 @@ class AvatarController extends AbstractController
|
||||||
if (!$bid)
|
if (!$bid)
|
||||||
return new BinaryFileResponse(dirname(__DIR__, 3) . '/hesabixArchive/avatars/default.png');
|
return new BinaryFileResponse(dirname(__DIR__, 3) . '/hesabixArchive/avatars/default.png');
|
||||||
$fileAdr = dirname(__DIR__, 3) . '/hesabixArchive/avatars/' . $bid->getAvatar();
|
$fileAdr = dirname(__DIR__, 3) . '/hesabixArchive/avatars/' . $bid->getAvatar();
|
||||||
if (!$bid->getAvatar())
|
if (!$bid->getAvatar() || !file_exists($fileAdr))
|
||||||
return new BinaryFileResponse(dirname(__DIR__, 3) . '/hesabixArchive/avatars/default.png');
|
return new BinaryFileResponse(dirname(__DIR__, 3) . '/hesabixArchive/avatars/default.png');
|
||||||
$response = new BinaryFileResponse($fileAdr);
|
$response = new BinaryFileResponse($fileAdr);
|
||||||
return $response;
|
return $response;
|
||||||
|
|
|
@ -229,7 +229,7 @@ class PrintersController extends AbstractController
|
||||||
#[Route('/api/print/last', name: 'app_print_last')]
|
#[Route('/api/print/last', name: 'app_print_last')]
|
||||||
public function app_print_last(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): Response
|
public function app_print_last(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$acc = $access->hasRole('join');
|
$acc = $access->hasRole('owner');
|
||||||
if (!$acc)
|
if (!$acc)
|
||||||
throw $this->createAccessDeniedException();
|
throw $this->createAccessDeniedException();
|
||||||
$printer = $entityManager->getRepository(Printer::class)->findBy([
|
$printer = $entityManager->getRepository(Printer::class)->findBy([
|
||||||
|
|
|
@ -274,12 +274,14 @@
|
||||||
حمل و نقل:
|
حمل و نقل:
|
||||||
{{transfer | number_format}}
|
{{transfer | number_format}}
|
||||||
</h4>
|
</h4>
|
||||||
|
{% if doc.amount != (doc.amount + discount) %}
|
||||||
|
<h4>
|
||||||
|
مبلغ کل بدون تخفیف:
|
||||||
|
{{ (doc.amount + discount) | number_format}}
|
||||||
|
</h4>
|
||||||
|
{% endif %}
|
||||||
<h4>
|
<h4>
|
||||||
مبلغ کل بدون تخفیف:
|
جمع کل:
|
||||||
{{ (doc.amount + discount) | number_format}}
|
|
||||||
</h4>
|
|
||||||
<h4>
|
|
||||||
جمع کل قابل پرداخت:
|
|
||||||
{{ doc.amount | number_format }}
|
{{ doc.amount | number_format }}
|
||||||
</h4>
|
</h4>
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Reference in a new issue