estimate-form
This commit is contained in:
parent
43c8c8172d
commit
8fd698c6c5
@ -268,7 +268,7 @@
|
||||
<th>{% trans "Marked Price"|capfirst %}</th>
|
||||
<td>{{ car.finances.marked_price|floatformat:2 }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
{% comment %} <tr>
|
||||
<th>{% trans "Selling Price"|capfirst %}</th>
|
||||
<td>{{ car.finances.selling_price|floatformat:2 }}</td>
|
||||
</tr>
|
||||
@ -295,7 +295,7 @@
|
||||
<tr>
|
||||
<th>{% trans "Total"|capfirst %}</th>
|
||||
<td>{{ car.finances.total_vat|floatformat:2 }}</td>
|
||||
</tr>
|
||||
</tr> {% endcomment %}
|
||||
{% if perms.inventory.change_carfinance %}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
|
||||
@ -122,81 +122,77 @@
|
||||
}
|
||||
</style>
|
||||
<div class="row justify-content-center mt-5 mb-3">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{% if not items %}
|
||||
|
||||
{% 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/empty/no_car.png" url=create_car_url %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col">
|
||||
{% if not customer_count %}
|
||||
{% url "customer_create" request.dealer.slug as create_customer_url %}
|
||||
{% include "message-illustration.html" with value1="Please add at least one customer before creating a quotation." value2="Add Customer" message_image="images/empty/no_estimate.png" url=create_customer_url %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
<div class="col-lg-8 col-md-10 needs-validation {% if not items or not customer_count %}d-none{% endif %}">
|
||||
<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">
|
||||
{% trans "Create Quotation" %}<i class="fa-regular fa-file-lines text-primary me-2"></i>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body bg-light-subtle">
|
||||
|
||||
|
||||
<form id="mainForm" method="post" class="needs-validation {% if not items and not customer_count %}d-none{% endif %}">
|
||||
|
||||
{% csrf_token %}
|
||||
<div class="row g-3 col-12">
|
||||
{{ form|crispy }}
|
||||
<div class="custom-select">
|
||||
<!-- Hidden native select for form submission -->
|
||||
<select class="native-select" name="item" required tabindex="-1">
|
||||
<option value="">Select a car</option>
|
||||
{% for item in items %}
|
||||
<option value="{{ item.hash }}"></option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<!-- Custom select UI -->
|
||||
<div class="select-trigger">
|
||||
<div class="selected-value">
|
||||
<span>Select a car</span>
|
||||
</div>
|
||||
<i class="fas fa-chevron-down dropdown-icon"></i>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="row ">
|
||||
<div class="col">
|
||||
{% if not items %}
|
||||
{% 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/empty/no_car.png" url=create_car_url %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="options-container">
|
||||
{% for item in items %}
|
||||
<div class="option" data-value="{{ item.hash }}" data-image="{{item.logo}}">
|
||||
<img src="{{item.logo}}" alt="{{item.model}}">
|
||||
<span>{{item.make}} {{item.model}} {{item.serie}} {{item.trim}} {{item.color_name}}</span>
|
||||
<div class="color-box" style="background-color: rgb({{ item.exterior_color }});"></div>
|
||||
<div class="color-box" style="background-color: rgb({{ item.interior_color }});"></div>
|
||||
<span style="color:gray;">({{item.hash_count}} in stock)</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="col">
|
||||
{% if not customer_count %}
|
||||
{% url "customer_create" request.dealer.slug as create_customer_url %}
|
||||
{% include "message-illustration.html" with value1="Please add at least one customer before creating a quotation." value2="Add Customer" message_image="images/empty/no_estimate.png" url=create_customer_url %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="col-lg-8 col-md-10 needs-validation {% if not items or not customer_count %}d-none{% endif %}">
|
||||
<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">
|
||||
{% trans "Create Quotation" %}<i class="fa-regular fa-file-lines text-primary me-2"></i>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body bg-light-subtle">
|
||||
<form id="mainForm" method="post" class="needs-validation {% if not items and not customer_count %}d-none{% endif %}">
|
||||
{% csrf_token %}
|
||||
<div class="row g-3 col-12">
|
||||
{{ form|crispy }}
|
||||
<div class="custom-select">
|
||||
<!-- Hidden native select for form submission -->
|
||||
<select class="native-select" name="item" required tabindex="-1">
|
||||
<option value="">Select a car</option>
|
||||
{% for item in items %}
|
||||
<option value="{{ item.hash }}"></option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<hr class="my-2">
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-center mt-3">
|
||||
<button class="btn btn-lg btn-phoenix-primary md-me-2" type="submit"><i class="fa-solid fa-floppy-disk me-1"></i>{{ _("Save") }}</button>
|
||||
<a href="{% url 'estimate_list' request.dealer.slug%}" class="btn btn-lg btn-phoenix-secondary"><i class="fa-solid fa-ban me-1"></i>{% trans "Cancel" %}</a>
|
||||
</div>
|
||||
</form>
|
||||
<!-- Custom select UI -->
|
||||
<div class="select-trigger">
|
||||
<div class="selected-value">
|
||||
<span>Select a car</span>
|
||||
</div>
|
||||
<i class="fas fa-chevron-down dropdown-icon"></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="options-container">
|
||||
{% for item in items %}
|
||||
<div class="option" data-value="{{ item.hash }}" data-image="{{item.logo}}">
|
||||
<img src="{{item.logo}}" alt="{{item.model}}">
|
||||
<span>{{item.make}} {{item.model}} {{item.serie}} {{item.trim}} {{item.color_name}}</span>
|
||||
<div class="color-box" style="background-color: rgb({{ item.exterior_color }});"></div>
|
||||
<div class="color-box" style="background-color: rgb({{ item.interior_color }});"></div>
|
||||
<span style="color:gray;">({{item.hash_count}} in stock)</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-2">
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-center mt-3">
|
||||
<button class="btn btn-lg btn-phoenix-primary md-me-2" type="submit"><i class="fa-solid fa-floppy-disk me-1"></i>{{ _("Save") }}</button>
|
||||
<a href="{% url 'estimate_list' request.dealer.slug%}" class="btn btn-lg btn-phoenix-secondary"><i class="fa-solid fa-ban me-1"></i>{% trans "Cancel" %}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block customJS %}
|
||||
<script>
|
||||
@ -431,5 +427,4 @@ function handleFormResponse(data) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user