From bdde0c2da9616697b9d21ce3e6165a33083b99f9 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 6 Feb 2026 06:32:17 +0000 Subject: [PATCH] revision 1 --- accounting/__pycache__/views.cpython-311.pyc | Bin 14428 -> 14777 bytes .../templates/accounting/journal_entries.html | 93 ++++++--- accounting/views.py | 5 +- core/templates/base.html | 123 ++++-------- core/templates/core/invoice_detail.html | 156 +++++++++------ core/templates/core/lpo_detail.html | 128 ++++++++----- core/templates/core/purchase_detail.html | 144 ++++++++------ .../core/purchase_return_detail.html | 116 ++++++++---- core/templates/core/quotation_detail.html | 144 ++++++++------ core/templates/core/sale_return_detail.html | 116 ++++++++---- hr/__pycache__/admin.cpython-311.pyc | Bin 2780 -> 2799 bytes hr/__pycache__/forms.cpython-311.pyc | Bin 0 -> 2125 bytes hr/__pycache__/views.cpython-311.pyc | Bin 10129 -> 10185 bytes hr/admin.py | 6 +- hr/forms.py | 27 +++ hr/templates/hr/employee_detail.html | 4 +- hr/templates/hr/employee_form.html | 177 ++++++++++++++++-- hr/templates/hr/employee_list.html | 6 +- hr/views.py | 7 +- media/product_images/بيض.jfif | Bin 0 -> 7236 bytes media/product_images/ةهمن.jfif | Bin 0 -> 11385 bytes media/product_images/ةهمن_et0OoKU.jfif | Bin 0 -> 11385 bytes media/product_images/ةهمن_r3GdN2u.jfif | Bin 0 -> 11385 bytes media/product_images/طماطم.jfif | Bin 0 -> 7546 bytes .../pasted-20260206-043257-ab1cccfb.png | Bin 0 -> 20235 bytes .../pasted-20260206-044350-8c65cfaa.png | Bin 0 -> 22621 bytes 26 files changed, 829 insertions(+), 423 deletions(-) create mode 100644 hr/__pycache__/forms.cpython-311.pyc create mode 100644 hr/forms.py create mode 100644 media/product_images/بيض.jfif create mode 100644 media/product_images/ةهمن.jfif create mode 100644 media/product_images/ةهمن_et0OoKU.jfif create mode 100644 media/product_images/ةهمن_r3GdN2u.jfif create mode 100644 media/product_images/طماطم.jfif create mode 100644 staticfiles/pasted-20260206-043257-ab1cccfb.png create mode 100644 staticfiles/pasted-20260206-044350-8c65cfaa.png diff --git a/accounting/__pycache__/views.cpython-311.pyc b/accounting/__pycache__/views.cpython-311.pyc index 86bed7d00766568c78139ff1eebd6a82a3778bc9..c4192dc6b4592adbcae0102dc6a5acc4024b0be4 100644 GIT binary patch delta 870 zcmZ9JQAkr!7{|}K^WJUF-7Vd6ZIa%~=2FL&)0J;VY)-OX41ylU+Fd!)X~!EB81|qQ zNe^`-EXx;Tr4CGnFdw7nt=i;DH1wgOr+S!K1U*FO+cd}z&X523{@?fAd(K%KTplt$ zH5$tii?cVz;;W0s@0A8U+iBR^Y{E3*^qf$%;Fm(i3fNmAb16*{BQ(!eDNVE2~@`jLl+ljAe-%ERG&^)R@HWrf3wp=u}nfaUC&0RR=>} z7fB=rl!y`|@MU6#oOzJM&c~E!ZXw0qnjUL;$%AMnBj3B?UE#64D3;QNpkb!Opc|WNUt

Iud30}qE2c#H+JFBqHl*D9 delta 579 zcmdm4e5ZhSIWI340}vd_Ys?hg$oolXvOOOsQxC)BL?eUA^ThckXR1h8r!XyJVqjPe z#1K%+Si%WoGceRJq%fzj)G%f;E@K9&0%8aVX3%8yn><~_RGGDi8z@xd2qFSNgd2!p z0TP-_MeZPW{A2-9MY9AT6C_n^2P7I8p7Kdu;ZwTKr*?@??INGX6+VsYe1@0!3^%Cn zFulm|$2Nl*ucV z6xr&50!4L`FDU7;wgQ<=o0*l5FtZhdL`x>0RkP4;1Tn$x;)J-%A0*HYA|R?jENKwY zG}%DioV6RsoV__mJ(-n7ld;HY@Yi|$6o z)055gHZq=>{6g>$&+vDn+r?81*-%Ye+AoA;O=WHe0xiGqTo2;}b~ zkh6a*#4iq;-29Z%oK(A_O`A8FM=(k - {% for entry in entries %} -

-
-
- {% trans "Date" %}: {{ entry.date }} - {% trans "Reference" %}: {{ entry.reference }} -
-
#{{ entry.id }}
-
-
-

{% trans "Description" %}: {{ entry.description }}

+
+
- +
- - - + + + + + + - {% for item in entry.items.all %} + {% for entry in entries %} + - + + + - + + + + + {% empty %} + + {% endfor %} @@ -58,12 +100,5 @@ - {% empty %} -
-
-

{% trans "No journal entries found." %}

-
-
- {% endfor %} {% endblock %} \ No newline at end of file diff --git a/accounting/views.py b/accounting/views.py index 4eee8dd..43f269a 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -69,7 +69,10 @@ def account_create_update(request, pk=None): @login_required def journal_entries(request): - entries = JournalEntry.objects.all().order_by('-date', '-id') + entries = JournalEntry.objects.annotate( + total_debit=Sum('items__amount', filter=Q(items__type='debit')), + total_credit=Sum('items__amount', filter=Q(items__type='credit')) + ).prefetch_related('items__account').order_by('-date', '-id') return render(request, 'accounting/journal_entries.html', {'entries': entries}) @login_required diff --git a/core/templates/base.html b/core/templates/base.html index e126f04..d566c76 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -320,6 +320,29 @@ {% endif %} + + + {% endwith %} @@ -327,85 +350,15 @@
- - -
+
{% block content %}{% endblock %}
@@ -417,15 +370,17 @@ const sidebar = document.getElementById('sidebar'); const sidebarCollapse = document.getElementById('sidebarCollapse'); - sidebarCollapse.addEventListener('click', function (e) { - e.stopPropagation(); - sidebar.classList.toggle('active'); - }); + if (sidebarCollapse) { + sidebarCollapse.addEventListener('click', function (e) { + e.stopPropagation(); + sidebar.classList.toggle('active'); + }); + } // Close sidebar when clicking outside on mobile document.addEventListener('click', function (e) { - if (window.innerWidth <= 992 && sidebar.classList.contains('active')) { - if (!sidebar.contains(e.target) && e.target !== sidebarCollapse) { + if (window.innerWidth <= 992 && sidebar && sidebar.classList.contains('active')) { + if (!sidebar.contains(e.target) && e.target !== sidebarCollapse && !sidebarCollapse.contains(e.target)) { sidebar.classList.remove('active'); } } diff --git a/core/templates/core/invoice_detail.html b/core/templates/core/invoice_detail.html index cbd00db..222d2e6 100644 --- a/core/templates/core/invoice_detail.html +++ b/core/templates/core/invoice_detail.html @@ -31,18 +31,18 @@ -
+
{% trans "Account" %}{% trans "Debit" %}{% trans "Credit" %}{% trans "Date" %}{% trans "Ref #" %}{% trans "Description" %}{% trans "Debit" %}{% trans "Credit" %}{% trans "Actions" %}
{{ entry.date }} - {{ item.account.code }} - - {% if LANGUAGE_CODE == 'ar' %}{{ item.account.name_ar }}{% else %}{{ item.account.name_en }}{% endif %} + {% if entry.reference %} + {{ entry.reference }} + {% else %} + - + {% endif %} - {% if item.type == 'debit' %}{{ item.amount|floatformat:global_settings.decimal_places }}{% endif %} + {{ entry.description|truncatechars:60 }}{{ entry.total_debit|floatformat:global_settings.decimal_places }}{{ entry.total_credit|floatformat:global_settings.decimal_places }} + - {% if item.type == 'credit' %}{{ item.amount|floatformat:global_settings.decimal_places }}{% endif %} +
+
+
+
{% trans "Transaction Details" %} #{{ entry.id }}
+ {% trans "Created" %}: {{ entry.created_at|date:"Y-m-d H:i" }} +
+ + + + + + + + + + {% for item in entry.items.all %} + + + + + + {% endfor %} + +
{% trans "Account" %}{% trans "Debit" %}{% trans "Credit" %}
+ {{ item.account.code }} - + {% if LANGUAGE_CODE == 'ar' %}{{ item.account.name_ar }}{% else %}{{ item.account.name_en }}{% endif %} + + {% if item.type == 'debit' %}{{ item.amount|floatformat:global_settings.decimal_places }}{% endif %} + + {% if item.type == 'credit' %}{{ item.amount|floatformat:global_settings.decimal_places }}{% endif %} +
+
+
+ {% trans "No journal entries found." %}
- +
+ - - - - @@ -121,74 +121,74 @@ {% for item in sale.items.all %} - - - - + + + {% endfor %} - - + - - + {% if sale.discount > 0 %} - - + {% endif %} - - + - - + - - +
+
{% trans "Item Description" %}
وصف العنصر
+
{% trans "Unit Price" %}
سعر الوحدة
+
{% trans "Quantity" %}
الكمية
+
{% trans "Total" %}
المجموع
+ {{ settings.currency_symbol }}{{ item.unit_price|floatformat:3 }}{{ item.quantity|floatformat:2 }}{{ settings.currency_symbol }}{{ item.line_total|floatformat:3 }}
+ {{ settings.currency_symbol }}{{ sale.subtotal|floatformat:3 }}
+ {{ settings.currency_symbol }}{{ sale.vat_amount|floatformat:3 }}
+ -{{ settings.currency_symbol }}{{ sale.discount|floatformat:3 }}
+ {{ settings.currency_symbol }}{{ sale.total_amount|floatformat:3 }}
+ {{ settings.currency_symbol }}{{ sale.paid_amount|floatformat:3 }}
+ {{ settings.currency_symbol }}{{ sale.balance_due|floatformat:3 }}
-
-
+