diff --git a/backend/templates/order/invoice_shop_order.html b/backend/templates/order/invoice_shop_order.html index 0f10123..0f9f887 100644 --- a/backend/templates/order/invoice_shop_order.html +++ b/backend/templates/order/invoice_shop_order.html @@ -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; } @@ -255,9 +259,13 @@
-

{{ shop.shop_name }}

-

{{ shop.shop_description }}

-

کمیسیون: {{ commission_percent }}%

+
+

{{ shop.shop_name }}

+ {% if shop.shop_description %} +

{{ shop.shop_description|truncatewords:10 }}

+ {% endif %} +
+

کمیسیون: {{ commission_percent }}%

@@ -311,25 +319,27 @@ {% if address_text %}

آدرس تحویل

-
- گیرنده: - {{ address_recipient_name }} -
-
- آدرس: - {{ address_text }} -
-
- شهر/استان: - {{ address_city }}, {{ address_province }} -
-
- کد پستی: - {{ address_postal_code }} -
-
- تلفن: - {{ address_phone }} +
+
+ گیرنده: + {{ address_recipient_name }} +
+
+ شهر/استان: + {{ address_city }}, {{ address_province }} +
+
+ آدرس: + {{ address_text }} +
+
+ کد پستی: + {{ address_postal_code }} +
+
+ تلفن: + {{ address_phone }} +
{% endif %} @@ -342,34 +352,36 @@ تنوع تعداد قیمت واحد + جمع تخفیف محصول تخفیف ویژه قیمت نهایی - {% for item in items %} + {% for item_data in items_with_discount %} {{ forloop.counter }} - {{ item.order_item.product.product.name }} - {{ item.order_item.product.title }} - {{ item.quantity }} - {{ item.unit_price|price_format }} تومان + {{ item_data.order_item.product.product.name }} + {{ item_data.order_item.product.title }} + {{ item_data.item.quantity }} + {{ item_data.unit_price|price_format }} تومان + {{ item_data.price_before_discount|price_format }} تومان - {% 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 %} - {% 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 %} - {{ item.total_price|price_format }} تومان + {{ item_data.final_price|price_format }} تومان {% endfor %} @@ -382,44 +394,46 @@ تعداد کل اقلام: {{ total_items }}
-
- جمع کل (Subtotal): + +
+ ۱. جمع سبد خرید (بعد از تخفیف محصولات): {{ subtotal|price_format }} تومان
- {% if discount_amount > 0 %} -
- تخفیف معمولی: - {{ discount_amount|price_format }} تومان + +
+ ۲. تخفیف محصولات: + + {% if items_discount_amount > 0 %} + -{{ items_discount_amount|price_format }} تومان + {% else %} + 0 تومان + {% endif %} +
- {% endif %} - {% if special_discount_amount > 0 %} -
- تخفیف ویژه: - {{ special_discount_amount|price_format }} تومان + +
+ ۳. تخفیف ویژه محصولات: + + {% if special_discount_total > 0 %} + -{{ special_discount_total|price_format }} تومان + {% else %} + 0 تومان + {% endif %} +
- {% endif %} +
مالیات: {{ tax_amount|price_format }} تومان
-
- -
-

محاسبات کمیسیون

+
- درصد کمیسیون: - {{ commission_percent }}% + کمیسیون ({{ commission_percent }}%): + -{{ commission_amount|price_format }} تومان
-
- مبلغ کمیسیون: - {{ commission_amount|price_format }} تومان -
-
- -
-

مبلغ نهایی

+
- مبلغ قابل پرداخت به فروشگاه: + قیمت نهایی (قابل پرداخت به فروشگاه): {{ payable_amount|price_format }} تومان