|
|
@@ -9,7 +9,7 @@ import { |
|
|
|
Stack, |
|
|
|
Dialog, DialogTitle, DialogContent, DialogActions, InputAdornment, |
|
|
|
} from '@mui/material'; |
|
|
|
import {isGranted, delBugMode } from "auth/utils"; |
|
|
|
import { isGranted, delBugMode } from "auth/utils"; |
|
|
|
const MainCard = Loadable(lazy(() => import('components/MainCard'))); |
|
|
|
import { useForm } from "react-hook-form"; |
|
|
|
import { |
|
|
@@ -23,7 +23,7 @@ import Loadable from 'components/Loadable'; |
|
|
|
const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); |
|
|
|
import * as HttpUtils from "utils/HttpUtils" |
|
|
|
import * as DateUtils from "utils/DateUtils" |
|
|
|
import {CHECK_CREATE_PROOF,UPDATE_GLDREMARKS } from "utils/ApiPathConst" |
|
|
|
import { CHECK_CREATE_PROOF, UPDATE_GLDREMARKS } from "utils/ApiPathConst" |
|
|
|
import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; |
|
|
|
|
|
|
|
import DoneIcon from '@mui/icons-material/Done'; |
|
|
@@ -43,15 +43,16 @@ const ApplicationDetailCard = ( |
|
|
|
|
|
|
|
const [currentApplicationDetailData, setCurrentApplicationDetailData] = useState({}); |
|
|
|
const [companyName, setCompanyName] = useState({}); |
|
|
|
const [orgDetail, setOrgDetail] = useState({}); |
|
|
|
const [verified, setVerified] = useState(null); |
|
|
|
const [fileDetail, setfileDetail] = useState({}); |
|
|
|
const [onReady, setOnReady] = useState(false); |
|
|
|
|
|
|
|
const { register,handleSubmit } = useForm() |
|
|
|
const { register, handleSubmit } = useForm() |
|
|
|
|
|
|
|
const [isWarningPopUp, setIsWarningPopUp] = useState(false); |
|
|
|
const [warningText, setWarningText] = useState(""); |
|
|
|
|
|
|
|
|
|
|
|
const [remarksPopUp, setRemarksPopUp] = useState(false); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
@@ -72,6 +73,7 @@ const ApplicationDetailCard = ( |
|
|
|
|
|
|
|
const loadApplicationDetail = () => { |
|
|
|
setCurrentApplicationDetailData(applicationDetailData.data); |
|
|
|
setOrgDetail(applicationDetailData.orgDetail?.data); |
|
|
|
setCompanyName(applicationDetailData.companyName); |
|
|
|
setVerified(applicationDetailData.userData.verifiedBy ? true : false) |
|
|
|
setfileDetail(applicationDetailData.fileDetail); |
|
|
@@ -97,6 +99,11 @@ const ApplicationDetailCard = ( |
|
|
|
setStatus("notAccepted") |
|
|
|
}; |
|
|
|
|
|
|
|
const paidClick = () => () => { |
|
|
|
setStatus("paid") |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const setCompleteDisable = () => { |
|
|
|
if (delBugMode) return false; |
|
|
|
return (new Date()).getTime() < DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate).getTime(); |
|
|
@@ -159,7 +166,7 @@ const ApplicationDetailCard = ( |
|
|
|
const onSubmit = (data) => { |
|
|
|
// console.log(data) |
|
|
|
const gldRemarks = data.makeRemarks |
|
|
|
if (gldRemarks!=null&&gldRemarks!=currentApplicationDetailData.gldRemarks){ |
|
|
|
if (gldRemarks != null && gldRemarks != currentApplicationDetailData.gldRemarks) { |
|
|
|
HttpUtils.post({ |
|
|
|
url: UPDATE_GLDREMARKS + "/" + currentApplicationDetailData.id, |
|
|
|
params: { |
|
|
@@ -172,7 +179,7 @@ const ApplicationDetailCard = ( |
|
|
|
alert(error) |
|
|
|
} |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
setRemarksPopUp(false) |
|
|
|
} |
|
|
|
|
|
|
@@ -220,6 +227,23 @@ const ApplicationDetailCard = ( |
|
|
|
spacing={2} |
|
|
|
mb={2} |
|
|
|
> |
|
|
|
{ |
|
|
|
!(orgDetail?.creditor) && currentApplicationDetailData.creditor && currentApplicationDetailData.status === "published" ? |
|
|
|
<> |
|
|
|
<Button |
|
|
|
variant="contained" |
|
|
|
onClick={paidClick()} |
|
|
|
sx={{ |
|
|
|
textTransform: 'capitalize', |
|
|
|
alignItems: 'end', |
|
|
|
}}> |
|
|
|
<DoneIcon /> |
|
|
|
<Typography ml={1} variant="h5">Paid</Typography> |
|
|
|
</Button> |
|
|
|
</> |
|
|
|
: |
|
|
|
<></> |
|
|
|
} |
|
|
|
{currentApplicationDetailData.status === "submitted" || currentApplicationDetailData.status == "reviewed" ? |
|
|
|
<> |
|
|
|
<Button |
|
|
@@ -296,13 +320,13 @@ const ApplicationDetailCard = ( |
|
|
|
// size="large" |
|
|
|
variant="contained" |
|
|
|
onClick={revokeClick()} |
|
|
|
disabled={currentApplicationDetailData.paymentMethod=="online"||currentApplicationDetailData.paymentMethod==null} |
|
|
|
disabled={currentApplicationDetailData.paymentMethod == "online" || currentApplicationDetailData.paymentMethod == null} |
|
|
|
sx={{ |
|
|
|
textTransform: 'capitalize', |
|
|
|
alignItems: 'end', |
|
|
|
backgroundColor: '#ffa733' |
|
|
|
}}> |
|
|
|
|
|
|
|
|
|
|
|
<ReplayIcon /> |
|
|
|
<Typography ml={1} variant="h5">Revoke Payment</Typography> |
|
|
|
</Button> |
|
|
@@ -376,7 +400,7 @@ const ApplicationDetailCard = ( |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} sm={12} md={5.5} lg={5} sx={{ mb: 1 , ml: { md: 1, lg: 3 } }}> |
|
|
|
<Grid item xs={12} sm={12} md={5.5} lg={5} sx={{ mb: 1, ml: { md: 1, lg: 3 } }}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={12} md={4} lg={4} |
|
|
|
sx={{ display: 'flex', alignItems: 'center' }}> |
|
|
@@ -653,7 +677,7 @@ const ApplicationDetailCard = ( |
|
|
|
|
|
|
|
<Grid item xs={12} md={10} lg={10}> |
|
|
|
<Grid container direction="row" > |
|
|
|
<Grid item xs={12} md={9} lg={9} > |
|
|
|
<Grid item xs={12} md={9} lg={9} > |
|
|
|
<FormControl variant="outlined" fullWidth disabled > |
|
|
|
<OutlinedInput |
|
|
|
fullWidth |
|
|
@@ -672,7 +696,7 @@ const ApplicationDetailCard = ( |
|
|
|
/> |
|
|
|
</FormControl> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} ml={1} md={2} lg={2}> |
|
|
|
<Grid item xs={12} ml={1} md={2} lg={2}> |
|
|
|
<Button |
|
|
|
// size="large" |
|
|
|
variant="contained" |
|
|
@@ -680,7 +704,7 @@ const ApplicationDetailCard = ( |
|
|
|
sx={{ |
|
|
|
textTransform: 'capitalize', |
|
|
|
alignItems: 'end', |
|
|
|
|
|
|
|
|
|
|
|
}}> |
|
|
|
<EditNoteIcon /> |
|
|
|
<Typography ml={1} variant="h5"> Edit</Typography> |
|
|
@@ -738,7 +762,7 @@ const ApplicationDetailCard = ( |
|
|
|
{...register("makeRemarks")} |
|
|
|
id='makeRemarks' |
|
|
|
// label="Remarks" |
|
|
|
defaultValue={currentApplicationDetailData.gldRemarks!=null?currentApplicationDetailData.gldRemarks:""} |
|
|
|
defaultValue={currentApplicationDetailData.gldRemarks != null ? currentApplicationDetailData.gldRemarks : ""} |
|
|
|
InputLabelProps={{ |
|
|
|
shrink: true |
|
|
|
}} |
|
|
|