diff --git a/src/pages/Payment/Details_GLD/PaymentDetails.js b/src/pages/Payment/Details_GLD/PaymentDetails.js
index 49fc45a..f14d955 100644
--- a/src/pages/Payment/Details_GLD/PaymentDetails.js
+++ b/src/pages/Payment/Details_GLD/PaymentDetails.js
@@ -3,24 +3,33 @@ import {
Grid,
Typography,
FormLabel,
- Button
+ Button,
+ Dialog,
+ DialogTitle,
+ DialogContent,
+ DialogActions,
+ Box
} from '@mui/material';
import * as React from "react";
import * as FormatUtils from "utils/FormatUtils";
import * as PaymentStatus from "utils/statusUtils/PaymentStatus";
import * as DateUtils from "utils/DateUtils";
+import * as HttpUtils from "utils/HttpUtils";
+import { PAYMENT_MARK_AS_PAID } from "utils/ApiPathConst";
import Loadable from 'components/Loadable';
const MainCard = Loadable(React.lazy(() => import('components/MainCard')));
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
import DownloadIcon from '@mui/icons-material/Download';
import {useIntl} from "react-intl";
// ==============================|| DASHBOARD - DEFAULT ||============================== //
-const PaymentDetails = ({ formData,doPrint,onDownload }) => {
+const PaymentDetails = ({ formData, doPrint, onDownload, onRefresh }) => {
const intl = useIntl();
const [data, setData] = React.useState({});
const [onReady, setOnReady] = React.useState(false);
+ const [confirmOpen, setConfirmOpen] = React.useState(false);
+ const [markingPaid, setMarkingPaid] = React.useState(false);
// const { locale } = intl;
React.useEffect(() => {
@@ -40,9 +49,29 @@ const PaymentDetails = ({ formData,doPrint,onDownload }) => {
if("01" == paymentmethod) return "PPS";
if("02" == paymentmethod || "03" == paymentmethod) return "Credit Card";
if("04" == paymentmethod) return "FPS";
+ if (data.payMethod === "04,BCFP,FPS") return "FPS";
return paymentmethod;
}
+ const showMarkAsPaid = data.status === "REJT" && getPaymentMethod() === "FPS";
+
+ const handleMarkAsPaid = () => {
+ setMarkingPaid(true);
+ HttpUtils.post({
+ url: PAYMENT_MARK_AS_PAID + "/" + data.id,
+ onSuccess: () => {
+ setConfirmOpen(false);
+ setMarkingPaid(false);
+ if (onRefresh) {
+ onRefresh();
+ }
+ },
+ onError: () => {
+ setMarkingPaid(false);
+ }
+ });
+ };
+
return (
!onReady ?