|
@@ -1,104 +1,66 @@
|
1
|
1
|
import * as React from 'react';
|
2
|
|
-import Table from '@mui/material/Table';
|
3
|
|
-import TableBody from '@mui/material/TableBody';
|
4
|
|
-import TableCell from '@mui/material/TableCell';
|
5
|
|
-import TableContainer from '@mui/material/TableContainer';
|
6
|
|
-import TableHead from '@mui/material/TableHead';
|
7
|
|
-import TableRow from '@mui/material/TableRow';
|
8
|
|
-import Paper from '@mui/material/Paper';
|
9
|
|
-import {
|
10
|
|
- Typography, Divider, Box, Button
|
11
|
|
-} from '@mui/material';
|
|
2
|
+import { Table } from 'react-bootstrap';
|
12
|
3
|
|
13
|
|
-const TAX_RATE = 0.07;
|
14
|
|
-
|
15
|
|
-function ccyFormat(num) {
|
16
|
|
- return `${num.toFixed(2)}`;
|
17
|
|
-}
|
18
|
|
-
|
19
|
|
-function priceRow(qty, unit) {
|
20
|
|
- return qty * unit;
|
21
|
|
-}
|
22
|
|
-
|
23
|
|
-function createRow(desc, qty, unit) {
|
24
|
|
- const price = priceRow(qty, unit);
|
25
|
|
- return { desc, qty, unit, price };
|
26
|
|
-}
|
27
|
|
-
|
28
|
|
-function subtotal(items) {
|
29
|
|
- return items.map(({ price }) => price).reduce((sum, i) => sum + i, 0);
|
30
|
|
-}
|
31
|
|
-
|
32
|
|
-const rows = [
|
33
|
|
- createRow('Paperclips (Box)', 100, 1.15),
|
34
|
|
- createRow('Paper (Case)', 10, 45.99),
|
35
|
|
- createRow('Waste Basket', 2, 17.99),
|
36
|
|
-];
|
37
|
|
-
|
38
|
|
-const invoiceSubtotal = subtotal(rows);
|
39
|
|
-const invoiceTaxes = TAX_RATE * invoiceSubtotal;
|
40
|
|
-const invoiceTotal = invoiceTaxes + invoiceSubtotal;
|
|
4
|
+import { Box, Button } from '@mui/material';
|
41
|
5
|
|
42
|
6
|
export function Resume(props) {
|
43
|
|
- let {handleBack, password } = props
|
44
|
|
- console.log("FINAL::", password)
|
45
|
7
|
|
46
|
|
- return (
|
47
|
|
- <React.Fragment>
|
48
|
|
- <Typography variant="h6">
|
49
|
|
- Resumen:
|
50
|
|
- </Typography>
|
51
|
|
- <Divider sx={{paddingTop : 1}}/>
|
52
|
|
- <TableContainer component={Paper}>
|
53
|
|
- <Table sx={{ minWidth: 700 }} aria-label="spanning table">
|
54
|
|
- <TableBody>
|
55
|
|
- {rows.map((row) => (
|
56
|
|
- <TableRow key={row.desc}>
|
57
|
|
- <TableCell>{row.desc}</TableCell>
|
58
|
|
- <TableCell align="right">{row.qty}</TableCell>
|
59
|
|
- <TableCell align="right">{row.unit}</TableCell>
|
60
|
|
- <TableCell align="right">{ccyFormat(row.price)}</TableCell>
|
61
|
|
- </TableRow>
|
62
|
|
- ))}
|
|
8
|
+ let {handleBack, password: key } = props
|
|
9
|
+ const fmt = React.useRef({ weekday: 'long', year: 'numeric', month: 'short', day: 'numeric' })
|
63
|
10
|
|
64
|
|
- <TableRow>
|
65
|
|
- <TableCell rowSpan={3} />
|
66
|
|
- <TableCell colSpan={2}>Subtotal</TableCell>
|
67
|
|
- <TableCell align="right">{ccyFormat(invoiceSubtotal)}</TableCell>
|
68
|
|
- </TableRow>
|
69
|
|
- <TableRow>
|
70
|
|
- <TableCell>Tax</TableCell>
|
71
|
|
- <TableCell align="right">{`${(TAX_RATE * 100).toFixed(0)} %`}</TableCell>
|
72
|
|
- <TableCell align="right">{ccyFormat(invoiceTaxes)}</TableCell>
|
73
|
|
- </TableRow>
|
74
|
|
- <TableRow>
|
75
|
|
- <TableCell colSpan={2}>Total</TableCell>
|
76
|
|
- <TableCell align="right">{ccyFormat(invoiceTotal)}</TableCell>
|
77
|
|
- </TableRow>
|
78
|
|
- </TableBody>
|
79
|
|
- </Table>
|
80
|
|
- </TableContainer>
|
|
11
|
+ return(
|
|
12
|
+ <React.Fragment>
|
|
13
|
+ <Table>
|
|
14
|
+ <thead>
|
|
15
|
+ <tr>
|
|
16
|
+ <th>{key.pwd}</th>
|
|
17
|
+ <th></th>
|
|
18
|
+ </tr>
|
|
19
|
+ </thead>
|
|
20
|
+ <tbody>
|
|
21
|
+ <tr>
|
|
22
|
+ <td>{"Candidato"}</td>
|
|
23
|
+ <td colSpan={2}>{key.nombres + " " + key.apellidos} - {key.mail}</td>
|
|
24
|
+ </tr>
|
|
25
|
+ <tr>
|
|
26
|
+ <td>{"Puesto"}</td>
|
|
27
|
+ <td colSpan={2}>{key.puesto[0].nombrepuesto}</td>
|
|
28
|
+ </tr>
|
|
29
|
+ <tr>
|
|
30
|
+ <td>{"Empresa"}</td>
|
|
31
|
+ <td colSpan={2}>{key.nombreEmpresa}</td>
|
|
32
|
+ </tr>
|
|
33
|
+ <tr>
|
|
34
|
+ <td>{"Fecha Activación"}</td>
|
|
35
|
+ <td colSpan={2}>{new Date( key.dateToActived ).toLocaleDateString('es-GT',fmt.current )}</td>
|
|
36
|
+ </tr>
|
|
37
|
+ <tr>
|
|
38
|
+ <td>{"Fecha de Vencimiento"}</td>
|
|
39
|
+ <td colSpan={2}>{new Date( key.deadpwd ).toLocaleDateString('es-GT',fmt.current )}</td>
|
|
40
|
+ </tr>
|
|
41
|
+ </tbody>
|
|
42
|
+ </Table>
|
81
|
43
|
|
82
|
|
- <Box sx={{ mb: 2 }}>
|
83
|
|
- <div style={{ paddingTop: 15 }}>
|
84
|
|
- <Button
|
85
|
|
- type="submit"
|
86
|
|
- className="registerBtn"
|
87
|
|
- variant="contained"
|
88
|
|
- sx={{ mt: 1, mr: 1 }}
|
89
|
|
- >
|
90
|
|
- {'Guardar'}
|
91
|
|
- </Button>
|
92
|
|
- <Button
|
93
|
|
- disabled={false}
|
94
|
|
- onClick={handleBack}
|
95
|
|
- sx={{ mt: 1, mr: 1 }}
|
96
|
|
- >
|
97
|
|
- Regresar
|
98
|
|
- </Button>
|
99
|
|
- </div>
|
100
|
|
- </Box>
|
101
|
44
|
|
|
45
|
+ <Box sx={{ mb: 2 }}>
|
|
46
|
+ <div style={{ paddingTop: 15 }}>
|
|
47
|
+ <Button
|
|
48
|
+ type="submit"
|
|
49
|
+ className="registerBtn"
|
|
50
|
+ variant="contained"
|
|
51
|
+ sx={{ mt: 1, mr: 1 }}
|
|
52
|
+ >
|
|
53
|
+ {'Guardar'}
|
|
54
|
+ </Button>
|
|
55
|
+ <Button
|
|
56
|
+ disabled={false}
|
|
57
|
+ onClick={handleBack}
|
|
58
|
+ sx={{ mt: 1, mr: 1 }}
|
|
59
|
+ >
|
|
60
|
+ Regresar
|
|
61
|
+ </Button>
|
|
62
|
+ </div>
|
|
63
|
+ </Box>
|
102
|
64
|
</React.Fragment>
|
103
|
|
- );
|
|
65
|
+ )
|
104
|
66
|
}
|