updated conditional balance due color in invoice print format
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<style>
|
<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 {
|
@media print {
|
||||||
.window-address-space {
|
.window-address-space {
|
||||||
padding-top: 1in;
|
padding-top: 1in;
|
||||||
@@ -131,9 +131,24 @@
|
|||||||
<p style="display:flex; justify-content:space-between;">
|
<p style="display:flex; justify-content:space-between;">
|
||||||
<strong>Paid:</strong><span>{{ doc.total_advance }}</span>
|
<strong>Paid:</strong><span>{{ doc.total_advance }}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
{% set balance = doc.outstanding_amount or 0 %}
|
||||||
|
|
||||||
|
{% if balance == 0 %}
|
||||||
|
{% set balance_color = "#2e7d32" %}
|
||||||
|
{% elif balance > 0 %}
|
||||||
|
{% set balance_color = "#c62828" %}
|
||||||
|
{% else %}
|
||||||
|
{% set balance_color = "#ef6c00" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<p style="display:flex; justify-content:space-between;">
|
<p style="display:flex; justify-content:space-between;">
|
||||||
<strong>Balance Due:</strong><span>{{ doc.outstanding_amount }}</span>
|
<strong style="color: {{ balance_color }} !important;">Balance Due:</strong>
|
||||||
|
<span style="color: {{ balance_color }} !important;">{{ balance }}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -150,5 +165,25 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% set balance = doc.outstanding_amount or 0 %}
|
||||||
|
|
||||||
|
|
||||||
|
{% if balance == 0 %}
|
||||||
|
<div style="text-align: center; margin-top: 35px;">
|
||||||
|
<div style="
|
||||||
|
margin-top: 35px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #2e7d32;
|
||||||
|
border: 3px solid #2e7d32;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 10px 40px;
|
||||||
|
transform: rotate(-5deg);
|
||||||
|
">
|
||||||
|
PAID
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user