| @@ -28,8 +28,9 @@ import { ThemeProvider } from "@emotion/react"; | |||||
| import { FormattedMessage, useIntl } from "react-intl"; | import { FormattedMessage, useIntl } from "react-intl"; | ||||
| import { | import { | ||||
| isDummyLoggedIn, | isDummyLoggedIn, | ||||
| checkIsOnlyOnlinePaymentByIssueDate, | |||||
| checkPaymentSuspention | |||||
| checkIsOnlyOnlinePayment, | |||||
| checkPaymentSuspention, | |||||
| checkIsNoPaymentByCreateDate, | |||||
| } from "utils/Utils" | } from "utils/Utils" | ||||
| const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); | const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); | ||||
| @@ -51,7 +52,8 @@ const FormPanel = ({ formData }) => { | |||||
| const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); | const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); | ||||
| const [warningText, setWarningText] = React.useState(""); | const [warningText, setWarningText] = React.useState(""); | ||||
| const [isOnlyOnlinePayment, setOnlyOnlinePayment] = React.useState(); | const [isOnlyOnlinePayment, setOnlyOnlinePayment] = React.useState(); | ||||
| const [isNoPayment, setNoPayment] = React.useState(); | |||||
| const navigate = useNavigate() | const navigate = useNavigate() | ||||
| const params = useParams(); | const params = useParams(); | ||||
| // const dft = locale === 'en' ? "DD MMMM YYYY" : "YYYY年MM月DD日"; | // const dft = locale === 'en' ? "DD MMMM YYYY" : "YYYY年MM月DD日"; | ||||
| @@ -65,12 +67,16 @@ const FormPanel = ({ formData }) => { | |||||
| React.useEffect(() => { | React.useEffect(() => { | ||||
| if (formData) { | if (formData) { | ||||
| // console.log("formData", formData) | |||||
| setData(formData); | setData(formData); | ||||
| setOnlyOnlinePayment(checkIsOnlyOnlinePaymentByIssueDate(formData.issueDate)) | |||||
| setOnlyOnlinePayment(checkIsOnlyOnlinePayment()) | |||||
| setNoPayment(checkIsNoPaymentByCreateDate(formData.created)) | |||||
| if (isDummyLoggedIn()) { | if (isDummyLoggedIn()) { | ||||
| set_paymentMethod("demandNote") | set_paymentMethod("demandNote") | ||||
| } else if (checkIsOnlyOnlinePaymentByIssueDate(formData.issueDate)){ | |||||
| } else if (checkIsOnlyOnlinePayment()){ | |||||
| set_paymentMethod("online") | set_paymentMethod("online") | ||||
| } else if (checkIsNoPaymentByCreateDate(formData.created)){ | |||||
| set_paymentMethod("demandNote") | |||||
| } | } | ||||
| } | } | ||||
| }, [formData]); | }, [formData]); | ||||
| @@ -414,156 +420,160 @@ const FormPanel = ({ formData }) => { | |||||
| </table> | </table> | ||||
| </Grid> : | </Grid> : | ||||
| <> | <> | ||||
| <Grid item xs={12} sx={{ mb: 1, }}> | |||||
| <table style={tabelStyle}> | |||||
| <tbody> | |||||
| <tr style={tabelStyle}> | |||||
| <th style={tabelStyle} width="50" align="left"></th> | |||||
| <th style={tabelStyle} width="300" align="left"><FormattedMessage id="paymentMeans" /></th> | |||||
| <th style={tabelStyle} width="300" align="left"><FormattedMessage id="commentDeadline" /></th> | |||||
| <th style={tabelStyle} width="300" align="left"><FormattedMessage id="confirmingDealine" /></th> | |||||
| <th style={tabelStyle} width="400" align="left"><FormattedMessage id="PaymentCoonpletDealine" /></th> | |||||
| </tr> | |||||
| <tr> | |||||
| <td style={tabelStyle}> | |||||
| <Checkbox | |||||
| checked={paymentMethod == "online"} | |||||
| onChange={() => { | |||||
| set_paymentMethod("online") | |||||
| }} | |||||
| /> | |||||
| </td> | |||||
| <td style={tabelStyle}> | |||||
| <FormattedMessage id="payOnline" /> | |||||
| {checkPaymentSuspention()? | |||||
| <Typography style={{ padding: '16px', color: "red" }}> | |||||
| <div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessageText" }) }} /> | |||||
| </Typography>:null | |||||
| } | |||||
| <br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||||
| setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payOnline" })) | |||||
| setWarningText( | |||||
| <><FormattedMessage id="paymentMethodMeans" />: | |||||
| <ul> | |||||
| <li><FormattedMessage id="fps" /></li> | |||||
| <li><FormattedMessage id="card" /></li> | |||||
| <li><FormattedMessage id="pps" /></li> | |||||
| </ul> | |||||
| </> | |||||
| ); | |||||
| setIsWarningPopUp(true); | |||||
| }}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
| </td> | |||||
| <td style={tabelStyle}>{ | |||||
| locale === 'en' ? | |||||
| `${DateUtils.dateFormat(formData.reviseDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "a.m.")?.replace("pm", "p.m.")}` | |||||
| : | |||||
| `${DateUtils.dateFormat(formData.reviseDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}` | |||||
| }</td> | |||||
| <td style={tabelStyle}>{ | |||||
| locale === 'en' ? | |||||
| `${DateUtils.dateFormat(formData.proofPaymentDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "a.m.")?.replace("pm", "p.m.")}` | |||||
| : | |||||
| `${DateUtils.dateFormat(formData.proofPaymentDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}` | |||||
| }</td> | |||||
| <td style={tabelStyle}> | |||||
| <FormattedMessage id="payOnlineRemarkProof" values={{ | |||||
| date: DateUtils.formatDateForLocale(formData.expiryDate, intl, locale) | |||||
| }} /> | |||||
| </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() ? | |||||
| {isNoPayment ? | |||||
| null | |||||
| : | |||||
| <Grid item xs={12} sx={{ mb: 1, }}> | |||||
| <table style={tabelStyle}> | |||||
| <tbody> | |||||
| <tr style={tabelStyle}> | |||||
| <th style={tabelStyle} width="50" align="left"></th> | |||||
| <th style={tabelStyle} width="300" align="left"><FormattedMessage id="paymentMeans" /></th> | |||||
| <th style={tabelStyle} width="300" align="left"><FormattedMessage id="commentDeadline" /></th> | |||||
| <th style={tabelStyle} width="300" align="left"><FormattedMessage id="confirmingDealine" /></th> | |||||
| <th style={tabelStyle} width="400" align="left"><FormattedMessage id="PaymentCoonpletDealine" /></th> | |||||
| </tr> | |||||
| <tr> | |||||
| <td style={tabelStyle}> | |||||
| <Checkbox | |||||
| checked={paymentMethod == "online"} | |||||
| onChange={() => { | |||||
| set_paymentMethod("online") | |||||
| }} | |||||
| /> | |||||
| </td> | |||||
| <td style={tabelStyle}> | |||||
| <FormattedMessage id="payOnline" /> | |||||
| {checkPaymentSuspention()? | |||||
| <Typography style={{ padding: '16px', color: "red" }}> | |||||
| <div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessageText" }) }} /> | |||||
| </Typography>:null | |||||
| } | |||||
| <br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||||
| setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payOnline" })) | |||||
| setWarningText( | |||||
| <><FormattedMessage id="paymentMethodMeans" />: | |||||
| <ul> | |||||
| <li><FormattedMessage id="fps" /></li> | |||||
| <li><FormattedMessage id="card" /></li> | |||||
| <li><FormattedMessage id="pps" /></li> | |||||
| </ul> | |||||
| </> | |||||
| ); | |||||
| setIsWarningPopUp(true); | |||||
| }}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
| </td> | |||||
| <td style={tabelStyle}>{ | |||||
| locale === 'en' ? | |||||
| `${DateUtils.dateFormat(formData.reviseDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "a.m.")?.replace("pm", "p.m.")}` | |||||
| : | |||||
| `${DateUtils.dateFormat(formData.reviseDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}` | |||||
| }</td> | |||||
| <td style={tabelStyle}>{ | |||||
| locale === 'en' ? | |||||
| `${DateUtils.dateFormat(formData.proofPaymentDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "a.m.")?.replace("pm", "p.m.")}` | |||||
| : | |||||
| `${DateUtils.dateFormat(formData.proofPaymentDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}` | |||||
| }</td> | |||||
| <td style={tabelStyle}> | |||||
| <FormattedMessage id="payOnlineRemarkProof" values={{ | |||||
| date: DateUtils.formatDateForLocale(formData.expiryDate, intl, locale) | |||||
| }} /> | |||||
| </td> | |||||
| </tr> | |||||
| {!isOnlyOnlinePayment? | |||||
| <> | |||||
| <tr> | |||||
| <td style={tabelStyle}> | |||||
| {isOverDnReviseDeadline() ? | |||||
| <></> : | <></> : | ||||
| <Checkbox | <Checkbox | ||||
| checked={paymentMethod == "office"} | |||||
| checked={paymentMethod == "demandNote"} | |||||
| onChange={() => { | onChange={() => { | ||||
| set_paymentMethod("office") | |||||
| set_paymentMethod("demandNote") | |||||
| }} | }} | ||||
| /> | /> | ||||
| } | |||||
| </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> | |||||
| </Grid> | |||||
| } | |||||
| </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> | |||||
| </Grid> | |||||
| } | |||||
| {/* <Grid item xs={12}> | {/* <Grid item xs={12}> | ||||
| <Typography variant="h6" height="100%" > | <Typography variant="h6" height="100%" > | ||||
| <div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} /> | <div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} /> | ||||
| @@ -20,9 +20,10 @@ import ForwardIcon from '@mui/icons-material/Forward'; | |||||
| import { | import { | ||||
| isORGLoggedIn, | isORGLoggedIn, | ||||
| isDummyLoggedIn, | isDummyLoggedIn, | ||||
| // isCreditorLoggedIn, | |||||
| checkIsOnlyOnlinePaymentByIssueDate, | |||||
| // checkIsOnlyOnlinePaymentApply, | |||||
| isCreditorLoggedIn, | |||||
| // checkIsOnlyOnlinePaymentByIssueDate, | |||||
| checkIsOnlyOnlinePayment, | |||||
| checkMarkAsCreditClient, | |||||
| } from "utils/Utils"; | } from "utils/Utils"; | ||||
| import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
| @@ -89,7 +90,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||||
| if (data.id == issueId) { | if (data.id == issueId) { | ||||
| setCloseDate(data.closingDate) | setCloseDate(data.closingDate) | ||||
| setClosingDateOff(data.closingDateOff) | setClosingDateOff(data.closingDateOff) | ||||
| setOnlyOnlinePayment(checkIsOnlyOnlinePaymentByIssueDate(data.issueDate)) | |||||
| setOnlyOnlinePayment(checkIsOnlyOnlinePayment()) | |||||
| break; | break; | ||||
| } | } | ||||
| @@ -360,101 +361,105 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||||
| </Grid> | </Grid> | ||||
| </Grid> | </Grid> | ||||
| </Grid> | </Grid> | ||||
| <Grid item xs={12} alignItems={"center"} sx={{ p: 2 }}> | |||||
| <table style={tabelStyle}> | |||||
| <tbody> | |||||
| <tr style={tabelStyle}> | |||||
| <th style={tabelStyle} width="400" align="left"><FormattedMessage id="paymentMeans" /></th> | |||||
| <th style={tabelStyle} width="300" align="left"><FormattedMessage id="confirmingDealine" /></th> | |||||
| <th style={tabelStyle} width="300" align="left"><FormattedMessage id="PaymentCoonpletDealine" /></th> | |||||
| </tr> | |||||
| <tr> | |||||
| <td style={tabelStyle}> | |||||
| <FormattedMessage id="payOnline" /> | |||||
| <br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||||
| setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payOnline" })) | |||||
| setWarningText( | |||||
| <><FormattedMessage id="paymentMethodMeans" />: | |||||
| <ul> | |||||
| <li><FormattedMessage id="fps" /></li> | |||||
| <li><FormattedMessage id="card" /></li> | |||||
| <li><FormattedMessage id="pps" /></li> | |||||
| </ul> | |||||
| </> | |||||
| ); | |||||
| setIsWarningPopUp(true); | |||||
| }}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
| </td> | |||||
| <td style={tabelStyle}>{DateUtils.dateFormat(closeDate, dft)} {locale==='en'?"2:00 p.m.":"下午2時"}</td> | |||||
| <td style={tabelStyle}> | |||||
| <FormattedMessage id="payOnlineRemark" 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> | |||||
| </Grid> | |||||
| {isCreditorLoggedIn() && checkMarkAsCreditClient()? | |||||
| null | |||||
| : | |||||
| <Grid item xs={12} alignItems={"center"} sx={{ p: 2 }}> | |||||
| <table style={tabelStyle}> | |||||
| <tbody> | |||||
| <tr style={tabelStyle}> | |||||
| <th style={tabelStyle} width="400" align="left"><FormattedMessage id="paymentMeans" /></th> | |||||
| <th style={tabelStyle} width="300" align="left"><FormattedMessage id="confirmingDealine" /></th> | |||||
| <th style={tabelStyle} width="300" align="left"><FormattedMessage id="PaymentCoonpletDealine" /></th> | |||||
| </tr> | |||||
| <tr> | |||||
| <td style={tabelStyle}> | |||||
| <FormattedMessage id="payOnline" /> | |||||
| <br /><a href="#payOnlineDetails" color='#fff' onClick={() => { | |||||
| setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payOnline" })) | |||||
| setWarningText( | |||||
| <><FormattedMessage id="paymentMethodMeans" />: | |||||
| <ul> | |||||
| <li><FormattedMessage id="fps" /></li> | |||||
| <li><FormattedMessage id="card" /></li> | |||||
| <li><FormattedMessage id="pps" /></li> | |||||
| </ul> | |||||
| </> | |||||
| ); | |||||
| setIsWarningPopUp(true); | |||||
| }}><u><FormattedMessage id="viewDetail" /></u></a> | |||||
| </td> | |||||
| <td style={tabelStyle}>{DateUtils.dateFormat(closeDate, dft)} {locale==='en'?"2:00 p.m.":"下午2時"}</td> | |||||
| <td style={tabelStyle}> | |||||
| <FormattedMessage id="payOnlineRemark" 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> | |||||
| </Grid> | |||||
| } | |||||
| <Grid item xs={12} md={12} lg={12}> | <Grid item xs={12} md={12} lg={12}> | ||||
| <Grid container direction="row" justifyContent="flex-start" alignItems="center"> | <Grid container direction="row" justifyContent="flex-start" alignItems="center"> | ||||
| <Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
| @@ -20,8 +20,8 @@ const PublicNoticeApplyForm = Loadable(lazy(() => import('./PublicNoticeApplyFor | |||||
| import { | import { | ||||
| // isORGLoggedIn, | // isORGLoggedIn, | ||||
| isDummyLoggedIn, | isDummyLoggedIn, | ||||
| checkIsOnlyOnlinePaymentByIssueDate, | |||||
| checkIsOnlyOnlinePayment | |||||
| // checkIsOnlyOnlinePaymentByIssueDate, | |||||
| // checkIsOnlyOnlinePayment | |||||
| // isCreditorLoggedIn | // isCreditorLoggedIn | ||||
| } from "utils/Utils"; | } from "utils/Utils"; | ||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -58,62 +58,14 @@ const ApplyForm = () => { | |||||
| response["faxNumber"] = ""; | response["faxNumber"] = ""; | ||||
| } | } | ||||
| if (response?.gazetteIssueList) { | |||||
| const issueList = response.gazetteIssueList; | |||||
| // check each issue | |||||
| const allTrue = issueList.every((d) => | |||||
| checkIsOnlyOnlinePaymentByIssueDate(d.issueDate) | |||||
| ); | |||||
| if (allTrue){ | |||||
| if (checkIsOnlyOnlinePayment()) { | |||||
| const selection = issueList.map((data) => ( | |||||
| <FormControlLabel | |||||
| key={data.id} | |||||
| value={data.id} | |||||
| control={<Radio />} | |||||
| label={getIssueLabel(data)} | |||||
| /> | |||||
| )); | |||||
| setGazetteIssueList(issueList); | |||||
| setSelection(selection); | |||||
| } else { | |||||
| //setGazetteIssueList(issueList); | |||||
| //setSelection([]); | |||||
| } | |||||
| } else { | |||||
| let selection = []; | |||||
| for (let i = 0; i < response.gazetteIssueList.length; i++) { | |||||
| let data = response.gazetteIssueList[i]; | |||||
| // only add if false | |||||
| if (!checkIsOnlyOnlinePaymentByIssueDate(data.issueDate)) { | |||||
| selection.push( | |||||
| <FormControlLabel | |||||
| key={data.id} | |||||
| value={data.id} | |||||
| control={<Radio />} | |||||
| label={getIssueLabel(data)} | |||||
| /> | |||||
| ); | |||||
| } | |||||
| if (checkIsOnlyOnlinePayment()){ | |||||
| if (!checkIsOnlyOnlinePaymentByIssueDate(data.issueDate)) { | |||||
| selection.push( | |||||
| <FormControlLabel | |||||
| key={data.id} | |||||
| value={data.id} | |||||
| control={<Radio />} | |||||
| label={getIssueLabel(data)} | |||||
| /> | |||||
| ); | |||||
| } | |||||
| } | |||||
| } | |||||
| setGazetteIssueList(issueList); | |||||
| setSelection(selection); | |||||
| } | |||||
| var selection = []; | |||||
| for (var i = 0; i < response?.gazetteIssueList?.length; i++) { | |||||
| let data = response.gazetteIssueList[i]; | |||||
| //let label = getIssueLabel(data); | |||||
| selection.push(<FormControlLabel value={data.id} control={<Radio />} label={getIssueLabel(data)} />); | |||||
| } | } | ||||
| setGazetteIssueList(response?.gazetteIssueList); | |||||
| setSelection(selection); | |||||
| setUserData(response); | setUserData(response); | ||||
| // setOnlyOnlinePayment(checkIsOnlyOnlinePayment()) | // setOnlyOnlinePayment(checkIsOnlyOnlinePayment()) | ||||
| } | } | ||||
| @@ -195,7 +195,7 @@ export const isPasswordExpiry = () =>{ | |||||
| export const checkIsOnlyOnlinePaymentByIssueDate = (date) => { | 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, 7, 1, 0, 0, 0) //2026-01-28T08:00:00.000Z hardcode | ||||
| const targetDate = new Date(2025, 9, 17, 0, 0, 0) //2025-10-17T08:00:00.000Z | |||||
| const targetDate = new Date(2026, 0, 28, 0, 0, 0) //2026-01-28T08:00:00.000Z | |||||
| const checkDate = DateUtils.convertToDate(date) | const checkDate = DateUtils.convertToDate(date) | ||||
| if (isDummyLoggedIn()){ | if (isDummyLoggedIn()){ | ||||
| return false; | return false; | ||||
| @@ -210,14 +210,14 @@ export const checkIsOnlyOnlinePaymentByIssueDate = (date) => { | |||||
| } | } | ||||
| export const checkIsOnlyOnlinePayment = () => { | export const checkIsOnlyOnlinePayment = () => { | ||||
| // const targetDate = new Date(2025, 28, 0, 0, 0, 0) // hardcode | |||||
| const targetDate = new Date(2025, 9, 8, 0, 0, 0) // hardcode | |||||
| // const targetDate = new Date(2025, 10, 17, 0, 0, 0) // hardcode | |||||
| const targetDate = new Date(2026, 0, 28, 0, 0, 0) // hardcode new Date(2026, 0, 28, 0, 0, 0) 28 Jan 2026 | |||||
| const checkDate = DateUtils.convertToDate(new Date()) | const checkDate = DateUtils.convertToDate(new Date()) | ||||
| if (isDummyLoggedIn()){ | if (isDummyLoggedIn()){ | ||||
| return false; | return false; | ||||
| } | } | ||||
| console.log(checkDate) | |||||
| console.log(targetDate) | |||||
| // console.log(checkDate) | |||||
| // console.log(targetDate) | |||||
| if (checkDate >= targetDate) { | if (checkDate >= targetDate) { | ||||
| return true | return true | ||||
| } else { | } else { | ||||
| @@ -225,32 +225,29 @@ export const checkIsOnlyOnlinePayment = () => { | |||||
| } | } | ||||
| } | } | ||||
| export const checkIsOnlyOnlinePaymentApply = (tickAccept) => { | |||||
| // const targetDate = new Date(2025, 28, 0, 0, 0, 0) // hardcode | |||||
| const targetDate = new Date(2025, 9, 8, 0, 0, 0) // hardcode | |||||
| export const checkMarkAsCreditClient = () => { | |||||
| // const targetDate = new Date(2025, 10, 17, 0, 0, 0) // hardcode | |||||
| const targetDate = new Date(2026, 0, 27, 0, 0, 0) // hardcode new Date(2026, 0, 28, 0, 0, 0) 28 Jan 2026 | |||||
| const checkDate = DateUtils.convertToDate(new Date()) | const checkDate = DateUtils.convertToDate(new Date()) | ||||
| if (isDummyLoggedIn()){ | |||||
| return false; | |||||
| } | |||||
| // console.log(checkDate) | |||||
| // console.log(targetDate) | // console.log(targetDate) | ||||
| if(tickAccept){ | |||||
| if (checkDate >= targetDate) { | |||||
| return false | |||||
| } else{ | |||||
| return true; | |||||
| } | |||||
| }else { | |||||
| return true; | |||||
| // console.log(checkDate >= targetDate) | |||||
| if (checkDate >= targetDate) { | |||||
| return true | |||||
| } else { | |||||
| return false; | |||||
| } | } | ||||
| } | } | ||||
| export const checkMarkAsCreditClient = () => { | |||||
| const targetDate = new Date(2025, 9, 8, 0, 0, 0) // hardcode | |||||
| const checkDate = DateUtils.convertToDate(new Date()) | |||||
| export const checkIsNoPaymentByCreateDate = (date) => { | |||||
| // const targetDate = new Date(2025, 10, 18, 0, 0, 0) //2026-01-28T08:00:00.000Z hardcode | |||||
| const targetDate = new Date(2026, 0, 27, 0, 0, 0) //2026-01-28T08:00:00.000Z | |||||
| const checkDate = DateUtils.convertToDate(date) | |||||
| if (isDummyLoggedIn()){ | |||||
| return false; | |||||
| } | |||||
| // console.log(checkDate) | |||||
| // console.log(targetDate) | // console.log(targetDate) | ||||
| // console.log(checkDate >= targetDate) | |||||
| if (checkDate >= targetDate) { | |||||
| if (checkDate <= targetDate && isCreditorLoggedIn()) { | |||||
| return true | return true | ||||
| } else { | } else { | ||||
| return false; | return false; | ||||