Merge pull request 'Empty state PAGE' (#148) from frontend into main

Reviewed-on: #148
This commit is contained in:
ismail 2025-07-27 17:15:53 +03:00
commit e8deb08818
33 changed files with 383 additions and 380 deletions

View File

@ -589,10 +589,11 @@ class AdditionalServices(models.Model, LocalizedNameMixin):
verbose_name_plural = _("Additional Services")
def __str__(self):
return self.name + " - " + str(self.price)
return self.name + " - " + str(self.price_)
class Car(Base):
item_model = models.OneToOneField(
ItemModel,
models.DO_NOTHING,

View File

@ -2266,6 +2266,49 @@ class CustomerListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
return context
# class CustomerDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
# """
# CustomerDetailView handles retrieving and presenting detailed information about
# a specific customer. It ensures that the user is authenticated and has the
# necessary permissions before accessing the customer's details. This view
# provides context data including estimates and invoices related to the customer.
# :ivar model: The model associated with the view.
# :type model: CustomerModel
# :ivar template_name: The path to the template used for rendering the view.
# :type template_name: str
# :ivar context_object_name: The name of the variable in the template context
# for the object being viewed.
# :type context_object_name: str
# :ivar permission_required: The list of permissions required to access this view.
# :type permission_required: list[str]
# """
# model = models.Customer
# template_name = "customers/view_customer.html"
# context_object_name = "customer"
# permission_required = ["inventory.view_customer"]
# def get_context_data(self, **kwargs):
# dealer = get_user_type(self.request)
# entity = dealer.entity
# context = super().get_context_data(**kwargs)
# context["notes"] = models.Notes.objects.filter(
# dealer=dealer,
# content_type__model="customer", object_id=self.object.id
# )
# estimates = entity.get_estimates().filter(customer=self.object.customer_model)
# invoices = entity.get_invoices().filter(customer=self.object.customer_model)
# total = estimates.count() + invoices.count()
# context["estimates"] = estimates
# context["invoices"] = invoices
# context["total"] = total
# context["note_form"] = forms.NoteForm()
# return context
class CustomerDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
"""
CustomerDetailView handles retrieving and presenting detailed information about
@ -2300,6 +2343,8 @@ class CustomerDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView
)
estimates = entity.get_estimates().filter(customer=self.object.customer_model)
invoices = entity.get_invoices().filter(customer=self.object.customer_model)
context['leads']=self.object.customer_leads.all()
total = estimates.count() + invoices.count()
@ -4830,7 +4875,7 @@ def create_sale_order(request, dealer_slug, pk):
estimate.save()
for item in estimate.get_itemtxs_data()[0].all():
try:
item.item_model.additional_info["car_info"]["status"] = "sold"
# item.item_model.additional_info["car_info"]["status"] = "sold"
item.item_model.save()
logger.debug(
f"Car status updated to 'sold' for item.item_model PK: {getattr(item.item_model, 'pk', 'N/A')}."
@ -7180,8 +7225,8 @@ class ItemServiceCreateView(
dealer = get_user_type(self.request)
vat = models.VatRate.objects.get(dealer=dealer, is_active=True)
form.instance.dealer = dealer
if form.instance.taxable:
form.instance.price = (form.instance.price * vat.rate) + form.instance.price
# if form.instance.taxable:
# form.instance.price = (form.instance.price * vat.rate) + form.instance.price
return super().form_valid(form)
def get_success_url(self):
@ -7229,8 +7274,8 @@ class ItemServiceUpdateView(
dealer = get_user_type(self.request)
vat = models.VatRate.objects.get(dealer=dealer, is_active=True)
form.instance.dealer = dealer
if form.instance.taxable:
form.instance.price = (form.instance.price * vat.rate) + form.instance.price
# if form.instance.taxable:
# form.instance.price = (form.instance.price * vat.rate) + form.instance.price
return super().form_valid(form)
def get_success_url(self):

View File

@ -31,10 +31,7 @@ msgstr ""
#: templates/inventory/transfer_details.html:89
#: templates/sales/estimates/estimate_detail.html:234
#: templates/sales/estimates/sale_order_form.html:123
#: templates/sales/estimates/sale_order_preview.html:203
#: templates/sales/invoices/invoice_detail.html:328
#: templates/sales/orders/order_details.html:201
#: templates/sales/orders/order_details.html:503
#: templates/sales/estimates/sale_or ils.html:503
msgid "VIN"
msgstr "رقم الهيكل"

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

Before

Width:  |  Height:  |  Size: 814 B

After

Width:  |  Height:  |  Size: 814 B

View File

@ -66,6 +66,7 @@
rel="stylesheet"
id="user-style-default">
{% endif %}
<script src="{% static 'js/main.js' %}"></script>
<script src="{% static 'js/jquery.min.js' %}"></script>

View File

@ -37,17 +37,9 @@
{% include "crm/leads/partials/update_action.html" %}
<div class="row align-items-center justify-content-between g-3 mb-3">
<div class="col-12 col-md-auto">
<h4 class="mb-0">{{ _("Lead Details") }}</h4>
</div>
<div class="col-12 col-md-auto">
<div class="d-flex">
<div class="flex-1 d-md-none">
<button class="btn px-3 btn-phoenix-secondary text-body-tertiary me-2">
<span class="fa-solid fa-bars"></span>
</button>
</div>
</div>
<h3 class="mb-0">{{ _("Lead Details") }}</h3>
</div>
</div>
</div>
</div>
@ -55,12 +47,7 @@
<div class="col-md-5 col-lg-5 col-xl-4">
<div class="sticky-leads-sidebar">
<div class="lead-details" data-breakpoint="md">
<div class="d-flex justify-content-between align-items-center mb-2 d-md-none">
<h3 class="mb-0">{{ _("Lead Details") }}</h3>
<button class="btn p-0">
<span class="uil uil-times fs-7"></span>
</button>
</div>
<div class="card mb-2">
<div class="card-body">
<div class="row align-items-center g-3 text-center text-xxl-start">
@ -807,21 +794,13 @@
</tbody>
</table>
</div>
<div class="row align-items-center justify-content-between py-2 pe-0 fs-9">
<div class="row align-items-center justify-content-between py-2 pe-0 fs-9 mt-3">
<div class="col-auto d-flex">
<p class="mb-0 d-none d-sm-block me-3 fw-semibold text-body"
data-list-info="data-list-info"></p>
</div>
<div class="col-auto d-flex">
<button class="page-link" data-list-pagination="prev">
<span class="fas fa-chevron-left"></span>
</button>
<ul class="mb-0 pagination">
</ul>
<button class="page-link pe-0" data-list-pagination="next">
<span class="fas fa-chevron-right"></span>
</button>
<a class="nav-link px-3 d-block"
href="{% url 'appointment:get_user_appointments' %}"> <span class="me-2 text-body align-bottom" data-feather="calendar"></span>{{ _("View in Calendar") }}
</a>
</div>
</div>
</div>
</div>
@ -968,20 +947,17 @@
}
// Close modal after successful form submission
/*document.body.addEventListener('htmx:afterSwap', function(evt) {
document.body.addEventListener('htmx:afterSwap', function(evt) {
if (evt.detail.target.id === 'main_content') {
document.querySelectorAll('.modal').forEach(function(modal) {
var modal = bootstrap.Modal.getInstance();
if (modal) {
modal.hide();
}
});
}
var modal = bootstrap.Modal.getInstance(document.getElementById('exampleModal'));
if (modal) {
modal.hide();
}
}
});
*/
// Cleanup modal backdrop if needed
/* document.body.addEventListener('htmx:beforeSwap', function(evt) {
document.body.addEventListener('htmx:beforeSwap', function(evt) {
if (evt.detail.target.id === 'main_content') {
var backdrops = document.querySelectorAll('.modal-backdrop');
backdrops.forEach(function(backdrop) {

View File

@ -1,9 +1,11 @@
{% extends 'base.html' %}
{% load i18n static humanize %}
{% block title %}
{{ _("Leads") |capfirst }}
{% endblock title %}
{% block content %}
{% if page_obj.object_list %}
<div class="row g-3 mt-4 mb-4">
<h2 class="mb-2">
{{ _("Leads") |capfirst }}
@ -11,6 +13,7 @@
</h2>
<!-- Action Tracking Modal -->
{% comment %} {% include "crm/leads/partials/update_action.html" %} {% endcomment %}
<div class="row g-3 justify-content-between mb-4">
<div class="col-auto">
<div class="d-md-flex justify-content-between">
@ -26,6 +29,7 @@
<div class="d-flex">{% include 'partials/search_box.html' %}</div>
</div>
</div>
<div class="row g-3">
<div class="col-12">
{% if page_obj.object_list %}
@ -201,26 +205,7 @@
</small>
</div>
</td>
{% comment %} <td class="align-middle white-space-nowrap text-body-tertiary text-opacity-85 fw-semibold text-body-highlight">
{% if lead.opportunity.stage == "prospect" %}
<span class="badge text-bg-primary">{{ lead.opportunity.stage|upper }}</span>
{% elif lead.opportunity.stage == "proposal" %}
<span class="badge text-bg-info">{{ lead.opportunity.stage|upper }}</span>
{% elif lead.opportunity.stage == "negotiation" %}
<span class="badge text-bg-warning">{{ lead.opportunity.stage|upper }}</span>
{% elif lead.opportunity.stage == "closed_won" %}
<span class="badge text-bg-success">{{ lead.opportunity.stage|upper }}</span>
{% elif lead.opportunity.stage == "closed_lost" %}
<span class="badge text-bg-danger">{{ lead.opportunity.stage|upper }}</span>
{% endif %}
</td> {% endcomment %}
{% comment %} <td class="align-middle white-space-nowrap text-body-tertiary text-opacity-85 fw-semibold text-body-highlight">
{% if lead.opportunity %}
<a href="{% url 'opportunity_detail' request.dealer.slug lead.opportunity.slug %}">
<span class="badge badge-phoenix badge-phoenix-success">Opportunity {{ lead.opportunity.lead}} <i class="fa-solid fa-arrow-up-right-from-square"></i></span>
</a>
{% endif %}
</td> {% endcomment %}
<td class="align-middle white-space-nowrap text-end">
{% if user == lead.staff.user or request.is_dealer %}
<div class="btn-reveal-trigger position-static">
@ -268,14 +253,15 @@
<div class="d-flex">{% include 'partials/pagination.html' %}</div>
</div>
{% endif %}
{% else %}
<tr>
<td colspan="6" class="text-center">{% trans "No Lead Yet" %}</td>
</tr>
{% endif %}
{% endif %}
</div>
</div>
</div>
{% else %}
{% url 'lead_create' request.dealer.slug as create_lead_url %}
{% include "empty-illustration-page.html" with value="lead" url=create_lead_url %}
{% endif %}
{% endblock %}
{% block customJS %}
<script>
@ -341,3 +327,5 @@
}
</script>
{% endblock customJS %}

View File

@ -168,6 +168,11 @@
{% endfor %}
</div>
</div>
{% if not new and not follow_up and not negotiation %}
{% url 'lead_create' request.dealer.slug as create_lead_url %}
{% include "empty-illustration-page.html" with value="lead" url=create_lead_url %}
{% endif %}
</div>
</div>
</div>

View File

@ -5,6 +5,7 @@
{{ _("Opportunities") }}
{% endblock title %}
{% block content %}
{% if opportunities %}
<div class="row g-3 mt-4">
<div class="col-12">
<h2 class="mb-3">
@ -87,6 +88,7 @@
{% endif %}
</div>
</div>
</div>
<div id="opportunities-grid" class="row g-4 px-2 px-lg-4 mt-1 mb-4">
{% include 'crm/opportunities/partials/opportunity_grid.html' %}
@ -96,6 +98,10 @@
<div class="d-flex">{% include 'partials/pagination.html' %}</div>
</div>
{% endif %}
{% else %}
{% url 'opportunity_create' request.dealer.slug as create_opportunity_url %}
{% include "empty-illustration-page.html" with value="opportunity" url=create_opportunity_url %}
{% endif %}
{% block customJS %}
<script>
document.addEventListener("DOMContentLoaded", function() {

View File

@ -6,6 +6,7 @@
{% endblock title %}
{% block vendors %}<a class="nav-link active">{{ _("Customers") |capfirst }}</a>{% endblock %}
{% block content %}
{% if customers %}
<div class="row g-3 mt-4">
<h2 class="mb-2">
{{ _("Customers") |capfirst }}
@ -168,4 +169,8 @@
</div>
{% endif %}
{% include 'modal/delete_modal.html' %}
{% else %}
{% url "customer_create" request.dealer.slug as create_customer_url %}
{% include "empty-illustration-page.html" with value="customer" url=create_customer_url %}
{% endif %}
{% endblock %}

View File

@ -5,9 +5,11 @@
{% endblock title %}
{% block content %}
{% include 'modal/delete_modal.html' %}
<div class="row">
<div class="mb-9">
<div class="row align-items-center justify-content-between g-3 mb-4">
<!---->
<div class="mt-4">
<!--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>
</div>
@ -32,12 +34,15 @@
{% endif %}
</div>
</div>
</div>
<div class="row g-5">
<div class="col-12 col-xxl-4">
<div class="row g-3 h-100">
<div class="col-12 col-md-7 col-xxl-12">
<div class="card h-100 h-xxl-auto">
</div>
<!--cards-->
<div class="row">
<div class="col m-2">
<div class="card h-100">
<div class="card-body d-flex flex-column justify-content-between pb-3">
<div class="row align-items-center g-5 mb-3 text-center text-sm-start">
<div class="col-12 col-sm-auto mb-sm-2">
@ -62,9 +67,11 @@
</div>
</div>
</div>
</div>
<div class="col-12 col-md-5 col-xxl-12">
<div class="card">
</div>
<div class="col m-2">
<div class="card h-100">
<div class="card-body">
<div class="d-flex align-items-center mb-3">
<h3 class="me-1">{% trans 'Default Address' %}</h3>
@ -82,9 +89,11 @@
<a class="text-body-secondary" href="#">{{ customer.phone_number }}</a>
</div>
</div>
</div>
<div class="col-12">
<div class="card">
</div>
<div class="col m-2">
<div class="card h-100">
<div class="card-body">
{% if perms.inventory.change_customer %}
<div class="d-flex align-items-center justify-content-end">
@ -115,14 +124,10 @@
</table>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-xxl-8">
</div>
<div class="col-12 mt-3">
<div class="mb-6">
<h3 class="mb-4">
{{ _("Related") }} <span class="text-body-tertiary fw-normal">({{ total }})</span>
</h3>
<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}'>
@ -130,100 +135,77 @@
<table class="table table-sm fs-9 mb-0">
<thead>
<tr>
<th class="sort white-space-nowrap align-middle ps-0 pe-3"
scope="col"
data-sort="order">{% trans 'Type'|upper %}</th>
<th class="sort align-middle text-end pe-7" scope="col" data-sort="total">{% trans 'Total'|upper %}</th>
<th class="sort align-middle white-space-nowrap pe-3"
scope="col"
data-sort="payment_status">{% trans 'Payment Status'|upper %}</th>
<th class="sort align-middle text-end pe-0" scope="col" data-sort="date">{% trans 'Date'|upper %}</th>
<th class="sort text-end align-middle pe-0 ps-5" scope="col"></th>
<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>
</tr>
</thead>
<tbody class="list" id="customer-order-table-body">
{% for estimate in estimates %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="order align-middle white-space-nowrap ps-0">
<p class="fw-semibold mb-0">
{{ _("Quotation") }}-<span class="fs-10 fw-medium">{{ estimate.estimate_number }}</span>
</p>
{% for lead in leads %}
<tr>
<td><a href="#">{{lead}} ({{ forloop.counter }})<a></td>
<td>{{lead.opportunity}} ({{ forloop.counter }})</td>
<td>
{% for estimate in lead.customer.customer_model.estimatemodel_set.all %}
<div class="me-2">{{estimate}}</div>
<hr>
{% endfor %}
</td>
<td class="total align-middle text-end fw-semibold pe-7 text-body-highlight">
{{ estimate.revenue_estimate|currency_format }} <span class="icon-saudi_riyal"></span>
<td>
{% for estimate in lead.customer.customer_model.estimatemodel_set.all %}
<div>{{estimate.sale_orders.first}}</div>
<hr>
{% endfor %}
</td>
<td class="payment_status align-middle white-space-nowrap text-start fw-bold text-body-tertiary"></td>
<td class="date align-middle white-space-nowrap text-body-tertiary fs-9 ps-4 text-end">{{ estimate.created }}</td>
<td class="align-middle white-space-nowrap text-end pe-0 ps-5">
<div class="btn-reveal-trigger position-static">
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a class="dropdown-item" href="#!">View</a><a class="dropdown-item" href="#!">Export</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger" href="#!">Remove</a>
</div>
</div>
</td>
</tr>
{% endfor %}
{% for invoice in invoices %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="order align-middle white-space-nowrap ps-0">
<p class="fw-semibold mb-0">
{{ _("Invoice") }}-<span class="fs-10 fw-medium">{{ invoice.invoice_number }}</span>
</p>
</td>
<td class="total align-middle text-end fw-semibold pe-7 text-body-highlight">
{{ invoice.amount_paid|currency_format }} <span class="icon-saudi_riyal"></span>
</td>
<td class="payment_status align-middle white-space-nowrap text-start fw-bold text-body-tertiary">
{% if invoice.is_paid %}
<td>
{% for invoice in lead.customer.customer_model.invoicemodel_set.all %}
{% if invoice.is_paid %}
<span class="badge badge-phoenix fs-10 badge-phoenix-success">
<span class="badge-label">{{ _("Paid") }}</span>
<span class="ms-1" data-feather="check" style="height:12.8px;width:12.8px;"></span>
<div>{{invoice}}</div>
</span>
{% endif %}
{%else%}
<span class="badge badge-phoenix fs-10 badge-phoenix-info">
<div>{{invoice}}</div>
</span>
{% endif %}
<hr>
{% endfor %}
</td>
<td class="date align-middle white-space-nowrap text-body-tertiary fs-9 ps-4 text-end">{{ invoice.created }}</td>
<td class="align-middle white-space-nowrap text-end pe-0 ps-5">
<div class="btn-reveal-trigger position-static">
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a class="dropdown-item" href="#!">View</a><a class="dropdown-item" href="#!">Export</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger" href="#!">Remove</a>
</div>
</div>
</td>
</tr>
<td>
{% for estimate in lead.customer.customer_model.invoicemodel_set.all %}
<div>{{estimate.itemtransactionmodel_set.first.item_model.name}}</div>
<hr>
{% endfor %}
<td>
<tr>
{% endfor %}
</tbody>
</table>
</div>
{% include 'partials/pagination.html' %}
</div>
</div>
</div>
</div>
</div>
</div>
{% include "components/note_modal.html" with content_type="customer" slug=customer.slug %}
<div>
{% include "components/note_modal.html" with content_type="customer" slug=customer.slug %}
<!---->
<script>
document.addEventListener("DOMContentLoaded", function () {

View File

@ -0,0 +1,55 @@
{% load static %}
<style>
.empty-state-container {
background-color: #ffffff;
padding: 40px;
border-radius: 15px; /* Rounded corners */
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* Subtle shadow */
text-align: center;
max-width: 80rem; /* Max width for content - made wider */
width: 90%; /* Fluid width */
margin: 10px auto; /* Added margin-top and auto for horizontal centering */
max-height: auto; /* 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: 50%; /* Responsive image size */
height: auto;
margin-bottom: 10px;
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 */
</style>
<div class="empty-state-container">
<!-- Empty State Illustration -->
<img src="{% static 'images/logos/no-content-new.jpg' %}" alt="No-empty-state-image" class="empty-state-image">
<!-- Title -->
<h3 class="empty-state-title">No {{ value|capfirst }} Yet</h3>
<!-- Description -->
<p class="empty-state-text">
It looks like you haven't added any {{ value }} to your account.
Click the button below to get started and add your first {{ value }}!
</p>
<!-- Call to Action Button -->
<a class="btn btn-lg btn-primary" href="{{ url }}">Create New {{ value|capfirst }} </a>
</div>

View File

@ -6,6 +6,8 @@
{% trans "Groups" %}
{% endblock title %}
{% block content %}
{% if groups %}
<section class="">
<div class="row mt-4">
<div class="col-auto">
@ -57,4 +59,9 @@
{% endif %}
</div>
</section>
{% else %}
{% url "group_create" request.dealer.slug as create_group_url %}
{% include "empty-illustration-page.html" with value="group" url=create_group_url %}
{% endif %}
{% endblock %}

View File

@ -24,6 +24,8 @@
</style>
{% endblock customCSS %}
{% block content %}
{% if cars%}
<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">
@ -312,6 +314,13 @@
</div>
</div>
</div>
{% else %}
{% url "car_add" request.dealer.slug as create_car_url %}
{% include "empty-illustration-page.html" with value="car" url=create_car_url %}
{% endif %}
{% endblock %}
{% block customJS %}
<script>

View File

@ -4,6 +4,8 @@
{% trans "Inventory Stats"|capfirst %}
{% endblock %}
{% block content %}
{% if inventory %}
<div class="row justify-content-between">
<div class="col-sm-12 ">
<div class="card border h-100 w-100 p-lg-10">
@ -92,4 +94,9 @@
{% endif %}
</div>
</div>
{% else %}
{% url "car_add" request.dealer.slug as create_car_url %}
{% include "empty-illustration-page.html" with value="car" url=create_car_url %}
{% endif %}
{% endblock %}

View File

@ -4,6 +4,9 @@
{{ _("Expenses") }}
{% endblock title %}
{% block content %}
{% if expenses %}
<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>
@ -54,4 +57,9 @@
{% endif %}
{% endif %}
</div>
{% else %}
{% url "item_expense_create" request.dealer.slug as create_expense_url %}
{% include "empty-illustration-page.html" with value="expense" url=create_expense_url %}
{% endif %}
{% endblock %}

View File

@ -4,6 +4,8 @@
{{ _("Services") }}
{% endblock title %}
{% block content %}
{% if services %}
<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>
@ -56,4 +58,10 @@
{% endif %}
{% endif %}
</div>
{% else %}
{% url 'item_service_create' request.dealer.slug as create_services_url %}
{% include "empty-illustration-page.html" with value="service" url=create_services_url %}
{%endif%}
{% endblock %}

View File

@ -4,6 +4,7 @@
{{ _("Bank Accounts") }}
{% endblock title %}
{% block content %}
{% if bank_accounts %}
<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>
@ -53,4 +54,9 @@
{% endif %}
{% endif %}
</div>
{% else %}
{% url 'bank_account_create' request.dealer.slug as create_bank_account_url %}
{% include "empty-illustration-page.html" with value="bank account" url=create_bank_account_url%}
{% endif %}
{% endblock %}

View File

@ -10,6 +10,8 @@
</a>
{% endblock %}
{% block content %}
{% if bills %}
<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>
@ -85,4 +87,10 @@
</div>
{% endif %}
</div>
{% endblock %}
{% else %}
{% url "bill-create" request.dealer.slug as create_bill_url %}
{% include "empty-illustration-page.html" with value="bill" url=create_bill_url %}
{% endif %}
{% endblock %}

View File

@ -10,6 +10,9 @@
</a>
{% endblock %}
{% block content %}
{% if accounts%}
<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>
@ -196,6 +199,12 @@
</div>
</div>
</div>
{% else %}
{% endif %}
{% url "account_create" request.dealer.slug as create_account_url %}
{% include "empty-illustration-page.html" with value="account" url=create_account_url %}
{% endblock %}
{% block customerJS %}
<script>

View File

@ -4,6 +4,8 @@
{{ _("Journal Entries") }}
{% endblock title %}
{% block content %}
{% if journal_entries %}
<div class="modal fade"
id="confirmModal"
tabindex="-1"
@ -130,5 +132,10 @@
</div>
{% endif %}
</div>
<!--test-->
{% else %}
{% url 'journalentry_create' request.dealer.slug ledger.pk as create_je_url %}
{% include "empty-illustration-page.html" with value="journal entry" url=create_je_url %}
{% endif %}
{% endblock %}

View File

@ -4,6 +4,8 @@
{{ _("Ledger") }}
{% endblock title %}
{% block content %}
{% if ledgers %}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Ledger" %} <span class="fas fa-book-open ms-2 text-primary"></span></h3>
@ -127,4 +129,9 @@
</div>
{% endif %}
</div>
{% else %}
{% url 'ledger_create' request.dealer.slug as create_ledger_url %}
{% include "empty-illustration-page.html" with value="ledger" url=create_ledger_url %}
{% endif %}
{% endblock %}

View File

@ -5,7 +5,7 @@
{% endblock title %}
{% block content %}
<div class="row my-4">
<h2>{{ organization.get_local_name }}</h2>
<h2 class="mb-2">{{ organization.get_local_name }}</h2>
<ul class="list-group mb-4">
<li class="list-group-item">
<strong>{% trans "CRN" %}:</strong> {{ organization.crn }}

View File

@ -8,6 +8,7 @@
<a class="nav-link active">{% trans 'Organizations' %}</a>
{% endblock %}
{% block content %}
{% if organizations%}
<section class="pt-5 pb-9 ">
<div class="row overflow-x-auto whitespace-nowrap -mx-2 sm:mx-0">
<h2 class="mb-4">
@ -182,4 +183,10 @@
{% endif %}
</div>
</section>
{% else %}
{% url 'organization_create' request.dealer.slug as create_organization_url %}
{% include "empty-illustration-page.html" with value="organization" url=create_organization_url %}
{% endif %}
{% endblock %}

View File

@ -3,6 +3,9 @@
{% load i18n static %}
{% block title %}Purchase Orders - {{ block.super }}{% endblock %}
{% block content %}
{% if purchase_orders %}
<div class="row mt-4">
<!-- Success Message -->
{% if messages %}
@ -118,4 +121,9 @@
{% endif %}
</div>
{% include 'modal/delete_modal.html' %}
{% else %}
{% url "purchase_order_create" request.dealer.slug request.dealer.entity.slug as create_purchase_url %}
{% include "empty-illustration-page.html" with value="purchase order" url=create_purchase_url %}
{% endif %}
{% endblock %}

View File

@ -250,12 +250,7 @@
<td class="align-middle text-body-tertiary fw-semibold">{{ item.total }}</td>
</tr>
{% endfor %}
<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>
</td>
</tr>
<tr class="bg-body-secondary total-sum">
<td class="align-middle ps-4 fw-semibold text-body-highlight" colspan="7">{% trans "Discount Amount" %}</td>
<td class="align-middle text-start text-danger fw-semibold">
@ -275,6 +270,12 @@
</form>
</td>
</tr>
<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>
</td>
</tr>
<tr class="bg-body-secondary total-sum">
<td class="align-middle ps-4 fw-semibold text-body-highlight" colspan="7">{% trans "Additional Services" %}</td>
<td class="align-middle text-start fw-semibold">

View File

@ -4,6 +4,7 @@
{{ _("Quotations") }}
{% endblock title %}
{% block content %}
{% if estimates %}
<div class="row g-3 mt-4 mb-4">
<div class="row g-3 justify-content-between mb-4">
<div class="col-auto">
@ -75,4 +76,10 @@
</div>
{% endif %}
</div>
{% else %}
{% url "estimate_create" request.dealer.slug as create_estimate_url %}
{% include "empty-illustration-page.html" with value="customer" url=create_estimate_url %}
{% endif %}
{% endblock %}

View File

@ -3,206 +3,23 @@
{% load static %}
{% load i18n %}
{% block title %}
<h1>{% trans 'Sale Order' %}</h1>
{% endblock %}
{{ _("Sale Order") }}
{% endblock title %}
{% block content %}
<link rel="stylesheet" href="{% static 'flags/sprite.css' %}" />
<div class="row">
<div class="row mb-3">
<div class="col-sm-6 col-md-8">
<div class="d-sm-flex justify-content-between">
<h3 class="mb-3">
{% if customer.created %}
{{ _('Edit Sale Order') }}
{% else %}
{{ _('Add Sale Order') }}
{% endif %}
<span class="fas fa-shopping-cart text-primary ms-2"></span>
</h3>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-xl-12 col-xxl-12">
<div class="px-xl-12">
<div class="row mx-0 mx-sm-3 mx-lg-0 px-lg-0">
<div class="col-sm-12 col-xxl-6 py-3">
<table class="w-100 table-stats ">
<tr>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<td class="py-2">
<div class="d-inline-flex align-items-center">
<div class="d-flex bg-success-subtle rounded-circle flex-center me-3" style="width:24px; height:24px">
<span class="text-success-dark" data-feather="user" style="width:16px; height:16px"></span>
</div>
<p class="fw-bold mb-0">{{ _("Customer Name")}}</p>
</div>
</td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td>
<td class="py-2">
<p class="ps-6 ps-sm-0 fw-semibold mb-0 mb-0 pb-3 pb-sm-0">{{ estimate.customer.customer_name }}</p>
</td>
</tr>
<tr>
<td class="py-2">
<div class="d-flex align-items-center">
<div class="d-flex bg-success-subtle rounded-circle flex-center me-3" style="width:24px; height:24px">
<span class="text-success-dark" data-feather="mail" style="width:16px; height:16px"></span>
</div>
<p class="fw-bold mb-0">{{ _("Email") }}</p>
</div>
</td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td>
<td class="py-2">
<p class="ps-6 ps-sm-0 fw-semibold mb-0">{{ estimate.customer.email }}</p>
</td>
</tr>
<tr>
<td class="py-2">
<div class="d-flex align-items-center">
<div class="d-flex bg-success-subtle rounded-circle flex-center me-3" style="width:24px; height:24px">
<span class="text-success-dark" data-feather="map-pin" style="width:16px; height:16px"></span>
</div>
<p class="fw-bold mb-0">{{ _("Address") }}</p>
</div>
</td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td>
<td class="py-2">
<p class="ps-6 ps-sm-0 fw-semibold mb-0">{{ estimate.customer.address_1 }}</p>
</td>
</tr>
<tr>
<td class="py-2">
<div class="d-flex align-items-center">
<div class="d-flex bg-success-subtle rounded-circle flex-center me-3" style="width:24px; height:24px">
<span class="text-success-dark" data-feather="trending-down" style="width:16px; height:16px"></span>
</div>
<p class="fw-bold mb-0">{{ _("Total Discount")}}</p>
</div>
</td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td>
<td class="py-2">
<p class="ps-6 ps-sm-0 fw-semibold mb-0">{{ data.total_discount }} <span class="icon-saudi_riyal"></span></p>
</td>
</tr>
<tr>
<td class="py-2">
<div class="d-flex align-items-center">
<div class="d-flex bg-success-subtle rounded-circle flex-center me-3" style="width:24px; height:24px">
<span class="text-success-dark" data-feather="briefcase" style="width:16px; height:16px"></span>
</div>
<p class="fw-bold mb-0">{{ _("Total Amount")}}</p>
</div>
</td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td>
<td class="py-2">
<p class="ps-6 ps-sm-0 fw-semibold mb-0">{{ data.grand_total }} <span class="icon-saudi_riyal"></span></p>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="border-top border-bottom border-translucent mt-10" id="leadDetailsTable">
<div class="table-responsive scrollbar mx-n1 px-1">
<table class="table fs-9 mb-0">
<thead>
<tr>
<th class="white-space-nowrap fs-9 align-middle ps-0" style="width:26px;">
<div class="form-check mb-0 fs-8">
<input class="form-check-input" type="checkbox" />
</div>
</th>
<th class="sort white-space-nowrap align-middle pe-3 ps-0 text-uppercase" scope="col" data-sort="name" style="width:20%; min-width:100px">
{{ _("VIN") }}</th>
<th class="sort align-middle pe-6 text-uppercase" scope="col" data-sort="description" style="width:20%; max-width:60px">
{{ _("Make") }}</th>
<th class="sort align-middle text-start text-uppercase" scope="col" data-sort="create_date" style="width:20%; min-width:115px">
{{ _("Model") }}</th>
<th class="sort align-middle text-start text-uppercase" scope="col" data-sort="create_by" style="width:20%; min-width:150px">
{{ _("Year") }}</th>
<th class="sort align-middle text-start text-uppercase" scope="col" data-sort="create_by" style="width:20%; min-width:150px">
{{ _("Unit Price")}}</th>
<th class="align-middle pe-0 text-end" scope="col" style="width:15%;"></th>
</tr>
</thead>
<tbody class="list" id="lead-details-table-body">
{% for car in data.cars %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="fs-9 align-middle px-0 py-3">
<div class="form-check mb-0 fs-8">
<input class="form-check-input" type="checkbox" />
</div>
</td>
<td class="name align-middle white-space-nowrap py-2 ps-0">
<a class="d-flex align-items-center text-body-highlight" href="#!">
{% comment %} <div class="avatar avatar-m me-3 status-online">
<img class="rounded-circle" src="" alt="" />
</div> {% endcomment %}
<h6 class="mb-0 text-body-highlight fw-bold">{{ car.vin }}</h6>
</a>
</td>
<td class="description align-middle white-space-nowrap text-start fw-bold text-body-tertiary py-2 pe-6">
{{ car.make }}
</td>
<td class="create_by align-middle white-space-nowrap fw-semibold text-body-highlight">{{ car.model }}</td>
<td class="create_by align-middle white-space-nowrap fw-semibold text-body-highlight">{{ car.year }}</td>
<td class="last_activity align-middle text-center py-2">
<div class="d-flex align-items-center flex-1">
<span class="fw-bold fs-9 text-body">{{ car.total }} <span class="icon-saudi_riyal"></span></span>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div class="row mx-0">
<form method="post" class="form row g-3 needs-validation" novalidate>
<div class="row">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ _("Sale Order") }}</div>
<div class="card-body">
<form method="post" action="{% url 'create_sale_order' request.dealer.slug estimate.pk %}">
{% csrf_token %}
<div class="col-md-6">
<label for="id_estimate" class="form-label">{% trans "Quotation" %}</label>
<input type="text"
class="form-control form-control-sm"
id="id_estimate"
name="estimate"
value="{{ form.estimate.value|default_if_none:'' }}"
readonly>
<div class="invalid-feedback">{% trans "Please provide an estimate." %}</div>
</div>
<div class="col-md-6">
<label for="id_payment_method" class="form-label">{% trans "Payment Method" %}</label>
<select class="form-select form-select-sm"
id="id_payment_method"
name="payment_method"
required>
{% for value, label in form.payment_method.field.choices %}
<option value="{{ value }}"
{% if form.payment_method.value == value %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
<div class="invalid-feedback">{% trans "Please select a payment method." %}</div>
</div>
<div class="col-12">
<label for="id_comments" class="form-label">{% trans "Comments" %}</label>
<textarea class="form-control" id="id_comments" name="comments" rows="3">{{ form.comments.value|default_if_none:'' }}</textarea>
</div>
<div class="col-12">
<button class="btn btn-phoenix-primary" type="submit">{% trans 'Save' %}</button>
</div>
{{ form|crispy }}
<button type="submit" class="btn btn-phoenix-primary">{% trans 'Save' %}</button>
</form>
</div>
</div>
</div>
</div>
</div>
<!---->
{% endblock content %}
{% endblock content %}

View File

@ -4,6 +4,8 @@
{{ _("Invoices") }}
{% endblock title %}
{% block content %}
{% if invoices %}
<div class="row mt-4">
<div class="row g-3 justify-content-between mb-4">
<div class="col-auto">
@ -85,4 +87,8 @@
</div>
{% endif %}
</div>
{% else %}
{% include "empty-illustration-page.html" with value="invoice" url="#" %}
{% endif %}
{% endblock %}

View File

@ -4,6 +4,7 @@
{%block title%} {%trans 'Sale Orders'%} {%endblock%}
{% block content %}
{% if txs %}
<section class="mt-2">
<div class="row overflow-x-auto whitespace-nowrap -mx-2 sm:mx-0">
@ -112,4 +113,7 @@
{% endif %}
</div>
</section>
{% else %}
{% include "empty-illustration-page.html" with value="sale order" url='#' %}
{% endif %}
{% endblock %}

View File

@ -5,6 +5,9 @@
{% trans "Staffs" %}
{% endblock title %}
{% block content %}
{%if users %}
<section class="">
<div class="row mt-4">
<div class="col-auto">
@ -21,7 +24,7 @@
<i class="fa-solid fa-circle-info fs-6"></i>
<p class="mb-0 flex-1">
{{ _("No Active Subscription,please activate your subscription.") }}<a href="{% url 'pricing_page' request.dealer.slug %}"
class="ms-3 text-body-primary fs-9">Manage Subscription</a>
class="ms-3 text-body-primary fs-9">Manage Subscription</a>
</p>
<button class="btn-close"
type="button"
@ -86,4 +89,10 @@
</div>
</div>
</section>
{% else %}
{% url "user_create" request.dealer.slug as create_staff_url %}
{% include "empty-illustration-page.html" with value="staff" url=create_staff_url %}
{% endif %}
{% endblock %}

View File

@ -6,6 +6,8 @@
{% endblock title %}
{% block vendors %}<a class="nav-link active">{{ _("Vendors") |capfirst }}</a>{% endblock %}
{% block content %}
{% if vendors %}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">
@ -161,4 +163,9 @@
{% endif %}
</div>
{% include 'modal/delete_modal.html' %}
{% else %}
{% url "vendor_create" request.dealer.slug as create_vendor_url %}
{% include "empty-illustration-page.html" with value="vendor" url=create_vendor_url %}
{% endif %}
{% endblock %}