purhchase report created by filed removed and added total leads in the dashboards

This commit is contained in:
Faheedkhan 2025-09-01 13:26:39 +03:00
parent 1b0330471a
commit e50f128d50
6 changed files with 10 additions and 7 deletions

View File

@ -169,8 +169,7 @@ class DealerSlugMiddleware:
"/ar/help_center/", "/ar/help_center/",
"/en/help_center/", "/en/help_center/",
] ]
print("------------------------------------")
print(request.path in paths)
if request.path in paths: if request.path in paths:
return None return None

View File

@ -690,6 +690,7 @@ def sales_dashboard(request,dealer_slug):
created__date__gte=start_date, created__date__gte=start_date,
created__date__lte=end_date created__date__lte=end_date
) )
total_leads=leads_filtered.count()
# ---------------------------------------------------- # ----------------------------------------------------
@ -747,6 +748,7 @@ def sales_dashboard(request,dealer_slug):
'total_new_cars_in_inventory': total_new_cars_in_inventory, 'total_new_cars_in_inventory': total_new_cars_in_inventory,
'total_used_cars_in_inventory': total_used_cars_in_inventory, 'total_used_cars_in_inventory': total_used_cars_in_inventory,
'aging_inventory_count': aging_inventory_count, 'aging_inventory_count': aging_inventory_count,
'total_leads':total_leads
} }
return render(request, 'dashboards/sales_dashboard.html', context) return render(request, 'dashboards/sales_dashboard.html', context)

View File

@ -77,7 +77,7 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="card h-100 shadow-sm border-0"> <div class="card h-100 shadow-sm border-0">
<div class="card-header bg-white border-bottom-0"> <div class="card-header bg-white border-bottom-0">
<h5 class="fw-bold mb-0 text-dark">{% trans "Top Lead Sources" %}</h5> <h5 class="fw-bold mb-0 text-dark">{% trans "Top Lead Sources" %}&nbsp;&nbsp;&nbsp;&nbsp;{% trans "Total Leads: " %}{{total_leads}}</h5>
</div> </div>
<div class="card-body d-flex align-items-center justify-content-center" <div class="card-body d-flex align-items-center justify-content-center"
style="height: 400px"> style="height: 400px">

View File

@ -269,6 +269,7 @@
</tr> </tr>
<tr> <tr>
{% if perms.inventory.add_car%}
<td colspan="2"> <td colspan="2">
{% if not car.get_transfer %} {% if not car.get_transfer %}
<a href="{% url 'car_finance_update' request.dealer.slug car.slug %}" <a href="{% url 'car_finance_update' request.dealer.slug car.slug %}"
@ -277,11 +278,14 @@
<span class="badge bg-danger">{% trans "Cannot Edit, Car in Transfer." %}</span> <span class="badge bg-danger">{% trans "Cannot Edit, Car in Transfer." %}</span>
{% endif %} {% endif %}
</td> </td>
{% endif %}
</tr> </tr>
{% else %} {% else %}
{% if perms.inventory.add_car%}
<p>{% trans "No finance details available." %}</p> <p>{% trans "No finance details available." %}</p>
<a href="{% url 'car_finance_update' request.dealer.slug car.slug %}" <a href="{% url 'car_finance_update' request.dealer.slug car.slug %}"
class="btn btn-phoenix-success btn-sm mb-3">{% trans "Add" %}</a> class="btn btn-phoenix-success btn-sm mb-3">{% trans "Add" %}</a>
{% endif %}
{% endif %} {% endif %}
</table> </table>
</div> </div>

View File

@ -98,7 +98,6 @@
<th scope="col">{% trans 'Status' %}</th> <th scope="col">{% trans 'Status' %}</th>
<th scope="col">{% trans 'PO Amount' %}</th> <th scope="col">{% trans 'PO Amount' %}</th>
<th scope="col">{% trans 'Date Fulfilled' %}</th> <th scope="col">{% trans 'Date Fulfilled' %}</th>
<th scope="col">{% trans 'Created By' %}</th>
<th scope="col">{% trans 'Cars Purchased' %}</th> <th scope="col">{% trans 'Cars Purchased' %}</th>
<th scope="col">{% trans 'Vendor' %}</th> <th scope="col">{% trans 'Vendor' %}</th>
</tr> </tr>
@ -117,7 +116,6 @@
{% trans 'Not fulfilled' %} {% trans 'Not fulfilled' %}
{% endif %} {% endif %}
</td> </td>
<td>{% firstof po.created_by.get_full_name 'staff' %}</td>
<td>{{ po.po_quantity }}</td> <td>{{ po.po_quantity }}</td>
<td>{{ po.vendors_str }}</td> <td>{{ po.vendors_str }}</td>
</tr> </tr>

View File

@ -122,9 +122,9 @@
<div class="row d-flex justify-content-center align-items-center mt-5 mb-3 ms-6 ps-3"> <div class="row d-flex justify-content-center align-items-center mt-5 mb-3 ms-6 ps-3">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
{% if not items %} {% if not items.car %}
{% url "car_add" request.dealer.slug as create_car_url %} {% url "car_add" request.dealer.slug as create_car_url %}
{% include "message-illustration.html" with value1="Please add at least one car before creating a quotation." value2="Add car" message_image="images/logos/no-content-new.jpg" url=create_car_url %} {% include "message-illustration.html" with value1="Please add at least one car or complete the car info before creating a quotation." value2="Add car" message_image="images/logos/no-content-new.jpg" url=create_car_url %}
{% endif %} {% endif %}
</div> </div>
<div class="col"> <div class="col">