Skip to content

Commit

Permalink
invoice: add a PAID stamp
Browse files Browse the repository at this point in the history
If the invoice has a Paid toggle, this will show a little "PAID" stamp
on the invoice once that's checked.
  • Loading branch information
jordigh committed Jan 2, 2025
1 parent be9a2ba commit 5805716
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions invoices/exampleData.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ const exampleData = {
Deduction: null,
Taxes: null,
Total: 615,
Paid: true,
};
5 changes: 5 additions & 0 deletions invoices/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@
</div>
</div>
</template>
<template v-if="invoice.Paid">
<div class="paid">
PAID
</div>
</template>

<div class="footer">
<div class="thanks">
Expand Down
12 changes: 12 additions & 0 deletions invoices/invoice.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,18 @@ div.instructions, .newlined, p.note {
white-space: pre-line;
}

div.paid {
position: relative;
left: 40%;
color: red;
rotate: 15deg;
font-size: 80px;
top: 20px;
border: 5px solid red;
float: left;
font-weight: bolder;
}

.app {
position: relative;
}
Expand Down
3 changes: 2 additions & 1 deletion invoices/invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ function updateInvoice(row) {
// Add some guidance about columns.
const want = new Set(Object.keys(addDemo({})));
const accepted = new Set(['References']);
const importance = ['Number', 'Client', 'Items', 'Total', 'Invoicer', 'Due', 'Issued', 'Subtotal', 'Deduction', 'Taxes', 'Note'];
const importance = ['Number', 'Client', 'Items', 'Total', 'Invoicer', 'Due',
'Issued', 'Subtotal', 'Deduction', 'Taxes', 'Note', 'Paid'];
if (!(row.Due || row.Issued)) {
const seen = new Set(Object.keys(row).filter(k => k !== 'id' && k !== '_error_'));
const help = row.Help = {};
Expand Down

0 comments on commit 5805716

Please sign in to comment.