| @@ -20,7 +20,8 @@ import { | |||
| isORGLoggedIn, | |||
| isDummyLoggedIn, | |||
| // isCreditorLoggedIn, | |||
| checkIsOnlyOnlinePaymentByIssueDate | |||
| checkIsOnlyOnlinePaymentByIssueDate, | |||
| checkIsOnlyOnlinePaymentApply, | |||
| } from "utils/Utils"; | |||
| import { useNavigate } from "react-router-dom"; | |||
| @@ -582,7 +583,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||
| aria-label={intl.formatMessage({ id: 'applyPublicNotice' })} | |||
| variant="contained" | |||
| type="submit" | |||
| disabled={!tickAccept} | |||
| disabled={checkIsOnlyOnlinePaymentApply(tickAccept)} | |||
| > | |||
| <FormattedMessage id="applyPublicNotice" /> | |||
| </Button> | |||
| @@ -20,7 +20,8 @@ const PublicNoticeApplyForm = Loadable(lazy(() => import('./PublicNoticeApplyFor | |||
| import { | |||
| // isORGLoggedIn, | |||
| isDummyLoggedIn, | |||
| checkIsOnlyOnlinePaymentByIssueDate | |||
| checkIsOnlyOnlinePaymentByIssueDate, | |||
| checkIsOnlyOnlinePayment | |||
| // isCreditorLoggedIn | |||
| } from "utils/Utils"; | |||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
| @@ -80,22 +81,24 @@ const ApplyForm = () => { | |||
| setSelection(selection); | |||
| } else { | |||
| let selection = []; | |||
| for (let i = 0; i < response.gazetteIssueList.length; i++) { | |||
| let data = response.gazetteIssueList[i]; | |||
| // only add if false | |||
| if (!checkIsOnlyOnlinePaymentByIssueDate(data.issueDate)) { | |||
| selection.push( | |||
| <FormControlLabel | |||
| key={data.id} | |||
| value={data.id} | |||
| control={<Radio />} | |||
| label={getIssueLabel(data)} | |||
| /> | |||
| ); | |||
| if (checkIsOnlyOnlinePayment()){ | |||
| for (let i = 0; i < response.gazetteIssueList.length; i++) { | |||
| let data = response.gazetteIssueList[i]; | |||
| // only add if false | |||
| if (!checkIsOnlyOnlinePaymentByIssueDate(data.issueDate)) { | |||
| selection.push( | |||
| <FormControlLabel | |||
| key={data.id} | |||
| value={data.id} | |||
| control={<Radio />} | |||
| label={getIssueLabel(data)} | |||
| /> | |||
| ); | |||
| } | |||
| } | |||
| setGazetteIssueList(issueList); | |||
| setSelection(selection); | |||
| } | |||
| setGazetteIssueList(issueList); | |||
| setSelection(selection); | |||
| } | |||
| } | |||
| setUserData(response); | |||
| @@ -210,7 +210,8 @@ export const checkIsOnlyOnlinePaymentByIssueDate = (date) => { | |||
| } | |||
| export const checkIsOnlyOnlinePayment = () => { | |||
| const targetDate = new Date(2025, 9, 17, 8, 0, 0) // hardcode | |||
| // const targetDate = new Date(2025, 28, 0, 0, 0, 0) // hardcode | |||
| const targetDate = new Date(2025, 9, 10, 0, 0, 0) // hardcode | |||
| const checkDate = DateUtils.convertToDate(new Date()) | |||
| if (isDummyLoggedIn()){ | |||
| return false; | |||
| @@ -224,6 +225,26 @@ export const checkIsOnlyOnlinePayment = () => { | |||
| } | |||
| } | |||
| export const checkIsOnlyOnlinePaymentApply = (tickAccept) => { | |||
| // const targetDate = new Date(2025, 28, 0, 0, 0, 0) // hardcode | |||
| const targetDate = new Date(2025, 9, 10, 0, 0, 0) // hardcode | |||
| const checkDate = DateUtils.convertToDate(new Date()) | |||
| if (isDummyLoggedIn()){ | |||
| return false; | |||
| } | |||
| // console.log(checkDate) | |||
| // console.log(targetDate) | |||
| if(tickAccept){ | |||
| if (checkDate >= targetDate) { | |||
| return false | |||
| } else{ | |||
| return true; | |||
| } | |||
| }else { | |||
| return true; | |||
| } | |||
| } | |||
| export const checkMarkAsCreditClient = () => { | |||
| const targetDate = new Date(2025, 9, 17, 8, 0, 0) // hardcode | |||
| const checkDate = DateUtils.convertToDate(new Date()) | |||