Edit Payment - Cospend

Edit Payment

Modify payment details and receipt image

{#if loading}
Loading payment...
{:else if error}
Error: {error}
{:else if payment}
{#if payment.originalAmount && payment.currency !== 'CHF'} {:else} {/if}
{#if payment.currency !== 'CHF' && payment.originalAmount}
Original amount in {payment.currency}, converted to CHF at payment date {#if loadingExchangeRate}
🔄 Fetching current exchange rate...
{:else if exchangeRateError}
⚠️ {exchangeRateError}
{:else if convertedAmount !== null && currentExchangeRate !== null}
{payment.currency} {payment.originalAmount.toFixed(2)} ≈ CHF {convertedAmount.toFixed(2)}
(Current rate: 1 {payment.currency} = {currentExchangeRate.toFixed(4)} CHF)
Stored: CHF {payment.amount.toFixed(2)} (Rate: {payment.exchangeRate ? payment.exchangeRate.toFixed(4) : 'N/A'})
{/if}
{/if}
payment.date = new Date(e.target.value).toISOString()} required />
{#if payment.splits && payment.splits.length > 0}
{#each payment.splits as split}
{split.username} 0}> {#if split.amount > 0} owes CHF {split.amount.toFixed(2)} {:else if split.amount < 0} owed CHF {Math.abs(split.amount).toFixed(2)} {:else} owes CHF {split.amount.toFixed(2)} {/if}
{/each}

Note: To modify splits, please delete and recreate the payment.

{/if}
{/if}