LFFE-25 implemenation of appraisal-confirmation and final-credit-amount print page

This commit is contained in:
AmirHossein Mahmoodi
2023-11-13 14:06:39 +03:30
parent e4f1509de4
commit 380eaf37be
10 changed files with 468 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
import PrintIcon from "@mui/icons-material/Print";
import {Button, CircularProgress} from "@mui/material";
import {useTranslations} from "next-intl";
import {useState} from "react";
import {useRouter} from "next/router";
const PrintAppraisalConfirmation = () => {
const t = useTranslations();
const router = useRouter()
const [loading, setLoading] = useState(false)
const clickHandler = () => {
setLoading(true)
sessionStorage.setItem('appraisal-confirmation-print', JSON.stringify([]))
router.push('/dashboard/passenger-boss/prints/appraisal-confirmation')
}
return (
<Button
color="primary"
variant="contained"
size="small"
disabled={loading}
sx={{textTransform: "unset", alignSelf: "center"}}
startIcon={loading ? <CircularProgress size={18} color="inherit"/> : <PrintIcon/>}
onClick={clickHandler}
>
{t("PassengerBoss.print_appraisal_confirmation")}
</Button>
)
}
export default PrintAppraisalConfirmation

View File

@@ -0,0 +1,32 @@
import PrintIcon from "@mui/icons-material/Print";
import {Button, CircularProgress} from "@mui/material";
import {useTranslations} from "next-intl";
import {useRouter} from "next/router";
import {useState} from "react";
const PrintFinalCreditAmount = () => {
const t = useTranslations();
const router = useRouter()
const [loading, setLoading] = useState(false)
const clickHandler = () => {
setLoading(true)
sessionStorage.setItem('final-credit-amount-print', JSON.stringify([]))
router.push('/dashboard/passenger-boss/prints/final-credit-amount')
}
return (
<Button
color="primary"
variant="contained"
size="small"
disabled={loading}
sx={{textTransform: "unset", alignSelf: "center"}}
startIcon={loading ? <CircularProgress size={18} color="inherit"/> : <PrintIcon/>}
onClick={clickHandler}
>
{t("PassengerBoss.print_final_credit_amount")}
</Button>
)
}
export default PrintFinalCreditAmount

View File

