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