pdf print added

This commit is contained in:
Faheed 2025-09-17 14:10:07 +03:00
parent b61791cbc9
commit 2a8e2bd276
8 changed files with 351 additions and 376 deletions

View File

@ -342,11 +342,6 @@ urlpatterns = [
views.CarDetailView.as_view(), views.CarDetailView.as_view(),
name="car_detail", name="car_detail",
), ),
path(
"<slug:dealer_slug>/cars/<slug:slug>/estimate/",
views.create_estimate_for_car,
name="create_estimate_for_car",
),
path("cars/<slug:slug>/history/", views.car_history, name="car_history"), path("cars/<slug:slug>/history/", views.car_history, name="car_history"),
path( path(
"<slug:dealer_slug>/cars/<slug:slug>/update/", "<slug:dealer_slug>/cars/<slug:slug>/update/",
@ -794,7 +789,7 @@ urlpatterns = [
), ),
path( path(
"<slug:dealer_slug>/sales/estimates/create/<slug:slug>/", "<slug:dealer_slug>/sales/estimates/create/<slug:slug>/",
views.estimate_create_from_opportunity, views.create_estimate,
name="estimate_create_from_opportunity", name="estimate_create_from_opportunity",
), ),
path( path(

View File

@ -5121,6 +5121,28 @@ class EstimatePrintView(EstimateDetailView):
""" """
template_name = "sales/estimates/estimate_preview.html" template_name = "sales/estimates/estimate_preview.html"
def get(self, request, *args, **kwargs):
self.object = self.get_object()
context = self.get_context_data(object=self.object)
# lang = request.GET.get('lang', 'ar')
template_path = "sales/estimates/estimate_preview.html"
html_string = render_to_string(template_path, context)
pdf_file = HTML(string=html_string).write_pdf()
response = HttpResponse(pdf_file, content_type='application/pdf')
response['Content-Disposition'] = f'attachment; filename="estimate_{self.object.estimate_number}.pdf"'
return response
@login_required @login_required

View File

@ -0,0 +1,52 @@
{% load django_ledger %}
{% load i18n %}
{%load tenhal_tag %}
<div class="table-container">
<table class="table is-fullwidth is-narrow is-striped is-bordered django-ledger-table-bottom-margin-75">
<thead>
<tr>
<th>{% trans "PO Number" %}</th>
<th>{% trans "Description" %}</th>
<th>{% trans "Status Date" %}</th>
<th>{% trans "PO Status" %}</th>
<th>{% trans "PO Amount" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
{% for po in po_list %}
<tr>
<td>
{% if po.po_number %}{{ po.po_number }}{% endif %}
</td>
<td>{{ po.po_title }}</td>
<td>{{ po.get_status_action_date }}</td>
<td>{{ po.get_po_status_display }}</td>
<td>
<span class="currency">{{ CURRENCY }}</span>{{ po.po_amount | currency_format }}
</td>
<td class="has-text-centered">
<div class="dropdown is-right is-hoverable" id="bill-action-{{ po.uuid }}">
<div class="dropdown-trigger">
<button class="button is-small is-rounded is-outlined is-dark"
aria-haspopup="true"
aria-controls="dropdown-menu">
<span>{% trans "Actions" %}</span>
<span class="icon is-small">{% icon 'bi:arrow-down' 24 %}</span>
</button>
</div>
<div class="dropdown-menu" id="dropdown-menu-{{ po.uuid }}" role="menu">
<div class="dropdown-content">
<a href="{% url 'purchase_order_detail' po_pk=po.uuid %}"
class="dropdown-item has-text-success">{% trans "Details" %}</a>
<a href="{% url 'po-delete' entity_slug=entity_slug po_pk=po.uuid %}"
class="dropdown-item has-text-weight-bold has-text-danger">{% trans ' Delete' %}</a>
</div>
</div>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View File

@ -1,6 +1,3 @@
{% load i18n %}
{% load static %}
{% load django_ledger %}
{% load tenhal_tag %} {% load tenhal_tag %}
{% load custom_filters %} {% load custom_filters %}
@ -119,6 +116,12 @@
padding-top: 15px; padding-top: 15px;
margin-top: 30px; margin-top: 30px;
} }
.footer-flex {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
</style> </style>
</head> </head>
<body> <body>
@ -128,11 +131,7 @@
<h2 style="font-size: 18px;">{{ po_model.po_number }}</h2> <h2 style="font-size: 18px;">{{ po_model.po_number }}</h2>
</div> </div>
<div> <div>
{% if dealer.logo %}
<img src="{{ dealer.logo.url }}" alt="شعار الشركة" class="logo">
{% else %}
<h1>{{ dealer.name }}</h1> <h1>{{ dealer.name }}</h1>
{% endif %}
<address> <address>
العنوان: {{ dealer.address }}<br> العنوان: {{ dealer.address }}<br>
البريد الإلكتروني: {{ dealer.user.email }}<br> البريد الإلكتروني: {{ dealer.user.email }}<br>
@ -175,8 +174,9 @@
</div> </div>
</div> </div>
<div class="document-footer"> <div class="document-footer footer-flex">
<p>&copy;&nbsp;حائل&nbsp;{% now "Y" %}&nbsp;جميع الحقوق محفوظة.</p> <p>&copy;&nbsp;<strong>هيكل</strong>&nbsp;{% now "Y" %}&nbsp;جميع الحقوق محفوظة.</p>
<p><strong>تنحل</strong>مدعوم من</p>
</div> </div>
</body> </body>
</html> </html>

View File

@ -112,16 +112,19 @@
padding-top: 15px; padding-top: 15px;
margin-top: 30px; margin-top: 30px;
} }
.footer-flex {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
</style> </style>
</head> </head>
<body> <body>
<div class="document-header"> <div class="document-header">
<div> <div>
{% if request.dealer.logo %}
<img src="{{ dealer.logo.url }}" alt="Company Logo" class="logo">
{% else %}
<h1>{{ dealer.name }}</h1> <h1>{{ dealer.name }}</h1>
{% endif %}
<address> <address>
Address: {{ dealer.address}}<br> Address: {{ dealer.address}}<br>
Email: {{ dealer.user.email }}<br> Email: {{ dealer.user.email }}<br>
@ -162,8 +165,9 @@
</div> </div>
</div> </div>
<div class="document-footer"> <div class="document-footer footer-flex">
<p>&copy;&nbsp;Haikal&nbsp;{% now "Y" %} {{ request.dealer.name }}. All rights reserved.</p> <p>&copy;&nbsp;{% now "Y" %}&nbsp;All rights reserved&nbsp;<strong>Haikal</strong>&nbsp;</p>
<p>Powered By&nbsp;<strong>Tenhal</strong></p>
</div> </div>
</body> </body>

View File

@ -1,5 +1,5 @@
{%load tenhal_tag%} {%load tenhal_tag %}
{% load custom_filters%} {% load custom_filters %}
<div class="table-container"> <div class="table-container">
<table class="table is-fullwidth is-striped is-narrow is-bordered"> <table class="table is-fullwidth is-striped is-narrow is-bordered">
<thead> <thead>

View File

@ -1,362 +1,264 @@
{% load i18n static custom_filters num2words_tags %} {% load i18n static custom_filters num2words_tags %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ar" dir="rtl"> <html lang="ar" dir="rtl">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>{% trans "Quotation" %}</title>
<title>{% trans "Quotation" %}</title> <style>
<link href="{% static 'css/theme.min.css' %}" /* General Body and Font Styles */
type="text/css" body {
rel="stylesheet" font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
id="style-default"> font-size: 12px;
<link href="{% static 'css/user.min.css' %}" color: #333;
type="text/css" margin: 0;
rel="stylesheet" padding: 0;
id="user-style-default"> }
<link href="{% static 'css/custom.css' %}" type="text/css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap"
rel="stylesheet">
<style>
body {
font-family: 'Roboto', sans-serif;
margin: 0;
padding: 0;
background-color: #f8f9fa;
}
.invoice-container { /* Page Layout and Margins for PDF */
width: 210mm; @page {
min-height: 297mm; size: A4;
padding: 10mm; margin: 20mm;
margin: 10mm auto; @top-left {
background: white; content: "صفحة " counter(page) " من " counter(pages);
border-radius: 5px; font-size: 10px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); color: #555;
display: flex;
flex-direction: column;
} }
}
.invoice-content { /* Header Styles */
flex-grow: 1; .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;
}
.invoice-header { /* Document Details Section */
text-align: center; .document-details {
border-bottom: 2px solid #dee2e6; display: flex;
padding-bottom: 10px; justify-content: space-between;
margin-bottom: 20px; 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;
}
.qr-code { /* Table Styles */
text-align: center; .table {
margin-top: 10px; 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;
}
.qr-code img {
width: 3cm;
height: 3cm;
border-radius: 0.3333333333rem;
}
.invoice-details, .invoice-table { /* Footer Styles */
font-size: 14px; .document-footer {
} text-align: center;
font-size: 10px;
.invoice-table th { color: #888;
background-color: #f8f9fa; border-top: 1px solid #ddd;
font-weight: 600; padding-top: 15px;
} margin-top: 30px;
}
.invoice-total { .footer-flex {
text-align: right; display: flex;
font-size: 16px; justify-content: space-between;
font-weight: 600; align-items: center;
margin-top: 10px; width: 100%;
} }
</style>
.footer-note { </head>
margin-top: auto; <body>
padding-top: 10mm; <div class="document-header">
font-size: 13px; <div>
display: flex; <h1>{{ request.dealer.name }}</h1>
justify-content: space-between; <address>
align-items: center; العنوان: {{ request.dealer.address }}<br>
border-top: 2px solid #dee2e6; البريد الإلكتروني: {{ request.dealer.user.email }}<br>
} الهاتف: {{ request.dealer.phone_number }}<br>
رقم السجل التجاري: {{ request.dealer.crn }}&nbsp;&nbsp;|&nbsp;الرقم الضريبي: {{ request.dealer.vrn }}
.logo-img img { </address>
width: 10mm;
height: 10mm;
}
</style>
</head>
<body>
<div class="row p-2">
<div class="col-2">
<button class="btn btn-sm btn-phoenix-danger w-100"
onclick="window.history.back()">الرجوع&nbsp;/&nbsp;Back</button>
</div>
<div class="col-2">
<button class="btn btn-sm btn-phoenix-primary w-100" id="download-pdf">تحميل&nbsp;/&nbsp;Download</button>
</div>
<div class="col-8"></div>
</div> </div>
<div class="invoice-container" id="estimate-content"> <div>
<div class="invoice-content"> <h1>عرض سعر</h1>
<div class="invoice-header"> <h2 style="font-size: 18px;">{{ estimate.estimate_number }}</h2>
<h5 class="fs-5"> </div>
<span>Quotation</span>&nbsp;/&nbsp;<span>عرض سعر</span> </div>
</h5>
</div> <div class="document-details">
<div class="invoice-details p-1"> <div class="section">
<div class="d-flex justify-content-end align-items-end"> <h2>{{ estimate.customer.customer_name }}: إلى</h2>
<div class="dealer-logo "> <p><span class="label">العميل: {{ estimate.customer.customer_name }}</span></p>
{% if request.dealer.logo %} <p><span class="label">البريد الإلكتروني: {{ estimate.customer.email |default:"N/A"}}</span></p>
<img class="rounded-soft" <p><span class="label">الهاتف: {{ estimate.customer.phone_number|default:"N/A" }}</span></p>
style="max-width:200px; <p><span class="label">العنوان: {{ estimate.customer.address_1|default:"N/A" }}</span></p>
max-height:200px" </div>
src="{{ request.dealer.logo.url|default:'' }}" <div class="section text-left">
alt="Dealer Logo" /> <h2>التفاصيل:</h2>
{% endif %} <p><span class="label">رقم عرض السعر:</span> {{ estimate.estimate_number }}</p>
</div> <p><span class="label">تاريخ الإصدار:</span> {{ estimate.date_approved|date:"Y/m/d" }}</p>
</div> <p><span class="label">طريقة الدفع:</span> {{ estimate.get_terms_display }}</p>
<table class="table table-sm table-responsive border-gray-50"> </div>
<tr> </div>
<td class="ps-1">
<strong>Dealership Name</strong> <div class="col-lg-12">
</td> <div class="table-responsive">
<td class="text-center">{{ request.dealer.name }}</td> <div class="d-flex justify-content-between">
<td class="text-end"> <span class="fs-9 fw-thin">تفاصيل السيارة</span>
<strong>اسم الوكالة</strong>
</td>
</tr>
<tr>
<td class="ps-1">
<strong>Dealership Address</strong>
</td>
<td class="text-center">{{ request.dealer.address }}</td>
<td class="text-end">
<strong>العنوان</strong>
</td>
</tr>
<tr>
<td class="ps-1">
<strong>Phone</strong>
</td>
<td class="text-center">{{ request.dealer.phone_number }}</td>
<td class="text-end">
<strong>جوال</strong>
</td>
</tr>
<tr>
<td>
<strong>VAT Number</strong>
</td>
<td class="text-center">{{ request.dealer.vrn }}</td>
<td class="text-end">
<strong>الرقم الضريبي</strong>
</td>
</tr>
</table>
<table class="table table-sm table-bordered border-gray-50 ">
<tr>
<td class="ps-1">
<strong>Quotation&nbsp;Number</strong>
</td>
<td class="text-center">{{ estimate.estimate_number }}</td>
<td class="text-end p-1">
<strong>رقم عرض السعر</strong>
</td>
</tr>
<tr>
<td class="ps-1">
<strong>Date</strong>
</td>
<td class="text-center">{{ estimate.date_approved| date:"Y/m/d" }}</td>
<td class="text-end p-1">
<strong>التاريخ</strong>
</td>
</tr>
<tr>
<td class="ps-1">
<strong>Customer Name</strong>
</td>
<td class="text-center">{{ estimate.customer.customer_name }}</td>
<td class="text-end p-1">
<strong>العميل</strong>
</td>
</tr>
<tr>
<td class="ps-1">
<strong>Email</strong>
</td>
<td class="text-center">{{ estimate.customer.email |default:"N/A" }}</td>
<td class="text-end p-1">
<strong>البريد الإلكتروني</strong>
</td>
</tr>
<tr>
<td class="ps-1">
<strong>Terms</strong>
</td>
<td class="text-center">{{ estimate.get_terms_display }}</td>
<td class="text-end p-1">
<strong>طريقة&nbsp;الدفع</strong>
</td>
</tr>
</table>
</div>
<div class="d-flex justify-content-between">
<span class="fs-9 fw-thin">Car Details</span>
<span class="fs-9 fw-thin">تفاصيل السيارة</span>
</div>
<div class="invoice-table p-1">
<table class="table table-sm table-bordered m-1">
<thead>
<tr>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">Make</span> / <span class="fs-10">الصانع</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">Model</span> / <span class="fs-10">الموديل</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">Series</span> / <span class="fs-10">السلسلة</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">Trim</span> / <span class="fs-10">الفئة</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">Year</span> / <span class="fs-10">السنة</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">VIN</span> / <span class="fs-10">رقم الهيكل</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">Quantity</span> / <span class="fs-10">الكمية</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">Unit Price</span> / <span class="fs-10">سعر الوحدة</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">Discount</span> / <span class="fs-10">الخصم</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">VAT</span> / <span class="fs-10">الضريبة</span>
</th>
<th class="text-wrap text-center align-content-center">
<span class="fs-10">Total</span> / <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 class="d-flex justify-content-between">
<span class="fs-9 fw-thin">Additional&nbsp;Services</span>
<span class="fs-9 fw-thin">الخدمات&nbsp;الإضافية</span>
</div>
{% if data.additional_services %}
<div class="invoice-table p-1">
<table class="table table-sm table-bordered m-1">
<thead>
<tr>
<th class="text-center fs-10 align-content-center">Type&nbsp;/&nbsp;النوع</th>
<th class="text-center fs-10 align-content-center">Price&nbsp;/&nbsp;القيمة</th>
<th class="text-center fs-10 align-content-center">VAT&nbsp;/&nbsp;ضريبة الخدمة</th>
<th class="text-center fs-10 align-content-center">
<span class="fs-10">Total</span> / <span class="fs-10">الإجمالي</span>
</th>
</tr>
</thead>
<tbody>
{% for service in data.additional_services.services %}
<tr>
<td class="ps-1 text-start fs-10 align-content-center">{{ service.0.name }}</td>
<td class="ps-1 text-center fs-10 align-content-center">{{ service.0.price|floatformat }}</td>
<td class="ps-1 text-center fs-10 align-content-center">{{ service.1|floatformat }}</td>
<td class="ps-1 text-center fs-10 align-content-center">{{ service.0.price_|floatformat }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
<div class="invoice-total d-flex justify-content-end">
<div class="table-responsive">
<table class="table table-sm table-responsive">
<tr>
<td class="text-start ps-1">
<strong class="fs-9">Total VAT</strong>
</td>
<td class="text-center">
<span class="fs-9">{{ data.total_vat|floatformat }} <span class="icon-saudi_riyal"></span></span>
</td>
<td class="text-end">
<strong class="fs-9">إجمالي&nbsp;ضريبة&nbsp;القيمة&nbsp;المضافة</strong>
</td>
</tr>
<tr>
<td class="text-start ps-1">
<strong class="fs-9">Grand Total</strong>
</td>
<td class="text-center">
<span class="fs-9">{{ data.grand_total|floatformat }}&nbsp;<span class="icon-saudi_riyal"></span></span>
</td>
<td class="text-end">
<strong class="fs-9">الإجمالي</strong>
</td>
</tr>
<tr>
<td class="text-end" colspan="3">
<span class="fs-9 fw-bold">كتابةً:&nbsp;</span><span class="fs-9">{{ data.grand_total|num_to_words }}&nbsp;<span class="icon-saudi_riyal"></span></span>
</td>
</tr>
</table>
</div>
</div>
</div> </div>
<div class="footer-note"> <table class="table table-sm table-bordered m-1">
<div class="logo-img text-center"> <thead>
<img src="{% static 'images/logos/logo-d-pdf.png' %}" alt="Logo" /> <tr>
<p class="fs-9 fw-bold"> <th class="text-wrap text-center align-content-center">
<span>Haikal</span>&nbsp;|&nbsp;<span>هيكل</span> <span class="fs-10">الصانع</span>
</p> </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> </div>
<p class="fs-11"> <table class="table table-sm table-bordered m-1">
<span class="fw-thin">Powered&nbsp;by&nbsp;</span> <thead>
<a class="text-decoration-none fs-9" <tr>
href="https://tenhal.sa" <th class="text-center fs-10 align-content-center">النوع</th>
style="color: #112e40"><span>TENHAL</span>&nbsp;|&nbsp;<span>تنحل</span></a> <th class="text-center fs-10 align-content-center">القيمة</th>
</p> <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>
</div> </div>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script> {% endif %}
<script src="{% static 'js/html2pdf.bundle.min.js' %}"></script>
<script> <div class="document-details" style="margin-top: 30px;">
document.getElementById('download-pdf').addEventListener('click', function () { <div class="section text-left">
html2pdf().from(document.getElementById('estimate-content')).set({ <p><span class="label">إجمالي ضريبة القيمة المضافة:</span> {{ data.total_vat|floatformat:'2g' }}</p>
margin: 0, <p><span class="label">الإجمالي الكلي:</span> {{ data.grand_total|floatformat:'2g' }}</p>
filename: "{{ estimate.estimate_number }}_{{ estimate.customer.customer_name  }}_{{estimate.date_approved|date:'Y-m-d' }}.pdf", <p><span class="label">كتابةً:</span> {{ data.grand_total|num_to_words }}</p>
image: { type: 'jpeg', quality: 0.98 }, </div>
html2canvas: { scale: 3 }, </div>
jsPDF: { unit: 'mm', format: 'a3', orientation: 'portrait' }
}).save(); <div class="document-footer footer-flex">
}); <p>&copy;&nbsp;{% now "Y" %}&nbsp;جميع الحقوق محفوظة&nbsp;<strong>هيكل</strong></p>
</script> <p>بواسطة&nbsp;<strong>تنحل</strong></p>
</body> </div>
</body>
</html> </html>