haikal/templates/sales/estimates/estimate_preview.html
2025-09-17 14:10:07 +03:00

264 lines
11 KiB
HTML

{% load i18n static custom_filters num2words_tags %}
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<title>{% trans "Quotation" %}</title>
<style>
/* General Body and Font Styles */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 12px;
color: #333;
margin: 0;
padding: 0;
}
/* Page Layout and Margins for PDF */
@page {
size: A4;
margin: 20mm;
@top-left {
content: "صفحة " counter(page) " من " counter(pages);
font-size: 10px;
color: #555;
}
}
/* Header Styles */
.document-header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2px solid #333;
padding-bottom: 15px;
margin-bottom: 20px;
}
.document-header .logo {
max-width: 150px;
height: auto;
}
.document-header h1 {
font-size: 24px;
margin: 0;
color: #0056b3; /* A professional blue */
}
.document-header address {
text-align: right;
font-style: normal;
font-size: 10px;
}
/* Document Details Section */
.document-details {
display: flex;
justify-content: space-between;
margin-bottom: 30px;
line-height: 1.6;
}
.document-details .section {
width: 48%;
}
.document-details h2 {
font-size: 14px;
border-bottom: 1px solid #ccc;
padding-bottom: 5px;
margin-bottom: 10px;
color: #555;
}
.document-details p {
margin: 0;
font-size: 12px;
}
.document-details .label {
font-weight: bold;
color: #555;
}
/* Table Styles */
.table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
.table th, .table td {
border: 1px solid #ddd;
padding: 8px;
text-align: right;
}
.table th {
background-color: #f2f2f2;
font-weight: bold;
}
.table tfoot td {
border-top: 2px solid #333;
font-weight: bold;
}
.text-right {
text-align: left;
}
.text-left {
text-align: right;
}
.text-center {
text-align: center;
}
/* Footer Styles */
.document-footer {
text-align: center;
font-size: 10px;
color: #888;
border-top: 1px solid #ddd;
padding-top: 15px;
margin-top: 30px;
}
.footer-flex {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
</style>
</head>
<body>
<div class="document-header">
<div>
<h1>{{ request.dealer.name }}</h1>
<address>
العنوان: {{ request.dealer.address }}<br>
البريد الإلكتروني: {{ request.dealer.user.email }}<br>
الهاتف: {{ request.dealer.phone_number }}<br>
رقم السجل التجاري: {{ request.dealer.crn }}&nbsp;&nbsp;|&nbsp;الرقم الضريبي: {{ request.dealer.vrn }}
</address>
</div>
<div>
<h1>عرض سعر</h1>
<h2 style="font-size: 18px;">{{ estimate.estimate_number }}</h2>
</div>
</div>
<div class="document-details">
<div class="section">
<h2>{{ estimate.customer.customer_name }}: إلى</h2>
<p><span class="label">العميل: {{ estimate.customer.customer_name }}</span></p>
<p><span class="label">البريد الإلكتروني: {{ estimate.customer.email |default:"N/A"}}</span></p>
<p><span class="label">الهاتف: {{ estimate.customer.phone_number|default:"N/A" }}</span></p>
<p><span class="label">العنوان: {{ estimate.customer.address_1|default:"N/A" }}</span></p>
</div>
<div class="section text-left">
<h2>التفاصيل:</h2>
<p><span class="label">رقم عرض السعر:</span> {{ estimate.estimate_number }}</p>
<p><span class="label">تاريخ الإصدار:</span> {{ estimate.date_approved|date:"Y/m/d" }}</p>
<p><span class="label">طريقة الدفع:</span> {{ estimate.get_terms_display }}</p>
</div>
</div>
<div class="col-lg-12">
<div class="table-responsive">
<div class="d-flex justify-content-between">
<span class="fs-9 fw-thin">تفاصيل السيارة</span>
</div>
<table class="table table-sm table-bordered m-1">
<thead>
<tr>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">الصانع</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">الموديل</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">السلسلة</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">الفئة</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">السنة</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">رقم الهيكل</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">الكمية</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">سعر الوحدة</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">الخصم</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">الضريبة</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">الإجمالي</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="ps-1 fs-10 align-content-center">{{ data.car.id_car_make.name }}</td>
<td class="ps-1 fs-10 align-content-center">{{ data.car.id_car_model.name }}</td>
<td class="ps-1 fs-10 align-content-center">{{ data.car.id_car_serie.name }}</td>
<td class="ps-1 fs-10 align-content-center">{{ data.car.id_car_trim.name }}</td>
<td class="text-center fs-10 align-content-center">{{ data.car.year }}</td>
<td class="ps-1 fs-10 align-content-center">{{ data.car.vin }}</td>
<td class="text-center fs-10 align-content-center">1</td>
<td class="text-center fs-10 align-content-center">{{ data.car.marked_price|floatformat:2 }}</td>
<td class="text-center fs-10 align-content-center">{{ data.discount_amount|floatformat:2 }}</td>
<td class="text-center fs-10 align-content-center">{{ data.vat_amount|floatformat:2 }}</td>
<td class="text-center fs-10 align-content-center">{{ data.final_price|floatformat:2 }}</td>
</tr>
</tbody>
</table>
</div>
</div>
{% if data.additional_services %}
<div class="col-lg-12">
<div class="table-responsive">
<div class="d-flex justify-content-between">
<span class="fs-9 fw-thin">الخدمات الإضافية</span>
</div>
<table class="table table-sm table-bordered m-1">
<thead>
<tr>
<th class="text-center fs-10 align-content-center">النوع</th>
<th class="text-center fs-10 align-content-center">القيمة</th>
<th class="text-center fs-10 align-content-center">ضريبة الخدمة</th>
<th class="text-center fs-10 align-content-center">الإجمالي</th>
</tr>
</thead>
<tbody>
{% for service in data.additional_services.services %}
<tr>
<td class="ps-1 text-center fs-10 align-content-center">{{ service.0.name }}</td>
<td class="ps-1 text-center fs-10 align-content-center">{{ service.0.price|floatformat:2 }}</td>
<td class="ps-1 text-center fs-10 align-content-center">{{ service.1|floatformat:2 }}</td>
<td class="ps-1 text-center fs-10 align-content-center">{{ service.0.price_|floatformat:2 }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
<div class="document-details" style="margin-top: 30px;">
<div class="section text-left">
<p><span class="label">إجمالي ضريبة القيمة المضافة:</span> {{ data.total_vat|floatformat:'2g' }}</p>
<p><span class="label">الإجمالي الكلي:</span> {{ data.grand_total|floatformat:'2g' }}</p>
<p><span class="label">كتابةً:</span> {{ data.grand_total|num_to_words }}</p>
</div>
</div>
<div class="document-footer footer-flex">
<p>&copy;&nbsp;{% now "Y" %}&nbsp;جميع الحقوق محفوظة&nbsp;<strong>هيكل</strong></p>
<p>بواسطة&nbsp;<strong>تنحل</strong></p>
</div>
</body>
</html>