From 263e5e6046a5d09c60d9671faa9142f79a29c802 Mon Sep 17 00:00:00 2001 From: Babak Alizadeh Date: Thu, 22 May 2025 01:29:38 +0000 Subject: [PATCH] bug fix in incomes. add code to accounting table --- .../src/Controller/HesabdariController.php | 2 + hesabixCore/templates/pdf/incomes.html.twig | 68 +++++++++++++++++++ webUI/src/views/acc/accounting/table.vue | 32 ++++++++- 3 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 hesabixCore/templates/pdf/incomes.html.twig diff --git a/hesabixCore/src/Controller/HesabdariController.php b/hesabixCore/src/Controller/HesabdariController.php index e6542b6..a9fb44a 100644 --- a/hesabixCore/src/Controller/HesabdariController.php +++ b/hesabixCore/src/Controller/HesabdariController.php @@ -819,11 +819,13 @@ class HesabdariController extends AbstractController if ($this->hasChild($entityManager, $node)) { $temp[$node->getCode()] = [ 'text' => $node->getName(), + 'id' => $node->getCode(), 'children' => $this->getFilteredChildsLabel($entityManager, $node, $business), ]; } else { $temp[$node->getCode()] = [ 'text' => $node->getName(), + 'id' => $node->getCode(), ]; } $temp[$node->getCode()]['is_public'] = $nodeBid === null; diff --git a/hesabixCore/templates/pdf/incomes.html.twig b/hesabixCore/templates/pdf/incomes.html.twig new file mode 100644 index 0000000..4d90bee --- /dev/null +++ b/hesabixCore/templates/pdf/incomes.html.twig @@ -0,0 +1,68 @@ +{% extends 'pdf/base.html.twig' %} + +{% block body %} + + + + + + + + + + + + {% for item in items %} + + + + + + + + + + {% endfor %} + + {# جمع کل #} + + + + + +
ردیفشماره سندتاریخشرحمرکز درآمدمرکز دریافتمبلغ (ریال)
{{ loop.index }}{{ item.code }}{{ item.date }}{{ item.des }} + {% set incomeCenters = [] %} + {% for row in item.hesabdariRows %} + {% if row.ref and row.bs != 0 %} + {% set incomeCenters = incomeCenters|merge([row.ref.name]) %} + {% endif %} + {% endfor %} + {{ incomeCenters|join('، ') }} + + {% set receiveCenter = null %} + {% for row in item.hesabdariRows %} + {% if not receiveCenter %} + {% if row.bank %} + {% set receiveCenter = row.bank.name %} + {% elseif row.cashdesk %} + {% set receiveCenter = row.cashdesk.name %} + {% elseif row.salary %} + {% set receiveCenter = row.salary.name %} + {% elseif row.person %} + {% set receiveCenter = row.person.nikename %} + {% endif %} + {% endif %} + {% endfor %} + {{ receiveCenter }} + {{ item.amount|number_format }}
جمع کل: + {{ items|reduce((sum, item) => sum + item.amount, 0)|number_format }} +
+ +{# اطلاعات تکمیلی #} +
+

تعداد اسناد: {{ items|length }} مورد

+ {% if items|length > 0 %} +

از تاریخ: {{ items|first.date }} تا تاریخ: {{ items|last.date }}

+ {% endif %} +
+{% endblock %} \ No newline at end of file diff --git a/webUI/src/views/acc/accounting/table.vue b/webUI/src/views/acc/accounting/table.vue index e2fc088..48225fc 100644 --- a/webUI/src/views/acc/accounting/table.vue +++ b/webUI/src/views/acc/accounting/table.vue @@ -13,6 +13,12 @@ +