From a579a020bcc44b1b72791632f02aeb2812871462 Mon Sep 17 00:00:00 2001 From: Babak Alizadeh Date: Thu, 23 Oct 2025 10:37:42 +0330 Subject: [PATCH] bug fix in print invoice sell type --- hesabixCore/src/Controller/SellController.php | 1 + hesabixCore/src/Service/twigFunctions.php | 5 ++ .../pdf/posPrinters/cashdesk.html.twig | 59 +++++++++++-------- .../pdf/posPrinters/footer.html.twig | 0 .../pdf/posPrinters/justSell.html.twig | 39 ++++++++++-- 5 files changed, 74 insertions(+), 30 deletions(-) delete mode 100644 hesabixCore/templates/pdf/posPrinters/footer.html.twig diff --git a/hesabixCore/src/Controller/SellController.php b/hesabixCore/src/Controller/SellController.php index 063f53c..32053a8 100644 --- a/hesabixCore/src/Controller/SellController.php +++ b/hesabixCore/src/Controller/SellController.php @@ -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(), diff --git a/hesabixCore/src/Service/twigFunctions.php b/hesabixCore/src/Service/twigFunctions.php index 6b33b51..0b33ec3 100644 --- a/hesabixCore/src/Service/twigFunctions.php +++ b/hesabixCore/src/Service/twigFunctions.php @@ -148,4 +148,9 @@ class twigFunctions return $footerText; } + + public function getSystemFooterText(string $side) + { + return $this->getStaticData('system', $side); + } } \ No newline at end of file diff --git a/hesabixCore/templates/pdf/posPrinters/cashdesk.html.twig b/hesabixCore/templates/pdf/posPrinters/cashdesk.html.twig index adead0a..65692c2 100644 --- a/hesabixCore/templates/pdf/posPrinters/cashdesk.html.twig +++ b/hesabixCore/templates/pdf/posPrinters/cashdesk.html.twig @@ -122,11 +122,11 @@ - +
تاریخ : - {{doc.date}} + {{Jdate.jdate('Y/n/d H:i',doc.dateSubmit)}} شماره : # @@ -140,7 +140,36 @@
- + + {% set firstPerson = null %} + {% for row in rows %} + {% if row.person != null and firstPerson is null %} + {% set firstPerson = row.person %} + {% endif %} + {% endfor %} + {% if firstPerson %} +
+

+ نام مستعار: {{ firstPerson.nikename|default(firstPerson.name) }} +

+

+ نام / نام خانوادگی: {{ firstPerson.name|default(firstPerson.name) }} +

+

+ آدرس: {{ firstPerson.address|default('-') }} +

+

+ موبایل: + {% if firstPerson.mobile %} + {{ firstPerson.mobile }} + {% elseif firstPerson.mobile2 is defined and firstPerson.mobile2 %} + {{ firstPerson.mobile2 }} + {% else %} + - + {% endif %} +

+
+ {% endif %} @@ -160,30 +189,12 @@ {% endfor %}
- {% set firstPerson = null %} - {% for row in rows %} - {% if row.person != null and firstPerson is null %} - {% set firstPerson = row.person %} - {% endif %} - {% endfor %} - {% if firstPerson %} -
-

نام مستعار: {{ firstPerson.nikename|default(firstPerson.name) }}

-

آدرس: {{ firstPerson.address|default('-') }}

-

موبایل: - {% if firstPerson.mobile %}{{ firstPerson.mobile }} - {% elseif firstPerson.mobile2 is defined and firstPerson.mobile2 %}{{ firstPerson.mobile2 }} - {% else %}-{% endif %} -

-
- {% endif %} -
-