Search fixes #167

Merged
ismail merged 7 commits from frontend into main 2025-08-03 14:26:59 +03:00
33 changed files with 159 additions and 190 deletions

View File

@ -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},
),
),
)

View File

@ -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'

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 MiB

View File

@ -282,9 +282,9 @@
</div>
</div>
</section>
<section class="pt-lg-0 pt-xl-8">
{% include 'footer.html' %}
</section>
<script src="{% static 'js/phoenix.js' %}"></script>
{% endblock content %}
{% block customJS %}

View File

@ -5,7 +5,8 @@
{{ _("Leads") |capfirst }}
{% endblock title %}
{% block content %}
{% if page_obj.object_list %}
{% if page_obj.object_list or request.GET.q%}
<div class="row g-3 mt-4 mb-4">
<h2 class="mb-2">
{{ _("Leads") |capfirst }}
@ -32,7 +33,7 @@
<div class="row g-3">
<div class="col-12">
{% if page_obj.object_list %}
{% if page_obj.object_list or request.GET.q%}
<div class="table-responsive scrollbar mx-n1 px-1">
<table class="table align-items-center table-flush table-hover">
<thead>
@ -244,6 +245,10 @@
{% endif %}
</td>
</tr>
{% empty %}
<tr>
<td colspan="6" class="text-center">{% trans "No Leads found." %}</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -178,9 +178,9 @@
<div class="d-flex flex-wrap justify-content-between mb-2">
<h5 class="mb-0 text-body-highlight me-2">{{ _("Invoice") }}</h5>
</div>
{% if opportunity.estimate.invoice %}
{% if opportunity.estimate.invoicemodel_set.all %}
<a class="dropdown-item"
href="{% url 'invoice_detail' request.dealer.slug request.entity.slug opportunity.estimate.invoice.pk %}">{{ _("View Invoice") }}</a>
href="{% url 'invoice_detail' request.dealer.slug request.entity.slug opportunity.estimate.invoicemodel_set.first.pk %}">{{ _("View Invoice") }}</a>
{% else %}
<p>{{ _("No Invoice") }}</p>
{% endif %}
@ -1020,7 +1020,7 @@
</div>
<div class="tab-pane fade"
id="tab-activity"
hx-get="{% url 'lead_detail' request.dealer.slug lead.slug %}"
hx-get="{% url 'opportunity_detail' request.dealer.slug opportunity.slug %}"
hx-trigger="htmx:afterRequest from:"
hx-select="#tab-activity"
hx-target="this"

View File

@ -5,7 +5,7 @@
{{ _("Opportunities") }}
{% endblock title %}
{% block content %}
{% if opportunities %}
{% if opportunities or request.GET.q%}
<div class="row g-3 mt-4">
<div class="col-12">
<h2 class="mb-3">

View File

@ -6,7 +6,7 @@
{% endblock title %}
{% block vendors %}<a class="nav-link active">{{ _("Customers") |capfirst }}</a>{% endblock %}
{% block content %}
{% if customers %}
{% if customers or request.GET.q %}
<div class="row g-3 mt-4">
<h2 class="mb-2">
{{ _("Customers") |capfirst }}
@ -27,7 +27,7 @@
<div class="d-flex">{% include 'partials/search_box.html' %}</div>
</div>
</div>
{% if page_obj.object_list %}
{% if page_obj.object_list or request.GET.q%}
<div class="table-responsive scrollbar transition">
<table class="table align-items-center table-flush table-hover">
<thead>
@ -159,6 +159,11 @@
{% endif %}
</td>
</tr>
{% empty %}
<tr>
<td colspan="6" class="text-center">{% trans "No Customers found." %}</td>
</tr>
{% endfor %}
</tbody>
{% endif %}

View File

