add cashdesk invoice to fast sell

This commit is contained in:
babak alizadeh 2024-06-24 01:45:26 +03:30
parent c42c5e8fed
commit 902d3f4829
3 changed files with 63 additions and 16 deletions

View file

@ -338,9 +338,11 @@ class SellController extends AbstractController
$this->renderView('pdf/posPrinters/sell.html.twig', [ $this->renderView('pdf/posPrinters/sell.html.twig', [
'bid' => $acc['bid'], 'bid' => $acc['bid'],
'doc'=>$doc, 'doc'=>$doc,
'rows'=>$doc->getHesabdariRows() 'rows'=>$doc->getHesabdariRows(),
'printInvoice'=>$params['posPrint'],
'printcashdeskRecp'=>$params['posPrintRecp'],
]), ]),
$posPrint true
); );
return $this->json(['id' => $pid]); return $this->json(['id' => $pid]);
} }

View file

@ -50,7 +50,7 @@ class pdfMGR
{ {
$mpdf = new \Mpdf\Mpdf([ $mpdf = new \Mpdf\Mpdf([
'mode' => 'utf-8', 'format' => [80, 600], 'mode' => 'utf-8', 'format' => [80, 300],
'fontdata' => [ 'fontdata' => [
'vazirmatn' => [ 'vazirmatn' => [
'R' => 'Vazir-Regular-FD.ttf', 'R' => 'Vazir-Regular-FD.ttf',

View file

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fa" direction="rtl"> <html lang="fa" direction="rtl"></html>
<head> <head>
<style> <style>
body { body {
margin: 0; margin: 5px;
padding: 0; padding: 0;
font-size: 100%; font-size: 100%;
} }
@ -15,9 +15,10 @@
tr { tr {
width: 100%; width: 100%;
} }
th,td {
border: 1px solid black !important;
}
h1 { h1 {
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
@ -119,8 +120,8 @@
} }
</style> </style>
</head> </head>
<body style="direction:rtl; text-align:right; width:100%"> <body style="direction:rtl; text-align:right; width:100%">
{% if printInvoice%}
<header> <header>
<p style="text-align:center;">{{ bid.name }}</p> <p style="text-align:center;">{{ bid.name }}</p>
</header> </header>
@ -135,10 +136,6 @@
{{doc.code | number_format}}</span> {{doc.code | number_format}}</span>
</td> </td>
</tr> </tr>
<tr>
<td style="text-align:right"></td>
<td></td>
</tr>
<tr> <tr>
<th class="center-align" colspan="2"> <th class="center-align" colspan="2">
<span class="receipt">صورتحساب</span> <span class="receipt">صورتحساب</span>
@ -174,17 +171,65 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<section style="margin-bottom:10px;margin-top:10px;"> <section style="margin-bottom:10px;margin-top:10px;text-align:center;">
<p style="text-align:center"> <b style="text-align:center">
از خرید شما متشکریم از خرید شما متشکریم
</p> </b>
</section> </section>
<footer style="text-align:center"> <footer style="text-align:center">
<p>{{ bid.name }}</p>
<p>{{ bid.address }}</p> <p>{{ bid.address }}</p>
<p>{{ bid.tel }}</p> <p>{{ bid.tel }}</p>
<p>hesabix.ir</p> <p>hesabix.ir</p>
</footer> </footer>
{% endif %}
{% if printcashdeskRecp%}
{% if printInvoice %}
<hr>
{% endif %}
<table class="bill-details">
<tbody style="text-align:right">
<tr>
<td style="text-align:right">تاریخ :
<span>{{doc.date}}</span>
</td>
<td style="text-align:right">شماره :
<span>#
{{doc.code | number_format}}</span>
</td>
</tr>
<tr>
<th class="center-align" colspan="2">
<span class="receipt">قبض صندوق</span>
</th>
</tr>
</tbody>
</table>
<table class="items">
<thead style="background:gray;text-color:white;">
<tr>
<th class="heading name">کالا</th>
<th class="heading qty">تعداد</th>
</tr>
</thead>
<tbody>
{% for row in rows %}
{% if row.commodity != null %}
<tr>
<td>{{row.commodity.name}}</td>
<td>{{row.commdityCount}}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
<footer style="text-align:center">
<p>{{ bid.name }}</p>
</footer>
{% endif %}
</body> </body>
</html> </html>