Add Quotation print format and updated the Invoice and Sales Order

This commit is contained in:
Ty Reynolds
2026-01-20 11:48:51 -05:00
parent 782a88168c
commit 113aeda82f
7 changed files with 109 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ fixtures = [
{
"dt": "Print Format",
"filters": [
["name", "=", "Sales Invoice - NS"]
["name", "=", "NS Invoice"]
]
}
]

View File

@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Quotation</title>
</head>
<body style="font-family: Helvetica, Arial, sans-serif; font-size: 14px; color: #333;">
<!-- HEADER -->
<table style="width:100%; border-bottom:1px solid #ccc; margin-bottom:12px;">
<tr>
<td>
<h2 style="margin:0;">{{ doc.company }}</h2>
{% if doc.company_address %}
<p style="margin:0;">{{ doc.company_address }}</p>
{% endif %}
</td>
<td style="text-align:right;">
<h1 style="margin:0;">QUOTATION</h1>
<p style="margin:0;"><strong>Quote #:</strong> {{ doc.name }}</p>
<p style="margin:0;"><strong>Date:</strong> {{ doc.transaction_date }}</p>
{% if doc.valid_till %}
<p style="margin:0;"><strong>Valid Till:</strong> {{ doc.valid_till }}</p>
{% endif %}
</td>
</tr>
</table>
<!-- CUSTOMER -->
<table style="width:100%; margin-bottom:16px;">
<tr>
<td>
<strong>Quote To:</strong><br>
{{ doc.customer_name }}<br>
{% if doc.customer_address %}
{{ doc.customer_address }}
{% endif %}
</td>
</tr>
</table>
<!-- ITEMS TABLE -->
<table style="width:100%; border-collapse:collapse; font-size:14px;">
<thead>
<tr>
<th style="border:1px solid #ccc; padding:6px;">Item</th>
<th style="border:1px solid #ccc; padding:6px;">Description</th>
<th style="border:1px solid #ccc; padding:6px; text-align:right;">Qty</th>
<th style="border:1px solid #ccc; padding:6px; text-align:right;">Rate</th>
<th style="border:1px solid #ccc; padding:6px; text-align:right;">Amount</th>
</tr>
</thead>
<tbody>
{% for row in doc.items %}
<tr>
<td style="border:1px solid #ccc; padding:6px;">{{ row.item_code }}</td>
<td style="border:1px solid #ccc; padding:6px;">{{ row.item_name }}</td>
<td style="border:1px solid #ccc; padding:6px; text-align:right;">{{ row.qty }}</td>
<td style="border:1px solid #ccc; padding:6px; text-align:right;">{{ row.rate }}</td>
<td style="border:1px solid #ccc; padding:6px; text-align:right;">{{ row.amount }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<!-- TOTALS -->
<div style="font-size: 15px; margin-top: 8px; width: 40%; margin-left: auto;">
<p style="display:flex; justify-content:space-between;">
<strong>Subtotal:</strong>
<span>{{ doc.total }}</span>
</p>
{% for tax in doc.taxes %}
<p style="display:flex; justify-content:space-between;">
<strong>{{ tax.account_head }} ({{ tax.rate }}%):</strong>
<span>{{ tax.tax_amount }}</span>
</p>
{% endfor %}
<p style="display:flex; justify-content:space-between;">
<strong>Total:</strong>
<span>{{ doc.grand_total }}</span>
</p>
</div>
<!-- TERMS -->
{% if doc.terms %}
<hr>
<p><strong>Terms & Conditions</strong></p>
<p>{{ doc.terms }}</p>
{% endif %}
</body>
</html>

View File

@@ -0,0 +1,12 @@
[
{
"doctype": "Print Format",
"name": "NS Quotation",
"doc_type": "Quotation",
"standard": "No",
"custom_format": 1,
"disabled": 0,
"print_format_type": "Jinja",
"html": "{% include \"ns_app/print_formats/quotation_ns.html\" %}"
}
]

View File

@@ -1,5 +1,5 @@
<style>
/* 💡 Reserve space in PRINT/PDF so table does not overlap window address */
/* Reserve space in PRINT/PDF so table does not overlap window address */
@media print {
.window-address-space {
padding-top: 1in;