@ -11,7 +11,7 @@
<!--heading -->
<div class="row align-items-center justify-content-between g-3 mb-4">
<div class="col-auto">
<h3 class="mb-0">{% trans 'Customer details' %}</h3>
<h3 class="mb-0">{% trans 'Customer details' %}<li class="fas fa-user ms-2 text-primary"></li></h3>
</div>
<div class="col-auto">
<div class="row g-3">
@ -127,20 +127,16 @@
</div>
<div class="col-12 mt-3">
<div class="mb-6">
<div class="border-top border-bottom border-translucent"
id="customerOrdersTable"
data-list='{"valueNames":["order","total","payment_status","fulfilment_status","delivery_type","date"],"page":6,"pagination":true}'>
<div>
<div class="table-responsive scrollbar">
<table class="table table-sm fs-9 mb-0">
<thead>
<thead class="bg-body-highlight">
<tr>
<th class="sort white-space-nowrap align-middle" scope="col" data-sort="leads">{% trans 'Leads'|upper %}</th>
<th class="sort align-middle " scope="col" data-sort="opportunities">{% trans 'Opportunities'|upper %}</th>
<th class="sort align-middle " scope="col" data-sort="estimates">{% trans 'Estimates'|upper %}</th>
<th class="sort align-middle " scope="col" data-sort="sale_orders">{% trans 'Sale orders'|upper %}</th>
<th class="sort align-middle " scope="col" data-sort="invoices">{% trans 'Invoices'|upper %}</th>
<th class="sort align-middle " scope="col" data-sort="car">{% trans 'Car'|upper %}</th>
<th class="sort align-middle" scope="col" >{% trans 'Leads'|upper %}</th>
<th class="sort align-middle " scope="col" >{% trans 'Opportunities'|upper %}</th>
<th class="sort align-middle " scope="col">{% trans 'Estimates'|upper %}</th>
</tr>
</thead>
@ -148,44 +144,69 @@
{% for lead in leads %}
<tr>
<td><a href="{% url 'lead_detail' request.dealer.slug lead.slug%}">{{lead}} ({{ forloop.counter }})<a></td>
<td><a href="{$ url 'opportunity_detail' lead.opportunity.slug request.dealer.slug}">{{lead.opportunity}} ({{ forloop.counter }})</a></td>
<td><a href="{% url 'opportunity_detail' request.dealer.slug lead.opportunity.slug%}">{{lead.opportunity}} ({{ forloop.counter }})</a></td>
<td>
{% for estimate in lead.customer.customer_model.estimatemodel_set.all %}
<div class="me-2"><a href="{% url 'estimate_detail' request.dealer.slug estimate.pk %}">{{estimate}}</a></div>
<hr>
{% endfor %}
</td>
{% for estimate in lead.customer.customer_model.estimatemodel_set.all %}
<h4 class="me-2 my-1"><a href="{% url 'estimate_detail' request.dealer.slug estimate.pk %}"><span class="me-2">#{{forloop.counter }}</span>{{estimate}}</a></h4>
<table class="table table-sm">
<thead class="bg-body-highlight">
<tr>
<th class="sort align-middle " scope="col">{% trans 'Sale orders'|upper %}</th>
<th class="sort align-middle " scope="col">{% trans 'Invoices'|upper %}</th>
<th class="sort align-middle " scope="col">{% trans 'Car VIN'|upper %}</th>
</tr>
</thead>
<tbody>
<tr>
<td>
{% for sale_order in estimate.sale_orders.all %}
<div><a href={% url 'order_detail' request.dealer.slug sale_order.pk%}>{{estimate.sale_orders.first}}</a></div>
{% endfor %}
</td>
<td>
{% for estimate in lead.customer.customer_model.estimatemodel_set.all %}
<div><a href={% url 'order_detail' request.dealer.slug estimate.sale_orders.first.pk%}>{{estimate.sale_orders.first}}</a></div>
<hr>
{% endfor %}
</td>
<td>
{% for invoice in lead.customer.customer_model.invoicemodel_set.all %}
<td>
{% for invoice in estimate.invoicemodel_set.all %}
{% if invoice.is_paid %}
<span class="badge badge-phoenix fs-10 badge-phoenix-success">
<div><a href="{% url 'invoice_detail' request.dealer.slug request.entity.slug invoice.pk %}">{{invoice}}</a></div>
</span>
{%else%}
<span class="badge badge-phoenix fs-10 badge-phoenix-info">
<div><a href="{% url 'invoice_detail' request.dealer.slug request.entity.slug invoice.pk %}">{{invoice}}</a></div>
</span>
{% endif %}
{% if invoice.is_paid %}
<span class="badge badge-phoenix fs-10 badge-phoenix-success">
<div><a href="{% url 'invoice_detail' request.dealer.slug request.entity.slug invoice.pk %}">{{invoice}}</a></div>
</span>
{%else%}
<span class="badge badge-phoenix fs-10 badge-phoenix-info">
<div><a href="{% url 'invoice_detail' request.dealer.slug request.entity.slug invoice.pk %}">{{invoice}}</a></div>
</span>
{% endif %}
<hr>
{% endfor %}
{% endfor %}
</td>
<td>
<div><a href="#">{{estimate.itemtransactionmodel_set.first.item_model.name}}</a></div>
<td>
</tr>
</tbody>
</table>
<br>
{% endfor %}
</td>
<td>
{% for estimate in lead.customer.customer_model.invoicemodel_set.all %}
<div><a href="#">{{estimate.itemtransactionmodel_set.first.item_model.name}}</a></div>
<hr>
{% endfor %}
<td>
<tr>

