bug fix in print invoice sell type

This commit is contained in:
Hesabix 2025-10-23 10:37:42 +03:30
parent 98645b24c3
commit a579a020bc
5 changed files with 74 additions and 30 deletions

View file

@ -1013,6 +1013,7 @@ class SellController extends AbstractController
'doc' => $doc,
'rows' => array_map(function ($row) {
return [
'person' => $row->getPerson(),
'commodity' => $row->getCommodity(),
'commodityCount' => $row->getCommdityCount(),
'des' => $row->getDes(),

View file

@ -148,4 +148,9 @@ class twigFunctions
return $footerText;
}
public function getSystemFooterText(string $side)
{
return $this->getStaticData('system', $side);
}
}

View file

@ -126,7 +126,7 @@
<tbody style="text-align:right">
<tr>
<td style="text-align:right">تاریخ :
<span>{{doc.date}}</span>
<span>{{Jdate.jdate('Y/n/d H:i',doc.dateSubmit)}}</span>
</td>
<td style="text-align:right">شماره :
<span>#
@ -141,6 +141,35 @@
</tbody>
</table>
{% set firstPerson = null %}
{% for row in rows %}
{% if row.person != null and firstPerson is null %}
{% set firstPerson = row.person %}
{% endif %}
{% endfor %}
{% if firstPerson %}
<section class="person-details" style="margin:4px 3px 6px 3px; padding:4px 3px; border:1px dashed #bbb; border-radius: 4px; background: #fafbfc;">
<p style="margin: 2px 0; font-size:11px; line-height: 1.5;">
<strong>نام مستعار:</strong> {{ firstPerson.nikename|default(firstPerson.name) }}
</p>
<p style="margin: 2px 0; font-size:11px; line-height: 1.5;">
<strong>نام / نام خانوادگی:</strong> {{ firstPerson.name|default(firstPerson.name) }}
</p>
<p style="margin: 2px 0; font-size:11px; line-height: 1.5;">
<strong>آدرس:</strong> {{ firstPerson.address|default('-') }}
</p>
<p style="margin: 2px 0; font-size:11px; line-height: 1.5;">
<strong>موبایل:</strong>
{% if firstPerson.mobile %}
{{ firstPerson.mobile }}
{% elseif firstPerson.mobile2 is defined and firstPerson.mobile2 %}
{{ firstPerson.mobile2 }}
{% else %}
-
{% endif %}
</p>
</section>
{% endif %}
<table class="items">
<thead style="background:gray;text-color:white;">
<tr>
@ -160,30 +189,12 @@
{% endfor %}
</tbody>
</table>
{% set firstPerson = null %}
{% for row in rows %}
{% if row.person != null and firstPerson is null %}
{% set firstPerson = row.person %}
{% endif %}
{% endfor %}
{% if firstPerson %}
<section class="person-details" style="margin-top:6px; width:100%;">
<p><strong>نام مستعار:</strong> {{ firstPerson.nikename|default(firstPerson.name) }}</p>
<p><strong>آدرس:</strong> {{ firstPerson.address|default('-') }}</p>
<p><strong>موبایل:</strong>
{% if firstPerson.mobile %}{{ firstPerson.mobile }}
{% elseif firstPerson.mobile2 is defined and firstPerson.mobile2 %}{{ firstPerson.mobile2 }}
{% else %}-{% endif %}
</p>
</section>
{% endif %}
<footer style="text-align:center">
<p>{{ bid.name }}</p>
</footer>
<hr>
<footer style="text-align:center; font-size: 11px;">
<p>{{ twigFunctions.getFooterText('right', pluginService, bid) }}</p>
<p>{{ twigFunctions.getFooterText('left', pluginService, bid) }}</p>
<footer style="text-align:center; font-size: 8px;">
<p>{{ twigFunctions.getSystemFooterText('footerRight') }}</p>
<p>{{ twigFunctions.getSystemFooterText('footerLeft') }}</p>
</footer>
</body>
</html>

View file

@ -131,7 +131,7 @@
<tbody style="text-align:right">
<tr>
<td style="text-align:right">تاریخ :
<span>{{doc.date}}</span>
<span>{{Jdate.jdate('Y/n/d H:i',doc.dateSubmit)}}</span>
</td>
<td style="text-align:right">شماره :
<span>#
@ -145,7 +145,35 @@
</tr>
</tbody>
</table>
{% set firstPerson = null %}
{% for row in rows %}
{% if row.person != null and firstPerson is null %}
{% set firstPerson = row.person %}
{% endif %}
{% endfor %}
{% if firstPerson %}
<section class="person-details" style="margin:4px 3px 6px 3px; padding:4px 3px; border:1px dashed #bbb; border-radius: 4px; background: #fafbfc;">
<p style="margin: 2px 0; font-size:11px; line-height: 1.5;">
<strong>نام مستعار:</strong> {{ firstPerson.nikename|default(firstPerson.name) }}
</p>
<p style="margin: 2px 0; font-size:11px; line-height: 1.5;">
<strong>نام / نام خانوادگی:</strong> {{ firstPerson.name|default(firstPerson.name) }}
</p>
<p style="margin: 2px 0; font-size:11px; line-height: 1.5;">
<strong>آدرس:</strong> {{ firstPerson.address|default('-') }}
</p>
<p style="margin: 2px 0; font-size:11px; line-height: 1.5;">
<strong>موبایل:</strong>
{% if firstPerson.mobile %}
{{ firstPerson.mobile }}
{% elseif firstPerson.mobile2 is defined and firstPerson.mobile2 %}
{{ firstPerson.mobile2 }}
{% else %}
-
{% endif %}
</p>
</section>
{% endif %}
<table class="items">
<thead style="background:gray;text-color:white;">
<tr>
@ -217,10 +245,9 @@
<p>{{ bid.address }}</p>
<p>{{ bid.tel }}</p>
</footer>
<hr>
<footer style="text-align:center; font-size: 11px;">
<p>{{ twigFunctions.getFooterText('right', pluginService, bid) }}</p>
<p>{{ twigFunctions.getFooterText('left', pluginService, bid) }}</p>
<footer style="text-align:center; font-size: 8px;">
<p>{{ twigFunctions.getSystemFooterText('footerRight') }}</p>
<p>{{ twigFunctions.getSystemFooterText('footerLeft') }}</p>
</footer>
</body>
</html>