This commit is contained in:
Marwan Alwali 2025-03-16 03:28:04 +03:00
parent 61fa47a35e
commit da1619b874
5 changed files with 948 additions and 715 deletions

View File

@ -1797,9 +1797,12 @@ class SaleOrder(models.Model):
blank=True blank=True
) )
payment_method = models.CharField(max_length=20, choices=[ payment_method = models.CharField(max_length=20, choices=[
('cash', 'Cash'), ('cash', _('Cash')),
('finance', 'Finance'), ('finance', _('Finance')),
('lease', 'Lease'), ('lease', _('Lease')),
("credit_card", _("Credit Card")),
("bank_transfer", _("Bank Transfer")),
("SADAD", _("SADAD")),
]) ])
comments = models.TextField(blank=True, null=True) comments = models.TextField(blank=True, null=True)
formatted_order_id = models.CharField(max_length=10, unique=True, editable=False) formatted_order_id = models.CharField(max_length=10, unique=True, editable=False)

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -23,20 +23,11 @@
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-sm-5 col-md-6"> <div class="col-xl-12 col-xxl-12">
<form method="post" class="form row g-3 needs-validation" novalidate> <div class="px-xl-12">
{% csrf_token %}
{{ form|crispy }}
<div class="col-12">
<button class="btn btn-primary" type="submit">{% trans 'Save' %}</button>
</div>
</form>
</div>
<div class="col-xl-4 col-xxl-4">
<div class="px-xl-4 mb-7">
<div class="row mx-0 mx-sm-3 mx-lg-0 px-lg-0"> <div class="row mx-0 mx-sm-3 mx-lg-0 px-lg-0">
<div class="col-sm-12 col-xxl-6 py-3"> <div class="col-sm-12 col-xxl-6 py-3">
<table class="w-100 table-stats table-stats"> <table class="w-100 table-stats ">
<tr> <tr>
<th></th> <th></th>
<th></th> <th></th>
@ -46,9 +37,9 @@
<td class="py-2"> <td class="py-2">
<div class="d-inline-flex align-items-center"> <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"> <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="bar-chart-2" style="width:16px; height:16px"></span> <span class="text-success-dark" data-feather="user" style="width:16px; height:16px"></span>
</div> </div>
<p class="fw-bold mb-0">Customer Name</p> <p class="fw-bold mb-0">{{ _("Customer Name")}}</p>
</div> </div>
</td> </td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td> <td class="py-2 d-none d-sm-block pe-sm-2">:</td>
@ -59,10 +50,10 @@
<tr> <tr>
<td class="py-2"> <td class="py-2">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="d-flex bg-info-subtle rounded-circle flex-center me-3" style="width:24px; height:24px"> <div class="d-flex bg-success-subtle rounded-circle flex-center me-3" style="width:24px; height:24px">
<span class="text-info-dark" data-feather="trending-up" style="width:16px; height:16px"></span> <span class="text-success-dark" data-feather="mail" style="width:16px; height:16px"></span>
</div> </div>
<p class="fw-bold mb-0">Email</p> <p class="fw-bold mb-0">{{ _("Email") }}</p>
</div> </div>
</td> </td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td> <td class="py-2 d-none d-sm-block pe-sm-2">:</td>
@ -73,10 +64,10 @@
<tr> <tr>
<td class="py-2"> <td class="py-2">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="d-flex bg-info-subtle rounded-circle flex-center me-3" style="width:24px; height:24px"> <div class="d-flex bg-success-subtle rounded-circle flex-center me-3" style="width:24px; height:24px">
<span class="text-info-dark" data-feather="trending-up" style="width:16px; height:16px"></span> <span class="text-success-dark" data-feather="map-pin" style="width:16px; height:16px"></span>
</div> </div>
<p class="fw-bold mb-0">Address</p> <p class="fw-bold mb-0">{{ _("Address") }}</p>
</div> </div>
</td> </td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td> <td class="py-2 d-none d-sm-block pe-sm-2">:</td>
@ -87,39 +78,37 @@
<tr> <tr>
<td class="py-2"> <td class="py-2">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="d-flex bg-info-subtle rounded-circle flex-center me-3" style="width:24px; height:24px"> <div class="d-flex bg-success-subtle rounded-circle flex-center me-3" style="width:24px; height:24px">
<span class="text-info-dark" data-feather="trending-up" style="width:16px; height:16px"></span> <span class="text-success-dark" data-feather="trending-down" style="width:16px; height:16px"></span>
</div> </div>
<p class="fw-bold mb-0">Total Discount</p> <p class="fw-bold mb-0">{{ _("Total Discount")}}</p>
</div> </div>
</td> </td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td> <td class="py-2 d-none d-sm-block pe-sm-2">:</td>
<td class="py-2"> <td class="py-2">
<p class="ps-6 ps-sm-0 fw-semibold mb-0">{{ data.total_discount }} {{ CURRENCY }}</p> <p class="ps-6 ps-sm-0 fw-semibold mb-0">{{ data.total_discount }} <span class="currency">{{ CURRENCY }}</span></p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="py-2"> <td class="py-2">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="d-flex bg-info-subtle rounded-circle flex-center me-3" style="width:24px; height:24px"> <div class="d-flex bg-success-subtle rounded-circle flex-center me-3" style="width:24px; height:24px">
<span class="text-info-dark" data-feather="trending-up" style="width:16px; height:16px"></span> <span class="text-success-dark" data-feather="briefcase" style="width:16px; height:16px"></span>
</div> </div>
<p class="fw-bold mb-0">Total Amount</p> <p class="fw-bold mb-0">{{ _("Total Amount")}}</p>
</div> </div>
</td> </td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td> <td class="py-2 d-none d-sm-block pe-sm-2">:</td>
<td class="py-2"> <td class="py-2">
<p class="ps-6 ps-sm-0 fw-semibold mb-0">{{ data.grand_total }} {{ CURRENCY }}</p> <p class="ps-6 ps-sm-0 fw-semibold mb-0">{{ data.grand_total }} <span class="currency">{{ CURRENCY }}</span></p>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</div> <div class="row">
</div> <div class="border-top border-bottom border-translucent mt-10" id="leadDetailsTable">
<div class="border-top border-bottom border-translucent mt-10" id="leadDetailsTable">
<div class="table-responsive scrollbar mx-n1 px-1"> <div class="table-responsive scrollbar mx-n1 px-1">
<table class="table fs-9 mb-0"> <table class="table fs-9 mb-0">
<thead> <thead>
@ -129,11 +118,16 @@
<input class="form-check-input" type="checkbox" /> <input class="form-check-input" type="checkbox" />
</div> </div>
</th> </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 white-space-nowrap align-middle pe-3 ps-0 text-uppercase" scope="col" data-sort="name" style="width:20%; min-width:100px">
<th class="sort align-middle pe-6 text-uppercase" scope="col" data-sort="description" style="width:20%; max-width:60px">Make</th> {{ _("VIN") }}</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 pe-6 text-uppercase" scope="col" data-sort="description" style="width:20%; max-width:60px">
<th class="sort align-middle text-start text-uppercase" scope="col" data-sort="create_by" style="width:20%; min-width:150px">Year</th> {{ _("Make") }}</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="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> <th class="align-middle pe-0 text-end" scope="col" style="width:15%;"></th>
</tr> </tr>
</thead> </thead>
@ -153,20 +147,57 @@
<h6 class="mb-0 text-body-highlight fw-bold">{{car.vin}}</h6> <h6 class="mb-0 text-body-highlight fw-bold">{{car.vin}}</h6>
</a> </a>
</td> </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="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.model}}</td>
<td class="create_by align-middle white-space-nowrap fw-semibold text-body-highlight">{{car.year}}</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"> <td class="last_activity align-middle text-center py-2">
<div class="d-flex align-items-center flex-1"> <div class="d-flex align-items-center flex-1">
<span class="fw-bold fs-9 text-body">{{car.total}} {{ CURRENCY }}</span> <span class="fw-bold fs-9 text-body">{{car.total}} <span class="currency">{{ CURRENCY }}</span></span>
</div> </div>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div>
<div class="row mx-0">
<form method="post" class="form row g-3 needs-validation" novalidate>
{% 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-primary" type="submit">{% trans 'Save' %}</button>
</div>
</form>
</div>
</div>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}