bug fix in create pdf images

This commit is contained in:
Hesabix 2025-03-24 12:14:44 +00:00
parent 59262b6515
commit 490e404568
13 changed files with 35 additions and 21 deletions

1
.gitignore vendored
View file

@ -1,5 +1,4 @@
hesabixArchive/
hesabixBackup/ hesabixBackup/
backup/ backup/
.idea/ .idea/

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

1
hesabixArchive/seal/index.php Executable file
View file

@ -0,0 +1 @@
<?php

View file

@ -55,15 +55,29 @@ class AvatarController extends AbstractController
} }
#[Route('/api/avatar/get/file/{id}', name: 'api_avatar_get_file')] #[Route('/api/avatar/get/file/{id}', name: 'api_avatar_get_file')]
public function api_avatar_get_file(string $id): BinaryFileResponse public function api_avatar_get_file(string $id = ''): BinaryFileResponse
{ {
$fileAdr = __DIR__ . '/../../../hesabixArchive/avatars/' . $id; $fileAdr = __DIR__ . '/../../../hesabixArchive/avatars/' . $id;
if (!file_exists($fileAdr)) if (!file_exists($fileAdr))
throw $this->createNotFoundException(); $fileAdr = __DIR__ . '/../../../hesabixArchive/avatars/default.png';
$response = new BinaryFileResponse($fileAdr); $response = new BinaryFileResponse($fileAdr);
return $response; return $response;
} }
#[Route('/front/seal/file/get/{id}', name: 'front_seal_file_get')]
public function front_seal_file_get(EntityManagerInterface $entityManager, string $id = '0'): BinaryFileResponse
{
$bid = $entityManager->getRepository(Business::class)->find($id);
if (!$bid)
return new BinaryFileResponse(dirname(__DIR__, 3) . '/hesabixArchive/seal/default.png');
$fileAdr = dirname(__DIR__, 3) . '/hesabixArchive/seal/' . $bid->getSealFile();
if (!$bid->getAvatar() || !file_exists($fileAdr))
return new BinaryFileResponse(dirname(__DIR__, 3) . '/hesabixArchive/seal/default.png');
$response = new BinaryFileResponse($fileAdr);
return $response;
}
#[Route('/api/seal/get/file/{id}', name: 'api_seal_get_file')] #[Route('/api/seal/get/file/{id}', name: 'api_seal_get_file')]
public function api_seal_get_file(string $id = null): BinaryFileResponse public function api_seal_get_file(string $id = null): BinaryFileResponse
{ {

View file

@ -442,10 +442,10 @@ class BuyController extends AbstractController
foreach ($doc->getHesabdariRows() as $item) { foreach ($doc->getHesabdariRows() as $item) {
if ($item->getPerson()) { if ($item->getPerson()) {
$person = $item->getPerson(); $person = $item->getPerson();
} elseif ($item->getRef()->getCode() == 90) {
$discount = $item->getBd();
} elseif ($item->getRef()->getCode() == 51) { } elseif ($item->getRef()->getCode() == 51) {
$transfer = $item->getBs(); $discount = $item->getBs();
} elseif ($item->getRef()->getCode() == 90) {
$transfer = $item->getBd();
} }
} }
$pdfPid = 0; $pdfPid = 0;

View file

@ -32,7 +32,7 @@
<thead> <thead>
<tr> <tr>
<td style="width:20%"> <td style="width:20%">
<img src="{{ "/api/avatar/get/file/" ~ bid.avatar}}" width="65"/> <img src="{{ url('front_avatar_file_get', {id: bid.id},)}}" width="65"/>
</td> </td>
<td style="width:60%; text-align:center"> <td style="width:60%; text-align:center">
<h3 class="">{{bid.name}}</h3> <h3 class="">{{bid.name}}</h3>

View file

@ -123,7 +123,7 @@
{% if printInvoice%} {% if printInvoice%}
<header> <header>
<p style="text-align:center;">{{ bid.name }}</p> <p style="text-align:center;">{{ bid.name }}</p>
<img src="{{ "/api/seal/get/file/" ~ bid.sealFile}}" width="80"/> <img src="{{ url('front_seal_file_get', {id: bid.id},)}}" width="80"/>
</header> </header>
<table class="bill-details"> <table class="bill-details">
<tbody style="text-align:right"> <tbody style="text-align:right">
@ -228,7 +228,7 @@
</table> </table>
<footer style="text-align:center"> <footer style="text-align:center">
<p>{{ bid.name }}</p> <p>{{ bid.name }}</p>
<img src="{{ "/api/seal/get/file/" ~ bid.sealFile}}" width="80"/> <img src="{{ url('front_seal_file_get', {id: bid.id},)}}" width="80"/>
</footer> </footer>
{% endif %} {% endif %}
</body> </body>

View file

@ -26,7 +26,7 @@
<thead> <thead>
<tr> <tr>
<td style="width:20%"> <td style="width:20%">
<img src="{{ "/api/avatar/get/file/" ~ bid.avatar}}" width="65"/> <img src="{{ url('front_avatar_file_get', {id: bid.id},)}}" width="65"/>
</td> </td>
<td style="width:60%; text-align:center"> <td style="width:60%; text-align:center">
<h3 class="">صورتحساب خرید کالا و خدمات</h3> <h3 class="">صورتحساب خرید کالا و خدمات</h3>
@ -297,7 +297,7 @@
مهر و امضا خریدار مهر و امضا خریدار
</h4> </h4>
<br> <br>
<img src="{{ "/api/seal/get/file/" ~ bid.sealFile}}" width="80"/> <img src="{{ url('front_seal_file_get', {id: bid.id},)}}" width="80"/>
</td> </td>
<td class="center" style="height:90px"> <td class="center" style="height:90px">
<h4> <h4>

View file

@ -29,7 +29,7 @@
<thead> <thead>
<tr> <tr>
<td style="width:20%"> <td style="width:20%">
<img src="{{ "/api/avatar/get/file/" ~ bid.avatar}}" width="65"/> <img src="{{ url('front_avatar_file_get', {id: bid.id},)}}" width="65"/>
</td> </td>
<td style="width:60%; text-align:center"> <td style="width:60%; text-align:center">
<h3 class="">{{ bid.name }}</h3> <h3 class="">{{ bid.name }}</h3>
@ -170,7 +170,7 @@
<br> <br>
<b>{{ doc.submitter.fullname }}</b> <b>{{ doc.submitter.fullname }}</b>
<br> <br>
<img src="{{ "/api/seal/get/file/" ~ bid.sealFile}}" width="80"/> <img src="{{ url('front_seal_file_get', {id: bid.id},)}}" width="80"/>
</h4> </h4>
</td> </td>
</tr> </tr>

View file

@ -26,7 +26,7 @@
<thead> <thead>
<tr> <tr>
<td style="width:20%"> <td style="width:20%">
<img src="{{ "/api/avatar/get/file/" ~ bid.avatar}}" width="65"/> <img src="{{ url('front_avatar_file_get', {id: bid.id},)}}" width="65"/>
</td> </td>
<td style="width:60%; text-align:center"> <td style="width:60%; text-align:center">
<h3 class="">صورتحساب برگشت از خرید کالا و خدمات</h3> <h3 class="">صورتحساب برگشت از خرید کالا و خدمات</h3>
@ -297,7 +297,7 @@
مهر و امضا خریدار مهر و امضا خریدار
</h4> </h4>
<br> <br>
<img src="{{ "/api/seal/get/file/" ~ bid.sealFile}}" width="80"/> <img src="{{ url('front_seal_file_get', {id: bid.id},)}}" width="80"/>
</td> </td>
<td class="center" style="height:90px"> <td class="center" style="height:90px">
<h4> <h4>

View file

@ -26,7 +26,7 @@
<thead> <thead>
<tr> <tr>
<td style="width:20%"> <td style="width:20%">
<img src="{{ "/api/avatar/get/file/" ~ bid.avatar}}" width="65"/> <img src="{{ url('front_avatar_file_get', {id: bid.id},)}}" width="65"/>
</td> </td>
<td style="width:60%; text-align:center"> <td style="width:60%; text-align:center">
<h3 class="">صورتحساب برگشت از فروش کالا و خدمات</h3> <h3 class="">صورتحساب برگشت از فروش کالا و خدمات</h3>
@ -302,7 +302,7 @@
مهر و امضا فروشنده: مهر و امضا فروشنده:
</h4> </h4>
<br> <br>
<img src="{{ "/api/seal/get/file/" ~ bid.sealFile}}" width="80"/> <img src="{{ url('front_seal_file_get', {id: bid.id},)}}" width="80"/>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View file

@ -26,7 +26,7 @@
<thead> <thead>
<tr> <tr>
<td style="width:20%"> <td style="width:20%">
<img src="{{ "/api/avatar/get/file/" ~ bid.avatar}}" width="65"/> <img src="{{ url('front_avatar_file_get', {id: bid.id},)}}" width="65"/>
</td> </td>
<td style="width:60%; text-align:center"> <td style="width:60%; text-align:center">
<h3 class="">صورتحساب فروش کالا و خدمات</h3> <h3 class="">صورتحساب فروش کالا و خدمات</h3>
@ -304,7 +304,7 @@
مهر و امضا فروشنده: مهر و امضا فروشنده:
</h4> </h4>
<br> <br>
<img src="{{ "/api/seal/get/file/" ~ bid.sealFile}}" width="160"/> <img src="{{ url('front_seal_file_get', {id: bid.id},)}}" width="160"/>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View file

@ -26,7 +26,7 @@
<thead> <thead>
<tr> <tr>
<td style="width:20%"> <td style="width:20%">
<img src="{{ "/api/avatar/get/file/" ~ bid.avatar}}" width="65"/> <img src="{{ url('front_avatar_file_get', {id: bid.id},)}}" width="65"/>
</td> </td>
<td style="width:60%; text-align:center"> <td style="width:60%; text-align:center">
<h3 class="">{{ bid.name }}</h3> <h3 class="">{{ bid.name }}</h3>
@ -185,7 +185,7 @@
{{doc.storeroom.manager}} {{doc.storeroom.manager}}
</h5> </h5>
<br> <br>
<img src="{{ "/api/seal/get/file/" ~ bid.sealFile}}" width="80"/> <img src="{{ url('front_seal_file_get', {id: bid.id},)}}" width="80"/>
</td> </td>
</tr> </tr>
</tbody> </tbody>