Skip to content

Commit

Permalink
feat: 🎨 show a draft warning it the document is not booked
Browse files Browse the repository at this point in the history
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 <[email protected]>

Update print_style/print_style.scss
Co-authored-by: Raffael Meyer <[email protected]>
  • Loading branch information
Sven Förster committed Oct 22, 2024
1 parent bb70ff0 commit e2056bb
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 0 deletions.
5 changes: 5 additions & 0 deletions print_format/delivery_note.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@

<!-- CONTENT -->
<div id="text">
{% if doc.docstatus == 0 %}
<div class="document-status draft">{{ _("Draft") }}</div>
{% elif doc.docstatus == 2 %}
<div class="document-status cancelled">{{ _("Cancelled") }}</div>
{% endif %}
<div id="subject">
<strong>{{ _("Delivery Note") }} {{ doc.name }}</strong>
</div>
Expand Down
7 changes: 7 additions & 0 deletions print_format/dunning.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@

<!-- CONTENT -->
<div id="text">
<div class="document-status">
{% if doc.docstatus == 0 %}
<span style="color: orange; font-weight: bold;">{{ _("Draft") }}</span>
{% elif doc.docstatus == 2 %}
<span style="color: red; font-weight: bold;">{{ _("Cancelled") }}</span>
{% endif %}
</div>
<div id="subject">
<strong>{{ doc.dunning_type }}</strong><br>
</div>
Expand Down
7 changes: 7 additions & 0 deletions print_format/purchase_order.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@

<!-- CONTENT -->
<div id="text">
<div class="document-status">
{% if doc.docstatus == 0 %}
<span style="color: orange; font-weight: bold;">{{ _("Draft") }}</span>
{% elif doc.docstatus == 2 %}
<span style="color: red; font-weight: bold;">{{ _("Cancelled") }}</span>
{% endif %}
</div>
<div id="subject">
<strong>{{ _("Purchase Order") }} {{ doc.name }}</strong>
</div>
Expand Down
7 changes: 7 additions & 0 deletions print_format/quotation.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@

<!-- CONTENT -->
<div id="text">
<div class="document-status">
{% if doc.docstatus == 0 %}
<span style="color: orange; font-weight: bold;">{{ _("Draft") }}</span>
{% elif doc.docstatus == 2 %}
<span style="color: red; font-weight: bold;">{{ _("Cancelled") }}</span>
{% endif %}
</div>
<div id="subject">
<strong>{{ _(doc.doctype) }} {{ doc.name }}</strong>
</div>
Expand Down
7 changes: 7 additions & 0 deletions print_format/request_for_quotation.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@

<!-- CONTENT -->
<div id="text">
<div class="document-status">
{% if doc.docstatus == 0 %}
<span style="color: orange; font-weight: bold;">{{ _("Draft") }}</span>
{% elif doc.docstatus == 2 %}
<span style="color: red; font-weight: bold;">{{ _("Cancelled") }}</span>
{% endif %}
</div>
<div id="subject">
<strong>{{ _("Request for Quotation") }} {{ doc.name }}</strong>
</div>
Expand Down
7 changes: 7 additions & 0 deletions print_format/sales_invoice.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@

<!-- CONTENT -->
<div id="text">
<div class="document-status">
{% if doc.docstatus == 0 %}
<span style="color: orange; font-weight: bold;">{{ _("Draft") }}</span>
{% elif doc.docstatus == 2 %}
<span style="color: red; font-weight: bold;">{{ _("Cancelled") }}</span>
{% endif %}
</div>
<div id="subject">
{% if doc.is_return %}
<p><strong>{{ _("Correction Invoice") }} {{ doc.name }}</strong></p>
Expand Down
7 changes: 7 additions & 0 deletions print_format/sales_order.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@

<!-- CONTENT -->
<div id="text">
<div class="document-status">
{% if doc.docstatus == 0 %}
<span style="color: orange; font-weight: bold;">{{ _("Draft") }}</span>
{% elif doc.docstatus == 2 %}
<span style="color: red; font-weight: bold;">{{ _("Cancelled") }}</span>
{% endif %}
</div>
<div id="subject">
<strong>{{ _("Order Confirmation") }} {{ doc.name }}</strong>
</div>
Expand Down
15 changes: 15 additions & 0 deletions print_style/print_style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e2056bb

Please sign in to comment.