Fix payment display and dashboard refresh functionality
Some checks failed
CI / update (push) Failing after 4s
Some checks failed
CI / update (push) Failing after 4s
- Fix 'paid in full for others' payments showing CHF 0.00 instead of actual amount - Add time-based sorting to payments (date + createdAt) for proper chronological order - Redirect to dashboard after adding payment instead of payments list - Implement complete dashboard refresh after payment deletion via modal - Fix dashboard component reactivity for single debtor view updates 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -135,12 +135,14 @@
|
||||
if (!formData.amount) return;
|
||||
|
||||
const amountNum = parseFloat(formData.amount);
|
||||
const otherUsers = users.filter(user => user !== formData.paidBy);
|
||||
const amountPerOtherUser = otherUsers.length > 0 ? amountNum / otherUsers.length : 0;
|
||||
|
||||
users.forEach(user => {
|
||||
if (user === formData.paidBy) {
|
||||
splitAmounts[user] = -amountNum;
|
||||
splitAmounts[user] = -amountNum; // They paid it all, so they're owed the full amount
|
||||
} else {
|
||||
splitAmounts[user] = 0;
|
||||
splitAmounts[user] = amountPerOtherUser; // Others owe their share of the full amount
|
||||
}
|
||||
});
|
||||
splitAmounts = { ...splitAmounts };
|
||||
@@ -573,7 +575,7 @@
|
||||
{:else if splitAmounts[user] < 0}
|
||||
is owed CHF {Math.abs(splitAmounts[user]).toFixed(2)}
|
||||
{:else}
|
||||
even
|
||||
owes CHF {splitAmounts[user].toFixed(2)}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user