Skip to content

Commit

Permalink
Merge pull request #977 from deepa-s-13/Dev-2.0
Browse files Browse the repository at this point in the history
OBPAS changes
  • Loading branch information
sriranjan-s authored Mar 11, 2024
2 parents e48f94b + 6196630 commit 12f8333
Show file tree
Hide file tree
Showing 16 changed files with 110 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ export const OBPSService = {
{ title: "BPA_KHATHA_NUMBER_LABEL", value: edcr?.planDetail?.planInformation?.khataNo || "NA", isNotTranslated: true },
{ title: "BPA_HOLDING_NUMBER_LABEL", value: BPA?.additionalDetails?.holdingNo || "NA", isNotTranslated: true },
{ title: "BPA_BOUNDARY_LAND_REG_DETAIL_LABEL", value: BPA?.additionalDetails?.registrationDetails || "NA", isNotTranslated: true },
//{ title: "BPA_BOUNDARY_WALL_LENGTH_LABEL", value: BPA?.additionalDetails?.boundaryWallLength || "NA", isNotTranslated: true }
{ title: "BPA_BOUNDARY_WALL_LENGTH_LABEL", value: BPA?.additionalDetails?.boundaryWallLength || "NA", isNotTranslated: true }
]
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ const EmployeeChallan = (props) => {

const challanDownload = {
order: 1,
label: t("PDF_STATIC_LABEL_CONSOLIDATED_RECEIPT_LETTER_HEAD"),
label: t("UC_CHALLAN"),
onClick: () => downloadAndPrintChallan(challanno),
};

const receiptDownload = {
order: 2,
label: t("RECEIPT"),
label: t("Receipt"),
onClick: () => downloadAndPrintReciept(challanDetails?.businessService, challanno),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,17 @@ export const downloadAndPrintChallan = async (challanNo, mode = "download") => {

export const downloadAndPrintReciept = async (bussinessService, consumerCode, mode = "download") => {
const tenantId = Digit.ULBService.getCurrentTenantId();
const response = await Digit.MCollectService.receipt_download(bussinessService, consumerCode, tenantId);
const data = await Digit.PaymentService.getReciept(tenantId, bussinessService,{ consumerCodes: consumerCode });
const payments=data?.Payments[0];
let response=null;
if (payments?.fileStoreIdS ) {
response = { filestoreIds: [payments?.fileStoreId] };
}
else{
response = await Digit.PaymentService.generatePdf(tenantId, { Payments: [{...payments}] }, "consolidatedreceipt");
}
const fileStore = await Digit.PaymentService.printReciept(tenantId, { fileStoreIds: response.filestoreIds[0] });
window.open(fileStore[response?.filestoreIds[0]], "_blank");
const responseStatus = parseInt(response.status, 10);
if (responseStatus === 201 || responseStatus === 200) {
let fileName =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ export const newConfig = [
},
name: "registrationDetails"
},
// {
// label: "BPA_BOUNDARY_WALL_LENGTH_LABEL",
// type: "text",
// validation: {},
// name: "boundaryWallLength"
// }
{
label: "BPA_BOUNDARY_WALL_LENGTH_LABEL",
type: "text",
validation: {},
name: "boundaryWallLength"
}
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ export const newConfig = [
validation: {},
name: "registrationDetails"
},
// {
// label: "BPA_BOUNDARY_WALL_LENGTH_LABEL",
// type: "text",
// validation: {},
// name: "boundaryWallLength"
// },
{
label: "BPA_BOUNDARY_WALL_LENGTH_LABEL",
type: "text",
validation: {},
name: "boundaryWallLength"
},
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ const DocsRequired = ({ onSelect, onSkip, config }) => {

useEffect(() => {
let architectName = "", isDone = true;
let isSelfCertificationRequired;
for (let i = 0; i < LicenseData?.Licenses?.length; i++) {
if (LicenseData?.Licenses?.[i]?.status === "APPROVED" && isDone) {
isDone = false;
architectName = LicenseData?.Licenses?.[i]?.tradeLicenseDetail?.tradeUnits?.[0]?.tradeType?.split('.')[0] || "ARCHITECT";
sessionStorage.setItem("BPA_ARCHITECT_NAME", JSON.stringify(architectName));
isSelfCertificationRequired=LicenseData?.Licenses?.[i]?.tradeLicenseDetail.additionalDetail.isSelfCertificationRequired;
sessionStorage.setItem("isSelfCertificationRequired", isSelfCertificationRequired);
}
}
}, [LicenseData])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {

// Additonal details
payload.additionalDetails = {GISPlaceName:formData?.address?.placeName};
payload.additionalDetails.boundaryWallLength = formData?.data?.boundaryWallLength || "NA";
payload.additionalDetails.area = formData?.data.edcrDetails.planDetail.planInformation.plotArea|| "NA";
payload.additionalDetails.height = formData?.data.edcrDetails.planDetail.blocks[0].building.buildingHeight || "NA";
payload.additionalDetails.isSelfCertificationRequired= formData?.data?.isSelfCertificationRequired || "NA";
payload.additionalDetails.usage = formData?.data.occupancyType || "NA";

if (formData?.data?.holdingNumber) payload.additionalDetails.holdingNo = formData?.data?.holdingNumber;
//if (formData?.data?.boundaryWallLength) payload.additionalDetails.boundaryWallLength = formData?.data?.boundaryWallLength;
if (formData?.data?.registrationDetails) payload.additionalDetails.registrationDetails = formData?.data?.registrationDetails;
Expand Down Expand Up @@ -354,8 +360,51 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {
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;
// create BPA call
Digit.OBPSService.create({ BPA: payload }, tenantId)
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 => {
Expand All @@ -378,6 +427,7 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {
setIsDisable(false);
setShowToast({ key: "true", error: true, message: e?.response?.data?.Errors[0]?.message });
});
}
} else {
onSelect(config.key, ownerStep);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { Card, CardCaption, TextInput, CardHeader, Label, StatusTable, Row, SubmitBar, Loader, FormStep } from "@upyog/digit-ui-react-components";
import React, { useState } from "react";
import { Card,CardLabel, CardCaption, TextInput, CardHeader, Label, StatusTable, Row, SubmitBar, Loader, FormStep } from "@upyog/digit-ui-react-components";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import Timeline from "../components/Timeline";

const PlotDetails = ({ formData, onSelect, config }) => {
const { t } = useTranslation();
const [holdingNumber, setHoldingNumber] = useState("");
//const [boundaryWallLength, setBoundaryWallLength] = useState("");
const [boundaryWallLength, setBoundaryWallLength] = useState("");
const [registrationDetails, setRegistrationDetails] = useState("");
const tenantId = Digit.ULBService.getCurrentTenantId();
const checkingFlow = formData?.uiFlow?.flow;
const state = Digit.ULBService.getStateId();
let [isNextDisabled,setIsNextDisabled] =useState(true);
const { data, isLoading } = Digit.Hooks.obps.useScrutinyDetails(state, formData?.data?.scrutinyNumber)

const handleSubmit = (data) => {
Expand All @@ -23,10 +24,18 @@ const PlotDetails = ({ formData, onSelect, config }) => {
return <Loader />;
}

function onChange(data){
if(data.target.name=="boundaryWallLength" && isNaN(parseInt(data.target.value))==false) {
setIsNextDisabled(false);
}
else if(data.target.name=="boundaryWallLength" && isNaN(parseInt(data.target.value))==true){
setIsNextDisabled(true);
}
}
return (
<div>
<Timeline flow= {checkingFlow === "OCBPA" ? "OCBPA" : ""}/>
<FormStep config={config} onSelect={handleSubmit} childrenAtTheBottom={false} t={t} _defaultValues={formData?.data} onSkip={onSkip}>
<FormStep config={config} onSelect={handleSubmit} childrenAtTheBottom={false} t={t} _defaultValues={formData?.data} onSkip={onSkip} onChange={onChange} isDisabled={isNextDisabled}>
<StatusTable>
<Row className="border-none" label={t(`BPA_BOUNDARY_PLOT_AREA_LABEL`)} text={data?.planDetail?.planInformation?.plotArea ? `${data?.planDetail?.planInformation?.plotArea} ${t(`BPA_SQ_FT_LABEL`)}` : "NA"} />
<Row className="border-none" label={t(`BPA_PLOT_NUMBER_LABEL`)} text={data?.planDetail?.planInformation?.plotNo} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const ScrutinyDetails = ({ onSelect, userType, formData, config }) => {
// Additonal details
payload.additionalDetails = {};
if (formData?.data?.holdingNumber) payload.additionalDetails.holdingNo = formData?.data?.holdingNumber;
//if (formData?.data?.boundaryWallLength) payload.additionalDetails.boundaryWallLength = formData?.data?.boundaryWallLength;
if (formData?.data?.boundaryWallLength) payload.additionalDetails.boundaryWallLength = formData?.data?.boundaryWallLength;
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const getBPAEditDetails = async (data, APIScrutinyDetails,mdmsData,nocdata,t) =>
applicationDate: data?.auditDetails?.createdTime,
applicationType: APIScrutinyDetails?.appliactionType,
holdingNumber: data?.additionalDetails?.holdingNo,
//boundaryWallLength: data?.additionalDetails?.boundaryWallLength,
boundaryWallLength: data?.additionalDetails?.boundaryWallLength,
occupancyType: APIScrutinyDetails?.planDetail?.planInformation?.occupancy,
registrationDetails: data?.additionalDetails?.registrationDetails,
riskType: Digit.Utils.obps.calculateRiskType(mdmsData?.BPA?.RiskTypeComputation, APIScrutinyDetails?.planDetail?.plot?.area, APIScrutinyDetails?.planDetail?.blocks),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ import {
return <Loader />
}

console.log("DATA",data)

return (
<React.Fragment>
<Timeline currentStep={4} />
Expand Down Expand Up @@ -189,7 +189,7 @@ import {
<Row className="border-none" label={t(`BPA_KHATHA_NUMBER_LABEL`)} text={datafromAPI?.planDetail?.planInformation?.khataNo || t("CS_NA")}/>
<Row className="border-none" label={t(`BPA_HOLDING_NUMBER_LABEL`)} text={data?.holdingNumber || t("CS_NA")} />
<Row className="border-none" label={t(`BPA_BOUNDARY_LAND_REG_DETAIL_LABEL`)} text={data?.registrationDetails || t("CS_NA")} />
{/* <Row className="border-none" label={t(`BPA_BOUNDARY_WALL_LENGTH_LABEL`)} text={data?.boundaryWallLength|| t("CS_NA")} /> */}
<Row className="border-none" label={t(`BPA_BOUNDARY_WALL_LENGTH_LABEL`)} text={data?.boundaryWallLength|| t("CS_NA")} />
</StatusTable>
</Card>
<Card style={{paddingRight:"16px"}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const newConfig1=[
"header": "BPA_PLOT_DETAILS_TITLE",
"cardText": "",
"submitBarLabel": "CS_COMMON_NEXT",
"skipText": "CORE_COMMON_SKIP_CONTINUE"
//"skipText": "CORE_COMMON_SKIP_CONTINUE"
},
"inputs": [
{
Expand All @@ -36,12 +36,12 @@ export const newConfig1=[
"validation": {},
"name": "registrationDetails"
},
// {
// "label": "BPA_BOUNDARY_WALL_LENGTH_LABEL",
// "type": "text",
// "validation": {},
// "name": "boundaryWallLength"
// },
{
"label": "BPA_BOUNDARY_WALL_LENGTH_LABEL",
"type": "text",
"validation": {},
"name": "boundaryWallLength"
},

]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const CheckPage = ({ onSubmit, value }) => {
<Row className="border-none" label={`${t(`BPA_KHATHA_NUMBER_LABEL`)}`} text={datafromAPI?.planDetail?.planInformation?.khataNo || t("CS_NA")} />
<Row className="border-none" label={`${t(`BPA_HOLDING_NUMBER_LABEL`)}`} text={data?.holdingNumber || t("CS_NA")} />
<Row className="border-none" label={`${t(`BPA_BOUNDARY_LAND_REG_DETAIL_LABEL`)}`} text={data?.registrationDetails || t("CS_NA")} />
{/* <Row className="border-none" label={`${t(`BPA_BOUNDARY_WALL_LENGTH_LABEL`)}`} text={ data?.boundaryWallLength || t("CS_NA")} /> */}
<Row className="border-none" label={`${t(`BPA_BOUNDARY_WALL_LENGTH_LABEL`)}`} text={ data?.boundaryWallLength || t("CS_NA")} />
</StatusTable>
</Card>
<Card style={{paddingRight:"16px"}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ const CheckPage = ({ onSubmit, value }) => {
<Row className="border-none" label={t(`BPA_KHATHA_NUMBER_LABEL`)} text={datafromAPI?.planDetail?.planInformation?.khataNo || t("CS_NA")} />
<Row className="border-none" label={t(`BPA_HOLDING_NUMBER_LABEL`)} text={data?.holdingNumber || t("CS_NA")} />
<Row className="border-none" label={t(`BPA_BOUNDARY_LAND_REG_DETAIL_LABEL`)} text={data?.registrationDetails || t("CS_NA")} />
{/* <Row className="border-none" label={t(`BPA_BOUNDARY_WALL_LENGTH_LABEL`)} text={ data?.boundaryWallLength ||t("CS_NA")} /> */}
<Row className="border-none" label={t(`BPA_BOUNDARY_WALL_LENGTH_LABEL`)} text={ data?.boundaryWallLength ||t("CS_NA")} />
</StatusTable>
</Card>
<Card style={{paddingRight:"16px"}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const getBPAEditDetails = async (data, APIScrutinyDetails,mdmsData,nocdata,t,OCD
applicationDate: data?.auditDetails?.createdTime,
applicationType: APIScrutinyDetails?.appliactionType,
holdingNumber: data?.additionalDetails?.holdingNo,
//boundaryWallLength: data?.additionalDetails?.boundaryWallLength,
boundaryWallLength: data?.additionalDetails?.boundaryWallLength,
bpaData:OCData,
occupancyType: APIScrutinyDetails?.planDetail?.planInformation?.occupancy,
registrationDetails: data?.additionalDetails?.registrationDetails,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const getBPAFormData = async (data, mdmsData, history, t) => {
applicationDate: data?.auditDetails?.createdTime,
applicationType: APIScrutinyDetails?.appliactionType,
holdingNumber: data?.additionalDetails?.holdingNo,
//boundaryWallLength:data?.additionalDetails?.boundaryWallLength,
boundaryWallLength:data?.additionalDetails?.boundaryWallLength,
occupancyType: APIScrutinyDetails?.planDetail?.planInformation?.occupancy,
registrationDetails: data?.additionalDetails?.registrationDetails,
riskType: Digit.Utils.obps.calculateRiskType(
Expand Down Expand Up @@ -409,7 +409,7 @@ export const convertToBPAObject = (data, isOCBPA = false, isSendBackTOCitizen =
...data?.additionalDetails,
GISPlaceName : data?.address?.placeName,
holdingNo: data?.data?.holdingNumber ? data?.data?.holdingNumber : data?.additionalDetails?.holdingNo,
//boundaryWallLength:data?.data?.boundaryWallLength ? data?.data?.boundaryWallLength : data?.additionalDetails?.boundaryWallLength ,
boundaryWallLength:data?.data?.boundaryWallLength ? data?.data?.boundaryWallLength : data?.additionalDetails?.boundaryWallLength ,
registrationDetails: data?.data?.registrationDetails ? data?.data?.registrationDetails : data?.additionalDetails?.registrationDetails,
},
applicationType: "BUILDING_PLAN_SCRUTINY",
Expand Down Expand Up @@ -555,7 +555,7 @@ export const getBPAEditDetails = async (data, APIScrutinyDetails, mdmsData, nocd
applicationDate: data?.auditDetails?.createdTime,
applicationType: APIScrutinyDetails?.appliactionType,
holdingNumber: data?.additionalDetails?.holdingNo,
//boundaryWallLength: data?.additionalDetails?.boundaryWallLength,
boundaryWallLength: data?.additionalDetails?.boundaryWallLength,
occupancyType: APIScrutinyDetails?.planDetail?.planInformation?.occupancy,
registrationDetails: data?.additionalDetails?.registrationDetails,
riskType: Digit.Utils.obps.calculateRiskType(
Expand Down

0 comments on commit 12f8333

Please sign in to comment.