From d98c08c6f125eaadb31cbd2a5d5973edb09948ae Mon Sep 17 00:00:00 2001 From: babak alizadeh Date: Tue, 23 Jul 2024 23:27:55 +0330 Subject: [PATCH] edit person card --- .../templates/pdf/person_card.html.twig | 76 +++++++++++++++---- 1 file changed, 61 insertions(+), 15 deletions(-) diff --git a/hesabixCore/templates/pdf/person_card.html.twig b/hesabixCore/templates/pdf/person_card.html.twig index 742ae7f..e2f399f 100644 --- a/hesabixCore/templates/pdf/person_card.html.twig +++ b/hesabixCore/templates/pdf/person_card.html.twig @@ -83,23 +83,69 @@ بستانکار سال مالی - {% for item in items %} - - - {{ loop.index }} - {{ item.doc.code }} - {{ item.doc.date }} - {{ item.des }} - {{ item.ref.name }} - {{ item.bd | number_format }} - {{ item.bs | number_format }} - {{ item.year.label }} - -{% endfor %} + {% set sumBs = 0 %} + {% set sumBd = 0 %} + {% for item in items %} + {% set sumBs = sumBs + item.bs %} + {% set sumBd = sumBd + item.bd %} + + {{ loop.index }} + {{ item.doc.code }} + {{ item.doc.date }} + {{ item.des }} + {{ item.ref.name }} + {{ item.bd | number_format }} + {{ item.bs | number_format }} + {{ item.year.label }} + + {% endfor %} - - +
+
+ وضعیت حساب +
+ + + + + + + + + +
+

+ جمع بستانکار: + + {{ sumBs | number_format }} +

+
+

+ جمع بدهکار: + + {{ sumBd | number_format }} +

+
+

+ تراز حساب: + + {{ (sumBs - sumBd) | abs |number_format }} +

+
+

+ وضعیت: + + {% if sumBs > sumBd%} + بستانکار + {% elseif sumBs == sumBd %} + تسویه شده + {% else %} + بدهکار + {% endif %} +

+
+
{% endblock %} \ No newline at end of file