| @@ -58,7 +58,10 @@ root.render( | |||||
| <ReduxProvider store={store}> | <ReduxProvider store={store}> | ||||
| <SysSettingProvider> | <SysSettingProvider> | ||||
| <I18nProvider> | <I18nProvider> | ||||
| <BrowserRouter basename="/"> | |||||
| <BrowserRouter | |||||
| basename="/" | |||||
| future={{ v7_startTransition: true, v7_relativeSplatPath: true }} | |||||
| > | |||||
| <RefreshTokenProvider> | <RefreshTokenProvider> | ||||
| <AutoLogoutProvider> | <AutoLogoutProvider> | ||||
| <GreyWrapper> | <GreyWrapper> | ||||
| @@ -164,7 +164,7 @@ const PaymentDetails = ({ formData,doPrint,onDownload }) => { | |||||
| Payment Receipt: | Payment Receipt: | ||||
| </FormLabel> | </FormLabel> | ||||
| </Grid> | </Grid> | ||||
| <Grid xs={6} md={5} sx={{ml:5,textAlign: "left" }}> | |||||
| <Grid item xs={6} md={5} sx={{ml:5,textAlign: "left" }}> | |||||
| <Button className="printHidden" variant="contained" disabled={onDownload} sx={{ mt:2 }} onClick={doPrint}> | <Button className="printHidden" variant="contained" disabled={onDownload} sx={{ mt:2 }} onClick={doPrint}> | ||||
| <DownloadIcon/> | <DownloadIcon/> | ||||
| <Typography sx={{fontSize: "16px"}}>Download</Typography> | <Typography sx={{fontSize: "16px"}}>Download</Typography> | ||||
| @@ -21,6 +21,7 @@ import ForwardIcon from '@mui/icons-material/Forward'; | |||||
| import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
| import {FormattedMessage,useIntl} from "react-intl"; | import {FormattedMessage,useIntl} from "react-intl"; | ||||
| import usePageTitle from "components/usePageTitle"; | import usePageTitle from "components/usePageTitle"; | ||||
| import { toReceiptLanguage } from "utils/Utils"; | |||||
| const BackgroundHead = { | const BackgroundHead = { | ||||
| backgroundImage: `url(${titleBackgroundImg})`, | backgroundImage: `url(${titleBackgroundImg})`, | ||||
| width: '100%', | width: '100%', | ||||
| @@ -76,10 +77,8 @@ const Index = () => { | |||||
| const doPrint = () => { | const doPrint = () => { | ||||
| // window.print(); | // window.print(); | ||||
| setOnDownload(true) | setOnDownload(true) | ||||
| const local = locale | |||||
| // console.log(local) | |||||
| HttpUtils.fileDownload({ | HttpUtils.fileDownload({ | ||||
| url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+params.id+"/"+local, | |||||
| url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+params.id+"/"+toReceiptLanguage(locale), | |||||
| onResponse:()=>{ | onResponse:()=>{ | ||||
| setOnDownload(false) | setOnDownload(false) | ||||
| }, | }, | ||||
| @@ -24,6 +24,7 @@ const DataGrid = Loadable(React.lazy(() => import('../Details_Public/DataGrid')) | |||||
| import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
| import {FormattedMessage,useIntl} from "react-intl"; | import {FormattedMessage,useIntl} from "react-intl"; | ||||
| import { toReceiptLanguage } from "utils/Utils"; | |||||
| const BackgroundHead = { | const BackgroundHead = { | ||||
| backgroundImage: `url(${titleBackgroundImg})`, | backgroundImage: `url(${titleBackgroundImg})`, | ||||
| width: '100%', | width: '100%', | ||||
| @@ -162,10 +163,8 @@ const AckPage = () => { | |||||
| const doPrint = () => { | const doPrint = () => { | ||||
| // window.print(); | // window.print(); | ||||
| setOnDownload(true) | setOnDownload(true) | ||||
| const local = locale | |||||
| HttpUtils.fileDownload({ | HttpUtils.fileDownload({ | ||||
| // url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId")+"/"+local, | |||||
| url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+paymentData.id+"/"+local, | |||||
| url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+paymentData.id+"/"+toReceiptLanguage(locale), | |||||
| onResponse:()=>{ | onResponse:()=>{ | ||||
| setOnDownload(false) | setOnDownload(false) | ||||
| }, | }, | ||||
| @@ -24,6 +24,7 @@ const DataGrid = Loadable(React.lazy(() => import('../Details_Public/DataGrid')) | |||||
| import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
| import {FormattedMessage,useIntl} from "react-intl"; | import {FormattedMessage,useIntl} from "react-intl"; | ||||
| import { toReceiptLanguage } from "utils/Utils"; | |||||
| const BackgroundHead = { | const BackgroundHead = { | ||||
| backgroundImage: `url(${titleBackgroundImg})`, | backgroundImage: `url(${titleBackgroundImg})`, | ||||
| width: '100%', | width: '100%', | ||||
| @@ -152,9 +153,8 @@ const Fpscallback = () => { | |||||
| const params = new URLSearchParams(window.location.search); | const params = new URLSearchParams(window.location.search); | ||||
| // window.print(); | // window.print(); | ||||
| setOnDownload(true) | setOnDownload(true) | ||||
| const local = locale | |||||
| HttpUtils.fileDownload({ | HttpUtils.fileDownload({ | ||||
| url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+params.get("PAYMENT_ID")+"/"+local, | |||||
| url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+params.get("PAYMENT_ID")+"/"+toReceiptLanguage(locale), | |||||
| onResponse:()=>{ | onResponse:()=>{ | ||||
| setOnDownload(false) | setOnDownload(false) | ||||
| }, | }, | ||||
| @@ -21,6 +21,7 @@ const DataGrid = Loadable(React.lazy(() => import('./Details_Public/DataGrid'))) | |||||
| import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
| import {FormattedMessage,useIntl} from "react-intl"; | import {FormattedMessage,useIntl} from "react-intl"; | ||||
| import { toReceiptLanguage } from "utils/Utils"; | |||||
| const BackgroundHead = { | const BackgroundHead = { | ||||
| backgroundImage: `url(${titleBackgroundImg})`, | backgroundImage: `url(${titleBackgroundImg})`, | ||||
| width: '100%', | width: '100%', | ||||
| @@ -159,11 +160,8 @@ const Index = () => { | |||||
| const doPrint = () => { | const doPrint = () => { | ||||
| // window.print(); | // window.print(); | ||||
| setOnDownload(true) | setOnDownload(true) | ||||
| const local = locale | |||||
| console.log(local) | |||||
| HttpUtils.fileDownload({ | HttpUtils.fileDownload({ | ||||
| // url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId")+"/"+local, | |||||
| url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+paymentData.id+"/"+local, | |||||
| url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+paymentData.id+"/"+toReceiptLanguage(locale), | |||||
| onResponse:()=>{ | onResponse:()=>{ | ||||
| setOnDownload(false) | setOnDownload(false) | ||||
| }, | }, | ||||
| @@ -165,6 +165,16 @@ export const gazetteLength = (length,noOfPages) => { | |||||
| return countLength+" cm" | return countLength+" cm" | ||||
| } | } | ||||
| export const toReceiptLanguage = (locale) => { | |||||
| if (locale === 'zh-CN' || locale === 'zh_CN') { | |||||
| return 'zh_CN'; | |||||
| } | |||||
| if (locale === 'zh-HK' || locale === 'zh_HK') { | |||||
| return 'zh_HK'; | |||||
| } | |||||
| return 'en'; | |||||
| } | |||||
| export const formatPaymentParticularsLength = (row, intl) => { | export const formatPaymentParticularsLength = (row, intl) => { | ||||
| if (row.groupTitle === 'Private Bill') { | if (row.groupTitle === 'Private Bill') { | ||||
| const pages = row.noOfPages ?? 1; | const pages = row.noOfPages ?? 1; | ||||