more compact invoice
This commit is contained in:
@@ -15,78 +15,82 @@
|
||||
body {
|
||||
font-family: 'Vazir', 'Tahoma', Arial, sans-serif;
|
||||
direction: rtl;
|
||||
padding: 10px;
|
||||
padding: 5px;
|
||||
background-color: #fff;
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
.invoice-container {
|
||||
max-width: 850px;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
padding: 20px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 15px;
|
||||
border-bottom: 2px solid #333;
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 8px;
|
||||
border-bottom: 1.5px solid #333;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
color: #333;
|
||||
font-size: 22px;
|
||||
margin-bottom: 5px;
|
||||
font-size: 16px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.header h2 {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.shop-info {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
padding: 12px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 15px;
|
||||
padding: 6px 8px;
|
||||
border-radius: 3px;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.shop-info h3 {
|
||||
font-size: 15px;
|
||||
margin-bottom: 5px;
|
||||
font-size: 11px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.shop-info p {
|
||||
font-size: 11px;
|
||||
margin: 3px 0;
|
||||
font-size: 9px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.order-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 15px;
|
||||
margin-bottom: 8px;
|
||||
background-color: #f9f9f9;
|
||||
padding: 12px;
|
||||
padding: 6px 8px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.info-section {
|
||||
flex: 1;
|
||||
margin: 0 5px;
|
||||
margin: 0 3px;
|
||||
}
|
||||
|
||||
.info-section h3 {
|
||||
color: #333;
|
||||
margin-bottom: 6px;
|
||||
font-size: 13px;
|
||||
margin-bottom: 3px;
|
||||
font-size: 10px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding-bottom: 3px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
margin: 4px 0;
|
||||
font-size: 11px;
|
||||
margin: 2px 0;
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
@@ -101,22 +105,22 @@
|
||||
.items-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin: 15px 0;
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
.items-table th {
|
||||
background-color: #333;
|
||||
color: white;
|
||||
padding: 6px;
|
||||
padding: 3px 2px;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.items-table td {
|
||||
padding: 6px;
|
||||
padding: 3px 2px;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #ddd;
|
||||
font-size: 10px;
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.items-table tr:hover {
|
||||
@@ -124,30 +128,30 @@
|
||||
}
|
||||
|
||||
.financial-summary {
|
||||
margin-top: 15px;
|
||||
margin-top: 8px;
|
||||
background-color: #f9f9f9;
|
||||
padding: 12px;
|
||||
border-radius: 5px;
|
||||
padding: 6px 8px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.summary-section {
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.summary-section h3 {
|
||||
color: #333;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
margin-bottom: 4px;
|
||||
font-size: 10px;
|
||||
border-bottom: 1px solid #667eea;
|
||||
padding-bottom: 5px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.summary-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 6px;
|
||||
padding: 3px 4px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
font-size: 11px;
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.summary-row.highlight {
|
||||
@@ -159,16 +163,16 @@
|
||||
background-color: #333;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
margin-top: 6px;
|
||||
font-size: 10px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.summary-row.payable {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: 15px;
|
||||
margin-top: 6px;
|
||||
font-size: 11px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.summary-label {
|
||||
@@ -181,9 +185,9 @@
|
||||
|
||||
.status-badge {
|
||||
display: inline-block;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
font-size: 9px;
|
||||
padding: 1px 5px;
|
||||
border-radius: 8px;
|
||||
font-size: 7px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -208,12 +212,12 @@
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 30px;
|
||||
margin-top: 10px;
|
||||
text-align: center;
|
||||
padding-top: 10px;
|
||||
padding-top: 5px;
|
||||
border-top: 1px solid #ddd;
|
||||
color: #777;
|
||||
font-size: 9px;
|
||||
font-size: 7px;
|
||||
}
|
||||
|
||||
.clearfix::after {
|
||||
@@ -235,15 +239,15 @@
|
||||
.address-box {
|
||||
background-color: #fff3cd;
|
||||
border: 1px solid #ffc107;
|
||||
padding: 10px;
|
||||
padding: 5px 8px;
|
||||
border-radius: 3px;
|
||||
margin: 12px 0;
|
||||
margin: 6px 0;
|
||||
}
|
||||
|
||||
.address-box h3 {
|
||||
color: #856404;
|
||||
margin-bottom: 6px;
|
||||
font-size: 13px;
|
||||
margin-bottom: 3px;
|
||||
font-size: 9px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@@ -255,9 +259,13 @@
|
||||
</div>
|
||||
|
||||
<div class="shop-info">
|
||||
<h3>{{ shop.shop_name }}</h3>
|
||||
<p>{{ shop.shop_description }}</p>
|
||||
<p>کمیسیون: {{ commission_percent }}%</p>
|
||||
<div>
|
||||
<h3>{{ shop.shop_name }}</h3>
|
||||
{% if shop.shop_description %}
|
||||
<p>{{ shop.shop_description|truncatewords:10 }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<p style="font-size: 10px; font-weight: bold;">کمیسیون: {{ commission_percent }}%</p>
|
||||
</div>
|
||||
|
||||
<div class="order-info">
|
||||
@@ -311,25 +319,27 @@
|
||||
{% if address_text %}
|
||||
<div class="address-box">
|
||||
<h3>آدرس تحویل</h3>
|
||||
<div class="info-row">
|
||||
<span class="info-label">گیرنده:</span>
|
||||
<span class="info-value">{{ address_recipient_name }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">آدرس:</span>
|
||||
<span class="info-value">{{ address_text }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">شهر/استان:</span>
|
||||
<span class="info-value">{{ address_city }}, {{ address_province }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">کد پستی:</span>
|
||||
<span class="info-value">{{ address_postal_code }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">تلفن:</span>
|
||||
<span class="info-value">{{ address_phone }}</span>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 8px;">
|
||||
<div class="info-row" style="flex: 1 1 45%;">
|
||||
<span class="info-label">گیرنده:</span>
|
||||
<span class="info-value">{{ address_recipient_name }}</span>
|
||||
</div>
|
||||
<div class="info-row" style="flex: 1 1 45%;">
|
||||
<span class="info-label">شهر/استان:</span>
|
||||
<span class="info-value">{{ address_city }}, {{ address_province }}</span>
|
||||
</div>
|
||||
<div class="info-row" style="flex: 1 1 60%;">
|
||||
<span class="info-label">آدرس:</span>
|
||||
<span class="info-value">{{ address_text }}</span>
|
||||
</div>
|
||||
<div class="info-row" style="flex: 1 1 18%;">
|
||||
<span class="info-label">کد پستی:</span>
|
||||
<span class="info-value">{{ address_postal_code }}</span>
|
||||
</div>
|
||||
<div class="info-row" style="flex: 1 1 18%;">
|
||||
<span class="info-label">تلفن:</span>
|
||||
<span class="info-value">{{ address_phone }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -342,34 +352,36 @@
|
||||
<th>تنوع</th>
|
||||
<th>تعداد</th>
|
||||
<th>قیمت واحد</th>
|
||||
<th>جمع</th>
|
||||
<th>تخفیف محصول</th>
|
||||
<th>تخفیف ویژه</th>
|
||||
<th>قیمت نهایی</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
{% for item_data in items_with_discount %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ item.order_item.product.product.name }}</td>
|
||||
<td>{{ item.order_item.product.title }}</td>
|
||||
<td>{{ item.quantity }}</td>
|
||||
<td>{{ item.unit_price|price_format }} تومان</td>
|
||||
<td>{{ item_data.order_item.product.product.name }}</td>
|
||||
<td>{{ item_data.order_item.product.title }}</td>
|
||||
<td>{{ item_data.item.quantity }}</td>
|
||||
<td>{{ item_data.unit_price|price_format }} تومان</td>
|
||||
<td>{{ item_data.price_before_discount|price_format }} تومان</td>
|
||||
<td class="discount-highlight">
|
||||
{% if item.discount_amount > 0 %}
|
||||
{{ item.order_item.discount_percent }}% ({{ item.discount_amount|price_format }} تومان)
|
||||
{% if item_data.order_item.discount_percent > 0 %}
|
||||
{{ item_data.order_item.discount_percent }}% ({{ item_data.discount_amount|price_format }} تومان)
|
||||
{% else %}
|
||||
---
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="discount-highlight">
|
||||
{% if item.special_discount_amount > 0 %}
|
||||
{{ item.special_discount_amount|price_format }} تومان
|
||||
{% if item_data.special_discount_amount > 0 %}
|
||||
{{ item_data.special_discount_amount|price_format }} تومان
|
||||
{% else %}
|
||||
---
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ item.total_price|price_format }} تومان</td>
|
||||
<td>{{ item_data.final_price|price_format }} تومان</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
@@ -382,44 +394,46 @@
|
||||
<span class="summary-label">تعداد کل اقلام:</span>
|
||||
<span class="summary-value">{{ total_items }}</span>
|
||||
</div>
|
||||
<div class="summary-row">
|
||||
<span class="summary-label">جمع کل (Subtotal):</span>
|
||||
|
||||
<div class="summary-row" style="background-color: #e8f5e9; font-weight: bold;">
|
||||
<span class="summary-label">۱. جمع سبد خرید (بعد از تخفیف محصولات):</span>
|
||||
<span class="summary-value">{{ subtotal|price_format }} تومان</span>
|
||||
</div>
|
||||
{% if discount_amount > 0 %}
|
||||
<div class="summary-row">
|
||||
<span class="summary-label discount-highlight">تخفیف معمولی:</span>
|
||||
<span class="summary-value discount-highlight">{{ discount_amount|price_format }} تومان</span>
|
||||
|
||||
<div class="summary-row" style="background-color: #fff3e0;">
|
||||
<span class="summary-label discount-highlight">۲. تخفیف محصولات:</span>
|
||||
<span class="summary-value discount-highlight">
|
||||
{% if items_discount_amount > 0 %}
|
||||
-{{ items_discount_amount|price_format }} تومان
|
||||
{% else %}
|
||||
0 تومان
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if special_discount_amount > 0 %}
|
||||
<div class="summary-row">
|
||||
<span class="summary-label discount-highlight">تخفیف ویژه:</span>
|
||||
<span class="summary-value discount-highlight">{{ special_discount_amount|price_format }} تومان</span>
|
||||
|
||||
<div class="summary-row" style="background-color: #fce4ec;">
|
||||
<span class="summary-label discount-highlight">۳. تخفیف ویژه محصولات:</span>
|
||||
<span class="summary-value discount-highlight">
|
||||
{% if special_discount_total > 0 %}
|
||||
-{{ special_discount_total|price_format }} تومان
|
||||
{% else %}
|
||||
0 تومان
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="summary-row">
|
||||
<span class="summary-label">مالیات:</span>
|
||||
<span class="summary-value">{{ tax_amount|price_format }} تومان</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="summary-section">
|
||||
<h3>محاسبات کمیسیون</h3>
|
||||
<div class="summary-row highlight">
|
||||
<span class="summary-label commission-highlight">درصد کمیسیون:</span>
|
||||
<span class="summary-value commission-highlight">{{ commission_percent }}%</span>
|
||||
<span class="summary-label commission-highlight">کمیسیون ({{ commission_percent }}%):</span>
|
||||
<span class="summary-value commission-highlight">-{{ commission_amount|price_format }} تومان</span>
|
||||
</div>
|
||||
<div class="summary-row highlight">
|
||||
<span class="summary-label commission-highlight">مبلغ کمیسیون:</span>
|
||||
<span class="summary-value commission-highlight">{{ commission_amount|price_format }} تومان</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="summary-section">
|
||||
<h3>مبلغ نهایی</h3>
|
||||
<div class="summary-row payable">
|
||||
<span class="summary-label">مبلغ قابل پرداخت به فروشگاه:</span>
|
||||
<span class="summary-label">قیمت نهایی (قابل پرداخت به فروشگاه):</span>
|
||||
<span class="summary-value">{{ payable_amount|price_format }} تومان</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user