From 788396eee4a6750b3419c43c9e4ab7052496298d Mon Sep 17 00:00:00 2001 From: Faheedkhan Date: Wed, 30 Jul 2025 12:54:56 +0300 Subject: [PATCH 1/4] plans history ui --- inventory/views.py | 2 ++ templates/dealers/dealer_detail.html | 2 +- templates/plans/order_list.html | 2 +- templates/users/user_detail.html | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/inventory/views.py b/inventory/views.py index f8ba32eb..2d7a7533 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -10365,7 +10365,9 @@ def upload_cars(request, dealer_slug, pk=None): f"User {user_username} retrieved ItemTransactionModel PK: {pk} for car upload." ) item = get_object_or_404(ItemTransactionModel, pk=pk) + po_item = models.PoItemsUploaded.objects.get(dealer=dealer, item=item) + response = redirect("upload_cars", dealer_slug=dealer_slug, pk=pk) if po_item.status == "uploaded": messages.add_message(request, messages.ERROR, "Item already uploaded.") diff --git a/templates/dealers/dealer_detail.html b/templates/dealers/dealer_detail.html index 59bab6df..525520b7 100644 --- a/templates/dealers/dealer_detail.html +++ b/templates/dealers/dealer_detail.html @@ -11,7 +11,7 @@
{{ _("Billing Information") }} diff --git a/templates/plans/order_list.html b/templates/plans/order_list.html index 4f6f4132..7874a3ee 100644 --- a/templates/plans/order_list.html +++ b/templates/plans/order_list.html @@ -5,7 +5,7 @@ {% block body %} {% block order_header %}

- {% trans "List of orders" %} + {% trans "Plan Purchase History" %}

{% endblock %} {% if object_list %} diff --git a/templates/users/user_detail.html b/templates/users/user_detail.html index 46663f81..9246bfc9 100644 --- a/templates/users/user_detail.html +++ b/templates/users/user_detail.html @@ -92,7 +92,7 @@ {{ _("Delete") }} - {{ _("Back to List") }} -- 2.39.5 From 499de137ba11099b96233a7da58dfe384123e6e6 Mon Sep 17 00:00:00 2001 From: Faheedkhan Date: Thu, 31 Jul 2025 13:53:00 +0300 Subject: [PATCH 2/4] update --- inventory/signals.py | 2 +- inventory/views.py | 1 + templates/base.html | 2 +- .../crm/opportunities/opportunity_detail.html | 6 +++--- .../sales/estimates/estimate_detail.html | 19 +++++++++---------- templates/sales/invoices/invoice_create.html | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/inventory/signals.py b/inventory/signals.py index e62fafde..dfc90c1f 100644 --- a/inventory/signals.py +++ b/inventory/signals.py @@ -1032,7 +1032,7 @@ def po_fullfilled_notification(sender, instance, created, **kwargs): ).format( url=reverse( "purchase_order_detail", - kwargs={"dealer_slug": dealer.slug, "pk": instance.pk}, + kwargs={"dealer_slug": dealer.slug,"entity_slug":instance.entity.slug, "pk": instance.pk}, ), ), ) diff --git a/inventory/views.py b/inventory/views.py index 8c3ea172..39cb9a47 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -4798,6 +4798,7 @@ class EstimateDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView finance_data = calculator.get_finance_data() invoice_obj = InvoiceModel.objects.all().filter(ce_model=estimate).first() kwargs["data"] = finance_data + print(kwargs["data"]) kwargs["invoice"] = invoice_obj try: car_finances = estimate.get_itemtxs_data()[0].first().item_model.car.finances diff --git a/templates/base.html b/templates/base.html index 45491024..53d4dbdf 100644 --- a/templates/base.html +++ b/templates/base.html @@ -84,7 +84,7 @@ {% include "plans/expiration_messages.html" %} {% block period_navigation %} {% endblock period_navigation %} -
+
diff --git a/templates/crm/opportunities/opportunity_detail.html b/templates/crm/opportunities/opportunity_detail.html index 229bf23f..c09af69e 100644 --- a/templates/crm/opportunities/opportunity_detail.html +++ b/templates/crm/opportunities/opportunity_detail.html @@ -178,9 +178,9 @@
{{ _("Invoice") }}
- {% if opportunity.estimate.invoice %} + {% if opportunity.estimate.invoicemodel_set.all %}
{{ _("View Invoice") }} + href="{% url 'invoice_detail' request.dealer.slug request.entity.slug opportunity.estimate.invoicemodel_set.first.pk %}">{{ _("View Invoice") }} {% else %}

{{ _("No Invoice") }}

{% endif %} @@ -1020,7 +1020,7 @@
{% for item in data.cars %} - + + + {{ item.make }} {{ item.model }} {{ item.year }} @@ -273,7 +275,7 @@ {% trans "Vat" %} ({{ data.vat }}) - + {{ data.total_vat_amount|floatformat }} + + {{ data.total_vat_amount }} @@ -336,19 +338,14 @@ {% endblock %} {% block customJS %}