diff --git a/inventory/signals.py b/inventory/signals.py index 4276d69e..30ee0c29 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 a1622737..434a540b 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 @@ -7463,7 +7464,8 @@ class BillListView(LoginRequiredMixin, PermissionRequiredMixin, ListView): qs = dealer.entity.get_bills() query = self.request.GET.get("q") if query: - qs = qs.filter(vendor__vendor_name__icontains=query) + qs = qs.filter(Q(bill_number__icontains=query)| + Q(vendor__vendor_name__icontains=query)) return qs def get_context_data(self, **kwargs): @@ -10151,49 +10153,10 @@ def InventoryItemCreateView(request, dealer_slug): ) -# def inventory_items_filter(request): -# year = request.GET.get("year") -# make = request.GET.get("make") -# model = request.GET.get("model") -# serie = request.GET.get("serie") - -# # Get all makes for initial dropdown -# makes = models.CarMake.objects.all() -# print(make) -# model_data = models.CarModel.objects.none() -# serie_data = models.CarSerie.objects.none() -# trim_data = models.CarTrim.objects.none() - -# if make: -# make_obj = models.CarMake.objects.get(pk=int(make)) -# model_data = make_obj.carmodel_set.all() -# if model: -# model_obj = models.CarModel.objects.get(pk=model) -# serie_data = model_obj.carserie_set.all() -# if year: -# serie_data = serie_data.filter(year_begin__lte=year, year_end__gte=year) -# if serie: -# serie_obj = models.CarSerie.objects.get(pk=serie) -# trim_data = serie_obj.cartrim_set.all() - -# # Generate year choices (adjust range as needed) -# current_year = datetime.now().year -# year_choices = range(current_year, current_year - 10, -1) - -# context = { -# "makes": makes, -# "model_data": model_data, -# "serie_data": serie_data, -# "trim_data": trim_data, -# "year_choices": year_choices, -# "selected_make": make, -# "selected_model": model, -# "selected_serie": serie, -# "selected_year": year, -# } -# return render(request, "cars/partials/recall_filter_form.html", context) @login_required -def inventory_items_filter(request,dealer_slug=None): +@permission_required("django_ledger.view_purchaseordermodel", raise_exception=True) +def inventory_items_filter(request, dealer_slug): + dealer = get_object_or_404(models.Dealer, slug=dealer_slug) year = request.GET.get("year", None) make = request.GET.get("make") model = request.GET.get("model") @@ -10410,7 +10373,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.") @@ -10648,7 +10613,7 @@ def purchase_report_view(request,dealer_slug): po_quantity=0 for item in items: po_amount+=item["total"] - po_quantity+=item["q"] + po_quantity+=item["q"] total_po_amount+=po_amount total_po_cars+=po_quantity @@ -10804,8 +10769,6 @@ def staff_password_reset_view(request, dealer_slug, user_pk): form = forms.CustomSetPasswordForm(staff.user) return render(request, 'users/user_password_reset.html', {'form': form}) - - class RecallListView(ListView): model = models.Recall template_name = 'recalls/recall_list.html' diff --git a/static/images/no_content/no_search_results.png b/static/images/no_content/no_search_results.png new file mode 100644 index 00000000..a360db49 Binary files /dev/null and b/static/images/no_content/no_search_results.png differ diff --git a/templates/account/signup-wizard.html b/templates/account/signup-wizard.html index 52dac1a7..e96b99c5 100644 --- a/templates/account/signup-wizard.html +++ b/templates/account/signup-wizard.html @@ -282,9 +282,9 @@ -
+ {% include 'footer.html' %} -
+ {% endblock content %} {% block customJS %} diff --git a/templates/crm/leads/lead_list.html b/templates/crm/leads/lead_list.html index fafcb832..2592ffa1 100644 --- a/templates/crm/leads/lead_list.html +++ b/templates/crm/leads/lead_list.html @@ -5,7 +5,8 @@ {{ _("Leads") |capfirst }} {% endblock title %} {% block content %} -{% if page_obj.object_list %} + +{% if page_obj.object_list or request.GET.q%}

{{ _("Leads") |capfirst }} @@ -32,7 +33,7 @@
- {% if page_obj.object_list %} + {% if page_obj.object_list or request.GET.q%}
@@ -244,6 +245,10 @@ {% endif %} + {% empty %} + + + {% endfor %}
{% trans "No Leads found." %}
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 @@

