blob: f1af5189c3bef16cec445e1a95130274f250a2ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
<script setup lang="ts">
import { onMounted, ref } from "vue"
import User from "./../classes/user.js"
import axios from "axios"
const props = defineProps(["invoice"])
const user = ref(new User())
// temporarily using this
// TODO: don't call api from PrintPreview
const getUser = async () => {
user.value = new User()
try {
const r = await axios.get('/user')
if (r.status === 200) {
user.value = r.data.data
}
} catch (err) {
console.error(err)
}
}
// TODO: remove
onMounted(() => {
getUser()
})
</script>
<template>
<div class="print-preview-header">
<!-- TODO: add option to not use logo -->
<div class="logo-container">
<img :src="'/pub/' + user.LogoFile"/>
</div>
<div>
<div class="firm-name">
<p>{{ props.invoice.IssuerFirmName }}</p>
</div>
<div class="firm-address">
{{ props.invoice.IssuerFirmAddress }}
</div>
<div class="firm-details">
{{ props.invoice.IssuerFirmDetails }}
</div>
</div>
<div class="header-col3">
<div class="firm-contact">
<div class="label">
<span><strong>Phone:</strong></span>
<span>{{ props.invoice.IssuerFirmPhone }}</span>
</div>
<div class="label">
<span><strong>Email:</strong></span>
<span>{{ props.invoice.IssuerFirmEmail }}</span>
</div>
<div class="label">
<span><strong>Website:</strong></span>
<span>{{ props.invoice.IssuerFirmWebsite }}</span>
</div>
<div class="label">
<span><strong>GSTIN:</strong></span>
<span>{{ props.invoice.IssuerFirmGstin }}</span>
</div>
</div>
<div class="qr-container">
<img src="../assets/placeholderqr.png"/>
</div>
</div>
</div>
</template>
<style>
.print-preview-header {
display: grid;
grid-template-columns: 1.7in 2.4in auto;
grid-column-gap: 1em;
width: 100%;
}
.logo-container {
display: flex;
justify-content: center;
align-items: flex-start;
max-width: 1.7in;
}
.logo-container img {
max-width: 100%;
max-height: 100%;
}
.firm-name {
height: 2em;
}
.firm-name p {
line-height: 0.8em;
font-size: 1.6em;
font-weight: bold;
}
.firm-address, .firm-details {
font-size: 0.9em;
line-height: 1.2em;
white-space: pre-wrap;
}
.header-col3 {
display: grid;
grid-template-columns: auto 0.8in;
}
.firm-contact {
display: flex;
flex-direction: column;
font-size: 0.9em;
}
.firm-contact .label {
display: grid;
grid-template-columns: 4.5em auto;
}
.qr-container {
display: flex;
justify-content: flex-end;
align-items: flex-start;
width: 100%;
}
.qr-container img {
max-width: 100%;
}
</style>
|