2024-09-30 15:17:38 -05:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import { Box, Table, TableBody, TableCell, TableHead, TableRow, Typography } from '@mui/material';
|
|
|
|
|
import Grid from '@mui/material/Grid2';
|
|
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
2024-10-01 13:45:34 -05:00
|
|
|
import { ItemObject } from '@interfaces/ResponseInterfaces/Sale/AddProductsResponseInterface';
|
2024-09-30 15:17:38 -05:00
|
|
|
|
|
|
|
|
interface SaleSummaryProps {
|
2024-10-01 13:45:34 -05:00
|
|
|
product: ItemObject;
|
|
|
|
|
|
2024-09-30 15:17:38 -05:00
|
|
|
}
|
|
|
|
|
|
2024-10-01 13:45:34 -05:00
|
|
|
const SaleSummary: React.FC<SaleSummaryProps> = ({ product }) => {
|
2024-09-30 15:17:38 -05:00
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Box sx={{
|
|
|
|
|
|
|
|
|
|
color: 'black',
|
|
|
|
|
borderRadius: '5px',
|
|
|
|
|
boxShadow: '2',
|
|
|
|
|
p: 1,
|
|
|
|
|
mb: 1
|
|
|
|
|
}}>
|
|
|
|
|
<Box sx={{mb: 1, p: 1, boxShadow: '2', }}>
|
|
|
|
|
<Table size="small">
|
|
|
|
|
<TableHead>
|
|
|
|
|
<TableRow>
|
|
|
|
|
<TableCell sx={{ color: 'primary', borderColor: 'black', fontWeight: 'bold', width: '30%' }}>{t("tle_product")}</TableCell>
|
|
|
|
|
<TableCell sx={{ color: 'primary', borderColor: 'black', fontWeight: 'bold', width: '20%', textAlign: 'right' }}>{t("tle_amount")}</TableCell>
|
|
|
|
|
</TableRow>
|
|
|
|
|
</TableHead>
|
|
|
|
|
<TableBody>
|
|
|
|
|
<TableRow>
|
2024-10-01 13:45:34 -05:00
|
|
|
<TableCell sx={{ color: 'black', borderColor: 'black' }}>{product.name}</TableCell>
|
|
|
|
|
<TableCell sx={{ color: 'black', borderColor: 'black', textAlign: 'right' }}>1</TableCell>
|
2024-09-30 15:17:38 -05:00
|
|
|
</TableRow>
|
|
|
|
|
</TableBody>
|
|
|
|
|
</Table>
|
|
|
|
|
<Grid container justifyContent='right'>
|
|
|
|
|
<Box sx={{ mt: 5, textAlign: 'right' }}>
|
|
|
|
|
<Grid container>
|
|
|
|
|
<Grid size={{xs:7}} sx={{ pr: 10 }}>
|
|
|
|
|
<Typography variant="body2" align="right">{t("lbl_subtotal")}:</Typography>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid size={{xs:5}}>
|
2024-10-01 13:45:34 -05:00
|
|
|
<Typography variant="body2" align="left">{product.regularUnitPrice}</Typography>
|
2024-09-30 15:17:38 -05:00
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
2024-10-01 13:45:34 -05:00
|
|
|
|
2024-09-30 15:17:38 -05:00
|
|
|
<Grid container>
|
|
|
|
|
<Grid size={{xs:7}} sx={{ pr: 5.5 }}>
|
|
|
|
|
<Typography variant="body2" align="right">{t("lbl_tax")}:</Typography>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid size={{xs:5}}>
|
2024-10-01 13:45:34 -05:00
|
|
|
<Typography variant="body2" align="left">{product.totalTaxes}</Typography>
|
2024-09-30 15:17:38 -05:00
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Box>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box sx={{ p: 3, boxShadow: '2' }}>
|
|
|
|
|
<Typography variant="h6" sx={{ color: 'primary', display: 'flex', justifyContent: 'space-between' }}>
|
|
|
|
|
<span>{t("tle_total")}:</span>
|
2024-10-01 13:45:34 -05:00
|
|
|
<span>{product.extendedPrice}</span>
|
2024-09-30 15:17:38 -05:00
|
|
|
</Typography>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default SaleSummary;
|