diff --git a/templates/customers/customer_list.html b/templates/customers/customer_list.html index be208c67..15aee501 100644 --- a/templates/customers/customer_list.html +++ b/templates/customers/customer_list.html @@ -6,7 +6,7 @@ {% endblock title %} {% block vendors %}{{ _("Customers") |capfirst }}{% endblock %} {% block content %} -{% if customers %} +{% if customers or request.GET.q %}

{{ _("Customers") |capfirst }} @@ -27,7 +27,7 @@
{% include 'partials/search_box.html' %}

- {% if page_obj.object_list %} + {% if page_obj.object_list or request.GET.q%}
@@ -159,6 +159,11 @@ {% endif %} + {% empty %} + + + + {% endfor %} {% endif %} diff --git a/templates/customers/view_customer.html b/templates/customers/view_customer.html index cbd38052..4dbb73ed 100644 --- a/templates/customers/view_customer.html +++ b/templates/customers/view_customer.html @@ -11,7 +11,7 @@
-

{% trans 'Customer details' %}

+

{% trans 'Customer details' %}
  • @@ -127,20 +127,16 @@
    + -
    +
    {% trans "No Customers found." %}
    - + - - - - - - + + + @@ -148,44 +144,69 @@ {% for lead in leads %} - + + {% for estimate in lead.customer.customer_model.estimatemodel_set.all %} +

    #{{forloop.counter }}{{estimate}}

    + + + +
    {% trans 'Leads'|upper %}{% trans 'Opportunities'|upper %}{% trans 'Estimates'|upper %}{% trans 'Sale orders'|upper %}{% trans 'Invoices'|upper %}{% trans 'Car'|upper %}{% trans 'Leads'|upper %}{% trans 'Opportunities'|upper %}{% trans 'Estimates'|upper %}
    {{lead}} ({{ forloop.counter }}){{lead.opportunity}} ({{ forloop.counter }}){{lead.opportunity}} ({{ forloop.counter }}) - - {% for estimate in lead.customer.customer_model.estimatemodel_set.all %} - -
    - {% endfor %} -
    + + + + + + + + + + + + - - + + + + +
    {% trans 'Sale orders'|upper %}{% trans 'Invoices'|upper %}{% trans 'Car VIN'|upper %}
    + {% for sale_order in estimate.sale_orders.all %} + + + {% endfor %} + - {% for estimate in lead.customer.customer_model.estimatemodel_set.all %} - -
    - {% endfor %} -
    - {% for invoice in lead.customer.customer_model.invoicemodel_set.all %} + + {% for invoice in estimate.invoicemodel_set.all %} - {% if invoice.is_paid %} - - - - {%else%} - - - - {% endif %} + {% if invoice.is_paid %} + + + + {%else%} + + + + {% endif %} -
    - {% endfor %} + + {% endfor %} +
    + + + + + + + +
    +
    + {% endfor %} - - {% for estimate in lead.customer.customer_model.invoicemodel_set.all %} - -
    - {% endfor %} - + + + + diff --git a/templates/dealers/dealer_detail.html b/templates/dealers/dealer_detail.html index 7a1730d7..45a078b9 100644 --- a/templates/dealers/dealer_detail.html +++ b/templates/dealers/dealer_detail.html @@ -7,12 +7,12 @@

    {% trans 'Profile' %}

    - {{dealer.invoices}} +
    {{ _("Billing Information") }} diff --git a/templates/empty-illustration-page.html b/templates/empty-illustration-page.html index f6e687be..31d704ac 100644 --- a/templates/empty-illustration-page.html +++ b/templates/empty-illustration-page.html @@ -37,31 +37,33 @@ /* No specific styles for .btn-add-new or .message-box are needed here as per previous updates */ -
    + +
    - {% if image %} + {% if image %} {% static image as final_image_path %} - {% else %} - {% static 'images/no_content/no_item.jpg' as final_image_path %} - {% endif %} + {% else %} + {% static 'images/no_content/no_item.jpg' as final_image_path %} + {% endif %} No-empty-state-image -

    +

    {% blocktrans %}No {{ value}} Yet{% endblocktrans %} -

    +

    -

    +

    {% blocktrans %}It looks like you haven't added any {{ value }} to your account. Click the button below to get started and add your first {{ value }}!{% endblocktrans %} -

    +

    - + {% blocktrans %}Create New {{value}}{% endblocktrans %} - -
    + + + diff --git a/templates/groups/group_list.html b/templates/groups/group_list.html index 6d16d103..85110d8a 100644 --- a/templates/groups/group_list.html +++ b/templates/groups/group_list.html @@ -7,7 +7,7 @@ {% endblock title %} {% block content %} -{% if groups %} +{% if groups or request.GET.q%}
    diff --git a/templates/inventory/car_list_view.html b/templates/inventory/car_list_view.html index 18dca3c1..ffa5d3e2 100644 --- a/templates/inventory/car_list_view.html +++ b/templates/inventory/car_list_view.html @@ -25,7 +25,7 @@ {% endblock customCSS %} {% block content %} - {% if cars%} + {% if cars or request.GET.q%}
    diff --git a/templates/items/expenses/expenses_list.html b/templates/items/expenses/expenses_list.html index 7e015a4f..1fcb90c4 100644 --- a/templates/items/expenses/expenses_list.html +++ b/templates/items/expenses/expenses_list.html @@ -6,7 +6,7 @@ {% block content %} -{% if expenses %} +{% if expenses or request.GET.q %}

    {% trans "Expenses" %}

    @@ -16,7 +16,7 @@ {% endif %}
    {% include "partials/search_box.html" %} - {% if page_obj.object_list %} + {% if page_obj.object_list or request.GET.q%}
    @@ -44,7 +44,7 @@ {% empty %} - + {% endfor %} diff --git a/templates/items/service/service_list.html b/templates/items/service/service_list.html index 8b637f47..aa472e9f 100644 --- a/templates/items/service/service_list.html +++ b/templates/items/service/service_list.html @@ -5,7 +5,7 @@ {% endblock title %} {% block content %} -{% if services %} +{% if services or request.GET.q %}

    {% trans "Services" %}

    @@ -15,7 +15,7 @@ {% endif %}
    {% include "partials/search_box.html" %} - {% if page_obj.object_list %} + {% if page_obj.object_list or request.GET.q %}
    {% trans "No Accounts Found" %}{% trans "No Expenses Found" %}
    @@ -45,7 +45,7 @@ {% empty %} - + {% endfor %} diff --git a/templates/ledger/bank_accounts/bank_account_list.html b/templates/ledger/bank_accounts/bank_account_list.html index ec3badd9..0049bf7b 100644 --- a/templates/ledger/bank_accounts/bank_account_list.html +++ b/templates/ledger/bank_accounts/bank_account_list.html @@ -4,7 +4,7 @@ {{ _("Bank Accounts") }} {% endblock title %} {% block content %} -{% if bank_accounts %} +{% if bank_accounts or request.GET.q%}

    {% trans "Bank Accounts" %}

    @@ -13,7 +13,7 @@ {% endif %}
    {% include "partials/search_box.html" %} - {% if page_obj.object_list %} + {% if page_obj.object_list or request.GET.q%}
    {% trans "No Accounts Found" %}{% trans "No Services Found" %}
    diff --git a/templates/ledger/bills/bill_list.html b/templates/ledger/bills/bill_list.html index c3041657..383167c2 100644 --- a/templates/ledger/bills/bill_list.html +++ b/templates/ledger/bills/bill_list.html @@ -11,7 +11,7 @@ {% endblock %} {% block content %} -{% if bills %} +{% if bills or request.GET.q%}

    {% trans "Bills" %}

    diff --git a/templates/ledger/coa_accounts/account_list.html b/templates/ledger/coa_accounts/account_list.html index b3f5730a..32d1b973 100644 --- a/templates/ledger/coa_accounts/account_list.html +++ b/templates/ledger/coa_accounts/account_list.html @@ -12,7 +12,7 @@ {% block content %} -{% if accounts%} +{% if accounts or request.GET.q%}

    {% trans "Accounts" %}

    @@ -201,10 +201,10 @@
    {% else %} - -{% endif %} - {% url "account_create" request.dealer.slug as create_account_url %} + {% url "account_create" request.dealer.slug as create_account_url %} {% include "empty-illustration-page.html" with value="account" url=create_account_url %} +{% endif %} + {% endblock %} {% block customerJS %}