# Conflicts: # src/pages/extra-pages/DatabaseHealthCheck/index.js # src/routes/LoginRoutes.jsCR013B2
@@ -532,13 +532,13 @@ function Header(props) { | |||
</Typography> | |||
</Link> | |||
</li> | |||
<li> | |||
{/* <li> | |||
<Link className="login" to={'/userGuidePub'}> | |||
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | |||
<FormattedMessage id="userGuide" /> | |||
</Typography> | |||
</Link> | |||
</li> | |||
</li> */} | |||
<li> | |||
<Link className="login" to='/login'> | |||
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | |||
@@ -1,6 +1,7 @@ | |||
import { useEffect, useState } from 'react'; | |||
import { Outlet } from 'react-router-dom'; | |||
import { useDispatch, useSelector } from 'react-redux'; | |||
import { useLocation } from 'react-router-dom'; | |||
// material-ui | |||
import { useTheme } from '@mui/material/styles'; | |||
@@ -31,7 +32,8 @@ const MainLayout = () => { | |||
const theme = useTheme(); | |||
const matchDownLG = useMediaQuery(theme.breakpoints.down('lg')); | |||
const dispatch = useDispatch(); | |||
const location = useLocation(); | |||
const hideNavbarRoutes = ['/databaseHealthCheck'] | |||
const { drawerOpen } = useSelector((state) => state.menu); | |||
// drawer toggler | |||
@@ -55,18 +57,26 @@ const MainLayout = () => { | |||
}, [drawerOpen]); | |||
return ( | |||
<Box sx={{backgroundColor:'#ffffff', display: 'flex', width: '100%', flexDirection: "column", paddingTop: { xs: "5px", sm: "25px", md: "43px" }}}> | |||
<Header/> | |||
{/* <Drawer open={open} handleDrawerToggle={handleDrawerToggle} /> */} | |||
<Box style={{ width: '100%', flexGrow: 1 } } sx={{ paddingTop: "38px" }}> | |||
{/* <Toolbar /> */} | |||
{/* <Breadcrumbs navigation={navigation} title /> */} | |||
<Outlet /> | |||
</Box> | |||
<Box sx={{borderTop: "3px solid #0C489E"}}> | |||
<Footer/> | |||
</Box> | |||
</Box> | |||
<> | |||
{!hideNavbarRoutes.includes(location.pathname) && ( | |||
<Box sx={{backgroundColor:'#ffffff', display: 'flex', width: '100%', flexDirection: "column", paddingTop: { xs: "5px", sm: "25px", md: "43px" }}}> | |||
<Header/> | |||
{/* <Drawer open={open} handleDrawerToggle={handleDrawerToggle} /> */} | |||
<Box style={{ width: '100%', flexGrow: 1 } } sx={{ paddingTop: "38px" }}> | |||
{/* <Toolbar /> */} | |||
{/* <Breadcrumbs navigation={navigation} title /> */} | |||
<Outlet /> | |||
</Box> | |||
<Box sx={{borderTop: "3px solid #0C489E"}}> | |||
<Footer/> | |||
</Box> | |||
</Box> | |||
)} | |||
{hideNavbarRoutes.includes(location.pathname) && ( | |||
<Outlet /> | |||
)} | |||
</> | |||
); | |||
}; | |||
@@ -14,6 +14,7 @@ import { useEffect, useState, lazy } from "react"; | |||
import * as DateUtils from 'utils/DateUtils'; | |||
import * as HttpUtils from 'utils/HttpUtils'; | |||
import * as UrlUtils from "utils/ApiPathConst"; | |||
import {checkMarkAsCreditClient} from 'utils/Utils'; | |||
import * as FieldUtils from "utils/FieldUtils"; | |||
import * as ComboData from "utils/ComboData"; | |||
const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | |||
@@ -312,30 +313,33 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||
{ | |||
currentUserData.creditor ? | |||
<Grid item sx={{ ml: 3, mr: 3 }}> | |||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||
<Button | |||
variant="contained" | |||
color="error" | |||
onClick={() => setNonCreditorConfirmPopUp(true)} | |||
> | |||
Mark as Non-Credit Client | |||
</Button> | |||
</ThemeProvider> | |||
</Grid> | |||
: | |||
<> | |||
!checkMarkAsCreditClient()? | |||
<Grid item sx={{ ml: 3, mr: 3 }}> | |||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||
<Button | |||
variant="contained" | |||
color="orange" | |||
onClick={() => setCreditorConfirmPopUp(true)} | |||
color="error" | |||
onClick={() => setNonCreditorConfirmPopUp(true)} | |||
> | |||
Mark as Credit Client | |||
Mark as Non-Credit Client | |||
</Button> | |||
</ThemeProvider> | |||
</Grid> | |||
</Grid>:null | |||
: | |||
<> | |||
{!checkMarkAsCreditClient()? | |||
<Grid item sx={{ ml: 3, mr: 3 }}> | |||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||
<Button | |||
variant="contained" | |||
color="orange" | |||
onClick={() => setCreditorConfirmPopUp(true)} | |||
> | |||
Mark as Credit Client | |||
</Button> | |||
</ThemeProvider> | |||
</Grid>:null | |||
} | |||
{ isGrantedAny("MAINTAIN_DEMANDNOTE")? | |||
<Grid item sx={{ ml: 3, mr: 3 }}> | |||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||
@@ -385,18 +389,20 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||
})} | |||
</Grid> | |||
<Grid item xs={12} lg={4} > | |||
<FormControlLabel | |||
control={<Checkbox checked={formik.values.creditor} />} | |||
label="is Credit Client" | |||
name="creditor" | |||
onChange={() => { | |||
formik.setFieldValue("creditor", !formik.values.creditor); | |||
}} | |||
disabled={true} | |||
//disabled={!editMode && !createMode} | |||
/> | |||
</Grid> | |||
{!checkMarkAsCreditClient()? | |||
<Grid item xs={12} lg={4} > | |||
<FormControlLabel | |||
control={<Checkbox checked={formik.values.creditor} />} | |||
label="is Credit Client" | |||
name="creditor" | |||
onChange={() => { | |||
formik.setFieldValue("creditor", !formik.values.creditor); | |||
}} | |||
disabled={true} | |||
//disabled={!editMode && !createMode} | |||
/> | |||
</Grid>:null | |||
} | |||
<Grid item xs={12} lg={4} ></Grid> | |||
@@ -7,6 +7,10 @@ import * as PaymentStatus from "utils/statusUtils/PaymentStatus" | |||
import { useNavigate } from "react-router-dom"; | |||
import { FiDataGrid } from "components/FiDataGrid"; | |||
import { clickableLink } from 'utils/CommonFunction'; | |||
import { | |||
Checkbox | |||
// MenuItem | |||
} from '@mui/material'; | |||
// ==============================|| EVENT TABLE ||============================== // | |||
export default function SearchPaymentTable({ searchCriteria, applyGridOnReady, applySearch}) { | |||
@@ -59,6 +63,16 @@ export default function SearchPaymentTable({ searchCriteria, applyGridOnReady, a | |||
return clickableLink('/paymentPage/details/' + params.row.id, params.row.transNo); | |||
}, | |||
}, | |||
{ | |||
id: 'payMethod', | |||
field: 'payMethod', | |||
headerName: 'Payment means', | |||
flex: 1, | |||
minWidth: 150, | |||
renderCell: (params) => { | |||
return <div style={{ marginTop: 2, marginBottom: 2 }}>{params.row.payMethod}</div> | |||
} | |||
}, | |||
{ | |||
id: 'transDateTime', | |||
field: 'transDateTime', | |||
@@ -69,6 +83,14 @@ export default function SearchPaymentTable({ searchCriteria, applyGridOnReady, a | |||
return DateUtils.dateStr(params?.value); | |||
} | |||
}, | |||
{ | |||
field: 'bib', | |||
headerName: 'BIB', | |||
width: 150, | |||
renderCell: (params) => { | |||
return <Checkbox checked={params.row.bib} onChange={() => {set_paymentMethod("demandNote")}}/>; | |||
} | |||
}, | |||
{ | |||
field: 'action', | |||
headerName: 'Status', | |||
@@ -26,7 +26,10 @@ import { notifyActionSuccess } from 'utils/CommonFunction'; | |||
import { PNSPS_BUTTON_THEME } from "themes/buttonConst"; | |||
import { ThemeProvider } from "@emotion/react"; | |||
import { FormattedMessage, useIntl } from "react-intl"; | |||
import { isDummyLoggedIn } from "utils/Utils" | |||
import { | |||
isDummyLoggedIn, | |||
checkIsOnlyOnlinePaymentByIssueDate | |||
} from "utils/Utils" | |||
const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); | |||
//import * as ProofStatus from "utils/statusUtils/ProofStatus"; | |||
@@ -46,6 +49,7 @@ const FormPanel = ({ formData }) => { | |||
const [warningTitle, setWarningTitle] = React.useState(""); | |||
const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); | |||
const [warningText, setWarningText] = React.useState(""); | |||
const [isOnlyOnlinePayment, setOnlyOnlinePayment] = React.useState(); | |||
const navigate = useNavigate() | |||
const params = useParams(); | |||
@@ -61,8 +65,11 @@ const FormPanel = ({ formData }) => { | |||
React.useEffect(() => { | |||
if (formData) { | |||
setData(formData); | |||
setOnlyOnlinePayment(checkIsOnlyOnlinePaymentByIssueDate(formData.issueDate)) | |||
if (isDummyLoggedIn()) { | |||
set_paymentMethod("demandNote") | |||
} else if (checkIsOnlyOnlinePaymentByIssueDate(formData.issueDate)){ | |||
set_paymentMethod("online") | |||
} | |||
} | |||
}, [formData]); | |||
@@ -461,90 +468,94 @@ const FormPanel = ({ formData }) => { | |||
}} /> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td style={tabelStyle}> | |||
{isOverDnReviseDeadline() ? | |||
<></> : | |||
<Checkbox | |||
checked={paymentMethod == "demandNote"} | |||
onChange={() => { | |||
set_paymentMethod("demandNote") | |||
}} | |||
/> | |||
} | |||
</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payDn" /> | |||
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payDn" })) | |||
setWarningText( | |||
<><FormattedMessage id="paymentMethodMeans" />: | |||
<ul> | |||
<li><FormattedMessage id="atm" /></li> | |||
<li><FormattedMessage id="pps" /></li> | |||
<li><FormattedMessage id="eBank" /></li> | |||
<li><FormattedMessage id="phoneBank" /></li> | |||
<li><FormattedMessage id="eCheque" /></li> | |||
<li><FormattedMessage id="fps" /></li> | |||
<li><FormattedMessage id="hkpo" /></li> | |||
<li><FormattedMessage id="store" /></li> | |||
<li><FormattedMessage id="post" /></li> | |||
</ul> | |||
<Typography variant="h6"> | |||
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} /> | |||
</Typography> | |||
</> | |||
); | |||
setIsWarningPopUp(true); | |||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||
</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"5:00 p.m.":"下午5時"}</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"5:00 p.m.":"下午5時"}</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payDnRemark" values={{ | |||
date: DateUtils.dateFormat(formData.proofPaymentDeadline, intl.formatMessage({ id: "dateStrFormat" })) | |||
}} /> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td style={tabelStyle}> | |||
{ | |||
isOverNpgoReviseDeadline() ? | |||
<></> : | |||
<Checkbox | |||
checked={paymentMethod == "office"} | |||
onChange={() => { | |||
set_paymentMethod("office") | |||
}} | |||
/> | |||
} | |||
</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payNPGO" /> | |||
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payNPGOPopUpTitle" })) | |||
setWarningText( | |||
<><FormattedMessage id="paymentMethodMeans" />: | |||
<ul> | |||
<li><FormattedMessage id="cheque" /></li> | |||
<li><FormattedMessage id="drafts" /></li> | |||
<li><FormattedMessage id="cashierOrders" /></li> | |||
<li><FormattedMessage id="cash" /></li> | |||
</ul> | |||
</> | |||
); | |||
setIsWarningPopUp(true); | |||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||
</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"11:30 a.m.":"上午11時30分"}</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"12:00 p.m.":"下午12時"}</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payNPGORemark" values={{ | |||
date: DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" })) | |||
}} /> | |||
</td> | |||
</tr> | |||
{!isOnlyOnlinePayment? | |||
<> | |||
<tr> | |||
<td style={tabelStyle}> | |||
{isOverDnReviseDeadline() ? | |||
<></> : | |||
<Checkbox | |||
checked={paymentMethod == "demandNote"} | |||
onChange={() => { | |||
set_paymentMethod("demandNote") | |||
}} | |||
/> | |||
} | |||
</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payDn" /> | |||
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payDn" })) | |||
setWarningText( | |||
<><FormattedMessage id="paymentMethodMeans" />: | |||
<ul> | |||
<li><FormattedMessage id="atm" /></li> | |||
<li><FormattedMessage id="pps" /></li> | |||
<li><FormattedMessage id="eBank" /></li> | |||
<li><FormattedMessage id="phoneBank" /></li> | |||
<li><FormattedMessage id="eCheque" /></li> | |||
<li><FormattedMessage id="fps" /></li> | |||
<li><FormattedMessage id="hkpo" /></li> | |||
<li><FormattedMessage id="store" /></li> | |||
<li><FormattedMessage id="post" /></li> | |||
</ul> | |||
<Typography variant="h6"> | |||
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} /> | |||
</Typography> | |||
</> | |||
); | |||
setIsWarningPopUp(true); | |||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||
</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"5:00 p.m.":"下午5時"}</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"5:00 p.m.":"下午5時"}</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payDnRemark" values={{ | |||
date: DateUtils.dateFormat(formData.proofPaymentDeadline, intl.formatMessage({ id: "dateStrFormat" })) | |||
}} /> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td style={tabelStyle}> | |||
{ | |||
isOverNpgoReviseDeadline() ? | |||
<></> : | |||
<Checkbox | |||
checked={paymentMethod == "office"} | |||
onChange={() => { | |||
set_paymentMethod("office") | |||
}} | |||
/> | |||
} | |||
</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payNPGO" /> | |||
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payNPGOPopUpTitle" })) | |||
setWarningText( | |||
<><FormattedMessage id="paymentMethodMeans" />: | |||
<ul> | |||
<li><FormattedMessage id="cheque" /></li> | |||
<li><FormattedMessage id="drafts" /></li> | |||
<li><FormattedMessage id="cashierOrders" /></li> | |||
<li><FormattedMessage id="cash" /></li> | |||
</ul> | |||
</> | |||
); | |||
setIsWarningPopUp(true); | |||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||
</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"11:30 a.m.":"上午11時30分"}</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"12:00 p.m.":"下午12時"}</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payNPGORemark" values={{ | |||
date: DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" })) | |||
}} /> | |||
</td> | |||
</tr> | |||
</>:null | |||
} | |||
</tbody> | |||
</table> | |||
@@ -19,7 +19,8 @@ import ForwardIcon from '@mui/icons-material/Forward'; | |||
import { | |||
isORGLoggedIn, | |||
isDummyLoggedIn, | |||
isCreditorLoggedIn | |||
isCreditorLoggedIn, | |||
checkIsOnlyOnlinePaymentByIssueDate | |||
} from "utils/Utils"; | |||
import { useNavigate } from "react-router-dom"; | |||
@@ -51,6 +52,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||
const [issueId, setIssueId] = useState(loadedData.issueId); | |||
const [closeDate, setCloseDate] = useState(null); | |||
const [closingDateOff, setClosingDateOff] = useState(null); | |||
const [isOnlyOnlinePayment, setOnlyOnlinePayment] = useState(); | |||
const navigate = useNavigate(); | |||
const BackgroundHead = { | |||
@@ -83,6 +85,8 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||
if (data.id == issueId) { | |||
setCloseDate(data.closingDate) | |||
setClosingDateOff(data.closingDateOff) | |||
setOnlyOnlinePayment(checkIsOnlyOnlinePaymentByIssueDate(data.issueDate)) | |||
break; | |||
} | |||
} | |||
@@ -383,62 +387,66 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||
}} /> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td style={tabelStyle}><FormattedMessage id="payDn" /> | |||
<br /><a href="#payDnDetails" onClick={() => { | |||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payDn" })) | |||
setWarningText( | |||
<><FormattedMessage id="paymentMethodMeans" />: | |||
<ul> | |||
<li><FormattedMessage id="atm" /></li> | |||
<li><FormattedMessage id="pps" /></li> | |||
<li><FormattedMessage id="eBank" /></li> | |||
<li><FormattedMessage id="phoneBank" /></li> | |||
<li><FormattedMessage id="eCheque" /></li> | |||
<li><FormattedMessage id="fps" /></li> | |||
<li><FormattedMessage id="hkpo" /></li> | |||
<li><FormattedMessage id="store" /></li> | |||
<li><FormattedMessage id="post" /></li> | |||
</ul> | |||
<Typography variant="h6"> | |||
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} /> | |||
</Typography> | |||
</> | |||
); | |||
setIsWarningPopUp(true); | |||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||
</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(closingDateOff, dft)} {locale==='en'?"5:00 p.m.":"下午5時"}</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payDnRemark" values={{ | |||
date: DateUtils.dateFormat(closeDate, dft) | |||
}} /> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td style={tabelStyle}><FormattedMessage id="payNPGO" /> | |||
<br /><a href="#payNPGODetails" onClick={() => { | |||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payNPGOPopUpTitle" })) | |||
setWarningText( | |||
<><FormattedMessage id="paymentMethodMeans" />: | |||
<ul> | |||
<li><FormattedMessage id="cheque" /></li> | |||
<li><FormattedMessage id="drafts" /></li> | |||
<li><FormattedMessage id="cashierOrders" /></li> | |||
<li><FormattedMessage id="cash" /></li> | |||
</ul> | |||
</> | |||
); | |||
setIsWarningPopUp(true); | |||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||
</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(closeDate, dft)} {locale==='en'?"12:00 p.m.":"下午12時"}</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payNPGORemark" values={{ | |||
date: DateUtils.dateFormat(closeDate, dft) | |||
}} /> | |||
</td> | |||
</tr> | |||
{!isOnlyOnlinePayment? | |||
<> | |||
<tr> | |||
<td style={tabelStyle}><FormattedMessage id="payDn" /> | |||
<br /><a href="#payDnDetails" onClick={() => { | |||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payDn" })) | |||
setWarningText( | |||
<><FormattedMessage id="paymentMethodMeans" />: | |||
<ul> | |||
<li><FormattedMessage id="atm" /></li> | |||
<li><FormattedMessage id="pps" /></li> | |||
<li><FormattedMessage id="eBank" /></li> | |||
<li><FormattedMessage id="phoneBank" /></li> | |||
<li><FormattedMessage id="eCheque" /></li> | |||
<li><FormattedMessage id="fps" /></li> | |||
<li><FormattedMessage id="hkpo" /></li> | |||
<li><FormattedMessage id="store" /></li> | |||
<li><FormattedMessage id="post" /></li> | |||
</ul> | |||
<Typography variant="h6"> | |||
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} /> | |||
</Typography> | |||
</> | |||
); | |||
setIsWarningPopUp(true); | |||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||
</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(closingDateOff, dft)} {locale==='en'?"5:00 p.m.":"下午5時"}</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payDnRemark" values={{ | |||
date: DateUtils.dateFormat(closeDate, dft) | |||
}} /> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td style={tabelStyle}><FormattedMessage id="payNPGO" /> | |||
<br /><a href="#payNPGODetails" onClick={() => { | |||
setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payNPGOPopUpTitle" })) | |||
setWarningText( | |||
<><FormattedMessage id="paymentMethodMeans" />: | |||
<ul> | |||
<li><FormattedMessage id="cheque" /></li> | |||
<li><FormattedMessage id="drafts" /></li> | |||
<li><FormattedMessage id="cashierOrders" /></li> | |||
<li><FormattedMessage id="cash" /></li> | |||
</ul> | |||
</> | |||
); | |||
setIsWarningPopUp(true); | |||
}}><u><FormattedMessage id="viewDetail" /></u></a> | |||
</td> | |||
<td style={tabelStyle}>{DateUtils.dateFormat(closeDate, dft)} {locale==='en'?"12:00 p.m.":"下午12時"}</td> | |||
<td style={tabelStyle}> | |||
<FormattedMessage id="payNPGORemark" values={{ | |||
date: DateUtils.dateFormat(closeDate, dft) | |||
}} /> | |||
</td> | |||
</tr> | |||
</>:null | |||
} | |||
</tbody> | |||
</table> | |||
@@ -20,6 +20,7 @@ const PublicNoticeApplyForm = Loadable(lazy(() => import('./PublicNoticeApplyFor | |||
import { | |||
// isORGLoggedIn, | |||
isDummyLoggedIn, | |||
// checkIsOnlyOnlinePaymentByIssueDate | |||
// isCreditorLoggedIn | |||
} from "utils/Utils"; | |||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
@@ -29,6 +30,7 @@ const ApplyForm = () => { | |||
const [gazetteIssueList, setGazetteIssueList] = React.useState([]); | |||
const [selections, setSelection] = React.useState([]); | |||
const [isLoading, setLoding] = React.useState(true); | |||
const intl = useIntl(); | |||
@@ -64,6 +66,7 @@ const ApplyForm = () => { | |||
setGazetteIssueList(response?.gazetteIssueList); | |||
setSelection(selection); | |||
setUserData(response); | |||
// setOnlyOnlinePayment(checkIsOnlyOnlinePayment()) | |||
} | |||
}); | |||
}; | |||
@@ -106,7 +109,10 @@ const ApplyForm = () => { | |||
React.useEffect(() => { | |||
if (userData !== null) setLoding(false); | |||
if (userData !== null){ | |||
setLoding(false); | |||
// console.log(isOnlyOnlinePayment) | |||
} | |||
}, [userData]); | |||
return ( | |||
@@ -121,6 +127,7 @@ const ApplyForm = () => { | |||
loadedData={userData} | |||
_selections={selections} | |||
gazetteIssueList = {gazetteIssueList} | |||
// isOnlyOnlinePayment = {isOnlyOnlinePayment} | |||
/> | |||
); | |||
}; | |||
@@ -1,31 +1,10 @@ | |||
import { Grid, Typography, Stack, } from '@mui/material'; | |||
import { useState, useEffect, lazy } from "react"; | |||
import { useState, useEffect } from "react"; | |||
import Loadable from 'components/Loadable'; | |||
// import { useIntl, FormattedMessage } from "react-intl"; | |||
import { get } from "utils/HttpUtils" | |||
import {GET_SYS_SETTING} from "utils/ApiPathConst" | |||
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | |||
const BackgroundHead = { | |||
backgroundImage: `url(${titleBackgroundImg})`, | |||
width: 'auto', | |||
height: 'auto', | |||
backgroundSize: 'contain', | |||
backgroundRepeat: 'no-repeat', | |||
backgroundColor: '#0C489E', | |||
backgroundPosition: 'right' | |||
} | |||
const LoadingComponent = Loadable(lazy(() => import('pages/extra-pages/LoadingComponent'))); | |||
// import DownloadIcon from '@mui/icons-material/Download'; | |||
import {GET_SYS_CHECKING} from "utils/ApiPathConst" | |||
const DatabaseHealthCheck = () => { | |||
// const intl = useIntl(); | |||
// const { locale } = intl; | |||
const [onReady, setOnReady] = useState(false); | |||
const [sysEnv, setSysEnv] = useState(""); | |||
const [sysEnv, setSysEnv] = useState("'N/A"); | |||
useEffect(() => { | |||
loadSysSetting(); | |||
@@ -37,41 +16,16 @@ const DatabaseHealthCheck = () => { | |||
const loadSysSetting = () => { | |||
get({ | |||
url: GET_SYS_SETTING, | |||
url: GET_SYS_CHECKING, | |||
onSuccess: (responseData) => { | |||
// console.log(responseData) | |||
setSysEnv(responseData.sysEnv); | |||
setOnReady(true); | |||
} | |||
}); | |||
} | |||
return ( | |||
!onReady ? | |||
<Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center"> | |||
<Grid item> | |||
<LoadingComponent /> | |||
</Grid> | |||
</Grid> | |||
: | |||
( | |||
<Grid container sx={{ minHeight: '87vh', mb: 3}} direction="column" alignItems="center" > | |||
<Grid item xs={12} md={12} width="100%"> | |||
<div style={BackgroundHead}> | |||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||
<Typography ml={15} color='#FFF' variant="h4" sx={{ display: { xs: 'none', sm: 'none', md: 'block'} }}> | |||
Database Health Check | |||
</Typography> | |||
</Stack> | |||
</div> | |||
</Grid> | |||
<Grid container justifyContent="center" alignItems="center" > | |||
<Grid item xs={12} md={12} ml={15}> | |||
<div>{sysEnv}</div> Connection OK | |||
</Grid> | |||
</Grid> | |||
</Grid> | |||
) | |||
<div>{sysEnv}</div> | |||
); | |||
} | |||
@@ -16,7 +16,7 @@ const PrivacyPolicyPage = Loadable(lazy(() => import('pages/extra-pages/PrivacyP | |||
const ImportantNoticePage = Loadable(lazy(() => import('pages/extra-pages/ImportantNoticePage'))); | |||
const AboutUsPage = Loadable(lazy(() => import('pages/extra-pages/AboutUs'))); | |||
const UserMenuPage = Loadable(lazy(() => import('pages/extra-pages/UserMenu'))); | |||
const UserMenuPubPage = Loadable(lazy(() => import('pages/extra-pages/UserMenuPub'))); | |||
// const UserMenuPubPage = Loadable(lazy(() => import('pages/extra-pages/UserMenuPub'))); | |||
const DatabaseHealthCheckPage = Loadable(lazy(() => import('pages/extra-pages/DatabaseHealthCheck'))); | |||
@@ -88,9 +88,13 @@ const LoginRoutes = { | |||
path: 'userGuide', | |||
element: <UserMenuPage/> | |||
}, | |||
// { | |||
// path: 'userGuidePub', | |||
// element: <UserMenuPubPage/> | |||
// }, | |||
{ | |||
path: 'userGuidePub', | |||
element: <UserMenuPubPage/> | |||
path: 'databaseHealthCheck', | |||
element: <DatabaseHealthCheckPage/> | |||
}, | |||
{ | |||
path: 'databaseHealthCheck', | |||
@@ -13,6 +13,7 @@ export const PRIVACY_POLICY_PATH = apiPath+'/privacyPolicy'; | |||
export const I_AM_SMART_PATH = apiPath+'/smart/call/iAmSmart'; | |||
export const I_AM_SMART_APP_PATH = apiPath+'/smart/call/app/iAmSmart'; | |||
export const GET_SYS_SETTING = apiPath+'/sys'; | |||
export const GET_SYS_CHECKING = apiPath+'/sysCheck'; | |||
//Group Config | |||
export const GET_GROUP_LIST_PATH = apiPath+'/group'; | |||
@@ -181,4 +181,47 @@ export const isPasswordExpiry = () =>{ | |||
return false; | |||
} | |||
} | |||
export const checkIsOnlyOnlinePaymentByIssueDate = (date) => { | |||
const targetDate = new Date(2025, 7, 1, 0, 0, 0) //2026-01-28T08:00:00.000Z hardcode | |||
// const targetDate = new Date(2025, 6, 13, 8, 0, 0); //2025-07-13T08:00:00.000Z | |||
const checkDate = DateUtils.convertToDate(date) | |||
if (isDummyLoggedIn()){ | |||
return false; | |||
} | |||
// console.log(checkDate) | |||
// console.log(targetDate) | |||
if (checkDate >= targetDate) { | |||
return true | |||
} else { | |||
return false; | |||
} | |||
} | |||
export const checkIsOnlyOnlinePayment = () => { | |||
const targetDate = new Date(2025, 7, 1, 0, 0, 0) // hardcode | |||
const checkDate = DateUtils.convertToDate(new Date()) | |||
if (isDummyLoggedIn()){ | |||
return false; | |||
} | |||
// console.log(checkDate) | |||
// console.log(targetDate) | |||
if (checkDate >= targetDate) { | |||
return true | |||
} else { | |||
return false; | |||
} | |||
} | |||
export const checkMarkAsCreditClient = () => { | |||
const targetDate = new Date(2025, 6, 15, 0, 0, 0) // hardcode | |||
const checkDate = DateUtils.convertToDate(new Date()) | |||
// console.log(targetDate) | |||
// console.log(checkDate >= targetDate) | |||
if (checkDate >= targetDate) { | |||
return true | |||
} else { | |||
return false; | |||
} | |||
} |