Feat: separate merged months configs and add 'other' payments to member popups
This commit is contained in:
@@ -471,8 +471,12 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
<td class="{% if row.balance > 0 %}balance-pos{% elif row.balance < 0 %}balance-neg{% endif %}">
|
||||
<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 %}
|
||||
<button class="pay-btn"
|
||||
onclick="showPayQR('{{ row.name|e }}', {{ -row.balance }}, '{{ row.unpaid_periods|e }}')">Pay All</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@@ -576,6 +580,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-section" id="modalOtherSection" style="display: none;">
|
||||
<div class="modal-section-title">Other Transactions</div>
|
||||
<div id="modalOtherList" class="tx-list">
|
||||
<!-- Filled by JS -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-section">
|
||||
<div class="modal-section-title">Payment History</div>
|
||||
<div id="modalTxList" class="tx-list">
|
||||
@@ -684,6 +695,30 @@
|
||||
exSection.style.display = 'none';
|
||||
}
|
||||
|
||||
const otherList = document.getElementById('modalOtherList');
|
||||
const otherSection = document.getElementById('modalOtherSection');
|
||||
otherList.innerHTML = '';
|
||||
|
||||
if (data.other_transactions && data.other_transactions.length > 0) {
|
||||
otherSection.style.display = 'block';
|
||||
data.other_transactions.forEach(tx => {
|
||||
const displayPurpose = tx.purpose || 'Other';
|
||||
const item = document.createElement('div');
|
||||
item.className = 'tx-item';
|
||||
item.innerHTML = `
|
||||
<div class="tx-meta">${tx.date} | ${displayPurpose}</div>
|
||||
<div class="tx-main">
|
||||
<span class="tx-amount" style="color: #66ccff;">${tx.amount} CZK</span>
|
||||
<span class="tx-sender">${tx.sender}</span>
|
||||
</div>
|
||||
<div class="tx-msg">${tx.message || ''}</div>
|
||||
`;
|
||||
otherList.appendChild(item);
|
||||
});
|
||||
} else {
|
||||
otherSection.style.display = 'none';
|
||||
}
|
||||
|
||||
const txList = document.getElementById('modalTxList');
|
||||
txList.innerHTML = '';
|
||||
|
||||
|
||||
@@ -471,8 +471,12 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
<td class="{% if row.balance > 0 %}balance-pos{% elif row.balance < 0 %}balance-neg{% endif %}">
|
||||
<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 %}
|
||||
<button class="pay-btn"
|
||||
onclick="showPayQR('{{ row.name|e }}', {{ -row.balance }}, '{{ row.unpaid_periods|e }}')">Pay All</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@@ -576,6 +580,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-section" id="modalOtherSection" style="display: none;">
|
||||
<div class="modal-section-title">Other Transactions</div>
|
||||
<div id="modalOtherList" class="tx-list">
|
||||
<!-- Filled by JS -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-section">
|
||||
<div class="modal-section-title">Payment History</div>
|
||||
<div id="modalTxList" class="tx-list">
|
||||
@@ -684,6 +695,30 @@
|
||||
exSection.style.display = 'none';
|
||||
}
|
||||
|
||||
const otherList = document.getElementById('modalOtherList');
|
||||
const otherSection = document.getElementById('modalOtherSection');
|
||||
otherList.innerHTML = '';
|
||||
|
||||
if (data.other_transactions && data.other_transactions.length > 0) {
|
||||
otherSection.style.display = 'block';
|
||||
data.other_transactions.forEach(tx => {
|
||||
const displayPurpose = tx.purpose || 'Other';
|
||||
const item = document.createElement('div');
|
||||
item.className = 'tx-item';
|
||||
item.innerHTML = `
|
||||
<div class="tx-meta">${tx.date} | ${displayPurpose}</div>
|
||||
<div class="tx-main">
|
||||
<span class="tx-amount" style="color: #66ccff;">${tx.amount} CZK</span>
|
||||
<span class="tx-sender">${tx.sender}</span>
|
||||
</div>
|
||||
<div class="tx-msg">${tx.message || ''}</div>
|
||||
`;
|
||||
otherList.appendChild(item);
|
||||
});
|
||||
} else {
|
||||
otherSection.style.display = 'none';
|
||||
}
|
||||
|
||||
const txList = document.getElementById('modalTxList');
|
||||
txList.innerHTML = '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user