haikal/templates/purchase_orders/po_detail_pdf.html
2025-09-16 17:05:29 +03:00

178 lines
5.3 KiB
HTML

{% load i18n %}
{% load static %}
{% load django_ledger %}
{% load tenhal_tag %}
{% load custom_filters %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{ po_model.po_number }}</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-right {
content: "Page " counter(page) " of " 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: left;
}
.table th {
background-color: #f2f2f2;
font-weight: bold;
}
.table tfoot td {
border-top: 2px solid #333;
font-weight: bold;
}
.text-right {
text-align: right;
}
/* Footer Styles */
.document-footer {
text-align: center;
font-size: 10px;
color: #888;
border-top: 1px solid #ddd;
padding-top: 15px;
margin-top: 30px;
}
</style>
</head>
<body>
<div class="document-header">
<div>
{% if request.dealer.logo %}
<img src="{{ request.dealer.logo.url }}" alt="Company Logo" class="logo">
{% else %}
<h1>{{ request.dealer.name }}</h1>
{% endif %}
<address>
{{ request.dealer.entity.address.street }}<br>
{{ request.dealer.entity.address.city }}, {{ request.dealer.entity.address.state }} {{ request.dealer.entity.address.zip_code }}<br>
Email: {{ request.dealer.user.email }}<br>
Phone: {{ request.dealer.phone }}
</address>
</div>
<div>
<h1>PURCHASE ORDER</h1>
<h2 style="font-size: 18px;">{{ po_model.po_number }}</h2>
</div>
</div>
<div class="document-details">
<div class="section">
<h2>BILL TO:</h2>
<p><span class="label">Vendor:</span> </p>
<p><span class="label">Email:</span> </p>
<p><span class="label">Phone:</span> </p>
<p><span class="label">Address:</span> </p>
<p>{{ po_model.vendor_model.address.city|default:"" }}, {{ po_model.vendor_model.address.state|default:"" }} {{ po_model.vendor_model.address.zip_code|default:"" }}</p>
</div>
<div class="section">
<h2>DETAILS:</h2>
<p><span class="label">PO Number:</span> {{ po_model.po_number }}</p>
<p><span class="label">Issue Date:</span> {{ po_model.date_created|date:"F j, Y" }}</p>
<p><span class="label">Status:</span> {{ po_model.get_po_status_display }}</p>
<p><span class="label">Due Date:</span> {{ po_model.due_date|date:"F j, Y"|default:"N/A" }}</p>
</div>
</div>
<div class="col-lg-12">
<div class="table-responsive">
{% po_item_table1 po_items %}
</div>
</div>
<div class="document-details" style="margin-top: 30px;">
<div class="section">
<h2>NOTES:</h2>
<p>{{ po_model.notes|default:"No additional notes." }}</p>
</div>
<div class="section text-right">
<p class="h4"><span class="label">Total Amount:</span> {{ po_total_amount|currency_format }}<span class="icon-saudi_riyal"></span></p>
</div>
</div>
<div class="document-footer">
<p>&copy; {% now "Y" %} {{ request.dealer.name }}. All rights reserved.</p>
</div>
</body>
</html>