Skip to content

Commit

Permalink
Less Adjustment and Other charges fee changes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepa-s-13 committed May 17, 2024
1 parent bc4bfab commit b034359
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {

if(found){
setCanmovenext(false);
setownerRoleCheck(found);
//setownerRoleCheck(found);
setShowToast({ key: "true", error: true, message: `BPA_OWNER_VALIDATION_${found?.code}` });
return;
}
Expand Down Expand Up @@ -342,7 +342,8 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {
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();
payload.additionalDetails.nocNumber=(formData?.nocnumber?.nocNumber).toString();
//payload.additionalDetails.nocNumber=(formData?.nocnumber?.nocNumber).toString();
payload.additionalDetails.ownerName=conversionOwners.map(obj=>obj.name).join(',');

if (formData?.data?.registrationDetails) payload.additionalDetails.registrationDetails = formData?.data?.registrationDetails;
if (formData?.data?.applicationType) payload.additionalDetails.applicationType = formData?.data?.applicationType;
Expand Down Expand Up @@ -380,7 +381,7 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {
if (formData?.owners?.schemeName) payload.additionalDetails.schemeName = formData?.owners?.schemeName;
if (formData?.owners?.transferredscheme) payload.additionalDetails.transferredscheme = formData?.owners?.transferredscheme;
if (formData?.owners?.Ulblisttype?.code) payload.additionalDetails.Ulblisttype = formData?.owners?.Ulblisttype?.code;

if (formData?.owners?.uploadedFile) payload.additionalDetails.uploadedFileNoc = formData?.owners?.uploadedFile;

//For LandInfo
payload.landInfo = {};
Expand Down Expand Up @@ -507,7 +508,7 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {

return (
<div>
<Timeline currentStep={2} />
<Timeline currentStep={3} />
<FormStep config={config} onSelect={goNext} onSkip={onSkip} t={t} isDisabled={canmovenext || getCanMoveNextMultiple() || !ownershipCategory || isDisable} forcedError={t(error)}>
{!isLoading ?
<div style={{marginBottom: "10px"}}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Card, CardHeader, CardSubHeader, CardText,TextInput,CardLabel,CheckBox, LabelFieldPair, UploadFile,
CitizenInfoLabel, Header, LinkButton, Row, StatusTable, SubmitBar, Table, CardSectionHeader, EditIcon, PDFSvg, Loader
CitizenInfoLabel, Header, LinkButton, Row, StatusTable, SubmitBar, Table, CardSectionHeader, EditIcon, PDFSvg, Loader,TextArea
} from "@upyog/digit-ui-react-components";
import React,{ useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
Expand All @@ -27,6 +27,14 @@ import {

const tenantId = user?.info?.permanentCity || value?.tenantId ||Digit.ULBService.getCurrentTenantId() ;
const { isMdmsLoading, data: mdmsData } = Digit.Hooks.obps.useMDMS(state, "BPA", ["GaushalaFees","MalbaCharges","LabourCess"]);
const [otherChargesDisc, setOtherChargesDisc] = useState()
const [uploadedFile, setUploadedFile] = useState();
const [uploadedFileLess, setUploadedFileLess] = useState([]);
const [file, setFile] = useState();
const [uploadMessage, setUploadMessage] = useState("");
const [errorFile, setError] = useState(null);
const [docLessAdjustment, setDocuments] = useState({});
let acceptFormat = ".pdf"
let BusinessService;
if(value.businessService === "BPA_LOW")
BusinessService="BPA.LOW_RISK_PERMIT_FEE";
Expand Down Expand Up @@ -151,18 +159,50 @@ import {

const isValidMobileNumber = mobileNumber.length === 10 && /^[0-9]+$/.test(mobileNumber);



useEffect(() => {
(async () => {
setError(null);
if (file&& file?.type) {
if(!(acceptFormat?.split(",")?.includes(`.${file?.type?.split("/")?.pop()}`)))
{
setError(t("PT_UPLOAD_FORMAT_NOT_SUPPORTED"));
}
else if (file.size >= 2000000) {
setError(t("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
} else {
try {
const response = await Digit.UploadServices.Filestorage("property-upload", file, Digit.ULBService.getStateId());
if (response?.data?.files?.length > 0) {
setUploadedFileLess([...uploadedFileLess,{fileStoreId:response?.data?.files[0]?.fileStoreId, time:new Date()}]);
} else {
setError(t("PT_FILE_UPLOAD_ERROR"));
}
} catch (err) {
}
}
}
})();
}, [file]);
useEffect(()=>{
sessionStorage.setItem("uploadedFileLess",JSON.stringify(uploadedFileLess));
},[uploadedFileLess])


useEffect(()=>{
if (value?.additionalDetails?.lessAdjustmentFeeFiles?.length) {
const fileStoresIds = value?.additionalDetails?.lessAdjustmentFeeFiles.map((document,index) =>(index===value?.additionalDetails?.lessAdjustmentFeeFiles?.length-1 ? value?.additionalDetails?.lessAdjustmentFeeFiles[value?.additionalDetails?.lessAdjustmentFeeFiles?.length-1]?.fileStoreId : null));
Digit.UploadServices.Filefetch(fileStoresIds, state).then((res) => setDocuments(res?.data));
}
if(isEditApplication){
setDevelopment(value?.additionalDetails?.selfCertificationCharges?.BPA_DEVELOPMENT_CHARGES);
sessionStorage.setItem("development",value?.additionalDetails?.selfCertificationCharges?.BPA_DEVELOPMENT_CHARGES);
setOtherCharges(value?.additionalDetails?.selfCertificationCharges?.BPA_OTHER_CHARGES);
sessionStorage.setItem("otherCharges",value?.additionalDetails?.selfCertificationCharges?.BPA_OTHER_CHARGES);
setLessAdjusment(value?.additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT);
sessionStorage.setItem("lessAdjusment",value?.additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT);
setOtherChargesDisc(value?.additionalDetails?.otherFeesDiscription);
sessionStorage.setItem("otherChargesDisc",value?.additionalDetails?.otherFeesDiscription);
setUploadedFileLess(value?.additionalDetails?.lessAdjustmentFeeFiles);
}
let plotArea = parseInt(sessionStorage.getItem("plotArea")) || datafromAPI?.planDetail?.planInformation?.plotArea || value?.additionalDetails?.area;
const LabourCess = plotArea > 909 ?mdmsData?.BPA?.LabourCess[1].rate * plotArea : 0
Expand Down Expand Up @@ -349,6 +389,15 @@ setWaterCharges(Malbafees/2)
//alert("Please enter numbers")
}
}
function setOtherChargesDis(value) {
setOtherChargesDisc(value);
sessionStorage.setItem("otherChargesDisc",value) ;
}

function selectfile(e) {
setUploadedFile(e.target.files[0]);
setFile(e.target.files[0]);
}

return (
<React.Fragment>
Expand Down Expand Up @@ -520,15 +569,15 @@ setWaterCharges(Malbafees/2)
{<DocumentsPreview documents={getOrderDocuments(applicationDocs)} svgStyles = {{}} isSendBackFlow = {false} isHrLine = {true} titleStyles ={{fontSize: "18px", lineHeight: "24px", "fontWeight": 700, marginBottom: "10px"}}/>}
</StatusTable>
</Card>
<Card style={{paddingRight:"16px"}}>
<StatusTable>
{/*<Card style={{paddingRight:"16px"}}>
<StatusTable>
<CardHeader>{t("BPA_NOC_DETAILS_SUMMARY")}</CardHeader>
<LinkButton
label={<EditIcon style={{ marginTop: "-10px", float: "right", position: "relative", bottom: "32px" }} />}
style={{ width: "100px", display: "inline" }}
onClick={() => routeTo(`${routeLink}/noc-number`)}
/>
<Row className="border-none" label={t(`BPA_NOC_NUMBER`)} text={value?.additionalDetails?.nocNumber} />
<Row className="border-none" label={t(`BPA_NOC_NUMBER`)} text={value?.additionalDetails?.nocNumber} /> */}
{/* {nocDocuments && nocDocuments?.NocDetails.map((noc, index) => (
<div key={`noc-${index}`} style={nocDocuments?.NocDetails?.length > 1 ?{ marginTop: "19px", background: "#FAFAFA", border: "1px solid #D6D5D4", borderRadius: "4px", padding: "8px", lineHeight: "19px", maxWidth: "960px", minWidth: "280px" } : {}}>
<CardSectionHeader style={{marginBottom: "24px"}}>{`${t(`BPA_${noc?.nocType}_HEADER`)}`}</CardSectionHeader>
Expand All @@ -543,8 +592,8 @@ setWaterCharges(Malbafees/2)
</StatusTable>
</div>
))} */}
</StatusTable>
</Card>
{/* </StatusTable>
</Card> */}
<Card style={{paddingRight:"16px"}}>
<CardSubHeader>{t("BPA_SUMMARY_FEE_EST")}</CardSubHeader>
<StatusTable>
Expand Down Expand Up @@ -591,6 +640,16 @@ setWaterCharges(Malbafees/2)
//disable={editScreen}
{...{ required: true, pattern: /^[0-9]*$/ }}
/>
<CardLabel>{t("BPA_COMMON_OTHER_AMT_DISCRIPTION")}</CardLabel>
<TextArea
t={t}
type={"text"}
name="otherChargesDiscription"
defaultValue={value?.additionalDetails?.otherFeesDiscription }
value={otherChargesDisc}
onChange={(e) => {setOtherChargesDis(e.target.value)}}
{...{ required: true }}
/>
<CardLabel>{t("BPA_COMMON_LESS_AMT")}</CardLabel>
<TextInput
t={t}
Expand All @@ -605,6 +664,29 @@ setWaterCharges(Malbafees/2)
//disable={editScreen}
{...{ required: true, pattern: "^[0-9]*$" }}
/>
<CardLabel>{t("BPA_COMMON_LESS_AMT_FILE")}</CardLabel>
<UploadFile
id={"noc-doc"}
style={{marginBottom:"200px"}}
onUpload={selectfile}
onDelete={() => {
setUploadedFile(null);
setFile("");
}}
message={uploadedFile ? `1 ${t(`FILEUPLOADED`)}` : t(`ES_NO_FILE_SELECTED_LABEL`)}
error={errorFile}
uploadMessage={uploadMessage}
/>
{docLessAdjustment?.fileStoreIds?.length &&
<CardLabel style={{marginTop:"15px"}}>{t("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")}</CardLabel>
}
{docLessAdjustment?.fileStoreIds?.length &&
<a target="_blank" href={docLessAdjustment?.fileStoreIds[0]?.url}>
<PDFSvg />
</a>
}
<Row className="border-none"></Row>
<Row className="border-none" label={t(`BPA_P2_TOTAL_FEE`)} text={`₹ ${(parseInt(development)+parseInt(otherCharges)+parseInt(malbafees)+parseInt(labourCess)+parseInt(waterCharges)+parseInt(gaushalaFees))-parseInt(lessAdjusment)}`} />

</StatusTable>
<br></br>
Expand Down Expand Up @@ -672,7 +754,7 @@ setWaterCharges(Malbafees/2)
<hr style={{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}/>
{/* <CardHeader>{t("BPA_COMMON_TOTAL_AMT")}</CardHeader>
<CardHeader>₹ {paymentDetails?.Bill?.[0]?.billDetails[0]?.amount || "0"}</CardHeader> */}
<SubmitBar label={t("BPA_SEND_TO_CITIZEN_LABEL")} onSubmit={onSubmitCheck} disabled={ (!development||!otherCharges||!lessAdjusment || !agree || !isOTPVerified)} id/>
<SubmitBar label={t("BPA_SEND_TO_CITIZEN_LABEL")} onSubmit={onSubmitCheck} disabled={ (!development||!otherCharges||!lessAdjusment || !agree || !isOTPVerified || !otherChargesDisc)} id/>
</Card>
</React.Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,8 @@ export const convertToBPAObject = (data, isOCBPA = false, isSendBackTOCitizen =
auditDetails: data?.auditDetails,
additionalDetails: {
...data?.additionalDetails,
otherFeesDiscription:sessionStorage.getItem("otherChargesDisc"),
lessAdjustmentFeeFiles:JSON.parse(sessionStorage.getItem("uploadedFileLess")),
selfCertificationCharges:{
"BPA_MALBA_CHARGES" : sessionStorage.getItem("Malbafees"),
"BPA_LABOUR_CESS": sessionStorage.getItem("LabourCess"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ const ActionModal = ({ t, action, tenantId, state, id, closeModal, submitAction,
applicationData.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development");
applicationData.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges");
applicationData.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment");
applicationData.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc");
applicationData.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));

const nocDetails = applicationDetails?.nocData?.map(noc => {
const uploadedDocuments = Digit.SessionStorage.get(noc?.nocType) || [];
Expand Down
Loading

0 comments on commit b034359

Please sign in to comment.