View File

@ -7,12 +7,12 @@
<div class="row align-items-center justify-content-between g-3 mb-4">
<div class="col-auto">
<h2 class="mb-0">{% trans 'Profile' %}</h2>
<small>{{dealer.invoices}}</small>
</div>
<div class="col-auto">
<div class="row g-2 g-sm-3">
<div class="col-auto">
<a hx-boost="false" href="{% url 'order_list' %}" class="btn btn-phoenix-success"><span class="fas fa-list me-2"></span>{{ _("Orders") }}</a>
<a href="{% url 'order_list' %}" class="btn btn-phoenix-success"><span class="fas fa-clipboard-list me-2"></span>{{ _("Plans History") }}</a>
</div>
<div class="col-auto">
<a href="{% url 'billing_info' %}" class="btn btn-phoenix-info"><span class="fas fa-credit-card me-2"></span>{{ _("Billing Information") }}</a>

View File

@ -37,31 +37,33 @@
/* No specific styles for .btn-add-new or .message-box are needed here as per previous updates */
</style>
<div class="empty-state-container">
<div class="empty-state-container">
<!-- Empty State Illustration -->
{% 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 %}
<img src="{{ final_image_path }}" alt="No-empty-state-image" class="empty-state-image">
<!-- Title -->
<h3 class="empty-state-title">
<h3 class="empty-state-title">
{% blocktrans %}No {{ value}} Yet{% endblocktrans %}
</h3>
</h3>
<!-- Description -->
<p class="empty-state-text">
<p class="empty-state-text">
{% 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 %}
</p>
</p>
<!-- Call to Action Button -->
<a class="btn btn-lg btn-primary" href="{{ url }}">
<a class="btn btn-lg btn-primary" href="{{ url }}">
<i class="fa fa-plus me-2"></i>
{% blocktrans %}Create New {{value}}{% endblocktrans %}
</a>
</div>
</a>
</div>

View File

@ -7,7 +7,7 @@
{% endblock title %}
{% block content %}
{% if groups %}
{% if groups or request.GET.q%}
<section class="">
<div class="row mt-4">
<div class="col-auto">

View File

@ -25,7 +25,7 @@
{% endblock customCSS %}
{% block content %}
{% if cars%}
{% if cars or request.GET.q%}
<div class="container-fluid" id="projectSummary">
<div class="row g-3 justify-content-between align-items-end mb-4">
<div class="col-12 col-sm-auto">

