feat: Exclude current month from Pay buttons and balance
Hide Pay/Pay All buttons for months still in progress, exclude current month debt from balance column, and show in-progress month debt in a muted red color. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -167,6 +167,12 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.cell-unpaid-current {
|
||||
color: #994444;
|
||||
background-color: rgba(153, 68, 68, 0.05);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.cell-overridden {
|
||||
color: #ffa500 !important;
|
||||
}
|
||||
@@ -532,9 +538,9 @@
|
||||
</td>
|
||||
{% for cell in row.months %}
|
||||
<td data-month-idx="{{ loop.index0 }}" title="{{ cell.tooltip }}"
|
||||
class="{% if cell.status == 'empty' %}cell-empty{% elif cell.status == 'unpaid' or cell.status == 'partial' %}cell-unpaid{% elif cell.status == 'ok' %}cell-ok{% endif %}{% if cell.overridden %} cell-overridden{% endif %}">
|
||||
class="{% if cell.status == 'empty' %}cell-empty{% elif (cell.status == 'unpaid' or cell.status == 'partial') and cell.raw_month >= current_month %}cell-unpaid-current{% elif cell.status == 'unpaid' or cell.status == 'partial' %}cell-unpaid{% elif cell.status == 'ok' %}cell-ok{% endif %}{% if cell.overridden %} cell-overridden{% endif %}">
|
||||
{{ cell.text }}
|
||||
{% if cell.status == 'unpaid' or cell.status == 'partial' %}
|
||||
{% if (cell.status == 'unpaid' or cell.status == 'partial') and cell.raw_month < current_month %}
|
||||
<button class="pay-btn"
|
||||
onclick="showPayQR('{{ row.name|e }}', {{ cell.amount }}, '{{ cell.month|e }}', '{{ cell.raw_month }}')">Pay</button>
|
||||
{% endif %}
|
||||
@@ -542,9 +548,9 @@
|
||||
{% endfor %}
|
||||
<td class="{% if row.balance > 0 %}balance-pos{% elif row.balance < 0 %}balance-neg{% endif %}" style="position: relative;">
|
||||
{{ "%+d"|format(row.balance) if row.balance != 0 else "0" }}
|
||||
{% if row.balance < 0 %}
|
||||
{% if row.payable_amount > 0 %}
|
||||
<button class="pay-btn"
|
||||
onclick="showPayQR('{{ row.name|e }}', {{ -row.balance }}, '{{ row.unpaid_periods|e }}', '{{ row.raw_unpaid_periods|e }}')">Pay All</button>
|
||||
onclick="showPayQR('{{ row.name|e }}', {{ row.payable_amount }}, '{{ row.unpaid_periods|e }}', '{{ row.raw_unpaid_periods|e }}')">Pay All</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -167,6 +167,12 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.cell-unpaid-current {
|
||||
color: #994444;
|
||||
background-color: rgba(153, 68, 68, 0.05);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.cell-overridden {
|
||||
color: #ffa500 !important;
|
||||
}
|
||||
@@ -532,9 +538,9 @@
|
||||
</td>
|
||||
{% for cell in row.months %}
|
||||
<td data-month-idx="{{ loop.index0 }}" title="{{ cell.tooltip }}"
|
||||
class="{% if cell.status == 'empty' %}cell-empty{% elif cell.status == 'unpaid' or cell.status == 'partial' %}cell-unpaid{% elif cell.status == 'ok' %}cell-ok{% endif %}{% if cell.overridden %} cell-overridden{% endif %}">
|
||||
class="{% if cell.status == 'empty' %}cell-empty{% elif (cell.status == 'unpaid' or cell.status == 'partial') and cell.raw_month >= current_month %}cell-unpaid-current{% elif cell.status == 'unpaid' or cell.status == 'partial' %}cell-unpaid{% elif cell.status == 'ok' %}cell-ok{% endif %}{% if cell.overridden %} cell-overridden{% endif %}">
|
||||
{{ cell.text }}
|
||||
{% if cell.status == 'unpaid' or cell.status == 'partial' %}
|
||||
{% if (cell.status == 'unpaid' or cell.status == 'partial') and cell.raw_month < current_month %}
|
||||
<button class="pay-btn"
|
||||
onclick="showPayQR('{{ row.name|e }}', {{ cell.amount }}, '{{ cell.month|e }}', '{{ cell.raw_month }}')">Pay</button>
|
||||
{% endif %}
|
||||
@@ -542,9 +548,9 @@
|
||||
{% endfor %}
|
||||
<td class="{% if row.balance > 0 %}balance-pos{% elif row.balance < 0 %}balance-neg{% endif %}" style="position: relative;">
|
||||
{{ "%+d"|format(row.balance) if row.balance != 0 else "0" }}
|
||||
{% if row.balance < 0 %}
|
||||
{% if row.payable_amount > 0 %}
|
||||
<button class="pay-btn"
|
||||
onclick="showPayQR('{{ row.name|e }}', {{ -row.balance }}, '{{ row.unpaid_periods|e }}', '{{ row.raw_unpaid_periods|e }}')">Pay All</button>
|
||||
onclick="showPayQR('{{ row.name|e }}', {{ row.payable_amount }}, '{{ row.unpaid_periods|e }}', '{{ row.raw_unpaid_periods|e }}')">Pay All</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user