-
Notifications
You must be signed in to change notification settings - Fork 0
/
PDF.html
181 lines (167 loc) · 6.12 KB
/
PDF.html
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Factura</title>
<style>
body {
font-family: Arial, sans-serif;
margin:110px;
}
.container {
width: 800px;
border: 1px solid black;
padding: 30px;
box-sizing: border-box;
}
.header, .section, .table-section, .total-section, .footer {
display: none;
margin-top: 20px;
border: 1px solid black;
padding: 10px;
}
.header-title, .section-title, .table-title {
font-weight: bold;
background-color: #009b8e;
color: white;
padding: 5px;
}
.table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
.table th, .table td {
border: 1px solid black;
padding: 8px;
text-align: left;
}
.table th {
background-color: #009b8e;
color: white;
}
.blue-background {
background-color: #009b8e;
color: white;
padding: 5px;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<!-- Input Fields for Data Entry -->
<h2>Ingresar datos para la factura</h2>
<div>
<label>Nombre del Receptor:</label>
<input type="text" id="receptor-name" oninput="showReceptorSection()">
</div>
<div>
<label>RFC del Receptor:</label>
<input type="text" id="receptor-rfc" oninput="showReceptorSection()">
</div>
<div>
<label>Folio SAT:</label>
<input type="text" id="sat-folio" oninput="showDatosFiscalesSection()">
</div>
<div>
<label>Número de Serie Certificado Emisor:</label>
<input type="text" id="certificado-emisor" oninput="showDatosFiscalesSection()">
</div>
<!-- Header Section -->
<div id="header" class="header">
<div class="header-title">MAURO JESUS JACINTO SANTOS</div>
<p>FACTURA A289 - Fecha y hora de emisión: 15/11/2024 5:57 PM</p>
</div>
<!-- Receptor Section -->
<div id="receptor-section" class="section">
<div class="section-title">Receptor</div>
<p><strong id="receptor-name-display"></strong></p>
<p>RFC: <span id="receptor-rfc-display"></span></p>
<p>Uso CFDI: D10 Pagos por servicios educativos</p>
<p>Domicilio fiscal: 39713</p>
</div>
<!-- Datos Fiscales Section -->
<div id="datos-fiscales-section" class="section">
<div class="section-title">Datos fiscales</div>
<p>Folio SAT: <span id="sat-folio-display"></span></p>
<p>Número de serie certificado emisor: <span id="certificado-emisor-display"></span></p>
<p>Número serie del certificado SAT: 00001000000598466663</p>
<p>Exportación: No aplica</p>
</div>
<!-- Table Section (Static Example) -->
<div id="table-section" class="table-section">
<div class="table-title">Detalles de Pago</div>
<table class="table">
<thead>
<tr>
<th>Cant</th>
<th>Unidad</th>
<th>Clave</th>
<th>Descripción</th>
<th>Obj. impuesto</th>
<th>Precio</th>
<th>Importe</th>
</tr>
</thead>
<tbody>
<tr>
<td>1.00</td>
<td>Unidad de servicio</td>
<td>86121503</td>
<td>pago de la reinscripcion...</td>
<td>No objeto de impuesto</td>
<td>$1,500.00</td>
<td>$1,500.00</td>
</tr>
</tbody>
</table>
</div>
<!-- Total Section -->
<div id="total-section" class="total-section">
<p>Subtotal: $1,500.00</p>
<p>Descuentos: $0.00</p>
<p class="blue-background">TOTAL: $1,500.00</p>
</div>
<!-- Footer Section -->
<div id="footer" class="footer">
<p>Forma de pago: Transferencia electrónica de fondos</p>
<p>Método de pago: Pago en una sola exhibición</p>
<p>Moneda: MXN Peso-Mexicano</p>
</div>
</div>
<script>
function showReceptorSection() {
const name = document.getElementById("receptor-name").value;
const rfc = document.getElementById("receptor-rfc").value;
if (name && rfc) {
document.getElementById("receptor-section").style.display = "block";
document.getElementById("header").style.display = "block";
document.getElementById("receptor-name-display").textContent = name;
document.getElementById("receptor-rfc-display").textContent = rfc;
showTableAndTotalSections();
} else {
document.getElementById("receptor-section").style.display = "none";
}
}
function showDatosFiscalesSection() {
const folio = document.getElementById("sat-folio").value;
const emisor = document.getElementById("certificado-emisor").value;
if (folio && emisor) {
document.getElementById("datos-fiscales-section").style.display = "block";
document.getElementById("sat-folio-display").textContent = folio;
document.getElementById("certificado-emisor-display").textContent = emisor;
showTableAndTotalSections();
} else {
document.getElementById("datos-fiscales-section").style.display = "none";
}
}
function showTableAndTotalSections() {
document.getElementById("table-section").style.display = "block";
document.getElementById("total-section").style.display = "block";
document.getElementById("footer").style.display = "block";
}
</script>
</body>
</html>