few fixes
This commit is contained in:
parent
56f5025c58
commit
8168753bbf
@ -881,11 +881,11 @@ class Car(Base):
|
|||||||
@property
|
@property
|
||||||
def get_additional_services_vat(self):
|
def get_additional_services_vat(self):
|
||||||
vat = VatRate.objects.filter(dealer=self.dealer,is_active=True).first()
|
vat = VatRate.objects.filter(dealer=self.dealer,is_active=True).first()
|
||||||
return sum([Decimal((x.price)*(vat.rate)) for x in self.additional_services.all()])
|
return sum([Decimal((x.price)*(vat.rate)) for x in self.additional_services.filter(taxable=True)])
|
||||||
|
|
||||||
def get_additional_services(self):
|
def get_additional_services(self):
|
||||||
vat = VatRate.objects.filter(dealer=self.dealer,is_active=True).first()
|
vat = VatRate.objects.filter(dealer=self.dealer,is_active=True).first()
|
||||||
return {"services": [[x,(x.price)*(vat.rate)] for x in self.additional_services.all()],
|
return {"services": [[x,((x.price)*(vat.rate) if x.taxable else 0)] for x in self.additional_services.all()],
|
||||||
"total_":self.get_additional_services_amount_,
|
"total_":self.get_additional_services_amount_,
|
||||||
"total":self.get_additional_services_amount,
|
"total":self.get_additional_services_amount,
|
||||||
"services_vat":self.get_additional_services_vat}
|
"services_vat":self.get_additional_services_vat}
|
||||||
|
|||||||
@ -1301,7 +1301,7 @@ def get_finance_data(estimate,dealer):
|
|||||||
additional_services = car.get_additional_services()
|
additional_services = car.get_additional_services()
|
||||||
discounted_price=(Decimal(car.marked_price) - discount)
|
discounted_price=(Decimal(car.marked_price) - discount)
|
||||||
vat_amount = discounted_price * vat.rate
|
vat_amount = discounted_price * vat.rate
|
||||||
total_services_vat=sum([ x[1] for x in additional_services.get("services")])
|
total_services_vat=sum([x[1] for x in additional_services.get("services")])
|
||||||
total_vat=vat_amount+total_services_vat
|
total_vat=vat_amount+total_services_vat
|
||||||
return {
|
return {
|
||||||
"car": car,
|
"car": car,
|
||||||
@ -1311,7 +1311,7 @@ def get_finance_data(estimate,dealer):
|
|||||||
"vat_rate": vat.rate,
|
"vat_rate": vat.rate,
|
||||||
"discount_amount": discount,
|
"discount_amount": discount,
|
||||||
"additional_services": additional_services,
|
"additional_services": additional_services,
|
||||||
"final_price": discounted_price+ vat_amount,
|
"final_price": discounted_price + vat_amount,
|
||||||
"total_services_vat":total_services_vat,
|
"total_services_vat":total_services_vat,
|
||||||
"total_vat":total_vat,
|
"total_vat":total_vat,
|
||||||
"grand_total": discounted_price + total_vat + additional_services.get("total")
|
"grand_total": discounted_price + total_vat + additional_services.get("total")
|
||||||
|
|||||||
@ -518,11 +518,12 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link px-3 d-block" href="{% url 'user_list' request.dealer.slug %}"><span class="me-2 text-body align-bottom" data-feather="users"></span>{{ _("Staff & Groups") }}</a>
|
<a class="nav-link px-3 d-block" href="{% url 'user_list' request.dealer.slug %}"><span class="me-2 text-body align-bottom" data-feather="users"></span>{{ _("Staff & Groups") }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
{% comment %} <li class="nav-item">
|
||||||
<a class="nav-link px-3 d-block" href="{% url 'dealer_activity' request.dealer.slug %}"> <span class="me-2 text-body align-bottom" data-feather="lock"></span>{{ _("Activities") }}</a>
|
<a class="nav-link px-3 d-block" href="{% url 'dealer_activity' request.dealer.slug %}"> <span class="me-2 text-body align-bottom" data-feather="lock"></span>{{ _("Activities") }}</a>
|
||||||
</li>
|
</li> {% endcomment %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
|
||||||
{% if request.is_dealer %}
|
{% if request.is_dealer %}
|
||||||
<a class="nav-link px-3 d-block" href="{% url 'dealer_settings' request.dealer.slug %}"> <span class="me-2 text-body align-bottom" data-feather="settings"></span>{{ _("Settings") }}</a>
|
<a class="nav-link px-3 d-block" href="{% url 'dealer_settings' request.dealer.slug %}"> <span class="me-2 text-body align-bottom" data-feather="settings"></span>{{ _("Settings") }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@ -280,7 +280,7 @@
|
|||||||
<tr class="bg-body-secondary total-sum">
|
<tr class="bg-body-secondary total-sum">
|
||||||
<td class="align-middle ps-4 fw-semibold text-body-highlight" colspan="7">{% trans "Vat" %} ({{ data.vat_rate }})</td>
|
<td class="align-middle ps-4 fw-semibold text-body-highlight" colspan="7">{% trans "Vat" %} ({{ data.vat_rate }})</td>
|
||||||
<td class="align-middle text-start fw-semibold">
|
<td class="align-middle text-start fw-semibold">
|
||||||
<span id="">+ {{ data.vat_amount }}<span class="icon-saudi_riyal"></span></span>
|
<span id="">+ {{ data.vat_amount|floatformat:2 }}<span class="icon-saudi_riyal"></span></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="bg-body-secondary total-sum">
|
<tr class="bg-body-secondary total-sum">
|
||||||
|
|||||||
@ -3,78 +3,129 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="card">
|
<div class="row g-4 mb-5">
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title">Need help?</h5>
|
<div class="col-12 col-lg-8">
|
||||||
<p class="card-text">Raise a ticket and we will get back to you as soon as possible.</p>
|
<div class="card h-100">
|
||||||
<a href="{% url 'create_ticket' request.dealer.slug %}" class="btn btn-phoenix-primary">Raise a Ticket</a>
|
<div class="card-body d-flex flex-column justify-content-center p-5 text-center">
|
||||||
|
<h2 class="card-title fw-bold text-primary">Need Help? We're Here for You.</h2>
|
||||||
|
<p class="card-text text-muted mb-4">
|
||||||
|
Our support team is ready to assist you with any questions or issues.
|
||||||
|
Raise a new ticket, and we'll get back to you as soon as possible.
|
||||||
|
</p>
|
||||||
|
<a href="{% url 'create_ticket' request.dealer.slug %}" class="btn btn-phoenix-primary btn-lg shadow-sm w-50 mx-auto">
|
||||||
|
Raise a New Ticket
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12 col-lg-4">
|
||||||
|
<div class="card h-100">
|
||||||
|
<div class="card-body p-4">
|
||||||
|
<h5 class="card-title fw-bold">Quick Links</h5>
|
||||||
|
<p class="card-text text-muted">Explore common resources to find answers quickly.</p>
|
||||||
|
<ul class="list-unstyled mb-0">
|
||||||
|
<li class="mb-3">
|
||||||
|
<a href="#" class="d-flex align-items-center text-decoration-none">
|
||||||
|
<span class="fs-4 text-secondary me-2"><i class="fas fa-search"></i></span>
|
||||||
|
<span class="text-dark">Search our knowledge base</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="mb-3">
|
||||||
|
<a href="#" class="d-flex align-items-center text-decoration-none">
|
||||||
|
<span class="fs-4 text-success me-2"><i class="fas fa-question-circle"></i></span>
|
||||||
|
<span class="text-dark">View frequently asked questions</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="mb-3">
|
||||||
|
<a href="#" class="d-flex align-items-center text-decoration-none">
|
||||||
|
<span class="fs-4 text-info me-2"><i class="fas fa-bell"></i></span>
|
||||||
|
<span class="text-dark">Check system status updates</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
|
<div class="alert-container mb-4">
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
|
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
|
||||||
{{ message }}
|
{{ message }}
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-header border-bottom d-flex justify-content-between align-items-center p-4">
|
||||||
<h5 class="card-title">Tickets</h5>
|
<h5 class="card-title mb-0">My Tickets</h5>
|
||||||
<div class="table-responsive">
|
<div class="input-group w-50">
|
||||||
<table class="table table-striped table-hover">
|
<input type="text" class="form-control" placeholder="Search by ID or subject..." aria-label="Search tickets">
|
||||||
<thead class="">
|
<button class="btn btn-outline-secondary" type="button">
|
||||||
<tr>
|
<i class="fas fa-search"></i>
|
||||||
<th>ID</th>
|
</button>
|
||||||
<th>Subject</th>
|
</div>
|
||||||
<th>Status</th>
|
</div>
|
||||||
<th>Priority</th>
|
<div class="card-body p-0">
|
||||||
<th>Created</th>
|
<div class="table-responsive">
|
||||||
|
<table class="table table-striped table-hover mb-0">
|
||||||
<th>Actions</th>
|
<thead class="bg-light">
|
||||||
</tr>
|
<tr>
|
||||||
</thead>
|
<th scope="col" class="text-secondary text-uppercase fw-bold">ID</th>
|
||||||
<tbody>
|
<th scope="col" class="text-secondary text-uppercase fw-bold">Subject</th>
|
||||||
{% for ticket in tickets %}
|
<th scope="col" class="text-secondary text-uppercase fw-bold">Status</th>
|
||||||
<tr>
|
<th scope="col" class="text-secondary text-uppercase fw-bold">Priority</th>
|
||||||
<td>#{{ ticket.id }}</td>
|
<th scope="col" class="text-secondary text-uppercase fw-bold">Created</th>
|
||||||
<td>{{ ticket.subject }}</td>
|
<th scope="col" class="text-secondary text-uppercase fw-bold text-end">Actions</th>
|
||||||
<td>
|
</tr>
|
||||||
<span class="badge
|
</thead>
|
||||||
{% if ticket.status == 'open' %}bg-primary
|
<tbody>
|
||||||
{% elif ticket.status == 'in_progress' %}bg-info
|
{% for ticket in tickets %}
|
||||||
{% elif ticket.status == 'resolved' %}bg-success
|
<tr>
|
||||||
{% else %}bg-secondary{% endif %}">
|
<td class="text-muted">#{{ ticket.id }}</td>
|
||||||
{{ ticket.get_status_display }}
|
<td>{{ ticket.subject }}</td>
|
||||||
</span>
|
<td>
|
||||||
</td>
|
<span class="badge
|
||||||
<td>
|
{% if ticket.status == 'open' %}bg-primary
|
||||||
<span class="badge
|
{% elif ticket.status == 'in_progress' %}bg-info
|
||||||
{% if ticket.priority == 'low' %}bg-success
|
{% elif ticket.status == 'resolved' %}bg-success
|
||||||
{% elif ticket.priority == 'medium' %}bg-warning
|
{% else %}bg-secondary{% endif %}">
|
||||||
{% elif ticket.priority == 'high' %}bg-danger
|
{{ ticket.get_status_display }}
|
||||||
{% else %}bg-dark{% endif %}">
|
</span>
|
||||||
{{ ticket.get_priority_display }}
|
</td>
|
||||||
</span>
|
<td>
|
||||||
</td>
|
<span class="badge
|
||||||
<td>{{ ticket.created_at|date:"M d, Y H:i" }}</td>
|
{% if ticket.priority == 'low' %}bg-success
|
||||||
|
{% elif ticket.priority == 'medium' %}bg-warning
|
||||||
<td>
|
{% elif ticket.priority == 'high' %}bg-danger
|
||||||
<a href="{% url 'ticket_detail' request.dealer.slug ticket.id %}" class="btn btn-sm btn-outline-primary">
|
{% else %}bg-dark{% endif %}">
|
||||||
View
|
{{ ticket.get_priority_display }}
|
||||||
</a>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
<td>{{ ticket.created_at|date:"M d, Y" }} <span class="text-muted small">{{ ticket.created_at|time:"H:i" }}</span></td>
|
||||||
{% empty %}
|
<td class="text-end">
|
||||||
<tr>
|
<a href="{% url 'ticket_detail' request.dealer.slug ticket.id %}" class="btn btn-sm btn-outline-primary">
|
||||||
<td colspan="6" class="text-center">No tickets found.</td>
|
View
|
||||||
</tr>
|
</a>
|
||||||
{% endfor %}
|
</td>
|
||||||
</tbody>
|
</tr>
|
||||||
</table>
|
{% empty %}
|
||||||
</div>
|
<tr>
|
||||||
</div>
|
<td colspan="6" class="text-center text-muted py-5">
|
||||||
|
<i class="fas fa-ticket-alt fs-2 mb-3"></i>
|
||||||
|
<p class="mb-0">No tickets found.</p>
|
||||||
|
<p class="text-muted small">All your past and present tickets will appear here.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Loading…
x
Reference in New Issue
Block a user