Don't hide invoices

This commit is contained in:
2022-10-18 15:42:40 +02:00
parent 922b8b6001
commit 942900eb49
2 changed files with 30 additions and 43 deletions

View File

@@ -601,8 +601,9 @@ input[type="date"] {
border: none; border: none;
border-radius: 6px; border-radius: 6px;
background: var(--input_background); background: var(--input_background);
/* box-shadow: inset 1px 1px 2px -1px var(--shadow_color); */
padding: 3px 5px; padding: 3px 5px;
/* override user-agent style */
min-width: 100px;
color: var(--input_text); color: var(--input_text);
font-size: 1em; font-size: 1em;
outline: 0; outline: 0;

View File

@@ -31,7 +31,6 @@ const checkout = async (network) => {
} }
} }
let show_expired = false
let invoices = [] let invoices = []
const load_invoices = async () => { const load_invoices = async () => {
loading = true loading = true
@@ -94,7 +93,10 @@ onMount(() => {
</button> </button>
</div> </div>
<h3>Open invoices</h3> <h2>Past invoices</h2>
<p>
Invoices are deleted after one year of inactivity.
</p>
<div class="table_scroll"> <div class="table_scroll">
<table style="text-align: left;"> <table style="text-align: left;">
<thead> <thead>
@@ -107,48 +109,32 @@ onMount(() => {
</thead> </thead>
<tbody> <tbody>
{#each invoices as row (row.id)} {#each invoices as row (row.id)}
{#if row.status === "New" || <tr>
row.status === "InvoiceCreated" || <td>{formatDate(row.time, true, true, false)}</td>
row.status === "InvoiceProcessing" || <td><Euro amount={row.amount}></Euro></td>
show_expired <td>
} {#if row.status === "InvoiceCreated"}
<tr> New (waiting for payment)
<td>{formatDate(row.time, true, true, false)}</td> {:else if row.status === "InvoiceProcessing"}
<td><Euro amount={row.amount}></Euro></td> Payment received, waiting for confirmations
<td> {:else if row.status === "InvoiceSettled"}
{#if row.status === "InvoiceCreated"} Paid
New (waiting for payment) {:else if row.status === "InvoiceExpired"}
{:else if row.status === "InvoiceProcessing"} Expired
Payment received, waiting for confirmations {:else}
{:else if row.status === "InvoiceSettled"} {row.status}
Paid {/if}
{:else if row.status === "InvoiceExpired"} </td>
Expired <td>
{:else} {#if row.status === "New" || row.status === "InvoiceCreated"}
{row.status} <a href={row.checkout_url} class="button button_highlight">
{/if} <i class="icon">paid</i> Pay
</td> </a>
<td> {/if}
{#if row.status === "New" || row.status === "InvoiceCreated"} </td>
<a href={row.checkout_url} class="button button_highlight"> </tr>
<i class="icon">paid</i> Pay
</a>
{/if}
</td>
</tr>
{/if}
{/each} {/each}
</tbody> </tbody>
</table> </table>
<div style="text-align: center;">
<button on:click={() => {show_expired = !show_expired}}>
{#if show_expired}
Hide
{:else}
Show
{/if}
expired and settled invoices
</button>
</div>
</div> </div>
</section> </section>