@@ -0,0 +1,135 @@
import PrintablePage from "@/core/components/PrintablePage";
import {Box, Stack, Typography} from "@mui/material";
const Content = ({data}) => {
return (
<>
<PrintablePage key={data.id} header={true} footer={true}>
<Typography sx={{mt: 6}}>
<Typography component={'span'}
sx={{
fontFamily: 'Bnazanin',
fontWeight: 'bold',
fontSize: '1.2rem'
}}> {'اداره کل راهداری و حمل و نقل جاده ای'} </Typography>
<Typography component={'strong'}
sx={{
fontFamily: 'Bnazanin',
fontWeight: 'bold',
fontSize: '1.2rem'
}}> {`استان ${data.province_name}`} </Typography>
</Typography>
<Typography
sx={{
fontFamily: 'Bnazanin',
fontWeight: 'bold'
}}> {'موضوع: تاییدیه ارزیابی و تخصیص اعتبار'} </Typography>
<Typography sx={{fontFamily: 'Bnazanin', mt: 2}}> {'با سلام و احترام'} </Typography>
<Typography textAlign={'justify'} sx={{lineHeight: '1.8'}}>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', pl: 4}}> {'با توجه به نامه شماره'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>35482</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'مورخ'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402/08/20</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'معاون محترم برنامه ریزی سازمان راهداری و حمل و نقل جاده ای در خصوص تسهیلات بند (الف) تبصره (18) قانون بودجه سال'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'موضوع بازسازی ناوگان اتوبوس و مینی بوس و نیز تصویب آن درشورای برنامه ریزی و توسعه استان'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>تهران</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'و نامه شماره'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>35482</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'مورخ'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402/08/20</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'اداره کل راهداری و حمل و نقل جاده ای'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>تهران</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'در خصوص استفاده از ظرفیت انجمن های صنفی رانندگان در تاریخ'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402/08/20</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'از ناوگان اتوبوس/مینی بوس به شماره پلاک انتظامی'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>25پ4582</Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin'}}> {'و شماره هوشمند ناوگان'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>5875698725</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'به مالکیت آقای'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>امیرحسین محمودی</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'با کد ملی'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>0311318897</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'و شماره تماس'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>09120630655</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'ساکن شهرستان'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>تهران</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'بازدید بعمل آمد که گزارش بازدید به شرخ ذیل مورد تایید می باشد.'} </Typography>
</Typography>
<Box sx={{border: 1, borderRadius: 1, mt: 3, p: 2}}>
<Typography
sx={{fontFamily: 'Bnazanin'}}> {'* با توجه به یک فقره پیش فاکتور پیوست ارائه شده از تعمیرگاه مجاز'} </Typography>
<Typography textAlign={'justify'} sx={{mt: 2, lineHeight: '1.8'}}>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin'}}> {'اصالت فاکتورهای شماره'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>7563842</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'و صحت اقلام لازم و قیمت آنها جهت نیازمندی بازسازی ناوگان مذکور به مبلغ'} </Typography>
<Typography component={'span'} sx={{
fontFamily: 'Bnazanin',
fontWeight: 'bold'
}}>{parseInt(2300000000).toLocaleString('en')}</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'ریال معادل'} </Typography>
<Typography component={'span'} sx={{
fontFamily: 'Bnazanin',
fontWeight: 'bold'
}}>{parseInt(230000000).toLocaleString('en')}</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'تومان بابت هزینه کرد تعمیرات ناوگان فوق الذکر مورد تأیید می باشد.'} </Typography>
</Typography>
</Box>
<Stack direction={'row'} sx={{mt: 6}} justifyContent={'space-between'}>
<Typography sx={{fontFamily: 'Bnazanin'}}>رئیس انجمن آقای .......</Typography>
<Typography sx={{fontFamily: 'Bnazanin'}}>انجمن صنفی رانندگان حمل و نقل مسافر
......</Typography>
</Stack>
<Box sx={{border: 1, borderRadius: 1, mt: 8, p: 2}}>
<Typography textAlign={'center'} sx={{fontFamily: 'Bnazanin'}}> {'تعهدنامه'} </Typography>
<Typography textAlign={'justify'} sx={{mt: 1, lineHeight: '1.8'}}>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'اینجانب'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>امیرحسین محمودی</Typography>
<Typography
component={'span'}
sx={{fontFamily: 'Bnazanin'}}> {'مالک ناوگان اتوبوس | مینی بوس با مشخصات فوق الذکر بدینوسیله تعهد می نمایم مبلغ دریافتی وام را برابر پیش فاکتور ارائه شده صرف تعمیرات و بازسازی ناوگان نمایم و اگر خلاف این ثابت شود برابر مقررات با بنده برخورد شود و حق هیچگونه اعتراضی ندارم.'} </Typography>
<Typography
sx={{fontFamily: 'Bnazanin', textAlign: 'right'}}>تاریخ و امضاء</Typography>
</Typography>
</Box>
</PrintablePage>
</>
)
}
export default Content

View File

@@ -0,0 +1,34 @@
import {useEffect, useState} from "react";
import CenterLayout from "@/layouts/CenterLayout";
import {useTranslations} from "next-intl";
import {Typography} from "@mui/material";
import Content from "@/components/dashboard/passenger-boss/Prints/appraisal-confirmation/Content";
const AppraisalConfirmationComponent = () => {
const t = useTranslations()
const [data, setData] = useState(null)
useEffect(() => {
if (sessionStorage.getItem('appraisal-confirmation-print') === null) {
sessionStorage.setItem('appraisal-confirmation-print', 'seen')
} else if (sessionStorage.getItem('appraisal-confirmation-print') === 'seen') {
setData(null)
} else if (data) {
sessionStorage.setItem('appraisal-confirmation-print', 'seen')
} else {
setData(JSON.parse(sessionStorage.getItem('appraisal-confirmation-print')))
}
}, [data]);
return (
<>
{!data ? (
<CenterLayout>
<Typography variant={'h5'}>
{t('data_not_found')}
</Typography>
</CenterLayout>
) : data.map(item => <Content key={item.id} data={item}/>)}
</>
)
}
export default AppraisalConfirmationComponent

View File

