adding logo to invoice
This commit is contained in:
parent
d28c59d57b
commit
7166fdc776
@ -1,7 +1,7 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Sales Invoice" %} #{{ sale.invoice_number|default:sale.id }} | {{ settings.business_name }}{% endblock %}
|
||||
{% block title %}{% trans "Sales Invoice" %} #{{ sale.invoice_number|default:sale.id }} | {{ site_settings.business_name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container py-4">
|
||||
@ -11,7 +11,7 @@
|
||||
<i class="bi bi-arrow-left me-2"></i>{% trans "Back to Invoices" %} / العودة إلى الفواتير
|
||||
</a>
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
{% if settings.wablas_enabled or site_settings.wablas_enabled %}
|
||||
{% if site_settings.wablas_enabled %}
|
||||
<div class="d-flex align-items-center bg-white border rounded-3 p-1 shadow-sm">
|
||||
<i class="bi bi-whatsapp text-success mx-2"></i>
|
||||
<input type="text" id="whatsappPhoneDirect" class="form-control form-control-sm border-0" style="width: 140px;" value="{{ sale.customer.phone|default:'' }}" placeholder="{% trans "Phone Number" %}">
|
||||
@ -37,17 +37,17 @@
|
||||
<div class="p-5 bg-white print-section">
|
||||
<div class="row mb-5 print-mb-2">
|
||||
<div class="col-sm-6">
|
||||
{% if settings.logo %}
|
||||
<img src="{{ settings.logo.url }}" alt="Logo" style="max-height: 80px;" class="mb-4 print-mb-2 print-logo">
|
||||
{% if site_settings.logo %}
|
||||
<img src="{{ site_settings.logo.url }}" alt="Logo" style="max-height: 80px;" class="mb-4 print-mb-2 print-logo">
|
||||
{% else %}
|
||||
<h3 class="fw-bold text-primary mb-4 print-mb-2 print-h3">{{ settings.business_name }}</h3>
|
||||
<h3 class="fw-bold text-primary mb-4 print-mb-2 print-h3">{{ site_settings.business_name }}</h3>
|
||||
{% endif %}
|
||||
<div class="text-muted small print-small">
|
||||
<p class="mb-1"><i class="bi bi-geo-alt me-2"></i>{{ settings.address }}</p>
|
||||
<p class="mb-1"><i class="bi bi-telephone me-2"></i>{{ settings.phone }}</p>
|
||||
<p class="mb-1"><i class="bi bi-envelope me-2"></i>{{ settings.email }}</p>
|
||||
{% if settings.vat_number %}
|
||||
<p class="mb-0"><i class="bi bi-receipt me-2"></i>{% trans "VAT" %} / الضريبة: {{ settings.vat_number }}</p>
|
||||
<p class="mb-1"><i class="bi bi-geo-alt me-2"></i>{{ site_settings.address }}</p>
|
||||
<p class="mb-1"><i class="bi bi-telephone me-2"></i>{{ site_settings.phone }}</p>
|
||||
<p class="mb-1"><i class="bi bi-envelope me-2"></i>{{ site_settings.email }}</p>
|
||||
{% if site_settings.vat_number %}
|
||||
<p class="mb-0"><i class="bi bi-receipt me-2"></i>{% trans "VAT" %} / الضريبة: {{ site_settings.vat_number }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@ -125,9 +125,9 @@
|
||||
<div class="fw-bold" dir="rtl">{{ item.product.name_ar }}</div>
|
||||
<div class="text-muted small">{{ item.product.name_en }}</div>
|
||||
</td>
|
||||
<td class="py-3 text-center print-py-1">{{ settings.currency_symbol }}{{ item.unit_price|floatformat:3 }}</td>
|
||||
<td class="py-3 text-center print-py-1">{{ site_settings.currency_symbol }}{{ item.unit_price|floatformat:3 }}</td>
|
||||
<td class="py-3 text-center print-py-1">{{ item.quantity|floatformat:2 }}</td>
|
||||
<td class="py-3 text-end pe-4 fw-bold text-primary print-py-1">{{ settings.currency_symbol }}{{ item.line_total|floatformat:3 }}</td>
|
||||
<td class="py-3 text-end pe-4 fw-bold text-primary print-py-1">{{ site_settings.currency_symbol }}{{ item.line_total|floatformat:3 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
@ -138,7 +138,7 @@
|
||||
<div>{% trans "Subtotal" %}</div>
|
||||
<div class="small fw-normal">المجموع الفرعي</div>
|
||||
</td>
|
||||
<td class="text-end pe-4 py-3 fw-bold border-top print-py-1">{{ settings.currency_symbol }}{{ sale.subtotal|floatformat:3 }}</td>
|
||||
<td class="text-end pe-4 py-3 fw-bold border-top print-py-1">{{ site_settings.currency_symbol }}{{ sale.subtotal|floatformat:3 }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="border-0"></td>
|
||||
@ -146,7 +146,7 @@
|
||||
<div>{% trans "VAT" %}</div>
|
||||
<div class="small fw-normal">الضريبة</div>
|
||||
</td>
|
||||
<td class="text-end pe-4 py-2 fw-bold text-muted print-py-1">{{ settings.currency_symbol }}{{ sale.vat_amount|floatformat:3 }}</td>
|
||||
<td class="text-end pe-4 py-2 fw-bold text-muted print-py-1">{{ site_settings.currency_symbol }}{{ sale.vat_amount|floatformat:3 }}</td>
|
||||
</tr>
|
||||
{% if sale.discount > 0 %}
|
||||
<tr class="text-muted">
|
||||
@ -155,7 +155,7 @@
|
||||
<div>{% trans "Discount" %}</div>
|
||||
<div class="small fw-normal">الخصم</div>
|
||||
</td>
|
||||
<td class="text-end pe-4 py-2 fw-bold print-py-1">-{{ settings.currency_symbol }}{{ sale.discount|floatformat:3 }}</td>
|
||||
<td class="text-end pe-4 py-2 fw-bold print-py-1">-{{ site_settings.currency_symbol }}{{ sale.discount|floatformat:3 }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
@ -164,7 +164,7 @@
|
||||
<div>{% trans "Grand Total" %}</div>
|
||||
<div class="small fw-normal">المجموع الكلي</div>
|
||||
</td>
|
||||
<td class="text-end pe-4 py-3 h5 fw-bold text-primary print-py-1 print-h5">{{ settings.currency_symbol }}{{ sale.total_amount|floatformat:3 }}</td>
|
||||
<td class="text-end pe-4 py-3 h5 fw-bold text-primary print-py-1 print-h5">{{ site_settings.currency_symbol }}{{ sale.total_amount|floatformat:3 }}</td>
|
||||
</tr>
|
||||
<tr class="text-success">
|
||||
<td colspan="2" class="border-0"></td>
|
||||
@ -172,7 +172,7 @@
|
||||
<div>{% trans "Total Paid" %}</div>
|
||||
<div class="small fw-normal">إجمالي المدفوع</div>
|
||||
</td>
|
||||
<td class="text-end pe-4 py-2 fw-bold print-py-1">{{ settings.currency_symbol }}{{ sale.paid_amount|floatformat:3 }}</td>
|
||||
<td class="text-end pe-4 py-2 fw-bold print-py-1">{{ site_settings.currency_symbol }}{{ sale.paid_amount|floatformat:3 }}</td>
|
||||
</tr>
|
||||
<tr class="text-danger">
|
||||
<td colspan="2" class="border-0"></td>
|
||||
@ -180,7 +180,7 @@
|
||||
<div>{% trans "Balance Due" %}</div>
|
||||
<div class="small fw-normal">الرصيد المستحق</div>
|
||||
</td>
|
||||
<td class="text-end pe-4 py-2 h5 fw-bold border-top print-py-1 print-h5">{{ settings.currency_symbol }}{{ sale.balance_due|floatformat:3 }}</td>
|
||||
<td class="text-end pe-4 py-2 h5 fw-bold border-top print-py-1 print-h5">{{ site_settings.currency_symbol }}{{ sale.balance_due|floatformat:3 }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@ -220,7 +220,7 @@
|
||||
{{ payment.payment_method_name }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="fw-bold">{{ settings.currency_symbol }}{{ payment.amount|floatformat:3 }}</td>
|
||||
<td class="fw-bold">{{ site_settings.currency_symbol }}{{ payment.amount|floatformat:3 }}</td>
|
||||
<td>{{ payment.created_by.username|default:"System" }}</td>
|
||||
<td class="text-muted">{{ payment.notes }}</td>
|
||||
</tr>
|
||||
@ -290,21 +290,21 @@ async function sendWhatsAppDirect() {
|
||||
btn.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@media print {
|
||||
@page {
|
||||
@page {
|
||||
size: A4 portrait;
|
||||
margin: 5mm;
|
||||
}
|
||||
body {
|
||||
body {
|
||||
background-color: white !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
font-size: 11px;
|
||||
}
|
||||
.container {
|
||||
.container {
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
margin: 0 !important;
|
||||
@ -351,7 +351,7 @@ async function sendWhatsAppDirect() {
|
||||
|
||||
/* Hide Backgrounds */
|
||||
.print-bg-none { background-color: transparent !important; }
|
||||
.badge {
|
||||
.badge {
|
||||
border: 1px solid #000;
|
||||
color: #000 !important;
|
||||
background: transparent !important;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user