Normalize invoice statuses

This commit is contained in:
2025-04-24 14:25:37 +02:00
parent 0522ca8d9f
commit cac8318815
2 changed files with 34 additions and 38 deletions

View File

@@ -125,12 +125,14 @@ onMount(() => {
Amount:<Euro amount={tot.amount}/><br/> Amount:<Euro amount={tot.amount}/><br/>
VAT: <Euro amount={tot.vat}/><br/> VAT: <Euro amount={tot.vat}/><br/>
{/each} {/each}
</section>
<div class="table_scroll"> <div class="table_scroll" style="text-align: initial;">
<table> <table>
<thead> <thead>
<tr> <tr>
<td>Time</td> <td>Time</td>
<td>ID</td>
<td>Amount</td> <td>Amount</td>
<td>VAT</td> <td>VAT</td>
<td>Country</td> <td>Country</td>
@@ -142,6 +144,7 @@ onMount(() => {
{#each invoices as row (row.id)} {#each invoices as row (row.id)}
<tr> <tr>
<td>{formatDate(row.time)}</td> <td>{formatDate(row.time)}</td>
<td>{row.id}</td>
<td><Euro amount={row.amount}/></td> <td><Euro amount={row.amount}/></td>
<td><Euro amount={row.vat}/></td> <td><Euro amount={row.vat}/></td>
<td>{row.country}</td> <td>{row.country}</td>
@@ -149,11 +152,9 @@ onMount(() => {
<td>{row.status}</td> <td>{row.status}</td>
</tr> </tr>
{/each} {/each}
</tbody> </tbody>
</table> </table>
</div> </div>
</section>
<style> <style>
.toolbar { .toolbar {

View File

@@ -130,13 +130,13 @@ onMount(() => {
<td>{row.country}</td> <td>{row.country}</td>
<td>{row.payment_method}</td> <td>{row.payment_method}</td>
<td> <td>
{#if row.status === "InvoiceCreated" || row.status === "open" || row.status === "CREATED" || row.status === "PAYER_ACTION_REQUIRED"} {#if row.status === "open"}
Waiting for payment Waiting for payment
{:else if row.status === "InvoiceProcessing"} {:else if row.status === "processing"}
Payment received, waiting for confirmations Payment received, waiting for confirmations
{:else if row.status === "InvoiceSettled" || row.status === "paid"} {:else if row.status === "paid"}
Paid Paid
{:else if row.status === "InvoiceExpired"} {:else if row.status === "expired"}
Expired Expired
{:else if row.status === "canceled"} {:else if row.status === "canceled"}
Canceled Canceled
@@ -145,12 +145,7 @@ onMount(() => {
{/if} {/if}
</td> </td>
<td> <td>
{#if row.status === "New" || {#if row.status === "open"}
row.status === "InvoiceCreated" ||
row.status === "open" ||
row.status === "CREATED" ||
row.status === "PAYER_ACTION_REQUIRED"
}
<a href="/api/user/pay_invoice/{row.id}" class="button button_highlight"> <a href="/api/user/pay_invoice/{row.id}" class="button button_highlight">
<i class="icon">paid</i> Pay <i class="icon">paid</i> Pay
</a> </a>