From 3086aab1c97c222b94aa77be1edaa6f9b0e85909 Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Thu, 9 May 2024 18:34:42 +0800 Subject: [PATCH] update dummy ac --- src/auth/utils.js | 7 + src/pages/Proof/Reply_Public/ProofForm.js | 255 +++++++++++------- .../ListPanel/PendingPaymentTab.js | 22 ++ src/translations/en.json | 4 + src/translations/zh-CN.json | 4 + src/translations/zh-HK.json | 4 + 6 files changed, 203 insertions(+), 93 deletions(-) diff --git a/src/auth/utils.js b/src/auth/utils.js index ad5e6c6..25c5dd7 100644 --- a/src/auth/utils.js +++ b/src/auth/utils.js @@ -136,3 +136,10 @@ export const getHomeRouteForLoggedInUser = (userRole) => { // open payment record export const local = { en: "en-us", zh: "zh-hk", cn: "zh-cn" }; export const preferpaymentmethods = ['visa', 'mastercard', 'pps', 'creditcard', 'fps']; + +export const getPaymentMethod = (paymentMethod) => { + if(paymentMethod == "online") return 'payOnlineMethod'; + if(paymentMethod == "demandNote") return 'payDnMethod'; + if(paymentMethod == "office") return 'payNPGOMethod'; + // return null; +} \ No newline at end of file diff --git a/src/pages/Proof/Reply_Public/ProofForm.js b/src/pages/Proof/Reply_Public/ProofForm.js index 8c11ff1..0134033 100644 --- a/src/pages/Proof/Reply_Public/ProofForm.js +++ b/src/pages/Proof/Reply_Public/ProofForm.js @@ -26,6 +26,7 @@ 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" const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); //import * as ProofStatus from "utils/statusUtils/ProofStatus"; @@ -58,6 +59,9 @@ const FormPanel = ({ formData }) => { React.useEffect(() => { if (formData) { setData(formData); + if (isDummyLoggedIn()){ + set_paymentMethod("demandNote") + } } }, [formData]); @@ -284,99 +288,164 @@ const FormPanel = ({ formData }) => { { actionValue && formData.creditor==false ? - - - - - - - - - - - - - - - - - { - isOverDnReviseDeadline() ? - <> : - - - - - - - - } - { - isOverNpgoReviseDeadline() ? - <> : - - - - - - - - } - -
- { - set_paymentMethod("online") - }} - /> - -
    -
  • -
  • -
  • -
-
{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 2:00 p.m.{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 2:30 p.m.
- { - set_paymentMethod("demandNote") - }} - /> - -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
-
{DateUtils.dateFormat(formData.beforeClosingDate, intl.formatMessage({ id: "dateStrFormat" }))} 5:00 p.m. - -
- { - set_paymentMethod("office") - }} - /> - -
    -
  • -
  • -
-
{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 12:00 p.m. - -
-
+ isDummyLoggedIn()? + + + + + + + + + + + + + + + + + + + + + + + +
+ { + set_paymentMethod("demandNote") + }} + /> + +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
+
{DateUtils.dateFormat(formData.beforeClosingDate, intl.formatMessage({ id: "dateStrFormat" }))} 5:00 p.m. + +
+ { + set_paymentMethod("office") + }} + /> + +
    +
  • +
  • +
+
{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 12:00 p.m. + +
+
: + + + + + + + + + + + + + + + + + { + isOverDnReviseDeadline() ? + <> : + + + + + + + + } + { + isOverNpgoReviseDeadline() ? + <> : + + + + + + + + } + +
+ { + set_paymentMethod("online") + }} + /> + +
    +
  • +
  • +
  • +
+
{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 2:00 p.m.{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 2:30 p.m.
+ { + set_paymentMethod("demandNote") + }} + /> + +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
+
{DateUtils.dateFormat(formData.beforeClosingDate, intl.formatMessage({ id: "dateStrFormat" }))} 5:00 p.m. + +
+ { + set_paymentMethod("office") + }} + /> + +
    +
  • +
  • +
+
{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 12:00 p.m. + +
+
: isOverReviseDeadline() ? diff --git a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js index 5040b24..98d93ae 100644 --- a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js +++ b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js @@ -11,6 +11,7 @@ import { } from '@mui/material'; import { FiDataGrid } from "components/FiDataGrid"; import * as HttpUtils from "utils/HttpUtils" +import * as utils from "auth/utils" import { PAYMENT_CHECK, POST_CHECK_APP_EXPRITY_DATE, @@ -41,6 +42,7 @@ export default function SubmittedTab({ setCount, url }) { const [paymentHoldedErrText, setPaymentHoldedErrText] = React.useState(""); const [paymentHoldedErr, setPaymentHoldedErr] = React.useState(false); const [_searchCriteria, set_searchCriteria] = React.useState({}); + // const [checkPaymentMethod, setCheckPaymentMethod] = React.useState(false); const theme = useTheme(); const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); @@ -196,6 +198,26 @@ export default function SubmittedTab({ setCount, url }) { return FormatUtils.currencyFormat(params.row.fee) }, }, + { + id: 'paymentMethod', + field: 'paymentMethod', + headerName: intl.formatMessage({ id: 'paymentMethod' }), + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, + renderCell: (params) => { + return params.row.paymentMethod!=null?intl.formatMessage({ id: utils.getPaymentMethod(params.row.paymentMethod)}):"" + }, + }, + { + id: 'paymentMethod', + field: 'paymentMethod', + headerName: intl.formatMessage({ id: 'paymentMethod' }), + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, + renderCell: (params) => { + return params.row.paymentMethod!=null?intl.formatMessage({ id: utils.getPaymentMethod(params.row.paymentMethod)}):"" + }, + }, { id: 'status', field: 'status', diff --git a/src/translations/en.json b/src/translations/en.json index 9b1028f..f81d6d9 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -424,6 +424,10 @@ "post":"By Post", "cheque":"Cheque", "cash":"Cash", + "paymentMethod":"Payment Method", + "payOnlineMethod":"Online", + "payDnMethod":"Demand Note", + "payNPGOMethod":"NPGO Collection Office", "payDnRemark": "Payment proof (e.g. ATM receipt, internet banking record) to be sent to gld_acct@gld.gov.hk by {date}", "payNPGORemark" :"Payment to be completed at Collection Office by {date}", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index d32fd2f..0abcbfd 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -55,6 +55,10 @@ "post":"通过邮寄", "cheque":"支票", "cash":"现金", + "paymentMethod":"付款方式", + "payOnlineMethod":"网上支付", + "payDnMethod":"缴款单支付", + "payNPGOMethod":"收款办公室付款", "payDnRemark": "在{date}之前将付款证明(如自动柜员机收据、网路银行记录)寄至 gld_acct@gld.gov.hk ", "payNPGORemark" :"在{date}之前在收款办公室完成付款", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 89b990c..00d6d93 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -55,6 +55,10 @@ "post":"透過郵寄", "cheque":"支票", "cash":"現金", + "paymentMethod":"付款方式", + "payOnlineMethod":"網上支付", + "payDnMethod":"繳款單支付", + "payNPGOMethod":"收款辦公室付款", "payDnRemark": "在{date}之前將付款證明(如自動櫃員機收據、網路銀行記錄)寄至 gld_acct@gld.gov.hk ", "payNPGORemark" :"在{date}之前在收款辦公室完成付款",