diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js index 8d93f065cd6..1af85e17d34 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js @@ -179,6 +179,9 @@ import useServiceTypeFromApplicationType from "./obps/useServiceTypeFromApplicat import useBusinessServiceBasedOnServiceType from "./obps/useBusinessServiceBasedOnServiceType"; import useBusinessServiceData from "./obps/useBusinessServiceData"; import useBPATaxDocuments from "./obps/useBPATaxDocuments"; +import useDistricts from "./obps/useDistricts"; +import useULBList from "./obps/useULBList"; + import useEventInbox from "./events/useEventInbox"; import useEventDetails from "./events/useEventDetails"; @@ -447,6 +450,8 @@ const obps = { useBusinessServiceBasedOnServiceType, useBusinessServiceData, useBPATaxDocuments, + useDistricts, + useULBList }; const events = { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/obps/useDistricts.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/obps/useDistricts.js new file mode 100644 index 00000000000..925f8d9f73a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/obps/useDistricts.js @@ -0,0 +1,20 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../../services/elements/MDMS"; + +const useDistricts = (tenantId, moduleCode, type, config = {}) => { + const usedistricttype = () => { + return useQuery("BPA_DISTRICTS", () => MdmsService.BPADistrict(tenantId, moduleCode ,type), config); + }; + + + switch (type) { + case "Districts": + return usedistricttype(); + default: + return null; + } +}; + + + +export default useDistricts; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/obps/useULBList.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/obps/useULBList.js new file mode 100644 index 00000000000..d92022d4c0a --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/obps/useULBList.js @@ -0,0 +1,20 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../../services/elements/MDMS"; + +const useULBList = (tenantId, moduleCode, type, config = {}) => { + const useULBType = () => { + return useQuery("BPA_ULB_TYPE", () => MdmsService.BPAUlb(tenantId, moduleCode ,type), config); + }; + + + switch (type) { + case "Ulb": + return useULBType(); + default: + return null; + } +}; + + + +export default useULBList; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js index 29bc790e857..cbd94ace22b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js @@ -287,6 +287,38 @@ const getApplicationChannelCriteria = (tenantId, moduleCode) => ({ ], }, }); +const getdistricttype = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "Districts", + }, + ], + }, + ], + }, +}); +const getulbtype = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "Ulb", + }, + ], + }, + ], + }, +}); const getPropertyTypeCriteria = (tenantId, moduleCode, type) => ({ type, @@ -375,6 +407,45 @@ const PTRBreedType = (MdmsRes) => { }; /////////// +const getdistrict = (MdmsRes) => { + return MdmsRes["BPA"].Districts.filter((Districts) => Districts.active).map((districtDetails) => { + return { + ...districtDetails, + i18nKey: `BPA_DISTRICT_${districtDetails.code}`, + }; + }); + //return MdmsRes; +}; + +const getulb = (MdmsRes) => { + return MdmsRes["BPA"].Ulb.filter((Ulb) => Ulb.active).map((ulbDetails) => { + return { + ...ulbDetails, + i18nKey: `BPA_DISTRICT_${ulbDetails.code}`, + }; + }); + //return MdmsRes; +}; +///////////// + +const BPADistrict = (MdmsRes) => { + MdmsRes["BPA"].Districts.filter((Districts) => Districts.active).map((districts) => { + return { + ...districts, + i18nKey: `BPA_DISTRICTS_${districts.code}`, + }; + }); +}; +const BPAUlb = (MdmsRes) => { + MdmsRes["BPA"].Ulb.filter((Ulb) => Ulb.active).map((ulblist) => { + return { + ...ulblist, + i18nKey: `BPA_ULB_${ulblist.code}`, + }; + }); +}; +///////////// + const getCommonFieldsCriteria = (tenantId, moduleCode, type) => ({ type, details: { @@ -1122,7 +1193,7 @@ const GetPropertyType = (MdmsRes) => i18nKey: `PROPERTYTYPE_MASTERS_${item.code}`, code: item.code, })); - + const GetPropertySubtype = (MdmsRes) => MdmsRes["FSM"].PropertyType.filter((property) => property.active && property.propertyType).map((item) => ({ ...item, @@ -1534,6 +1605,20 @@ const transformResponse = (type, MdmsRes, moduleCode, tenantId) => { case "PTRBreedType": return PTRBreedType(MdmsRes); + + case "Districts": + return getdistrict(MdmsRes); + + case "Ulb": + return getulb(MdmsRes); + + case "BPADistrict": + return BPADistrict(MdmsRes); + case "BPAUlb": + return BPAUlb(MdmsRes); + + + @@ -1679,6 +1764,14 @@ export const MdmsService = { return MdmsService.getDataByCriteria(tenantId, getPetDocumentsRequiredScreenCategory(tenantId, moduleCode), moduleCode); }, + getdistrict: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getdistricttype(tenantId, moduleCode, type), moduleCode); + }, + getulb: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getulbtype(tenantId, moduleCode, type), moduleCode); + }, + + getPetType: (tenantId, moduleCode, type) => { return MdmsService.getDataByCriteria(tenantId, getPetTypeList(tenantId, moduleCode, type), moduleCode); }, @@ -1686,6 +1779,12 @@ export const MdmsService = { getBreedType: (tenantId, moduleCode, type) => { return MdmsService.getDataByCriteria(tenantId, getBreedTypeList(tenantId, moduleCode, type), moduleCode); }, + BPADistrict: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getdistricttype(tenantId, moduleCode, type), moduleCode); + }, + BPAUlb: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getulbtype(tenantId, moduleCode, type), moduleCode); + }, PTRGenderType: (tenantId, moduleCode, type) => { return MdmsService.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); }, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/package.json b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/package.json index 473189014ad..d77c540f493 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/package.json +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/package.json @@ -20,6 +20,7 @@ "dependencies": { "@upyog/digit-ui-react-components": "1.7.0-beta.4", "microbundle-crl": "^0.13.11", + "exif-js": "^2.3.0", "react": "17.0.2", "react-dom": "17.0.2", "react-hook-form": "6.15.8", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/Module.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/Module.js index 392f282e9af..e57933af82f 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/Module.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/Module.js @@ -12,6 +12,7 @@ import BasicDetails from "./pageComponents/BasicDetails"; import DocsRequired from "./pageComponents/DocsRequired"; import PlotDetails from "./pageComponents/PlotDetails"; import ScrutinyDetails from "./pageComponents/ScrutinyDetails"; +import BPANewBuildingdetails from "./pageComponents/BPANewBuildingdetails" import OwnerDetails from "./pageComponents/OwnerDetails"; import DocumentDetails from "./pageComponents/DocumentDetails"; import NOCDetails from "./pageComponents/NOCDetails"; @@ -19,6 +20,7 @@ import NOCNumber from "./pageComponents/NOCNumber"; import LocationDetails from "./pageComponents/LocationDetails"; import StakeholderDocsRequired from "./pageComponents/StakeholderDocsRequired"; import GIS from "./pageComponents/GIS"; + import OCEDCRDocsRequired from "./pageComponents/OCEDCRDocsRequired"; import OCeDCRScrutiny from "./pageComponents/OCeDCRScrutiny"; import OCUploadPlanDiagram from "./pageComponents/OCUploadPlanDiagram"; @@ -57,6 +59,12 @@ import BPAAcknowledgement from "./pages/citizen/NewBuildingPermit/OBPSAcknowledg import OCBPAAcknowledgement from "./pages/citizen/OCBuildingPermit/OBPSAcknowledgement"; import OCSendBackAcknowledgement from "./pages/citizen/OCSendBackToCitizen/Acknowledgement"; import StakeholderAcknowledgement from "./pages/citizen/StakeholderRegistration/StakeholderAcknowledgement"; + + + + + + const OBPSModule = ({ stateCode, userType, tenants }) => { @@ -113,6 +121,7 @@ const componentsToRegister = { DocsRequired, PlotDetails, ScrutinyDetails, + BPANewBuildingdetails, OwnerDetails, DocumentDetails, NOCDetails, @@ -155,7 +164,10 @@ const componentsToRegister = { ObpsOCSendBackToCitizen : OCSendBackToCitizen, ObpsEdcrInbox : EdcrInbox, ObpsEmpApplicationDetail : EmpApplicationDetail, - ObpsEmployeeBpaApplicationDetail : EmployeeBpaApplicationDetail + ObpsEmployeeBpaApplicationDetail : EmployeeBpaApplicationDetail, + + + } export const initOBPSComponents = () => { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/BPANewBuildingdetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/BPANewBuildingdetails.js new file mode 100644 index 00000000000..83a930bc2ef --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/BPANewBuildingdetails.js @@ -0,0 +1,436 @@ + import React, { useEffect, useState, Fragment } from "react"; + import { FormStep, TextInput, CardLabel, Dropdown } from "@upyog/digit-ui-react-components"; + import { useLocation, useRouteMatch } from "react-router-dom"; + import { Controller, useForm } from "react-hook-form"; + + + const BPANewBuildingdetails = ({ t, config, onSelect, formData }) => { + const { pathname: url } = useLocation(); + let index = window.location.href.charAt(window.location.href.length - 1); + let validation = {}; + const [approvedColony, setapprovedColony] = useState(formData?.owners?.approvedColony || ""); + const [masterPlan, setmasterPlan] = useState(formData?.owners?.masterPlan || ""); + const [district, setDistrict] = useState(formData?.owners?.district || ""); + const [buildingStatus, setbuildingStatus] = useState(formData?.owners?.buildingStatus || ""); + const [schemes, setschemes] = useState(formData?.owners?.schemes || ""); + const [purchasedFAR, setpurchasedFAR] = useState(formData?.owners?.purchasedFAR || ""); + const [greenbuilding, setgreenbuilding] = useState(formData?.owners?.greenbuilding || ""); + const [restrictedArea, setrestrictedArea] = useState(formData?.owners?.restrictedArea || ""); + const [ulbType, setulbType] = useState(formData?.owners?.ulbType || ""); + const [proposedSite, setproposedSite] = useState(formData?.owners?.proposedSite || ""); + const [nameofApprovedcolony, setnameofApprovedcolony] = useState(formData?.owners?.nameofApprovedcolony || ""); + const [NocNumber, setNocNumber] = useState(formData?.owners?.NocNumber || ""); + + + const approvedcolonyStatus = [ + { + code: "YES", + i18nKey: "YES" + }, + { + code: "NO", + i18nKey: "NO" + }, + { + code: "LAL_LAKEER", + i18nKey: "LAL LAKEER" + } + ] + + const common = [ + { + code: "YES", + i18nKey: "YES" + }, + { + code: "NO", + i18nKey: "NO" + } + ] + + + const Typeofproposedsite = [ + { + code: "PROPOSED", + i18nKey: "Proposed" + } + ] + + const forschemes = [ + { + code: "TP_SCHEMES", + i18nKey: "TP SCHEMES" + }, + { + code: "DEVELOPMENT_SCHEMES", + i18nKey: "DEVELOPMENT SCHEMES" + }, + { + code: "AFFORDABLE", + i18nKey: "AFFORDABLE" + } + ] + + const status = [ + { + code: "AUTHORIZED", + i18nKey: "Authorized" + }, + { + code: "REGULARIZED", + i18nKey: "Regularized" + } + ] + + const tenantId = Digit.ULBService.getCurrentTenantId(); + const stateId = Digit.ULBService.getStateId(); + + const { data: Menu } = Digit.Hooks.obps.useDistricts(stateId, "BPA", "Districts"); + const { data: ULB } = Digit.Hooks.obps.useULBList(stateId, "BPA", "Ulb"); + + let menu = []; + let ulb = []; + + Menu && + Menu.map((districts) => { + menu.push({ i18nKey: `BPA_DISTRICTS_${districts.code}`, code: `${districts.code}`, value: `${districts.name}` }); + }); + + ULB && + ULB.map((ulblist) => { + if (ulblist.Districts == district?.code) { + ulb.push({ + i18nKey: `BPA_ULB_${ulblist.code}`, + code: `${ulblist.code}`, + value: `${ulblist.name}` + }); + } + + }); + + + const { control } = useForm(); + + function setApprovedColony(e) { + setapprovedColony(e.target.value); + } + + function setMasterPlan(e) { + setmasterPlan(e.target.value); + } + + function setdistrict(e) { + setDistrict(e.target.value); + } + + function setBuildingStatus(e) { + setbuildingStatus(e.target.value); + } + function setSchemes(e) { + setschemes(e.target.value); + } + function setPurchasedFAR(e) { + setpurchasedFAR(e.target.value); + } + function setGreenbuilding(e) { + setgreenbuilding(e.target.value); + } + function setRestrictedArea(e) { + setrestrictedArea(e.target.value); + } + function setUlbType(e) { + setulbType(e.target.value); + } + function setProposedSite(e) { + setproposedSite(e.target.value); + } + + function setNameapprovedcolony(e) { + setnameofApprovedcolony(e.target.value); + } + + function setnocNumber(e) { + setNocNumber(e.target.value); + } + + + + const goNext = () => { + let owners = formData.owners && formData.owners[index]; + let ownerStep = { ...owners, approvedColony, district, ulbType, masterPlan, buildingStatus, schemes, purchasedFAR, greenbuilding, restrictedArea, proposedSite, nameofApprovedcolony, NocNumber }; + let updatedFormData = { ...formData }; + + // Check if owners array exists in formData if not , then it will add it + if (!updatedFormData.owners) { + updatedFormData.owners = []; + } + + onSelect(config.key, { ...formData[config.key], ...ownerStep }, updatedFormData, false, index); + + + }; + + + + + const onSkip = () => onSelect(); + + const renderFields = () => { + switch (approvedColony?.code) { + case "YES": + return ( + <> + {`${t("BPA_APPROVED_COLONY_NAME")}`} + + + ); + case "NO": + return ( + <> + {`${t("BPA_NOC_NUMBER")}`} + + + + ); + default: + return null; + } + }; + + + return ( + + +
+ {`${t("BPA_APPROVED_COLONY")}`} + ( + + + )} + + /> + + {renderFields()} + + + + {`${t("BPA_MASTER_PLAN")}`} + ( + + + )} + + /> + {`${t("BPA_DISTRICT")}`} + ( + + )} + /> + + {`${t("BPA_ULB_TYPE")}`} + ( + + )} + /> + {`${t("BPA_BUILDING_STATUS")}`} + ( + + )} + /> + {`${t("BPA_SCHEMES")}`} + ( + + )} + /> + {`${t("BPA_PURCHASED_FAR")}`} + ( + + )} + /> + {`${t("BPA_GREEN_BUIDINGS")}`} + ( + + )} + /> + {`${t("BPA_RESTRICTED_AREA")}`} + ( + + )} + /> + {`${t("BPA_PROPOSED_SITE_TYPE")}`} + ( + + )} + /> + +
+
+
+ ); + }; + + export default BPANewBuildingdetails; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/DocumentDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/DocumentDetails.js index b6c3366bd77..4296e65345e 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/DocumentDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/DocumentDetails.js @@ -1,3 +1,31 @@ + +/** + * @author - Shivank Shukla - NIUA + + * Addition of feature of fetching Latitude and Longitude from uploaded photo + + - i have added a function (extractGeoLocation) to extract latitude and longitude from an uploaded image file. + - It takes the file object as input and returns a promise. + - Within the promise, EXIF.get() is called with the file object to extract EXIF data. + - Latitude and longitude are then retrieved from the EXIF data and converted to decimal format using the convertToDecimal function. + - If latitude and longitude are found, the promise is resolved with an object containing latitude and longitude. + Otherwise, if not found still it resolve the promise with latitude and longitude as NULL value. + - The convertToDecimal function converts GPS coordinates from degrees, minutes, and seconds format to decimal format. + + - The getData function is modified to include the geolocation extraction logic. + - When files are uploaded (e?.length > 0), the function extractGeoLocation extracts geolocation if any + - If geolocation extraction is successful, it logs the latitude and longitude to the console. + - After extracting geolocation, the function continues with the existing logic to handle the uploaded files. +*/ + + + + + + + + + import React, { useEffect, useMemo, useState } from "react"; import { CardLabel, @@ -13,6 +41,7 @@ import Timeline from "../components/Timeline"; import DocumentsPreview from "../../../templates/ApplicationDetails/components/DocumentsPreview"; import { stringReplaceAll } from "../utils"; import cloneDeep from "lodash/cloneDeep"; +import EXIF from 'exif-js'; const DocumentDetails = ({ t, config, onSelect, userType, formData, setError: setFormError, clearErrors: clearFormErrors, formState }) => { const stateId = Digit.ULBService.getStateId(); @@ -117,7 +146,35 @@ const SelectDocument = React.memo(function MyComponent({ const [newArray, setnewArray ] = useState([]); const [uploadedfileArray, setuploadedfileArray] = useState([]); const [fileArray, setfileArray] = useState([] || formData?.documents?.documents.filter((ob) => ob.documentType === selectedDocument.code) ); + + const [latitude, setLatitude] = useState(null); + const [longitude, setLongitude] = useState(null); +//////////////////////////////////////////////////////////// + function extractGeoLocation(file) { + return new Promise((resolve) => { + EXIF.getData(file, function() { + const lat = EXIF.getTag(this, 'GPSLatitude'); + const lon = EXIF.getTag(this, 'GPSLongitude'); + if (lat && lon) { + // Convert GPS coordinates to decimal format + const latDecimal = convertToDecimal(lat); + const lonDecimal = convertToDecimal(lon); + resolve({ latitude: latDecimal, longitude: lonDecimal }); + } else { + resolve({ latitude: null, longitude: null }); + } + }); + }); + } + + function convertToDecimal(coordinate) { + const degrees = coordinate[0]; + const minutes = coordinate[1]; + const seconds = coordinate[2]; + return degrees + minutes / 60 + seconds / 3600; + } + ////////////////////////// const handleSelectDocument = (value) => { if(filteredDocument?.documentType){ filteredDocument.documentType=value?.code; @@ -134,46 +191,107 @@ const SelectDocument = React.memo(function MyComponent({ e && setfileArray([...fileArray,e.file]); } + // function getData(e) { + // let key = selectedDocument.code; + // let data,newArr; + // if (e?.length > 0) { + // data = Object.fromEntries(e); + // newArr = Object.values(data); + // newArr = formData?.documents?.documents?.filter((ob) => ob.documentType === selectedDocument.code); + // setnewArray(newArr); + // // const filteredDocumentsByFileStoreId = documents?.filter((item) => item?.fileStoreId !== uploadedFile.fileStoreId) || [] + // let newfiles = []; + // e?.map((doc, index) => { + // newfiles.push({ + // documentType: selectedDocument?.code, + // additionalDetails:{category:selectedDocument?.code/*.split(".").slice(0,2).join('_')*/}, + // fileStoreId: doc?.[1]?.fileStoreId?.fileStoreId, + // documentUid: doc?.[1].fileStoreId?.fileStoreId, + // fileName: doc?.[0] || "", + // id:documents? documents.find(x => x.documentType === selectedDocument?.code)?.id:undefined, + // }) + // }) + // const __documents = [ + // ...documents.filter(e => e.documentType !== key ), + // ...newfiles, + // ] + // setDocuments(__documents) + // }else if(e?.length==0){ + // const __documents = [ + // ...documents.filter(e => e.documentType !== key ), + // ] + // setDocuments(__documents); + // } + + // newArr?.map((ob) => { + // if(!ob?.file){ + // ob.file = {} + // } + // ob.file.documentType = key; + // selectfile(ob,key); + // }) + // } + function getData(e) { let key = selectedDocument.code; - let data,newArr; + let data, newArr; if (e?.length > 0) { - data = Object.fromEntries(e); - newArr = Object.values(data); - newArr = formData?.documents?.documents?.filter((ob) => ob.documentType === selectedDocument.code); - setnewArray(newArr); - // const filteredDocumentsByFileStoreId = documents?.filter((item) => item?.fileStoreId !== uploadedFile.fileStoreId) || [] - let newfiles = []; - e?.map((doc, index) => { - newfiles.push({ - documentType: selectedDocument?.code, - additionalDetails:{category:selectedDocument?.code.split(".").slice(0,2).join('_')}, - fileStoreId: doc?.[1]?.fileStoreId?.fileStoreId, - documentUid: doc?.[1].fileStoreId?.fileStoreId, - fileName: doc?.[0] || "", - id:documents? documents.find(x => x.documentType === selectedDocument?.code)?.id:undefined, + // Extract geo location from the first file + extractGeoLocation(e[0][1].file) + .then(location => { + console.log('Latitude:', location.latitude); + console.log('Longitude:', location.longitude); + setLatitude(location.latitude); + setLongitude(location.longitude); + // Continue with your existing code + data = Object.fromEntries(e); + newArr = Object.values(data); + newArr = formData?.documents?.documents?.filter((ob) => ob.documentType === selectedDocument.code); + setnewArray(newArr); + // const filteredDocumentsByFileStoreId = documents?.filter((item) => item?.fileStoreId !== uploadedFile.fileStoreId) || [] + let newfiles = []; + e?.map((doc, index) => { + newfiles.push({ + documentType: selectedDocument?.code, + additionalDetails:{category:selectedDocument?.code.split(".").slice(0,2).join('_'), + latitude: location.latitude, + longitude: location.longitude, + }, + fileStoreId: doc?.[1]?.fileStoreId?.fileStoreId, + documentUid: doc?.[1].fileStoreId?.fileStoreId, + fileName: doc?.[0] || "", + id: documents ? documents.find(x => x.documentType === selectedDocument?.code)?.id : undefined, + }) + }) + const __documents = [ + ...documents.filter(e => e.documentType !== key), + ...newfiles, + ] + setDocuments(__documents); + + newArr?.map((ob) => { + if (!ob?.file) { + ob.file = {} + } + ob.file.documentType = key; + selectfile(ob, key); + }); }) - }) - const __documents = [ - ...documents.filter(e => e.documentType !== key ), - ...newfiles, - ] - setDocuments(__documents) - }else if(e?.length==0){ + .catch(error => { + console.error('Error extracting geo location:', error); + // Handle error if needed + }); + + // Rest of your code... + } else if (e?.length == 0) { const __documents = [ - ...documents.filter(e => e.documentType !== key ), + ...documents.filter(e => e.documentType !== key), ] setDocuments(__documents); } - - newArr?.map((ob) => { - if(!ob?.file){ - ob.file = {} - } - ob.file.documentType = key; - selectfile(ob,key); - }) - } + } + + function setcodeafterupload(){ if (selectedDocument?.code) { @@ -190,7 +308,10 @@ const SelectDocument = React.memo(function MyComponent({ newfiles.push({ documentType: selectedDocument?.code, fileStoreId: doc.fileStoreId, - additionalDetails:{category:selectedDocument?.code.split(".").slice(0,2).join('_')}, + additionalDetails:{category:selectedDocument?.code.split(".").slice(0,2).join('_'), + latitude: latitude, + longitude: longitude, + }, documentUid: doc.fileStoreId, fileName: fileArray[index]?.name || "", id:documents? documents.find(x => x.documentType === selectedDocument?.code)?.id:undefined, @@ -276,10 +397,23 @@ const SelectDocument = React.memo(function MyComponent({ t={t} extraStyleName={"OBPS"} allowedFileTypesRegex={allowedFileTypes} - allowedMaxSizeInMB={5} + allowedMaxSizeInMB={10} acceptFiles= "image/*, .pdf, .png, .jpeg, .jpg" /> {doc?.uploadedDocuments?.length && } + + {doc?.code === "SITEPHOTOGRAPH.ONE" && ( + latitude !== null && longitude !== null ? ( +
+

Latitude: {latitude}

+

Longitude: {longitude}

+
+ ): + ( +

Please upload a Photo with Location details.

+ ) + )} + ); }); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/OwnerDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/OwnerDetails.js index 719abee217d..71049e2c124 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/OwnerDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/OwnerDetails.js @@ -16,10 +16,11 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => { const [genderList, setGenderList] = useState([]); const [ownershipCategory, setOwnershipCategory] = useState(formData?.owners?.ownershipCategory); const [name, setName] = useState(formData?.owners?.name || ""); + const [emailId, setEmail] = useState(formData?.owners?.emailId || ""); + const [aadharNumber, setaadharNumber] = useState(formData?.owners?.aadharNumber || ""); const [isPrimaryOwner, setisPrimaryOwner] = useState(false); const [gender, setGender] = useState(formData?.owners?.gender); const [mobileNumber, setMobileNumber] = useState(formData?.owners?.mobileNumber || ""); - const [emailId, setEmail] = useState(formData?.owners?.emailId || ""); const [showToast, setShowToast] = useState(null); const [isDisable, setIsDisable] = useState(false); let Webview = !Digit.Utils.browser.isMobile(); @@ -142,6 +143,15 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => { setCanmovenext(false); } } + function setAadharNumber(i, e) { + let units = [...fields]; + units[i].aadharNumber = e.target.value; + setaadharNumber(e.target.value); + setFeilds(units); + if (units[i].gender && units[i].mobileNumber && units[i].name) { + setCanmovenext(false); + } + } function setMobileNo(i, e) { let units = [...fields]; units[i].mobileNumber = e.target.value; @@ -294,7 +304,172 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => { let owner = formData.owners; let ownerStep; ownerStep = { ...owner, owners: fields, ownershipCategory: ownershipCategory }; - onSelect(config.key, ownerStep); + + if (!formData?.id) { + setIsDisable(true); + //for owners conversion + let conversionOwners = []; + ownerStep?.owners?.map(owner => { + conversionOwners.push({ + ...owner, + active:true, + name: owner.name, + emailId:owner.emailId, + aadharNumber:owner.aadharNumber, + mobileNumber: owner.mobileNumber, + isPrimaryOwner: owner.isPrimaryOwner, + gender: owner.gender.code, + fatherOrHusbandName: "NAME" + }) + }); + let payload = {}; + payload.edcrNumber = formData?.edcrNumber?.edcrNumber ? formData?.edcrNumber?.edcrNumber :formData?.data?.scrutinyNumber?.edcrNumber; + payload.riskType = formData?.data?.riskType; + payload.applicationType = formData?.data?.applicationType; + payload.serviceType = formData?.data?.serviceType; + + const userInfo = Digit.UserService.getUser(); + const accountId = userInfo?.info?.uuid; + payload.tenantId = formData?.address?.city?.code; + payload.workflow = { action: "INITIATE", assignes : [userInfo?.info?.uuid] }; + payload.accountId = accountId; + payload.documents = null; + + // Additonal details + payload.additionalDetails = {GISPlaceName:formData?.address?.placeName}; + payload.additionalDetails.boundaryWallLength = formData?.data?.boundaryWallLength || "NA"; + payload.additionalDetails.area = (formData?.data.edcrDetails.planDetail.planInformation.plotArea).toString()|| "NA"; + payload.additionalDetails.height = (formData?.data.edcrDetails.planDetail.blocks[0].building.buildingHeight).toString() || "NA"; + payload.additionalDetails.usage = formData?.data.occupancyType || "NA"; + payload.additionalDetails.builtUpArea =(formData?.data.edcrDetails.planDetail.blocks[0].building.totalBuitUpArea).toString(); + + + if (formData?.data?.registrationDetails) payload.additionalDetails.registrationDetails = formData?.data?.registrationDetails; + if (formData?.data?.applicationType) payload.additionalDetails.applicationType = formData?.data?.applicationType; + if (formData?.data?.serviceType) payload.additionalDetails.serviceType = formData?.data?.serviceType; + if (formData?.data?.wardnumber) payload.additionalDetails.wardnumber = formData?.data?.wardnumber; + if (formData?.data?.zonenumber) payload.additionalDetails.zonenumber = formData?.data?.zonenumber; + if (formData?.data?.khasraNumber) payload.additionalDetails.khasraNumber = formData?.data?.khasraNumber; + if (formData?.data?.applicationType) payload.additionalDetails.applicationType = formData?.data?.applicationType; + if (formData?.data?.serviceType) payload.additionalDetails.serviceType = formData?.data?.serviceType; + if (formData?.data?.architectid) payload.additionalDetails.architectid = formData?.data?.architectid; + if (formData?.data?.propertyuid) payload.additionalDetails.propertyuid = formData?.data?.propertyuid; + if (formData?.data?.bathnumber) payload.additionalDetails.bathnumber = formData?.data?.bathnumber; + if (formData?.data?.kitchenNumber) payload.additionalDetails.kitchenNumber = formData?.data?.kitchenNumber; + if (formData?.data?.approxinhabitants) payload.additionalDetails.approxinhabitants = formData?.data?.approxinhabitants; + if (formData?.data?.materialusedinfloor) payload.additionalDetails.materialusedinfloor = formData?.data?.materialusedinfloor; + if (formData?.data?.distancefromsewer) payload.additionalDetails.distancefromsewer = formData?.data?.distancefromsewer; + if (formData?.data?.sourceofwater) payload.additionalDetails.sourceofwater = formData?.data?.sourceofwater; + if (formData?.data?.watercloset) payload.additionalDetails.watercloset = formData?.data?.watercloset; + if (formData?.data?.materialused) payload.additionalDetails.materialused = formData?.data?.materialused; + if (formData?.data?.materialusedinroofs) payload.additionalDetails.materialusedinroofs = formData?.data?.materialusedinroofs; + if (formData?.owners?.approvedColony?.code) payload.additionalDetails.approvedColony = formData?.owners?.approvedColony?.code; + if (formData?.owners?.buildingStatus?.code) payload.additionalDetails.buildingStatus = formData?.owners?.buildingStatus?.code; + if (formData?.owners?.greenbuilding?.code) payload.additionalDetails.greenbuilding = formData?.owners?.greenbuilding?.code; + if (formData?.owners?.masterPlan?.code) payload.additionalDetails.masterPlan = formData?.owners?.masterPlan?.code; + if (formData?.owners?.proposedSite?.code) payload.additionalDetails.proposedSite = formData?.owners?.proposedSite?.code; + if (formData?.owners?.purchasedFAR?.code) payload.additionalDetails.purchasedFAR = formData?.owners?.purchasedFAR?.code; + if (formData?.owners?.restrictedArea?.code) payload.additionalDetails.restrictedArea = formData?.owners?.restrictedArea?.code; + if (formData?.owners?.schemes?.i18nKey) payload.additionalDetails.schemes = formData?.owners?.schemes?.i18nKey; + if (formData?.owners?.district?.code) payload.additionalDetails.district = formData?.owners?.district?.code; + if (formData?.owners?.ulbType?.code) payload.additionalDetails.ulbType = formData?.owners?.ulbType?.code; + if (formData?.owners?.nameofApprovedcolony) payload.additionalDetails.nameofApprovedcolony = formData?.owners?.nameofApprovedcolony; + if (formData?.owners?.NocNumber) payload.additionalDetails.NocNumber = formData?.owners?.NocNumber; + + + //For LandInfo + payload.landInfo = {}; + //For Address + payload.landInfo.address = {}; + if (formData?.address?.city?.code) payload.landInfo.address.city = formData?.address?.city?.code; + if (formData?.address?.locality?.code) payload.landInfo.address.locality = { code: formData?.address?.locality?.code }; + if (formData?.address?.pincode) payload.landInfo.address.pincode = formData?.address?.pincode; + if (formData?.address?.landmark) payload.landInfo.address.landmark = formData?.address?.landmark; + if (formData?.address?.street) payload.landInfo.address.street = formData?.address?.street; + if (formData?.address?.geoLocation) payload.landInfo.address.geoLocation = formData?.address?.geoLocation; + + payload.landInfo.owners = conversionOwners; + payload.landInfo.ownershipCategory = ownershipCategory.code; + payload.landInfo.tenantId = formData?.address?.city?.code; + + //for units + const blockOccupancyDetails = formData; + payload.landInfo.unit = getUnitsForAPI(blockOccupancyDetails); + + let nameOfAchitect = sessionStorage.getItem("BPA_ARCHITECT_NAME"); + let parsedArchitectName = nameOfAchitect ? JSON.parse(nameOfAchitect) : "ARCHITECT"; + payload.additionalDetails.typeOfArchitect = parsedArchitectName; + let isSelfCertificationRequired=sessionStorage.getItem("isSelfCertificationRequired"); + if(isSelfCertificationRequired==="undefined"){ + isSelfCertificationRequired="false"; + } + payload.additionalDetails.isSelfCertificationRequired = isSelfCertificationRequired.toString(); + // create BPA call + if(isSelfCertificationRequired===true && formData?.data.occupancyType==="Residential" && (parsedArchitectName=="ARCHITECT" || parsedArchitectName=="ENGINEER"|| parsedArchitectName=="DESIGNER" || parsedArchitectName=="SUPERVISOR")){ + if(formData?.data.edcrDetails.planDetail.blocks[0].building.buildingHeight > 15){ + alert("Height should not be more than 15 metres"); + } + else if((parsedArchitectName=="ARCHITECT" || parsedArchitectName=="ENGINEER") && formData?.data.edcrDetails.planDetail.planInformation.plotArea>500){ + alert("Architect/Engineer can apply for area less then 500 sq. yards. in self declaration") + } + else if((parsedArchitectName=="DESIGNER" || parsedArchitectName=="SUPERVISOR") && formData?.data.edcrDetails.planDetail.planInformation.plotArea>250){ + alert("Designer/Supervisor can apply for area less then 500 sq. yards. in self declaration") + } + else{ + Digit.OBPSService.create({ BPA: payload }, tenantId) + .then((result, err) => { + if (result?.BPA?.length > 0) { + result?.BPA?.[0]?.landInfo?.owners?.forEach(owner => { + owner.gender = { code: owner.gender, active: true, i18nKey: `COMMON_GENDER_${owner.gender}` } + }); + result.BPA[0].owners = { ...owner, owners: result?.BPA?.[0]?.landInfo?.owners, ownershipCategory: ownershipCategory }; + result.BPA[0].address = result?.BPA?.[0]?.landInfo?.address; + result.BPA[0].address.city = formData.address.city; + result.BPA[0].address.locality = formData.address.locality; + result.BPA[0].placeName = formData?.address?.placeName; + result.BPA[0].data = formData.data; + result.BPA[0].BlockIds = getBlockIds(result.BPA[0].landInfo.unit); + result.BPA[0].subOccupancy= formData?.subOccupancy; + result.BPA[0].uiFlow = formData?.uiFlow; + setIsDisable(false); + onSelect("", result.BPA[0], "", true); + } + }) + .catch((e) => { + setIsDisable(false); + setShowToast({ key: "true", error: true, message: e?.response?.data?.Errors[0]?.message }); + }); + } + + } + else{ + Digit.OBPSService.create({ BPA: payload }, tenantId) + .then((result, err) => { + if (result?.BPA?.length > 0) { + result?.BPA?.[0]?.landInfo?.owners?.forEach(owner => { + owner.gender = { code: owner.gender, active: true, i18nKey: `COMMON_GENDER_${owner.gender}` } + }); + result.BPA[0].owners = { ...owner, owners: result?.BPA?.[0]?.landInfo?.owners, ownershipCategory: ownershipCategory }; + result.BPA[0].address = result?.BPA?.[0]?.landInfo?.address; + result.BPA[0].address.city = formData.address.city; + result.BPA[0].address.locality = formData.address.locality; + result.BPA[0].placeName = formData?.address?.placeName; + result.BPA[0].data = formData.data; + result.BPA[0].BlockIds = getBlockIds(result.BPA[0].landInfo.unit); + result.BPA[0].subOccupancy= formData?.subOccupancy; + result.BPA[0].uiFlow = formData?.uiFlow; + setIsDisable(false); + onSelect("", result.BPA[0], "", true); + } + }) + .catch((e) => { + setIsDisable(false); + setShowToast({ key: "true", error: true, message: e?.response?.data?.Errors[0]?.message }); + }); + } + } else { + onSelect(config.key, ownerStep); + } } } @@ -398,6 +573,22 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => { onSelect={(e) => setGenderName(index, e)} t={t} /> + {`${t("BPA_AADHAAR_NUMBER_LABEL")}`} + setAadharNumber(index, e)} + {...(validation = { + pattern: "^[2-9]{1}[0-9]{3}[0-9]{4}[0-9]{4}$", + type: "tel", + title: t("INVALID_AADHAAR_NUMBER") + })} + /> {`${t("CORE_EMAIL_ID")}`} { type: "emailId", title: t("TL_EMAIL_ID_ERROR_MESSAGE"), })} + disabled={false} //disabled={true} /> {ismultiple && ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/PlotDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/PlotDetails.js index 443ea2e0ba4..28dd4157f5f 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/PlotDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pageComponents/PlotDetails.js @@ -5,9 +5,21 @@ import Timeline from "../components/Timeline"; const PlotDetails = ({ formData, onSelect, config }) => { const { t } = useTranslation(); - const [holdingNumber, setHoldingNumber] = useState(""); const [boundaryWallLength, setBoundaryWallLength] = useState(""); const [registrationDetails, setRegistrationDetails] = useState(""); + const [wardnumber, setWardNumber] = useState(""); + const [zonenumber, setZoneNumber] = useState(""); + const [khasraNumber, setkhasraNumber] = useState(""); + const [architectid, setarchitectid] = useState(""); + const [bathnumber, setbathnumber] = useState(""); + const [kitchenNumber, setkitchenNumber] = useState(""); + const [approxinhabitants, setapproxinhabitants] = useState(""); + const [distancefromsewer, setdistancefromsewer] = useState(""); + const [sourceofwater, setsourceofwater] = useState(""); + const [materialused, setmaterialused] = useState(""); + const [materialusedinfloor, setmaterialusedinfloor] = useState(""); + const [materialusedinroofs, setmaterialusedinroofs] = useState(""); + const [propertyuid, setpropertyuid] = useState(""); const tenantId = Digit.ULBService.getCurrentTenantId(); const checkingFlow = formData?.uiFlow?.flow; const state = Digit.ULBService.getStateId(); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/NewBuildingPermit/NewConfig.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/NewBuildingPermit/NewConfig.js index 935905fecee..e72a47b74ab 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/NewBuildingPermit/NewConfig.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/NewBuildingPermit/NewConfig.js @@ -24,12 +24,6 @@ export const newConfig1=[ //"skipText": "CORE_COMMON_SKIP_CONTINUE" }, "inputs": [ - { - "label": "BPA_HOLDING_NUMBER_LABEL", - "type": "text", - "validation": {}, - "name": "holdingNumber" - }, { "label": "BPA_BOUNDARY_LAND_REG_DETAIL_LABEL", "type": "textarea", @@ -42,6 +36,93 @@ export const newConfig1=[ "validation": {}, "name": "boundaryWallLength" }, + { + "label": "BPA_WARD_NUMBER_LABEL", + "type": "text", + "validation": { + "pattern": "^[a-zA-Z0-9 -]+$", + "required": true + }, + "name": "wardnumber" + }, + { + "label": "BPA_ZONE_NUMBER_LABEL", + "type": "text", + "validation": {}, + "name": "zonenumber" + }, + { + "label": "BPA_KHASRA_NUMBER_LABEL", + "type": "text", + "validation": {"required": true}, + "name": "khasraNumber" + }, + { + "label": "BPA_ARCHITECT_ID", + "type": "text", + "validation": {}, + "name": "architectid" + }, + { + "label": "BPA_PROPERTY_UID", + "type": "text", + "validation": {}, + "name": "propertyuid" + }, + { + "label": "BPA_NUMBER_OF_BATHS", + "type": "text", + "validation": {}, + "name": "bathnumber" + }, + { + "label": "BPA_NUMBER_OF_KITCHENS", + "type": "text", + "validation": {}, + "name": "kitchenNumber" + }, + { + "label": "BPA_APPROX_INHABITANTS_FOR_ACCOMODATION", + "type": "text", + "validation": {}, + "name": "approxinhabitants" + }, + { + "label": "BPA_DISTANCE_FROM_SEWER", + "type": "text", + "validation": {}, + "name": "distancefromsewer" + }, + { + "label": "BPA_SOURCE_OF_WATER", + "type": "text", + "validation": {}, + "name": "sourceofwater" + }, + { + "label": "BPA_NUMBER_OF_WATER_CLOSETS", + "type": "text", + "validation": {}, + "name": "watercloset" + }, + { + "label": "BPA_MATERIAL_TO-BE_USED_IN_WALLS", + "type": "text", + "validation": {}, + "name": "materialused" + }, + { + "label": "BPA_MATERIAL_TO-BE_USED_IN_FLOOR", + "type": "text", + "validation": {}, + "name": "materialusedinfloor" + }, + { + "label": "BPA_MATERIAL_TO-BE_USED_IN_ROOFS", + "type": "text", + "validation": {}, + "name": "materialusedinroofs" + }, ] }, @@ -102,7 +183,7 @@ export const newConfig1=[ { "route": "location", "component": "LocationDetails", - "nextStep": "owner-details", + "nextStep": "additional-building-details", "hideInEmployee": true, "key": "address", "texts": { @@ -113,6 +194,17 @@ export const newConfig1=[ "skipAndContinueText": "" } }, + { + "route": "additional-building-details", + "component": "BPANewBuildingdetails", + "nextStep": "owner-details", + "key": "owners", + "texts": { + "headerCaption": "BPA_ADDITIONAL_BUILDING_DETAILS", + "header": "BPA_APPLICANT_DETAILS_HEADER", + "submitBarLabel": "CS_COMMON_NEXT" + } + }, { "route": "owner-details", "component": "OwnerDetails", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/utils/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/utils/index.js index 11ce5b8cdf1..a9f352e63ce 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/utils/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/utils/index.js @@ -169,28 +169,47 @@ export const getBPAFormData = async (data, mdmsData, history, t) => { export const getDocumentforBPA = (docs, PrevStateDocs) => { let document = []; docs && - docs.map((ob) => { - if (ob.id) { - document.push({ - documentType: ob.documentType, - fileStoreId: ob.fileStoreId, - fileStore: ob.fileStoreId, - fileName: "", - fileUrl: "", - additionalDetails: {}, - id: ob.id, - }); - } else { - document.push({ - documentType: ob.documentType, - fileStoreId: ob.fileStoreId, - fileStore: ob.fileStoreId, - fileName: "", - fileUrl: "", - additionalDetails: {}, - }); + docs.map((ob) => { + console.log("ob",ob); + if (ob.id) { + let docObject = { + documentType: ob.documentType, + fileStoreId: ob.fileStoreId, + fileStore: ob.fileStoreId, + fileName: "", + fileUrl: "", + additionalDetails: {}, + id: ob.id, + }; + + if (ob.documentType === "SITEPHOTOGRAPH.ONE") { + docObject.additionalDetails = { + latitude: ob?.additionalDetails?.latitude, + longitude: ob?.additionalDetails?.longitude, + }; } - }); + + document.push(docObject); + } else { + let docObject = { + documentType: ob.documentType, + fileStoreId: ob.fileStoreId, + fileStore: ob.fileStoreId, + fileName: "", + fileUrl: "", + additionalDetails: {}, + }; + + if (ob.documentType === "SITEPHOTOGRAPH.ONE") { + docObject.additionalDetails = { + latitude: ob?.additionalDetails?.latitude, + longitude: ob?.additionalDetails?.longitude, + }; + } + + document.push(docObject); + } + }); document = [...document, ...(PrevStateDocs ? PrevStateDocs : [])]; return document; }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ptr/src/pages/citizen/PTRApplicationDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ptr/src/pages/citizen/PTRApplicationDetails.js index 0f4bddd2ec6..65b0460f0b8 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ptr/src/pages/citizen/PTRApplicationDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ptr/src/pages/citizen/PTRApplicationDetails.js @@ -93,6 +93,8 @@ fetchBillData(); { enabled: acknowledgementIds ? true : false } ); + + if (!pet_details.workflow) { let workflow = { id: null, @@ -173,7 +175,9 @@ fetchBillData(); label: t("PTR_FEE_RECIEPT"), onClick: () => getRecieptSearch({ tenantId: reciept_data?.Payments[0]?.tenantId, payments: reciept_data?.Payments[0] }), }); - if (data?.ResponseInfo?.status === "successful") + + + if (reciept_data?.Payments[0]?.paymentStatus === "DEPOSITED") dowloadOptions.push({ label: t("PTR_CERTIFICATE"), onClick: () => printCertificate(),