View File

@ -6,7 +6,7 @@
{% block content %}
{% if expenses %}
{% if expenses or request.GET.q %}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Expenses" %} <span class="fas fa-money-bill-wave ms-2 text-primary"></span></h3>
@ -16,7 +16,7 @@
{% endif %}
</div>
{% include "partials/search_box.html" %}
{% if page_obj.object_list %}
{% if page_obj.object_list or request.GET.q%}
<div class="table-responsive px-1 scrollbar mt-3">
<table class="table align-items-center table-flush">
<thead>
@ -44,7 +44,7 @@
</tr>
{% empty %}
<tr>
<td colspan="6" class="text-center text-muted">{% trans "No Accounts Found" %}</td>
<td colspan="6" class="text-center text-muted">{% trans "No Expenses Found" %}</td>
</tr>
{% endfor %}
</tbody>

View File

@ -5,7 +5,7 @@
{% endblock title %}
{% block content %}
{% if services %}
{% if services or request.GET.q %}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Services" %}<span class="fas fa-tools text-primary ms-2"></span></h3>
@ -15,7 +15,7 @@
{% endif %}
</div>
{% include "partials/search_box.html" %}
{% if page_obj.object_list %}
{% if page_obj.object_list or request.GET.q %}
<div class="table-responsive px-1 scrollbar mt-3">
<table class="table align-items-center table-flush">
<thead>
@ -45,7 +45,7 @@
</tr>
{% empty %}
<tr>
<td colspan="6" class="text-center text-muted">{% trans "No Accounts Found" %}</td>
<td colspan="6" class="text-center text-muted">{% trans "No Services Found" %}</td>
</tr>
{% endfor %}
</tbody>

View File

@ -4,7 +4,7 @@
{{ _("Bank Accounts") }}
{% endblock title %}
{% block content %}
{% if bank_accounts %}
{% if bank_accounts or request.GET.q%}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Bank Accounts" %}<span class="fas fa-bank ms-2 text-primary"></span></h3>
@ -13,7 +13,7 @@
{% endif %}
</div>
{% include "partials/search_box.html" %}
{% if page_obj.object_list %}
{% if page_obj.object_list or request.GET.q%}
<div class="table-responsive px-1 scrollbar mt-3">
<table class="table align-items-center table-flush">
<thead>

View File

@ -11,7 +11,7 @@
{% endblock %}
{% block content %}
{% if bills %}
{% if bills or request.GET.q%}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Bills" %}<span class="fas fa-money-bills ms-2 text-primary"></span></h3>

View File

@ -12,7 +12,7 @@
{% block content %}
{% if accounts%}
{% if accounts or request.GET.q%}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class=""> {% trans "Accounts" %}<i class="fa-solid fa-book ms-2 text-primary"></i></h3>
@ -201,10 +201,10 @@
</div>
{% 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 %}
<script>

View File

@ -5,7 +5,7 @@
{% endblock title %}
{% block content %}
{% if journal_entries %}
{% if journal_entries or request.GET.q%}
<div class="modal fade"
id="confirmModal"
tabindex="-1"

View File

@ -70,10 +70,10 @@
{% for po in data %}
<tr>
<td class="ps-1">{{po.po_number}}</td>
<td>{{po.po_created}}</td>
<td>{{po.po_created|date}}</td>
<td>{{po.po_status}}</td>
<td>{{po.po_amount}}</td>
<td>{{po.date_fulfilled}}</td>
<td>{{po.po_fulfilled_date}}</td>
<td>staff</td>
<td>{{po.po_quantity}}</td>
<td>

View File

