transaction edit

This commit is contained in:
2024-11-19 11:49:37 +01:00
parent c56a7e6dc4
commit 5e75b53d11
10 changed files with 165 additions and 12 deletions
@@ -76,6 +76,52 @@
</option>
</select>
</div>
<div class="form-group">
<button type="button" @click="addTransactionItem" class="btn btn-success">Add Transaction Item</button>
<div class="table-responsive">
<table class="table table-striped" aria-describedby="event.registrations">
<thead>
<tr>
<th scope="col"><span></span></th>
<th scope="col"><span>Locked</span></th>
<th scope="col"><span>Account</span></th>
<th scope="col"><span>Amount</span></th>
<th scope="col"><span>Comment</span></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in transaction.transactionItems" :key="index" class="transaction-item">
<td>
{{ item.id }}
</td>
<td>
<input type="checkbox" v-model="item.locked" class="form-check-input" />
</td>
<td>
<select v-model="item.userAccount" class="form-control" v-if="dictUserAccounts.length">
<option v-for="account in dictUserAccounts" :key="account.id" :value="account">{{ account.name }}</option>
</select>
</td>
<td>
<input type="number" v-model="item.amount" step="0.01" class="form-control" />
</td>
<td>
<input type="text" v-model="item.comment" class="form-control" placeholder="Comment" />
</td>
<td>
<button type="button" @click="removeTransactionItem(index)" class="btn btn-danger">Remove</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="form-group">
<label>Unsettled Balance:</label>
<input type="text" class="form-control" :value="calculateUnsettledBalance()" readonly />
</div>
</div>
<div>
<button type="button" id="cancel-save" data-cy="entityCreateCancelButton" class="btn btn-secondary" @click="previousState()">