@@ -19,7 +19,8 @@ import ForwardIcon from '@mui/icons-material/Forward'; | |||
import { | |||
isORGLoggedIn, | |||
isDummyLoggedIn, | |||
isCreditorLoggedIn | |||
isCreditorLoggedIn, | |||
checkIsOnlyOnlinePaymentByIssueDate | |||
} from "utils/Utils"; | |||
import { useNavigate } from "react-router-dom"; | |||
@@ -33,7 +34,7 @@ const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingCo | |||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList, isOnlyOnlinePayment }) => { | |||
const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => { | |||
const [isWarningPopUp, setIsWarningPopUp] = useState(false); | |||
const [warningTitle, setWarningTitle] = useState(""); | |||
const [warningText, setWarningText] = useState(""); | |||
@@ -51,6 +52,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList, isOn | |||
const [issueId, setIssueId] = useState(loadedData.issueId); | |||
const [closeDate, setCloseDate] = useState(null); | |||
const [closingDateOff, setClosingDateOff] = useState(null); | |||
const [isOnlyOnlinePayment, setOnlyOnlinePayment] = useState(); | |||
const navigate = useNavigate(); | |||
const BackgroundHead = { | |||
@@ -83,6 +85,8 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList, isOn | |||
if (data.id == issueId) { | |||
setCloseDate(data.closingDate) | |||
setClosingDateOff(data.closingDateOff) | |||
setOnlyOnlinePayment(checkIsOnlyOnlinePaymentByIssueDate(data.issueDate)) | |||
break; | |||
} | |||
} | |||
@@ -20,7 +20,7 @@ const PublicNoticeApplyForm = Loadable(lazy(() => import('./PublicNoticeApplyFor | |||
import { | |||
// isORGLoggedIn, | |||
isDummyLoggedIn, | |||
checkIsOnlyOnlinePayment | |||
// checkIsOnlyOnlinePaymentByIssueDate | |||
// isCreditorLoggedIn | |||
} from "utils/Utils"; | |||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
@@ -30,7 +30,7 @@ const ApplyForm = () => { | |||
const [gazetteIssueList, setGazetteIssueList] = React.useState([]); | |||
const [selections, setSelection] = React.useState([]); | |||
const [isOnlyOnlinePayment, setOnlyOnlinePayment] = React.useState(); | |||
const [isLoading, setLoding] = React.useState(true); | |||
const intl = useIntl(); | |||
@@ -66,7 +66,7 @@ const ApplyForm = () => { | |||
setGazetteIssueList(response?.gazetteIssueList); | |||
setSelection(selection); | |||
setUserData(response); | |||
setOnlyOnlinePayment(checkIsOnlyOnlinePayment()) | |||
// setOnlyOnlinePayment(checkIsOnlyOnlinePayment()) | |||
} | |||
}); | |||
}; | |||
@@ -109,11 +109,11 @@ const ApplyForm = () => { | |||
React.useEffect(() => { | |||
if (userData !== null&& isOnlyOnlinePayment !== null){ | |||
if (userData !== null){ | |||
setLoding(false); | |||
// console.log(isOnlyOnlinePayment) | |||
} | |||
}, [userData,isOnlyOnlinePayment]); | |||
}, [userData]); | |||
return ( | |||
isLoading ? | |||
@@ -127,7 +127,7 @@ const ApplyForm = () => { | |||
loadedData={userData} | |||
_selections={selections} | |||
gazetteIssueList = {gazetteIssueList} | |||
isOnlyOnlinePayment = {isOnlyOnlinePayment} | |||
// isOnlyOnlinePayment = {isOnlyOnlinePayment} | |||
/> | |||
); | |||
}; | |||
@@ -183,6 +183,21 @@ export const isPasswordExpiry = () =>{ | |||
} | |||
export const checkIsOnlyOnlinePaymentByIssueDate = (date) => { | |||
const targetDate = new Date(2026, 0, 28, 8, 0, 0) | |||
const checkDate = DateUtils.convertToDate(date) | |||
if (isDummyLoggedIn()){ | |||
return false; | |||
} | |||
// console.log(checkDate) | |||
// console.log(targetDate) | |||
if (checkDate >= targetDate) { | |||
return true | |||
} else { | |||
return false; | |||
} | |||
} | |||
export const checkIsOnlyOnlinePayment = () => { | |||
const targetDate = new Date(2026, 0, 28, 8, 0, 0) | |||
const checkDate = DateUtils.convertToDate(new Date()) | |||