@ -2,38 +2,7 @@
{% load i18n %}
<style>
{% comment %} .empty-state-container {
background-color: #ffffff;
padding: 50px;
border-radius: 5px; /* Rounded corners */
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); /* Subtle shadow */
text-align: center;
max-width: 70rem; /* Max width for content - made wider */
width: 90%; /* Fluid width */
margin: 0px auto; /* Added margin-top and auto for horizontal centering */
max-height: 40vh; /* Added min-height to control the height */
display: flex; /* Use flexbox for vertical centering of content */
flex-direction: column; /* Stack children vertically */
justify-content: center; /* Center content vertically */
align-items: center; /* Center content horizontally */
}
.empty-state-image {
max-width: 90%; /* Responsive image size */
height: 90%;
border-radius: 10px; /* Rounded corners for image */
}
.empty-state-title {
color: #343a40; /* Dark text for title */
font-weight: 600;
margin-bottom: 15px;
}
.empty-state-text {
color: #6c757d; /* Muted text for description */
margin-bottom: 30px;
line-height: 1.6;
}
/* No specific styles for .btn-add-new or .message-box are needed here as per previous updates */ {% endcomment %}
.empty-state-container {
background-color: #ffffff;
@ -71,7 +40,7 @@
<div class="empty-state-container alert mb-2" role="alert">
<img src="{% static message_image %}" alt="message-image" class="empty-state-image mb-2">
<img src="{% static 'images/no_content/no_item.jpg' %}" alt="message-image" class="empty-state-image mb-2">
<!-- Title -->
<h3 class="empty-state-title mb-2">
{% blocktrans %}{{ value1}}{% endblocktrans %}

View File

@ -8,7 +8,7 @@
<a class="nav-link active">{% trans 'Organizations' %}</a>
{% endblock %}
{% block content %}
{% if organizations%}
{% if organizations or request.GET.q%}
<section class="pt-5 pb-9 ">
<div class="row overflow-x-auto whitespace-nowrap -mx-2 sm:mx-0">
<h2 class="mb-4">
@ -172,7 +172,12 @@
{% endif %}
</td>
</tr>
{% endfor %}
{% empty %}
<tr>
<td colspan="6" class="text-center">{% trans "No Organizations found." %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View File

@ -5,7 +5,7 @@
{% block body %}
{% block order_header %}
<h3 class="mt-4">
<i class="fa-solid fa-list me-2"></i>{% trans "List of orders" %}
{% trans "Plan Purchase History" %}<i class="fa-solid fa-clipboard-list ms-2 text-primary"></i>
</h3>
{% endblock %}
{% if object_list %}

View File

@ -4,9 +4,9 @@
{% block title %}
{# Check if an 'object' exists in the context #}
{% if object %}
{% trans 'Update Vendor' %}
{% trans 'Update Purchase Order' %}
{% else %}
{% trans 'Add New Vendor' %}
{% trans 'Create Purchase Order' %}
{% endif %}
{% endblock %}
{% block content %}

View File

@ -5,7 +5,7 @@
{% block content %}
{% if purchase_orders %}
{% if purchase_orders or request.GET.q %}
<div class="row mt-4">
<!-- Success Message -->
{% if messages %}

View File

@ -240,7 +240,9 @@
<tbody>
{% for item in data.cars %}
<tr>
<td class="align-middle"></td>
<td class="align-middle">
<img src="{{item.logo}}" width="40" height="40" class="ps-2"></img>
</td>
<td class="align-middle">{{ item.make }}</td>
<td class="align-middle">{{ item.model }}</td>
<td class="align-middle">{{ item.year }}</td>
@ -273,7 +275,7 @@
<tr class="bg-body-secondary total-sum">
<td class="align-middle ps-4 fw-semibold text-body-highlight" colspan="7">{% trans "Vat" %} ({{ data.vat }})</td>
<td class="align-middle text-start fw-semibold">
<span id="grand-total">+ {{ data.total_vat_amount|floatformat }}<span class="icon-saudi_riyal"></span></span>
<span id="">+ {{ data.total_vat_amount }}<span class="icon-saudi_riyal"></span></span>
</td>
</tr>
<tr class="bg-body-secondary total-sum">
@ -336,19 +338,14 @@
{% endblock %}
{% block customJS %}
<script>
// Initialize when page loads and after HTMX swaps
// Initialize when page loads and after HTMX swaps
document.addEventListener('DOMContentLoaded', initEstimateFunctions);
document.addEventListener('htmx:afterSwap', initEstimateFunctions);
function initEstimateFunctions() {
// Initialize calculateTotals if estimate table exists
const estimateTable = document.getElementById('estimate-table');
if (estimateTable) {
calculateTotals();
// Optional: If you need to recalculate when table content changes
estimateTable.addEventListener('change', calculateTotals);
}
// Initialize form action setter if form exists
const confirmForm = document.getElementById('confirmForm');
@ -359,6 +356,7 @@ function initEstimateFunctions() {
button.addEventListener('click', setFormActionHandler);
});
}
htmx.process(confirmForm)
}
function calculateTotals() {
@ -412,6 +410,7 @@ function setFormActionHandler(event) {
function setFormAction(action) {
const form = document.getElementById('confirmForm');
htmx.process(form)
if (!form) return;
const baseUrl = "{% url 'estimate_mark_as' request.dealer.slug estimate.pk %}";

View File

@ -4,7 +4,7 @@
{{ _("Quotations") }}
{% endblock title %}
{% block content %}
{% if estimates %}
{% if estimates or request.GET.q %}
<div class="row g-3 mt-4 mb-4">
<div class="row g-3 justify-content-between mb-4">
<div class="col-auto">

View File

@ -10,7 +10,7 @@
<div class="col-lg-8 col-md-10">
<div class="card shadow-sm border-0 rounded-3">
<div class="card-header bg-gray-200 py-3 border-0 rounded-top-3">
<h3 class="mb-0 fs-4 text-center text-white">
<h3 class="mb-0 fs-4 text-center">
{{ _("Add Invoice") }}<i class="fa-solid fa-receipt ms-2 text-primary"></i>
</h3>
</div>

View File

@ -5,7 +5,7 @@
{% endblock title %}
{% block content %}
{% if invoices %}
{% if invoices or request.GET.q%}
<div class="row mt-4">
<div class="row g-3 justify-content-between mb-4">
<div class="col-auto">

View File

@ -4,7 +4,7 @@
{%block title%} {%trans 'Sale Orders'%} {%endblock%}
{% block content %}
{% if txs %}
{% if txs or request.GET.q%}
<section class="mt-2">
<div class="row overflow-x-auto whitespace-nowrap -mx-2 sm:mx-0">

View File

@ -92,7 +92,7 @@
{{ _("Delete") }}
<i class="fas fa-trash"></i>
</button>
<a class="btn btn-sm btn-phoenix-secondary"
<a class="btn btn-sm btn-phoenix-secondary me-1"
href="{% url 'user_list' request.dealer.slug %}">
{{ _("Back to List") }}
<i class="fa-regular fa-circle-left"></i>

View File

@ -6,7 +6,7 @@
{% endblock title %}
{% block content %}
{%if users %}
{%if users or request.GET.q%}
<section class="">
<div class="row mt-4">
<div class="col-auto">

View File

@ -7,7 +7,7 @@
{% block vendors %}<a class="nav-link active">{{ _("Vendors") |capfirst }}</a>{% endblock %}
{% block content %}
{% if vendors %}
{% if vendors or request.GET.q%}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">
@ -22,7 +22,7 @@
{% endif %}
</div>
{% include "partials/search_box.html" %}
{% if page_obj.object_list %}
{% if page_obj.object_list or request.GET.q%}
<div class="table-responsive px-1 scrollbar mt-3">
<table class= "table align-items-center table-flush table-hover">
<thead>
@ -147,7 +147,7 @@
</tr>
{% empty %}
<tr>
<td colspan="6" class="text-center text-muted">{% trans "No Accounts Found" %}</td>
<td colspan="6" class="text-center text-muted">{% trans "No Vendors Found" %}</td>
</tr>
{% endfor %}
</tbody>