| @@ -20,7 +20,8 @@ import { | |||||
| isORGLoggedIn, | isORGLoggedIn, | ||||
| isDummyLoggedIn, | isDummyLoggedIn, | ||||
| // isCreditorLoggedIn, | // isCreditorLoggedIn, | ||||
| checkIsOnlyOnlinePaymentByIssueDate | |||||
| checkIsOnlyOnlinePaymentByIssueDate, | |||||
| checkIsOnlyOnlinePaymentApply, | |||||
| } from "utils/Utils"; | } from "utils/Utils"; | ||||
| import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
| @@ -582,7 +583,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||||
| aria-label={intl.formatMessage({ id: 'applyPublicNotice' })} | aria-label={intl.formatMessage({ id: 'applyPublicNotice' })} | ||||
| variant="contained" | variant="contained" | ||||
| type="submit" | type="submit" | ||||
| disabled={!tickAccept} | |||||
| disabled={checkIsOnlyOnlinePaymentApply(tickAccept)} | |||||
| > | > | ||||
| <FormattedMessage id="applyPublicNotice" /> | <FormattedMessage id="applyPublicNotice" /> | ||||
| </Button> | </Button> | ||||
| @@ -20,7 +20,8 @@ const PublicNoticeApplyForm = Loadable(lazy(() => import('./PublicNoticeApplyFor | |||||
| import { | import { | ||||
| // isORGLoggedIn, | // isORGLoggedIn, | ||||
| isDummyLoggedIn, | isDummyLoggedIn, | ||||
| checkIsOnlyOnlinePaymentByIssueDate | |||||
| checkIsOnlyOnlinePaymentByIssueDate, | |||||
| checkIsOnlyOnlinePayment | |||||
| // isCreditorLoggedIn | // isCreditorLoggedIn | ||||
| } from "utils/Utils"; | } from "utils/Utils"; | ||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -80,22 +81,24 @@ const ApplyForm = () => { | |||||
| setSelection(selection); | setSelection(selection); | ||||
| } else { | } else { | ||||
| let selection = []; | 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); | setUserData(response); | ||||
| @@ -210,7 +210,8 @@ export const checkIsOnlyOnlinePaymentByIssueDate = (date) => { | |||||
| } | } | ||||
| export const checkIsOnlyOnlinePayment = () => { | 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()) | const checkDate = DateUtils.convertToDate(new Date()) | ||||
| if (isDummyLoggedIn()){ | if (isDummyLoggedIn()){ | ||||
| return false; | 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 = () => { | export const checkMarkAsCreditClient = () => { | ||||
| const targetDate = new Date(2025, 9, 17, 8, 0, 0) // hardcode | const targetDate = new Date(2025, 9, 17, 8, 0, 0) // hardcode | ||||
| const checkDate = DateUtils.convertToDate(new Date()) | const checkDate = DateUtils.convertToDate(new Date()) | ||||