From dcd30b0bb26d8bbfb370d4600c29d8d344663385 Mon Sep 17 00:00:00 2001 From: Faheedkhan Date: Wed, 20 Aug 2025 20:23:03 +0300 Subject: [PATCH] ui changes --- inventory/views.py | 5 +- templates/bill/bill_detail.html | 24 ++++-- templates/chart_of_accounts/coa_create.html | 6 +- templates/chart_of_accounts/coa_list.html | 10 +-- templates/chart_of_accounts/coa_update.html | 10 +-- .../chart_of_accounts/includes/coa_card.html | 73 ++++++++++--------- .../includes/po_item_formset.html | 4 +- templates/staff/staff_detail.html | 2 +- templates/users/user_detail.html | 11 ++- templates/users/user_form.html | 1 - templates/users/user_list.html | 6 +- templates/vendors/view_vendor.html | 46 +++++++++++- 12 files changed, 130 insertions(+), 68 deletions(-) diff --git a/inventory/views.py b/inventory/views.py index a151b5f2..5bfca83b 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -2813,12 +2813,15 @@ def vendorDetailView(request, dealer_slug, slug): """ dealer = get_object_or_404(models.Dealer, slug=dealer_slug) vendor = get_object_or_404(models.Vendor, slug=slug,dealer=dealer) + cars=vendor.cars.all() + total_cars_from_vendor=cars.count() + vendor_makes=cars.values('id_car_make__name').annotate(make_count=Count('id_car_make__name')) vendor_bills=BillModel.objects.filter(vendor=vendor.vendor_model) paginator=Paginator(vendor_bills,20) page_number = request.GET.get("page") page_obj=paginator.get_page(page_number) return render( - request, template_name="vendors/view_vendor.html", context={"vendor": vendor,"vendor_bills":page_obj} + request, template_name="vendors/view_vendor.html", context={"vendor": vendor,"vendor_bills":page_obj,"total_cars_from_vendor":total_cars_from_vendor,"vendor_makes":vendor_makes} ) diff --git a/templates/bill/bill_detail.html b/templates/bill/bill_detail.html index a350d14a..786a4561 100644 --- a/templates/bill/bill_detail.html +++ b/templates/bill/bill_detail.html @@ -20,8 +20,12 @@
{% trans 'Cash Account' %}: - {{ bill.cash_account.code }} + {% else %} + {{ bill.cash_account.code }} + {% endif %}

{% currency_symbol %}{{ bill.get_amount_cash | absolute | currency_format }} @@ -33,10 +37,14 @@

{% trans 'Prepaid Account' %}: - {{ bill.prepaid_account.code }} + {% else %} + {{ bill.prepaid_account.code }} + {% endif %}

{% currency_symbol %}{{ bill.get_amount_prepaid | currency_format }} @@ -47,10 +55,14 @@

{% trans 'Accounts Payable' %}: - - {{ bill.unearned_account.code }} - + {% if bill.unearned_account %} + + {{ bill.unearned_account.code }} + + {% else %} + {{ bill.unearned_account.code }} + {% endif %}

{% currency_symbol %}{{ bill.get_amount_unearned | currency_format }} diff --git a/templates/chart_of_accounts/coa_create.html b/templates/chart_of_accounts/coa_create.html index d8fef027..f5c9bd26 100644 --- a/templates/chart_of_accounts/coa_create.html +++ b/templates/chart_of_accounts/coa_create.html @@ -39,9 +39,9 @@ -
- - + diff --git a/templates/chart_of_accounts/coa_list.html b/templates/chart_of_accounts/coa_list.html index 574798e6..09f2c205 100644 --- a/templates/chart_of_accounts/coa_list.html +++ b/templates/chart_of_accounts/coa_list.html @@ -9,18 +9,18 @@
{% if not inactive %} - + {% trans 'Show Inactive' %} {% else %} - + {% trans 'Show Active' %} {% endif %} diff --git a/templates/chart_of_accounts/coa_update.html b/templates/chart_of_accounts/coa_update.html index 75ed24aa..433fd0b4 100644 --- a/templates/chart_of_accounts/coa_update.html +++ b/templates/chart_of_accounts/coa_update.html @@ -32,13 +32,13 @@
-
- - - Back + {% trans 'Back'%}
diff --git a/templates/chart_of_accounts/includes/coa_card.html b/templates/chart_of_accounts/includes/coa_card.html index 35afd177..54d1f817 100644 --- a/templates/chart_of_accounts/includes/coa_card.html +++ b/templates/chart_of_accounts/includes/coa_card.html @@ -3,33 +3,37 @@ {% now "Y" as current_year %}
-
-
-
- -
-
+
+
+ +
+
+
{{ coa_model.name }} {% if coa_model.is_default %} - {% trans 'DEFAULT' %} + {% trans 'DEFAULT' %} {% endif %} -
+

+ {% if coa_model.is_default %} + {% trans 'DEFAULT' %} + {% endif %} + +
+ {% if coa_model.is_active %} + {% trans 'Active' %} + {% else %} + {% trans 'Inactive' %} + {% endif %} + {% if coa_model.is_default %} + {% trans 'Entity Default' %} + {% endif %}
-
-
- {% trans 'Entity Default' %}: - {% if coa_model.is_default %} - - {% else %} - - {% endif %} -
- -
+
+
{% trans 'Is Active' %}: {% if coa_model.is_active %} @@ -37,14 +41,13 @@ {% endif %}
-
CoA ID: {{ coa_model.slug }}
-
+
{% trans 'Total Accounts' %}: {{ coa_model.accountmodel_total__count }} @@ -64,50 +67,50 @@
-
-
- +
+
+ {% trans 'Created' %}: - {{ coa_model.created|date }} + {{ coa_model.created|date }}
-
- +
+ {% trans 'Updated' %}: - {{ coa_model.created|timesince }} {% trans 'ago' %} + {{ coa_model.created|timesince }} {% trans 'ago' %}
- diff --git a/templates/vendors/view_vendor.html b/templates/vendors/view_vendor.html index 71fc867d..b9cdea7d 100644 --- a/templates/vendors/view_vendor.html +++ b/templates/vendors/view_vendor.html @@ -3,14 +3,17 @@ {% block title %} {% trans "View Vendor" %} {% endblock title %} +{% block customCSS %} +{% endblock %} {% block content %} +

{% trans "Vendor Details" %}

-
+
{% if vendor.logo%}{% endif %}
@@ -37,7 +40,7 @@
-
+
  • {% trans "Name" %}: {{ vendor.get_local_name }}
  • @@ -55,6 +58,43 @@
+ +
+ + +
+ + + + + + + + + + {% for make in vendor_makes%} + + + + + + {% empty %} + + + + + + + + {% endfor %} + + + +
{% trans "Make" %}{% trans "Total Cars Purchased" %}
{{ make.id_car_make__name }}{{make.make_count}}
{% trans "There is no Purchase from this vendor yet" %}
+
+ + +
@@ -86,7 +126,7 @@ {% empty %} - {% trans "No Bills Found For the Vendor: {vendor.get_local_name}" %} + {% trans "No Bills Found For the Vendor : " %}{{vendor.get_local_name}} {% endfor %}