@@ -0,0 +1,136 @@
import PrintablePage from "@/core/components/PrintablePage";
import {Box, Grid, Stack, Typography} from "@mui/material";
const Content = ({data}) => {
return (
<>
<PrintablePage key={data.id} header={true} footer={true}>
<Typography sx={{mt: 6}}>
<Typography
sx={{
fontFamily: 'Bnazanin',
fontWeight: 'bold',
fontSize: '1.2rem',
textAlign: 'center'
}}> {'فرم صورتجلسه تعیین مبلغ نهایی اعتبار'} </Typography>
</Typography>
<Typography textAlign={'justify'} sx={{lineHeight: '1.8', mt: 2}}>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', pl: 4}}> {'با توجه به نامه شماره'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>35482</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'مورخ'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402/08/20</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'معاون محترم برنامه ریزی سازمان راهداری و حمل و نقل جاده ای در خصوص تسهیلات بند (الف) تبصره (18) قانون بودجه سال'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'موضوع بازسازی ناوگان اتوبوس و مینی بوس و نیز تصویب آن درشورای برنامه ریزی و توسعه استان'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>تهران</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'و نامه شماره'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>35482</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'مورخ'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402/08/20</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'اداره کل راهداری و حمل و نقل جاده ای'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>تهران</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'در خصوص استفاده از ظرفیت انجمن های صنفی رانندگان در تاریخ'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402/08/20</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'از ناوگان اتوبوس/مینی بوس به شماره پلاک انتظامی'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>25پ4582</Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin'}}> {'و شماره هوشمند ناوگان'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>5875698725</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'به مالکیت آقای'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>امیرحسین محمودی</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'با کد ملی'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>0311318897</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'و شماره تماس'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>09120630655</Typography>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'ساکن شهرستان'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>تهران</Typography>
<Typography
sx={{fontFamily: 'Bnazanin'}}
component={'span'}> {'در جلسه مطرح شد که نتیجه آن به شرح ذیل مورد تایید می باشد.'} </Typography>
</Typography>
<Box sx={{border: 1, borderRadius: 1, mt: 3, p: 2}}>
<Typography textAlign={'justify'}
sx={{fontFamily: 'Bnazanin'}}> {'با توجه به گزارش واصله از اداره ماشین آلات (نامه در پیوست موجود می باشد) جهت بازسازی ناوگان مذکور مبلغ .............................................. ریال معادل .............................................. تومان مورد تایید می باشد.'} </Typography>
</Box>
<Grid container columns={4} sx={{border: 1, borderRadius: 1, mt: 3}}>
<Grid item xs={1} sx={{borderRight: 1, aspectRatio: '3 / 1'}}>
<Stack alignItems={'center'}>
<Typography variant={'caption'} sx={{fontFamily: 'Bnazanin'}}>رئیس انجمن</Typography>
</Stack>
</Grid>
<Grid item xs={1} sx={{borderRight: 1, aspectRatio: '3 / 1'}}>
<Stack alignItems={'center'}>
<Typography variant={'caption'} sx={{fontFamily: 'Bnazanin'}}>رئیس اداره مسافر</Typography>
</Stack>
</Grid>
<Grid item xs={1} sx={{borderRight: 1, aspectRatio: '3 / 1'}}>
</Grid>
<Grid item xs={1} sx={{aspectRatio: '3 / 1'}}>
</Grid>
<Grid item xs={1} sx={{borderRight: 1, borderTop: 1, aspectRatio: '2 / 1'}}>
<Stack alignItems={'center'} justifyContent={'center'} sx={{height: '100%'}}>
<Typography variant={'caption'} sx={{fontFamily: 'Bnazanin'}}>امضاء</Typography>
</Stack>
</Grid>
<Grid item xs={1} sx={{borderRight: 1, borderTop: 1, aspectRatio: '2 / 1'}}>
<Stack alignItems={'center'} justifyContent={'center'} sx={{height: '100%'}}>
<Typography variant={'caption'} sx={{fontFamily: 'Bnazanin'}}>امضاء</Typography>
</Stack>
</Grid>
<Grid item xs={1} sx={{borderRight: 1, borderTop: 1, aspectRatio: '2 / 1'}}>
<Stack alignItems={'center'} justifyContent={'center'} sx={{height: '100%'}}>
<Typography variant={'caption'} sx={{fontFamily: 'Bnazanin'}}>امضاء</Typography>
</Stack>
</Grid>
<Grid item xs={1} sx={{borderTop: 1, aspectRatio: '2 / 1'}}>
<Stack alignItems={'center'} justifyContent={'center'} sx={{height: '100%'}}>
<Typography variant={'caption'} sx={{fontFamily: 'Bnazanin'}}>امضاء</Typography>
</Stack>
</Grid>
</Grid>
<Box sx={{border: 1, borderRadius: 1, mt: 8, p: 2}}>
<Typography textAlign={'center'} sx={{fontFamily: 'Bnazanin'}}> {'تعهدنامه'} </Typography>
<Typography textAlign={'justify'} sx={{mt: 1, lineHeight: '1.8'}}>
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'اینجانب'} </Typography>
<Typography component={'span'}
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>امیرحسین محمودی</Typography>
<Typography
component={'span'}
sx={{fontFamily: 'Bnazanin'}}> {'مالک ناوگان اتوبوس | مینی بوس با مشخصات فوق الذکر بدینوسیله تعهد می نمایم مبلغ دریافتی وام را برابر پیش فاکتور ارائه شده صرف تعمیرات و بازسازی ناوگان نمایم و اگر خلاف این ثابت شود برابر مقررات با بنده برخورد شود و حق هیچگونه اعتراضی ندارم.'} </Typography>
<Typography
sx={{fontFamily: 'Bnazanin', textAlign: 'right'}}>تاریخ و امضاء</Typography>
</Typography>
</Box>
</PrintablePage>
</>
)
}
export default Content

