Skip to content

Commit 36a0ddc

Browse files
committed
add copy buttons to invoices
1 parent 40e4931 commit 36a0ddc

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

templates/admin/account/overview.html

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ <h2>Utlägg</h2>
2626
<tbody v-for="expense in expenses" v-if="cost_centre == false || expense.cost_centres.indexOf(cost_centre) > -1">
2727
<tr>
2828
<td>
29-
<a v-bind:href="'/expenses/' + expense.id" v-text="expense.description"></a>
3029
(<span v-text="expense.id"></span>)
30+
<a v-bind:href="'/expenses/' + expense.id" v-text="expense.description"></a>
3131
<button style="background: none; padding: 4px; box-shadow: none; margin-left: auto"
3232
v-on:click="copy('(' + expense.id + ') ' + expense.description)">📋</button>
3333
</td>
@@ -62,7 +62,7 @@ <h2>Utlägg</h2>
6262
<td>
6363
<span v-text="expense.expense_parts.map(x => x.amount).reduce((a,b) => a + b, 0).toFixed(2)"></span> kr
6464
<button style="background: none; padding: 4px; box-shadow: none; margin-left: auto"
65-
v-on:click="copy(expense.expense_parts.map(x => x.amount).reduce((a,b) => a + b, 0).toFixed(2))">📋</button>
65+
v-on:click="copy(expense.expense_parts.map(x => x.amount).reduce((a,b) => a + b, 0).toFixed(2))">📋</button>
6666
</td>
6767
</tr>
6868
</table>
@@ -85,7 +85,12 @@ <h2>Fakturor</h2>
8585
</thead>
8686
<tbody v-for="invoice in invoices" v-if="cost_centre == false || invoice.cost_centres.indexOf(cost_centre) > -1">
8787
<tr>
88-
<td><a v-bind:href="'/invoices/' + invoice.id" v-text="invoice.description"></a></td>
88+
<td>
89+
(<span v-text="invoice.id"></span>)
90+
<a v-bind:href="'/invoices/' + invoice.id" v-text="invoice.description"></a>
91+
<button style="background: none; padding: 4px; box-shadow: none; margin-left: auto"
92+
v-on:click="copy('(' + invoice.id + ') ' + invoice.description)">📋</button>
93+
</td>
8994
<td v-text="invoice.invoice_date"></td>
9095

9196
<td class="right">
@@ -106,11 +111,19 @@ <h2>Fakturor</h2>
106111
<table>
107112
<tr v-for="invoicePart in invoice.invoice_parts">
108113
<td style="text-align: right; width: 50%;" v-text="invoicePart.cost_centre + ' > ' + invoicePart.secondary_cost_centre + ' > ' + invoicePart.budget_line"></td>
109-
<td v-text="invoicePart.amount + ' kr'"></td>
114+
<td>
115+
<span v-text="invoicePart.amount + ' kr'"></span>
116+
<button style="background: none; padding: 4px; box-shadow: none; margin-left: auto"
117+
v-on:click="copy(invoicePart.amount)">📋</button>
118+
</td>
110119
</tr>
111120
<tr style="font-weight: bold;">
112121
<td class="right">Totalt:</td>
113-
<td><span v-text="invoice.invoice_parts.map(x => x.amount).reduce((a,b) => a + b, 0)"></span> kr</td>
122+
<td>
123+
<span v-text="invoice.invoice_parts.map(x => x.amount).reduce((a,b) => a + b, 0)"></span> kr
124+
<button style="background: none; padding: 4px; box-shadow: none; margin-left: auto"
125+
v-on:click="copy(invoice.invoice_parts.map(x => x.amount).reduce((a,b) => a + b, 0).toFixed(2))">📋</button>
126+
</td>
114127
</tr>
115128
</table>
116129
</td>

0 commit comments

Comments
 (0)