Skip to content

Commit 19f2cc5

Browse files
committed
Add reciept without styles.
1 parent b9bc960 commit 19f2cc5

File tree

8 files changed

+20752
-108
lines changed

8 files changed

+20752
-108
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,14 @@ module.exports = {
2929
},
3030
],
3131
"vue/multi-word-component-names": "off",
32+
"new-cap": [
33+
"error",
34+
{
35+
newIsCap: true,
36+
capIsNew: false,
37+
properties: true,
38+
newIsCapExceptions: ["jsPDF"],
39+
},
40+
],
3241
},
3342
}

components/ReceiptComponent.vue

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<template>
2+
<v-row class="justify-center">
3+
<v-col>
4+
<v-img
5+
class="mt-8"
6+
max-height="80"
7+
max-width="80"
8+
contain
9+
:src="`${STATIC_PATH}/icon.svg`"
10+
/>
11+
<v-card-title
12+
v-icon="`${STATIC_PATH}/icon.svg`"
13+
class="subheading font-weight-bold"
14+
>
15+
Bitcart AI
16+
</v-card-title>
17+
18+
<v-divider></v-divider>
19+
20+
<v-list dense>
21+
<v-list-item>
22+
<v-list-item-content class="grey--text text--darken"
23+
><strong>Invoice ID</strong></v-list-item-content
24+
>
25+
<v-list-item-content class="align-end">
26+
{{ invoice.id }}
27+
</v-list-item-content>
28+
</v-list-item>
29+
30+
<v-list-item>
31+
<v-list-item-content class="grey--text text--darken"
32+
><strong>Order ID</strong></v-list-item-content
33+
>
34+
<v-list-item-content class="align-end">
35+
{{ invoice.order_id }}
36+
</v-list-item-content>
37+
</v-list-item>
38+
39+
<v-list-item>
40+
<v-list-item-content class="grey--text text--darken"
41+
><strong>Store ID</strong></v-list-item-content
42+
>
43+
<v-list-item-content class="align-end">
44+
{{ invoice.store_id }}
45+
</v-list-item-content>
46+
</v-list-item>
47+
48+
<v-list-item>
49+
<v-list-item-content class="grey--text text--darken"
50+
><strong>Total Amount</strong></v-list-item-content
51+
>
52+
<v-list-item-content class="align-end">
53+
{{ invoice.price }}
54+
{{ invoice.currency }}
55+
</v-list-item-content>
56+
</v-list-item>
57+
<v-list-item>
58+
<v-list-item-content class="grey--text text--darken"
59+
><strong>Sent Amount</strong></v-list-item-content
60+
>
61+
<v-list-item-content class="align-end">
62+
{{ invoice.sent_amount + " " + invoice.currency }}
63+
</v-list-item-content>
64+
</v-list-item>
65+
<v-list-item>
66+
<v-list-item-content class="grey--text text--darken"
67+
><strong>Total Fiat</strong></v-list-item-content
68+
>
69+
<v-list-item-content class="align-end">
70+
{{ payment.amount + " " + payment.currency.toUpperCase() }}
71+
</v-list-item-content>
72+
</v-list-item>
73+
<v-list-item>
74+
<v-list-item-content class="grey--text text--darken"
75+
><strong>Exchange Rate</strong></v-list-item-content
76+
>
77+
<v-list-item-content class="align-end">
78+
{{ payment.rate_str }}
79+
</v-list-item-content>
80+
</v-list-item>
81+
<v-list-item>
82+
<v-list-item-content class="grey--text text--darken"
83+
><strong>Amount Due</strong></v-list-item-content
84+
>
85+
<v-list-item-content class="align-end">
86+
{{ invoice.sent_amount }} {{ invoice.currency }}
87+
</v-list-item-content>
88+
</v-list-item>
89+
90+
<v-list-item>
91+
<v-list-item-content class="grey--text text--darken"
92+
><strong>Date</strong></v-list-item-content
93+
>
94+
<v-list-item-content class="align-end">
95+
{{ invoice.paid_date.substring(0, 19).replace("T", " ") }}
96+
</v-list-item-content>
97+
</v-list-item>
98+
</v-list>
99+
</v-col>
100+
</v-row>
101+
</template>
102+
103+
<script>
104+
export default {
105+
props: {
106+
invoice: {
107+
type: Object,
108+
required: true,
109+
},
110+
},
111+
computed: {
112+
payment() {
113+
return this.invoice.payments.find(
114+
(obj) => obj.id === this.invoice.payment_id
115+
)
116+
},
117+
},
118+
}
119+
</script>

nuxt.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export default {
7171
"~/plugins/eventbus.js",
7272
{ src: "~/plugins/imageinput.js", mode: "client" },
7373
{ src: "~/plugins/datetimepicker.js", mode: "client" },
74+
{ src: "~/plugins/vue-html2pdf.js", mode: "client" },
7475
"~/plugins/vueQR.js",
7576
],
7677
/*

0 commit comments

Comments
 (0)