diff --git a/src/pages/Announcement/Search/SearchForm.js b/src/pages/Announcement/Search/SearchForm.js index 6d2aaf0..dd4b06d 100644 --- a/src/pages/Announcement/Search/SearchForm.js +++ b/src/pages/Announcement/Search/SearchForm.js @@ -84,6 +84,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria}) => { InputLabelProps={{ shrink: true }} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -102,6 +103,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria}) => { type="date" label={"Submit Date (To)"} defaultValue={searchCriteria.dateTo} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> diff --git a/src/pages/DemandNote/Search/SearchForm.js b/src/pages/DemandNote/Search/SearchForm.js index 052cf73..4d28dbf 100644 --- a/src/pages/DemandNote/Search/SearchForm.js +++ b/src/pages/DemandNote/Search/SearchForm.js @@ -30,7 +30,8 @@ const useStyles = makeStyles(() => ({ pointerEvents: "none", right: 50, display: "flex", - alignItems: "center" + alignItems: "center", + width:"70%" }, })); @@ -166,20 +167,31 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue const onSubmit = (data) => { data.status = selectedStatus?.type; let typeArray = []; + let sentDateFrom = ""; + let sentDateTo = ""; + let sentDueDateFrom = ""; + let sentDueDateTo = ""; for (let i = 0; i < type.length; i++) { typeArray.push(type[i].label); } + if (fromDateValue != "dd / mm / yyyy" && toDateValue != "dd / mm / yyyy") { + sentDateFrom = DateUtils.dateValue(fromDateValue) + sentDateTo = DateUtils.dateValue(toDateValue) + sentDueDateFrom = DateUtils.dateValue(fromDueDateValue) + sentDueDateTo = DateUtils.dateValue(toDueDateValue) + } + const temp = { appNo: data.appNo, issueId: issueSelected?.id, orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "", dnNo: data.dnNo, - dateFrom: data.dateFrom, - dateTo: data.dateTo, - dueDateFrom: data.dueDateFrom, - dueDateTo: data.dueDateTo, + dateFrom: sentDateFrom, + dateTo: sentDateTo, + dueDateFrom: sentDueDateFrom, + dueDateTo: sentDueDateTo, status: (data?.status === '' || data?.status?.includes("all")) ? "" : data.status, }; applySearch(temp); @@ -350,6 +362,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue InputLabelProps={{ shrink: true }} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -370,6 +383,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue type="date" label={"Issue Date (To)"} defaultValue={searchCriteria.dateTo} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -394,6 +408,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue InputLabelProps={{ shrink: true }} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -415,6 +430,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue type="date" label={"Due Date (To)"} defaultValue={searchCriteria.dueDateTo} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> diff --git a/src/pages/GFMIS/SearchForm.js b/src/pages/GFMIS/SearchForm.js index c020160..04dd469 100644 --- a/src/pages/GFMIS/SearchForm.js +++ b/src/pages/GFMIS/SearchForm.js @@ -29,7 +29,8 @@ const useStyles = makeStyles(() => ({ pointerEvents: "none", right: 50, display: "flex", - alignItems: "center" + alignItems: "center", + width:"70%" }, })); @@ -138,6 +139,7 @@ const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria }) => InputLabelProps={{ shrink: true }} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> diff --git a/src/pages/Payment/Search_GLD/SearchForm.js b/src/pages/Payment/Search_GLD/SearchForm.js index 9f2297c..eadd7b6 100644 --- a/src/pages/Payment/Search_GLD/SearchForm.js +++ b/src/pages/Payment/Search_GLD/SearchForm.js @@ -28,7 +28,8 @@ const useStyles = makeStyles(() => ({ pointerEvents: "none", right: 50, display: "flex", - alignItems: "center" + alignItems: "center", + width:"70%" }, })); @@ -171,6 +172,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { InputLabelProps={{ shrink: true }} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -190,6 +192,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { type="date" label="Transaction Date (To)" defaultValue={searchCriteria.dateTo} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> diff --git a/src/pages/Payment/Search_Public/SearchForm.js b/src/pages/Payment/Search_Public/SearchForm.js index 8043960..de493e2 100644 --- a/src/pages/Payment/Search_Public/SearchForm.js +++ b/src/pages/Payment/Search_Public/SearchForm.js @@ -189,6 +189,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { InputLabelProps={{ shrink: true }} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -209,6 +210,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { type="date" label={intl.formatMessage({id: 'payDateTo'})} defaultValue={searchCriteria.dateTo} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> diff --git a/src/pages/Proof/Search_GLD/SearchForm.js b/src/pages/Proof/Search_GLD/SearchForm.js index fb0d887..ba73815 100644 --- a/src/pages/Proof/Search_GLD/SearchForm.js +++ b/src/pages/Proof/Search_GLD/SearchForm.js @@ -30,7 +30,8 @@ const useStyles = makeStyles(() => ({ pointerEvents: "none", right: 50, display: "flex", - alignItems: "center" + alignItems: "center", + width:"70%" }, })); @@ -296,6 +297,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss InputLabelProps={{ shrink: true }} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -316,6 +318,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss type="date" label="Proof Issue Date (To)" defaultValue={searchCriteria.dateTo} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -371,13 +374,18 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss size="small" options={orgCombo} value={orgSelected} - inputValue={(orgSelected?.label) ? orgSelected?.label : ""} + getOptionLabel={(option) => option.name? option.name : ""} + inputValue={orgSelected ? orgSelected.name : ""} onChange={(event, newValue) => { - setOrgSelected(newValue); + if (newValue !== null) { + setOrgSelected(newValue); + }else{ + setOrgSelected({}); + } }} renderInput={(params) => ( @@ -317,6 +318,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData type="date" label={intl.formatMessage({id: 'proofDateTo'})} defaultValue={searchCriteria.dateTo} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> diff --git a/src/pages/PublicNotice/Search_GLD/SearchForm.js b/src/pages/PublicNotice/Search_GLD/SearchForm.js index d8c5f4f..b0a470b 100644 --- a/src/pages/PublicNotice/Search_GLD/SearchForm.js +++ b/src/pages/PublicNotice/Search_GLD/SearchForm.js @@ -31,9 +31,7 @@ const useStyles = makeStyles(() => ({ right: 50, display: "flex", alignItems: "center", - md:{ - width: "130px" - } + width:"70%" }, })); @@ -71,8 +69,8 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss : DateUtils.dateStr(fromDateValue)} - @@ -254,6 +253,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss type="date" label={"Submit Date (To)"} defaultValue={searchCriteria.dateTo} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -346,11 +346,11 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss getOptionLabel={(option) => option.name? option.name : ""} inputValue={orgSelected ? orgSelected.name : ""} onChange={(event, newValue) => { - if (newValue !== null) { - setOrgSelected(newValue); - }else{ - setOrgSelected({}); - } + if (newValue !== null) { + setOrgSelected(newValue); + }else{ + setOrgSelected({}); + } }} renderInput={(params) => ( import('pages/extra-pages/LoadingComponent'))); +import { makeStyles } from '@mui/styles'; // ==============================|| DASHBOARD - DEFAULT ||============================== // - +const useStyles = makeStyles(() => ({ + root: { + position: "relative" + }, + display: { + position: "absolute", + top: 2, + left: 12, + bottom: 2, + background: "white", + pointerEvents: "none", + right: 50, + display: "flex", + alignItems: "center", + width:"70%" + }, +})); const SearchPublicNoticeForm = ({ applySearch, generateReport, searchCriteria, onDownload, onView }) => { @@ -27,29 +44,203 @@ const SearchPublicNoticeForm = ({ applySearch, generateReport, searchCriteria, o const [txnMaxDate, setTxnMaxDate] = React.useState(searchCriteria.dateTo); const [collMinDate, setCollMinDate] = React.useState(searchCriteria.dateFrom); const [collMaxDate, setCollMaxDate] = React.useState(searchCriteria.dateTo); + + const [sysTxnFromDateValue, setSysTxnFromDateValue] = React.useState("dd / mm / yyyy"); + const [sysTxnToDateValue, setSysTxnToDateValue] = React.useState("dd / mm / yyyy"); + const [txnFromDateValue, setTxnFromDateValue] = React.useState("dd / mm / yyyy"); + const [txnToDateValue, setTxnToDateValue] = React.useState("dd / mm / yyyy"); + const [collFromDateValue, setCollFromDateValue] = React.useState("dd / mm / yyyy"); + const [collToDateValue, setCollToDateValue] = React.useState("dd / mm / yyyy"); + const [status, setStatus] = React.useState(ComboData.paymentStatus[0]); const [method, setMethod] = React.useState(ComboData.paymentMethod[0]); const marginBottom = 2.5; const { register, handleSubmit, getValues } = useForm() + React.useEffect(() => { + setSysTxnFromDateValue(sysTxnMinDate); + }, [sysTxnMinDate]); + + React.useEffect(() => { + setSysTxnToDateValue(sysTxnMaxDate); + }, [sysTxnMaxDate]); + + React.useEffect(() => { + setTxnFromDateValue(txnMinDate); + }, [txnMinDate]); + + React.useEffect(() => { + setTxnToDateValue(txnMaxDate); + }, [txnMaxDate]); + + React.useEffect(() => { + setCollFromDateValue(collMinDate); + }, [collMinDate]); + + React.useEffect(() => { + setCollToDateValue(collMaxDate); + }, [collMaxDate]); + + function SysTxnFormDateInputComponent({ inputRef, ...props }) { + const classes = useStyles(); + return ( + <> +
+ {DateUtils.dateStr(sysTxnFromDateValue) == "Invalid Date" ? + sysTxnFromDateValue + : + DateUtils.dateStr(sysTxnFromDateValue)} +
+ + + ); + } + + function SysTxnToDateInputComponent({ inputRef, ...props }) { + const classes = useStyles(); + return ( + <> +
+ {DateUtils.dateStr(sysTxnToDateValue) == "Invalid Date" ? + sysTxnToDateValue + : + DateUtils.dateStr(sysTxnToDateValue)} +
+ + + ); + } + + function TxnFormDateInputComponent({ inputRef, ...props }) { + const classes = useStyles(); + return ( + <> +
+ {DateUtils.dateStr(txnFromDateValue) == "Invalid Date" ? + txnFromDateValue + : + DateUtils.dateStr(txnFromDateValue)} +
+ + + ); + } + + function TxnToDateInputComponent({ inputRef, ...props }) { + const classes = useStyles(); + return ( + <> +
+ {DateUtils.dateStr(txnToDateValue) == "Invalid Date" ? + txnToDateValue + : + DateUtils.dateStr(txnToDateValue)} +
+ + + ); + } + + function CollFormDateInputComponent({ inputRef, ...props }) { + const classes = useStyles(); + return ( + <> +
+ {DateUtils.dateStr(collFromDateValue) == "Invalid Date" ? + collFromDateValue + : + DateUtils.dateStr(collFromDateValue)} +
+ + + ); + } + + function CollToDateInputComponent({ inputRef, ...props }) { + const classes = useStyles(); + return ( + <> +
+ {DateUtils.dateStr(collToDateValue) == "Invalid Date" ? + collToDateValue + : + DateUtils.dateStr(collToDateValue)} +
+ + + ); + } + const onSubmit = () => { - const sysTxnDateFrom = getValues("sysTxnDateFrom") - const sysTxnDateTo = getValues("sysTxnDateTo") - const txnDateFrom = getValues("txnDateFrom") - const txnDateTo = getValues("txnDateTo") - const collDateFrom = getValues("collDateFrom") - const collDateTo = getValues("collDateTo") + + let sentSysTxnDateFrom = ""; + let sentSysTxnDateTo = ""; + let sentTxnDateFrom = ""; + let sentTxnDateTo = ""; + let sentCollDateFrom = ""; + let sentCollDateTo = ""; + + if (fromDateValue != "dd / mm / yyyy" && toDateValue != "dd / mm / yyyy") { + sentSysTxnDateFrom = DateUtils.dateValue(sysTxnFromDateValue) + sentSysTxnDateTo = DateUtils.dateValue(sysTxnToDateValue) + sentTxnDateFrom = DateUtils.dateValue(txnFromDateValue) + sentTxnDateTo = DateUtils.dateValue(txnToDateValue) + sentCollDateFrom = DateUtils.dateValue(collFromDateValue) + sentCollDateTo = DateUtils.dateValue(collToDateValue) + } const temp = { PaymentMethod:(method?.type && method?.type != 'Please Select') ? method?.type : "", PaymentStatus : (status?.type && status?.type != 'all') ? status?.type : "", - SysTxnDateFrom:sysTxnDateFrom, - SysTxnDateTo:sysTxnDateTo, - TxnDateFrom:txnDateFrom, - TxnDateTo:txnDateTo, - CollDateFrom:collDateFrom, - CollDateTo:collDateTo, + SysTxnDateFrom: sentSysTxnDateFrom, + SysTxnDateTo: sentSysTxnDateTo, + TxnDateFrom: sentTxnDateFrom, + TxnDateTo: sentTxnDateTo, + CollDateFrom: sentCollDateFrom, + CollDateTo: sentCollDateTo, }; applySearch(temp); }; @@ -186,13 +377,16 @@ const SearchPublicNoticeForm = ({ applySearch, generateReport, searchCriteria, o type="date" label="PNSPS Transaction Date (From)" ////defaultValue={searchCriteria.dateFrom} - InputProps={{ inputProps: { max: sysTxnMaxDate } }} + InputProps={{ + inputComponent: SysTxnFormDateInputComponent, + }} onChange={(newValue) => { - setSysTxnMinDate(DateUtils.dateValue(newValue)); + setSysTxnMinDate(newValue.target.value); }} InputLabelProps={{ shrink: true }} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -202,14 +396,17 @@ const SearchPublicNoticeForm = ({ applySearch, generateReport, searchCriteria, o shrink: true }} {...register("sysTxnDateTo")} - InputProps={{ inputProps: { min: sysTxnMinDate } }} + InputProps={{ + inputComponent: SysTxnToDateInputComponent, + }} onChange={(newValue) => { - setsysTxnMaxDate(DateUtils.dateValue(newValue)); + setsysTxnMaxDate(newValue.target.value); }} id="sysTxnDateTo" type="date" label="PNSPS Transaction Date (To)" ////defaultValue={searchCriteria.dateTo} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -228,13 +425,16 @@ const SearchPublicNoticeForm = ({ applySearch, generateReport, searchCriteria, o type="date" label="FI Transaction Date (From)" //defaultValue={searchCriteria.dateFrom} - InputProps={{ inputProps: { max: txnMaxDate } }} + InputProps={{ + inputComponent: TxnFormDateInputComponent, + }} onChange={(newValue) => { - setTxnMaxDate(DateUtils.dateValue(newValue)); + setTxnMinDate(newValue.target.value); }} InputLabelProps={{ shrink: true }} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -244,14 +444,17 @@ const SearchPublicNoticeForm = ({ applySearch, generateReport, searchCriteria, o shrink: true }} {...register("txnDateTo")} - InputProps={{ inputProps: { min: txnMinDate } }} + InputProps={{ + inputComponent: TxnToDateInputComponent, + }} onChange={(newValue) => { - setTxnMinDate(DateUtils.dateValue(newValue)); + setTxnMaxDate(newValue.target.value); }} id="txnDateTo" type="date" label="FI Transaction Date (To)" //defaultValue={searchCriteria.dateTo} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -270,13 +473,16 @@ const SearchPublicNoticeForm = ({ applySearch, generateReport, searchCriteria, o type="date" label="Bank Credit Date (From)" //defaultValue={searchCriteria.dateFrom} - InputProps={{ inputProps: { max: collMaxDate } }} + InputProps={{ + inputComponent: CollFormDateInputComponent, + }} onChange={(newValue) => { - setCollMinDate(DateUtils.dateValue(newValue)); + setCollMinDate(newValue.target.value); }} InputLabelProps={{ shrink: true }} + sx={{ "& .MuiInputBase-input": {display:"block"} }} /> @@ -286,14 +492,17 @@ const SearchPublicNoticeForm = ({ applySearch, generateReport, searchCriteria, o shrink: true }} {...register("collDateTo")} - InputProps={{ inputProps: { min: collMinDate } }} + InputProps={{ + inputComponent: CollToDateInputComponent, + }} onChange={(newValue) => { - setCollMaxDate(DateUtils.dateValue(newValue)); + setCollMaxDate(newValue.target.value); }} id="collDateTo" type="date" label="Bank Credit Date (To)" //defaultValue={searchCriteria.dateTo} + sx={{ "& .MuiInputBase-input": {display:"block"} }} />