Просмотр исходного кода

payment description in receipt

web-access-fix-2
Jason Chuang 1 день назад
Родитель
Сommit
a684f4cb6f
7 измененных файлов: 23 добавлений и 14 удалений
  1. +4
    -1
      src/index.js
  2. +1
    -1
      src/pages/Payment/Details_GLD/PaymentDetails.js
  3. +2
    -3
      src/pages/Payment/Details_Public/index.js
  4. +2
    -3
      src/pages/Payment/FPS/AckPage.js
  5. +2
    -2
      src/pages/Payment/FPS/fpscallback.js
  6. +2
    -4
      src/pages/Payment/PaymentCallback.js
  7. +10
    -0
      src/utils/Utils.js

+ 4
- 1
src/index.js Просмотреть файл

@@ -58,7 +58,10 @@ root.render(
<ReduxProvider store={store}>
<SysSettingProvider>
<I18nProvider>
<BrowserRouter basename="/">
<BrowserRouter
basename="/"
future={{ v7_startTransition: true, v7_relativeSplatPath: true }}
>
<RefreshTokenProvider>
<AutoLogoutProvider>
<GreyWrapper>


+ 1
- 1
src/pages/Payment/Details_GLD/PaymentDetails.js Просмотреть файл

@@ -164,7 +164,7 @@ const PaymentDetails = ({ formData,doPrint,onDownload }) => {
Payment Receipt:
</FormLabel>
</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}>
<DownloadIcon/>
<Typography sx={{fontSize: "16px"}}>Download</Typography>


+ 2
- 3
src/pages/Payment/Details_Public/index.js Просмотреть файл

@@ -21,6 +21,7 @@ import ForwardIcon from '@mui/icons-material/Forward';
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
import {FormattedMessage,useIntl} from "react-intl";
import usePageTitle from "components/usePageTitle";
import { toReceiptLanguage } from "utils/Utils";
const BackgroundHead = {
backgroundImage: `url(${titleBackgroundImg})`,
width: '100%',
@@ -76,10 +77,8 @@ const Index = () => {
const doPrint = () => {
// window.print();
setOnDownload(true)
const local = locale
// console.log(local)
HttpUtils.fileDownload({
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+params.id+"/"+local,
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+params.id+"/"+toReceiptLanguage(locale),
onResponse:()=>{
setOnDownload(false)
},


+ 2
- 3
src/pages/Payment/FPS/AckPage.js Просмотреть файл

@@ -24,6 +24,7 @@ const DataGrid = Loadable(React.lazy(() => import('../Details_Public/DataGrid'))

import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
import {FormattedMessage,useIntl} from "react-intl";
import { toReceiptLanguage } from "utils/Utils";
const BackgroundHead = {
backgroundImage: `url(${titleBackgroundImg})`,
width: '100%',
@@ -162,10 +163,8 @@ const AckPage = () => {
const doPrint = () => {
// window.print();
setOnDownload(true)
const local = locale
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:()=>{
setOnDownload(false)
},


+ 2
- 2
src/pages/Payment/FPS/fpscallback.js Просмотреть файл

@@ -24,6 +24,7 @@ const DataGrid = Loadable(React.lazy(() => import('../Details_Public/DataGrid'))

import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
import {FormattedMessage,useIntl} from "react-intl";
import { toReceiptLanguage } from "utils/Utils";
const BackgroundHead = {
backgroundImage: `url(${titleBackgroundImg})`,
width: '100%',
@@ -152,9 +153,8 @@ const Fpscallback = () => {
const params = new URLSearchParams(window.location.search);
// window.print();
setOnDownload(true)
const local = locale
HttpUtils.fileDownload({
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+params.get("PAYMENT_ID")+"/"+local,
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+params.get("PAYMENT_ID")+"/"+toReceiptLanguage(locale),
onResponse:()=>{
setOnDownload(false)
},


+ 2
- 4
src/pages/Payment/PaymentCallback.js Просмотреть файл

@@ -21,6 +21,7 @@ const DataGrid = Loadable(React.lazy(() => import('./Details_Public/DataGrid')))

import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
import {FormattedMessage,useIntl} from "react-intl";
import { toReceiptLanguage } from "utils/Utils";
const BackgroundHead = {
backgroundImage: `url(${titleBackgroundImg})`,
width: '100%',
@@ -159,11 +160,8 @@ const Index = () => {
const doPrint = () => {
// window.print();
setOnDownload(true)
const local = locale
console.log(local)
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:()=>{
setOnDownload(false)
},


+ 10
- 0
src/utils/Utils.js Просмотреть файл

@@ -165,6 +165,16 @@ export const gazetteLength = (length,noOfPages) => {
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) => {
if (row.groupTitle === 'Private Bill') {
const pages = row.noOfPages ?? 1;


Загрузка…
Отмена
Сохранить