| @@ -30,7 +30,9 @@ import * as DateUtils from "utils/DateUtils"; | |||
| import * as FormatUtils from "utils/FormatUtils"; | |||
| import { | |||
| isORGLoggedIn, | |||
| // isDummyLoggedIn | |||
| } from "utils/Utils"; | |||
| import * as utils from "auth/utils" | |||
| // import BorderColorOutlinedIcon from '@mui/icons-material/BorderColorOutlined'; | |||
| // import DoneIcon from '@mui/icons-material/Done'; | |||
| @@ -189,7 +191,9 @@ const ApplicationDetailCard = ( | |||
| disabled={currentApplicationDetailData.status == "rejected" | |||
| || currentApplicationDetailData.status == "cancelled" | |||
| || currentApplicationDetailData.status == "paid" | |||
| || currentApplicationDetailData.creditor} | |||
| || currentApplicationDetailData.creditor | |||
| || currentApplicationDetailData.paymentMethod != "online" | |||
| } | |||
| startIcon={<EditNoteIcon />} | |||
| aria-label={intl.formatMessage({ id: 'payFor' })} | |||
| > | |||
| @@ -501,9 +505,11 @@ const ApplicationDetailCard = ( | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel><Typography variant="pnspsFormParagraph"> | |||
| <FormattedMessage id="currencyAmount" />(HK$): | |||
| </Typography></FormLabel> | |||
| <FormLabel> | |||
| <Typography variant="pnspsFormParagraph"> | |||
| <FormattedMessage id="currencyAmountTitle" /> | |||
| </Typography> | |||
| </FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| @@ -527,52 +533,86 @@ const ApplicationDetailCard = ( | |||
| } | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={9} lg={6} sx={{ mb: 1, }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel><Typography variant="pnspsFormParagraph"> | |||
| <FormattedMessage id="userFaxNumber" />: | |||
| </Typography></FormLabel> | |||
| </Grid> | |||
| <Grid container direction="row" justifyContent="space-between" | |||
| alignItems="center"> | |||
| <Grid item xs={12} sm={12} md={9} lg={6} sx={{ mb: 1, }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel><Typography variant="pnspsFormParagraph"> | |||
| <FormattedMessage id="userFaxNumber" />: | |||
| </Typography></FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} sm={12} md={9} lg={9}> | |||
| <Stack direction="row"> | |||
| <FormControl variant="outlined" sx={{ width: '25%' }} disabled> | |||
| <OutlinedInput | |||
| size="small" | |||
| {...register("countryCode", | |||
| { | |||
| value: currentApplicationDetailData.contactFaxNo.countryCode, | |||
| })} | |||
| id='countryCode' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| <FormControl variant="outlined" sx={{ width: '100%' }} disabled> | |||
| <OutlinedInput | |||
| size="small" | |||
| {...register("faxNumber", | |||
| { | |||
| value: currentApplicationDetailData.contactFaxNo.faxNumber, | |||
| })} | |||
| id='faxNumber' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Stack> | |||
| <Grid item xs={12} sm={12} md={9} lg={9}> | |||
| <Stack direction="row"> | |||
| <FormControl variant="outlined" sx={{ width: '25%' }} disabled> | |||
| <OutlinedInput | |||
| size="small" | |||
| {...register("countryCode", | |||
| { | |||
| value: currentApplicationDetailData.contactFaxNo.countryCode, | |||
| })} | |||
| id='countryCode' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| <FormControl variant="outlined" sx={{ width: '100%' }} disabled> | |||
| <OutlinedInput | |||
| size="small" | |||
| {...register("faxNumber", | |||
| { | |||
| value: currentApplicationDetailData.contactFaxNo.faxNumber, | |||
| })} | |||
| id='faxNumber' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Stack> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| { | |||
| fee > 0 ? | |||
| <Grid item xs={12} sm={12} md={9} lg={5} sx={{ mb: 1, }}> | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| <FormLabel><Typography variant="pnspsFormParagraph"> | |||
| <FormattedMessage id="paymentMethod" />: | |||
| </Typography></FormLabel> | |||
| </Grid> | |||
| <Grid item xs={12} md={9} lg={9}> | |||
| <FormControl variant="outlined" fullWidth disabled> | |||
| <OutlinedInput | |||
| size="small" | |||
| value={currentApplicationDetailData.paymentMethod!=null?intl.formatMessage({ id: utils.getPaymentMethod(currentApplicationDetailData.paymentMethod)}):""} | |||
| id='paymentMethod' | |||
| sx={{ | |||
| "& .MuiInputBase-input.Mui-disabled": { | |||
| WebkitTextFillColor: "#000000", | |||
| background: "#f8f8f8", | |||
| }, | |||
| }} | |||
| /> | |||
| </FormControl> | |||
| </Grid> | |||
| </Grid> | |||
| </Grid> | |||
| : | |||
| <></> | |||
| } | |||
| </Grid> | |||
| <Grid container direction="row" justifyContent="space-between" | |||
| alignItems="center"> | |||
| @@ -80,6 +80,7 @@ export default function SubmittedTab({ setCount, url }) { | |||
| const handlePaymentBtn = () => { | |||
| let appIdList = []; | |||
| let paymentCheckList = []; | |||
| const _datas = rowList; | |||
| const datas = _datas?.filter((row) => | |||
| selectedRowItems.includes(row.id) | |||
| @@ -87,31 +88,41 @@ export default function SubmittedTab({ setCount, url }) { | |||
| // console.log(datas) | |||
| for (var i = 0; i < datas?.length; i++) { | |||
| appIdList.push(datas[i].id); | |||
| if ( datas[i].paymentMethod != "online"){ | |||
| paymentCheckList.push(datas[i].paymentMethod) | |||
| } | |||
| } | |||
| if (appIdList.length < 1) { | |||
| setExpiryDateErrText(intl.formatMessage({ id: 'MSG.plzSelectApp' })); | |||
| // console.log(paymentCheckList) | |||
| if(paymentCheckList.length == 0){ | |||
| if (appIdList.length < 1) { | |||
| setExpiryDateErrText(intl.formatMessage({ id: 'MSG.plzSelectApp' })); | |||
| setExpiryDateErr(true); | |||
| return; | |||
| } | |||
| HttpUtils.post({ | |||
| url: POST_CHECK_APP_EXPRITY_DATE, | |||
| params: { | |||
| ids: appIdList | |||
| }, | |||
| onSuccess: (responData) => { | |||
| if (responData.success == true) { | |||
| // setIsPopUp(true); | |||
| handlePaymentCheck(appIdList) | |||
| return; | |||
| } | |||
| let str = ""; | |||
| responData.msg.forEach((item) => { | |||
| str += "App: " + item.appNo + ", 到期日: " + DateUtils.datetimeStr_Cht(item.expiryDate) + "\n"; | |||
| }); | |||
| setExpiryDateErrText(str.split('\n').map(str => <>{str}<br /></>)); | |||
| setExpiryDateErr(true); | |||
| } | |||
| }); | |||
| } else { | |||
| setExpiryDateErrText(intl.formatMessage({ id: 'MSG.plzonlinePayment' })); | |||
| setExpiryDateErr(true); | |||
| return; | |||
| } | |||
| HttpUtils.post({ | |||
| url: POST_CHECK_APP_EXPRITY_DATE, | |||
| params: { | |||
| ids: appIdList | |||
| }, | |||
| onSuccess: (responData) => { | |||
| if (responData.success == true) { | |||
| // setIsPopUp(true); | |||
| handlePaymentCheck(appIdList) | |||
| return; | |||
| } | |||
| let str = ""; | |||
| responData.msg.forEach((item) => { | |||
| str += "App: " + item.appNo + ", 到期日: " + DateUtils.datetimeStr_Cht(item.expiryDate) + "\n"; | |||
| }); | |||
| setExpiryDateErrText(str.split('\n').map(str => <>{str}<br /></>)); | |||
| setExpiryDateErr(true); | |||
| } | |||
| }); | |||
| }; | |||
| const handlePaymentCheck = (appIdList) => { | |||
| @@ -361,11 +372,11 @@ export default function SubmittedTab({ setCount, url }) { | |||
| <Button | |||
| color="create" | |||
| variant="contained" | |||
| aria-label={intl.formatMessage({ id: 'pay' })} | |||
| aria-label={intl.formatMessage({ id: 'payOnlineBtn' })} | |||
| onClick={() => { handlePaymentBtn() }} | |||
| sx={{ mt: 2, ml: 1 }} | |||
| > | |||
| <FormattedMessage id="pay" /> | |||
| <FormattedMessage id="payOnlineBtn" /> | |||
| </Button> | |||
| </ThemeProvider> | |||
| </div> | |||
| @@ -78,6 +78,7 @@ | |||
| "MSG.paymentHolded": "Application number {appNo} is currently in the process of payment. If the payment is unsuccessful, please try again after 20 minutes. We apologise for any inconvenience caused.", | |||
| "MSG.pay_credity1": "We have received your confirmed application for proofreading and printing instructions regarding application number {appNo}. We will arrange for its publication with in the Year {year}, Volume {issueVolume}, Issue {issueNo} of the Official Gazette.", | |||
| "MSG.pay_credity2": "The fee for this public notice will be consolidated in the next Payment Notice. Please ensure timely payment.", | |||
| "MSG.plzonlinePayment": "Please select online payment", | |||
| "registerTitle1": "Become", | |||
| "registerTitle2": "Gazette Notice", | |||
| @@ -369,6 +370,7 @@ | |||
| "particulars": "Particulars", | |||
| "currencyPrice": "Price", | |||
| "currencyAmount": "Amount", | |||
| "currencyAmountTitle": "Amount (HK$):", | |||
| "transactionRefNo": "Transaction Reference Number", | |||
| "selectedPaymentMethod": "Selected payment method", | |||
| "paymentMethodNotAvailable":"The payment function is currently not available", | |||
| @@ -428,6 +430,7 @@ | |||
| "payOnlineMethod":"Online", | |||
| "payDnMethod":"Demand Note", | |||
| "payNPGOMethod":"NPGO Collection Office", | |||
| "payOnlineBtn":"Online Pay", | |||
| "payDnRemark": "Payment proof (e.g. ATM receipt, internet banking record) to be sent to [email protected] by {date}", | |||
| "payNPGORemark" :"Payment to be completed at Collection Office by {date}", | |||
| @@ -59,6 +59,7 @@ | |||
| "payOnlineMethod":"网上支付", | |||
| "payDnMethod":"缴款单支付", | |||
| "payNPGOMethod":"收款办公室付款", | |||
| "payOnlineBtn":"网上付款", | |||
| "payDnRemark": "在{date}之前将付款证明(如自动柜员机收据、网路银行记录)寄至 [email protected] ", | |||
| "payNPGORemark" :"在{date}之前在收款办公室完成付款", | |||
| @@ -103,6 +104,7 @@ | |||
| "MSG.paymentHolded": "申请编号 {appNo} 已正在付款的流程中,如相关付款没有成功,请于20分钟后再尝试付款,不便之处,请见谅!", | |||
| "MSG.pay_credity1": "我们已收到你已确定申请编号: {appNo} 的稿件校对确定及可付印的指示,并将安排刊登于宪报期数{year} 年{issueVolume} 卷第{issueNo } 期内。", | |||
| "MSG.pay_credity2": "此公共启事申请的费用将于下期发出的缴费发票时收取,请依时缴费。", | |||
| "MSG.plzonlinePayment": "请选择网上支付", | |||
| "registerTitle1": "立即成为", | |||
| "registerTitle2": "宪报刊登公共启事", | |||
| @@ -386,9 +388,10 @@ | |||
| "particulars": "项目", | |||
| "currencyPrice": "金额 ($)", | |||
| "currencyAmount": "金额", | |||
| "transactionRefNo": "交易參考編號", | |||
| "selectedPaymentMethod": "已選擇付款方法", | |||
| "paymentMethodNotAvailable":"付款功能現在不可用", | |||
| "currencyAmountTitle": "金额 (HK$):", | |||
| "transactionRefNo": "交易参考编号", | |||
| "selectedPaymentMethod": "已选择付款方法", | |||
| "paymentMethodNotAvailable":"付款功能现在不可用", | |||
| "paymentLimitPrice1":"只适用于最小金额为 1.00 及最高金额为 9,999,999.99", | |||
| "paymentLimitPrice2":"只适用于最小金额为 0.10 及最高金额为 9,999,999.99", | |||
| "paymentLimitPPS":"付款不适用于流动装置的浏览器,请使用桌面电脑。", | |||
| @@ -59,7 +59,8 @@ | |||
| "payOnlineMethod":"網上支付", | |||
| "payDnMethod":"繳款單支付", | |||
| "payNPGOMethod":"收款辦公室付款", | |||
| "payOnlineBtn":"網上付款", | |||
| "payDnRemark": "在{date}之前將付款證明(如自動櫃員機收據、網路銀行記錄)寄至 [email protected] ", | |||
| "payNPGORemark" :"在{date}之前在收款辦公室完成付款", | |||
| @@ -103,6 +104,7 @@ | |||
| "MSG.paymentHolded": "申請編號 {appNo} 已正在付款的流程中,如相關付款沒有成功,請於20分鐘後再嘗試付款,不便之處,請見諒!", | |||
| "MSG.pay_credity1": "我們已收到你已確定申請編號: {appNo} 的稿件校對確定及可付印的指示,並將安排刊登於憲報 期數 {year} 年 {issueVolume} 卷 第 {issueNo} 期內。", | |||
| "MSG.pay_credity2": "此公共啟事申請的費用將於下期發出的繳費發票時收取,請依時繳費。", | |||
| "MSG.plzonlinePayment": "請選擇網上支付", | |||
| "registerTitle1": "立即成為", | |||
| "registerTitle2": "憲報刊登公共啟事", | |||
| @@ -391,6 +393,7 @@ | |||
| "particulars": "項目", | |||
| "currencyPrice": "金額 ($)", | |||
| "currencyAmount": "金額", | |||
| "currencyAmountTitle": "金額 (HK$):", | |||
| "transactionRefNo": "交易參考編號", | |||
| "selectedPaymentMethod": "已選擇付款方法", | |||
| "paymentMethodNotAvailable":"付款功能現在不可用", | |||