haikal/templates/purchase_orders/po_detail_ar_pdf.html

237 lines
7.5 KiB
HTML

{% load tenhal_tag %}
{% load custom_filters %}
{% load i18n static custom_filters num2words_tags %}
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<title>{{ po_model.po_number }}</title>
<style>
@font-face {
font-family: 'Noto Sans Arabic';
src: url('https://fonts.gstatic.com/s/notosansarabic/v35/or3qQxoQpw-Gv0yqj6V1p-B3.ttf') format('truetype');
}
/* General Body and Font Styles */
body {
font-family: 'Noto Sans Arabic', sans-serif;
font-size: 12px;
color: #333;
margin: 0;
padding: 0;
direction: rtl; /* This is the key for RTL support */
}
/* 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: left; /* Aligned to the left for RTL layout */
font-style: normal;
font-size: 10px;
}
/* Document Details Section */
.document-details {
display: flex;
flex-direction: row-reverse; /* Reverses the order of the sections */
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; /* Aligned to the right for RTL layout */
}
.table th {
background-color: #f2f2f2;
font-weight: bold;
}
.table tfoot td {
border-top: 2px solid #333;
font-weight: bold;
}
.text-right {
text-align: left; /* This is now for left alignment in an RTL context */
}
/* Footer Styles */
.document-footer {
position: relative;
bottom: 0;
left: 0;
width: 100%;
text-align: center;
font-size: 10px;
color: #888;
padding-top: 15px;
margin: 0 20mm;
}
.footer-flex {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.footer-logo {
text-align: center;
}
.footer-logo img {
height: 20px;
width: 20px;
}
.footer-logo p {
font-size: 9px;
font-weight: bold;
}
.footer-powered p {
font-size: 11px;
}
.footer-powered span {
font-weight: lighter;
}
.footer-powered a {
color: #112e40;
text-decoration: none;
font-size: 9px;
}
</style>
</head>
<body>
<div class="document-header">
<div>
<h1>{{ dealer.name }}</h1>
<address>
العنوان&nbsp;:&nbsp;{{ dealer.address }}<br>
البريد الإلكتروني&nbsp;:&nbsp;{{ dealer.user.email }}<br>
الهاتف&nbsp;:&nbsp;{{ dealer.phone_number }}<br>
رقم السجل التجاري&nbsp;:&nbsp;{{ dealer.crn }} &nbsp;|&nbsp; رقم ضريبة القيمة المضافة&nbsp;:&nbsp;{{ dealer.vrn }}
</address>
</div>
<div>
<div class="dealer-logo ">
{% if dealer.logo %}
<img class="rounded-soft"
style="max-width:100px;
max-height:100px"
src="{{dealer.logo.url|default:'' }}"
alt="Dealer Logo" />
{% endif %}
</div>
</div>
<div>
<h1>أمر شراء</h1>
<h2 style="font-size: 18px;">{{ po_model.po_number }}</h2>
</div>
</div>
<div class="document-details">
<div class="section">
<h2>التفاصيل:</h2>
<p><span class="label">رقم أمر الشراء&nbsp;:&nbsp;</span> {{ po_model.po_number }}</p>
<p><span class="label">تاريخ الإصدار&nbsp;:&nbsp;</span> {{ po_model.date_fulfilled|date:"Y/m/d" }}</p>
</div>
<div class="section">
<h2>يُرسل إلى:</h2>
<p><span class="label">المورد&nbsp;:&nbsp;</span> {{ vendor.vendor_name }}</p>
<p><span class="label">البريد الإلكتروني&nbsp;:&nbsp;</span> {{ vendor.email }}</p>
<p><span class="label">الهاتف&nbsp;:&nbsp;</span> {{ vendor.phone }}</p>
<p><span class="label">العنوان&nbsp;:&nbsp;</span> {{ vendor.address_1 }}</p>
</div>
</div>
<div class="col-lg-12">
<div class="table-responsive">
{% include 'purchase_orders/tags/po_item_table_print_ar.html' with po_items_list=po_items_list %}
</div>
</div>
<div class="document-details" style="margin-top: 30px;">
<div class="section" style="width: 100%;">
<h2>ملاحظات:</h2>
<p>{{ po_model.notes|default:"لا توجد ملاحظات إضافية." }}</p>
</div>
</div>
<div class="document-details" style="margin-top: 10px; border-top: 1px solid #ddd; padding-top: 10px;">
<div class="section text-right" style="width: 100%;">
<p class="h4"><span class="label">المبلغ الإجمالي&nbsp;:&nbsp;</span> {{ po_total_amount|currency_format }}<span class="icon-saudi_riyal"></span></p>
</div>
</div>
<hr style="border-bottom:1px solid #ccc; ">
<div class="document-footer">
<div class="footer-logo">
<img src="{% static 'images/logos/logo-d-pdf.png' %}" alt="Logo" />
<p>
<span>Haikal</span>&nbsp;|&nbsp;<span>هيكل</span>
</p>
</div>
<div class="footer-powered">
<p>
<span>Powered&nbsp;by&nbsp;</span>
<a href="https://tenhal.sa"><span>TENHAL</span>&nbsp;|&nbsp;<span>تنحل</span></a>
</p>
</div>
</div>
</body>
</html>