View File

@@ -0,0 +1,40 @@
import {useEffect, useState} from "react";
import CenterLayout from "@/layouts/CenterLayout";
import {useTranslations} from "next-intl";
import {Typography} from "@mui/material";
import Content from "@/components/dashboard/passenger-boss/Prints/final-credit-amount/Content";
const FinalCreditAmountComponent = () => {
const t = useTranslations()
const [data, setData] = useState(null)
useEffect(() => {
if (sessionStorage.getItem('final-credit-amount-print') === null) {
sessionStorage.setItem('final-credit-amount-print', 'seen')
} else if (sessionStorage.getItem('final-credit-amount-print') === 'seen') {
setData(null)
} else if (data) {
sessionStorage.setItem('final-credit-amount-print', 'seen')
} else {
setData(JSON.parse(sessionStorage.getItem('final-credit-amount-print')))
}
}, [data]);
return (
<>
{!data ? (
<CenterLayout>
<Typography variant={'h5'}>
{t('data_not_found')}
</Typography>
</CenterLayout>
) : !data.length ? (
<CenterLayout>
<Typography variant={'h5'}>
{t('data_not_found')}
</Typography>
</CenterLayout>
) : data.map(item => <Content key={item.id} data={item}/>)}
</>
)
}
export default FinalCreditAmountComponent

View File

@@ -0,0 +1,14 @@
import {Stack} from "@mui/material";
import PrintAppraisalConfirmation from "@/components/dashboard/passenger-boss/Buttons/printAppraisalConfirmation";
import PrintFinalCreditAmount from "@/components/dashboard/passenger-boss/Buttons/printFinalCreditAmount";
const TableToolbar = () => {
return (
<Stack direction={"row"} spacing={2}>
<PrintAppraisalConfirmation/>
<PrintFinalCreditAmount/>
</Stack>
)
}
export default TableToolbar

View File

@@ -6,6 +6,7 @@ import TableRowActions from "./TableRowActions";
import moment from "jalali-moment";
import DataTable from "@/core/components/DataTable";
import MuiDatePicker from "@/core/components/MuiDatePicker";
import TableToolbar from "@/components/dashboard/passenger-boss/TableToolbar";
function DashboardPassengerOfficeComponent() {
const t = useTranslations();
@@ -161,7 +162,8 @@ function DashboardPassengerOfficeComponent() {
tableUrl={GET_PASSENGER_BOSS}
columns={columns}
selectableRow={false}
enableCustomToolbar={false}
enableCustomToolbar={true}
CustomToolbar={TableToolbar}
enableLastUpdate={true}
sorting={[{
id: 'id', desc: false

View File

@@ -0,0 +1,21 @@
import {parse} from "next-useragent";
import AppraisalConfirmationComponent from "@/components/dashboard/passenger-boss/Prints/appraisal-confirmation";
export default function AppraisalConfirmation() {
return (
<AppraisalConfirmationComponent/>
)
}
export async function getServerSideProps({req, locale}) {
const {isBot} = parse(req.headers["user-agent"]);
return {
props: {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.passenger_boss_page",
isBot,
locale,
layout: {name: 'PrintLayout'}
},
};
}

View File

@@ -0,0 +1,21 @@
import {parse} from "next-useragent";
import FinalCreditAmountComponent from "@/components/dashboard/passenger-boss/Prints/final-credit-amount";
export default function FinalCreditAmount() {
return (
<FinalCreditAmountComponent/>
)
}
export async function getServerSideProps({req, locale}) {
const {isBot} = parse(req.headers["user-agent"]);
return {
props: {
messages: (await import(`&/locales/${locale}/app.json`)).default,
title: "Dashboard.passenger_boss_page",
isBot,
locale,
layout: {name: 'PrintLayout'}
},
};
}