started to implement updates on transactions
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import { t } from '../../translations.svelte';
|
||||
|
||||
import EntryForm from './add_entry.svelte';
|
||||
import Transaction from './transaction.svelte';
|
||||
|
||||
let { id } = $props();
|
||||
let account = $state(null);
|
||||
@@ -67,31 +68,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each transactions as transaction, i}
|
||||
<tr>
|
||||
<td>{transaction.date}</td>
|
||||
{#each Object.entries(users) as [id,user]}
|
||||
<td class="amount">
|
||||
{#if id == transaction.source.id}
|
||||
{(-transaction.amount).toFixed(2)} {account.currency}
|
||||
{/if}
|
||||
{#if id == transaction.destination.id}
|
||||
{(+transaction.amount).toFixed(2)} {account.currency}
|
||||
{/if}
|
||||
</td>
|
||||
{/each}
|
||||
<td class="party">
|
||||
{#if !transaction.source.id}
|
||||
← {transaction.source.value}
|
||||
{/if}
|
||||
{#if !transaction.destination.id}
|
||||
→ {transaction.destination.value}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="purpose">{transaction.purpose}</td>
|
||||
<td class="tags">
|
||||
{transaction.tags.join(', ')}
|
||||
</td>
|
||||
</tr>
|
||||
<Transaction {account} {transaction} {users} />
|
||||
{/each}
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user