Преглед изворни кода

payment description in receipt

web-access-fix-2
Jason Chuang пре 1 дан
родитељ
комит
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}> <ReduxProvider store={store}>
<SysSettingProvider> <SysSettingProvider>
<I18nProvider> <I18nProvider>
<BrowserRouter basename="/">
<BrowserRouter
basename="/"
future={{ v7_startTransition: true, v7_relativeSplatPath: true }}
>
<RefreshTokenProvider> <RefreshTokenProvider>
<AutoLogoutProvider> <AutoLogoutProvider>
<GreyWrapper> <GreyWrapper>


+ 1
- 1
src/pages/Payment/Details_GLD/PaymentDetails.js Прегледај датотеку

@@ -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>


+ 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 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)
}, },


+ 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 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)
}, },


+ 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 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)
}, },


+ 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 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)
}, },


+ 10
- 0
src/utils/Utils.js Прегледај датотеку

@@ -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;


Loading…
Откажи
Сачувај