From e2056bb027a4baf046617efd05c7de0d3eb69e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20F=C3=B6rster?= Date: Wed, 16 Oct 2024 10:18:41 +0200 Subject: [PATCH] feat: :art: show a draft warning it the document is not booked shows a documentstate of Draft and Cancelled if the document is not booked regularly Update print_format/delivery_note.jinja Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Update print_style/print_style.scss Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> --- print_format/delivery_note.jinja | 5 +++++ print_format/dunning.jinja | 7 +++++++ print_format/purchase_order.jinja | 7 +++++++ print_format/quotation.jinja | 7 +++++++ print_format/request_for_quotation.jinja | 7 +++++++ print_format/sales_invoice.jinja | 7 +++++++ print_format/sales_order.jinja | 7 +++++++ print_style/print_style.scss | 15 +++++++++++++++ 8 files changed, 62 insertions(+) diff --git a/print_format/delivery_note.jinja b/print_format/delivery_note.jinja index 6a0468b..55b7777 100644 --- a/print_format/delivery_note.jinja +++ b/print_format/delivery_note.jinja @@ -71,6 +71,11 @@
+ {% if doc.docstatus == 0 %} +
{{ _("Draft") }}
+ {% elif doc.docstatus == 2 %} +
{{ _("Cancelled") }}
+ {% endif %}
{{ _("Delivery Note") }} {{ doc.name }}
diff --git a/print_format/dunning.jinja b/print_format/dunning.jinja index cd42b6b..0213c5a 100644 --- a/print_format/dunning.jinja +++ b/print_format/dunning.jinja @@ -98,6 +98,13 @@
+
+ {% if doc.docstatus == 0 %} + {{ _("Draft") }} + {% elif doc.docstatus == 2 %} + {{ _("Cancelled") }} + {% endif %} +
{{ doc.dunning_type }}
diff --git a/print_format/purchase_order.jinja b/print_format/purchase_order.jinja index 1b72a06..9b93622 100644 --- a/print_format/purchase_order.jinja +++ b/print_format/purchase_order.jinja @@ -65,6 +65,13 @@
+
+ {% if doc.docstatus == 0 %} + {{ _("Draft") }} + {% elif doc.docstatus == 2 %} + {{ _("Cancelled") }} + {% endif %} +
{{ _("Purchase Order") }} {{ doc.name }}
diff --git a/print_format/quotation.jinja b/print_format/quotation.jinja index 168592c..a0022e3 100644 --- a/print_format/quotation.jinja +++ b/print_format/quotation.jinja @@ -80,6 +80,13 @@
+
+ {% if doc.docstatus == 0 %} + {{ _("Draft") }} + {% elif doc.docstatus == 2 %} + {{ _("Cancelled") }} + {% endif %} +
{{ _(doc.doctype) }} {{ doc.name }}
diff --git a/print_format/request_for_quotation.jinja b/print_format/request_for_quotation.jinja index 9161fed..bf52eaf 100644 --- a/print_format/request_for_quotation.jinja +++ b/print_format/request_for_quotation.jinja @@ -76,6 +76,13 @@
+
+ {% if doc.docstatus == 0 %} + {{ _("Draft") }} + {% elif doc.docstatus == 2 %} + {{ _("Cancelled") }} + {% endif %} +
{{ _("Request for Quotation") }} {{ doc.name }}
diff --git a/print_format/sales_invoice.jinja b/print_format/sales_invoice.jinja index 170ae09..d9ecce6 100644 --- a/print_format/sales_invoice.jinja +++ b/print_format/sales_invoice.jinja @@ -111,6 +111,13 @@
+
+ {% if doc.docstatus == 0 %} + {{ _("Draft") }} + {% elif doc.docstatus == 2 %} + {{ _("Cancelled") }} + {% endif %} +
{% if doc.is_return %}

{{ _("Correction Invoice") }} {{ doc.name }}

diff --git a/print_format/sales_order.jinja b/print_format/sales_order.jinja index e08ccf1..7a3d55a 100644 --- a/print_format/sales_order.jinja +++ b/print_format/sales_order.jinja @@ -82,6 +82,13 @@
+
+ {% if doc.docstatus == 0 %} + {{ _("Draft") }} + {% elif doc.docstatus == 2 %} + {{ _("Cancelled") }} + {% endif %} +
{{ _("Order Confirmation") }} {{ doc.name }}
diff --git a/print_style/print_style.scss b/print_style/print_style.scss index cff1df6..eb27600 100644 --- a/print_style/print_style.scss +++ b/print_style/print_style.scss @@ -52,6 +52,21 @@ padding: 1.5px !important; } + .document-status { + font-size: 14pt; + font-weight: bold; + text-align: center; + text-transform: uppercase; + + &.draft { + color: orange; + } + + &.cancelled { + color: red; + } + } + #subject { margin-bottom: 2em; }