Skip to content

Commit

Permalink
Merge pull request #1067 from deepa-s-13/Dev-2.0
Browse files Browse the repository at this point in the history
OBPAS changes
  • Loading branch information
ashutoshpatnaik12 authored Apr 19, 2024
2 parents 96acacb + 8fd9bf6 commit b53596e
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ const InspectionReportForm = (_props) => {
{questionList && questionList.map((ob, ind) => (
<div key={ind} className="fieldInsepctionInsideWrapper" style={{ maxWidth: "100%" }}>
<LabelFieldPair style={{width :"100%"}}>
<CardLabel style={{ marginRight: "30px", width :"100%" }} className="card-label-smaller">{`${t(ob.question)}*`}</CardLabel>
<CardLabel style={{ marginRight: "30px", width :"100%" }} className="card-label-smaller">{`${t(ob.question)}`}</CardLabel>
<div className="field" style={{ width: "100%" }}>
<Controller
control={control}
name={`question_${ind}`}
rules={{ required: t("REQUIRED_FIELD") }}
//rules={{ required: t("REQUIRED_FIELD") }}
render={(props) => (
<Dropdown
className="form-field"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function SelectDocument({
<LabelFieldPair style={{width :"100%"}}>
<CardLabel className="card-label-smaller" style={{width :"100%"}}>
{doc?.documentType != "OLDLICENCENO" ?
`${t(`${doc?.documentType.replaceAll(".", "_")}`)}*` :
`${t(`${doc?.documentType.replaceAll(".", "_")}`)}` :
`${t(`${doc?.documentType.replaceAll(".", "_")}`)}`}
</CardLabel>
<div className="field" style={{ width: "100%" }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ setWaterCharges(Malbafees/2)
isMandatory={false}
optionKey="i18nKey"
name="email"
defaultValue={value?.additionalDetails?.selfCertificationCharges?.BPA_DEVELOPMENT_CHARGES || ""}
defaultValue={value?.additionalDetails?.selfCertificationCharges?.BPA_DEVELOPMENT_CHARGES }
value={development}
onChange={(e) => {setDevelopment(e.target.value),sessionStorage.setItem("development",e.target.value)}}
//disable={userInfo?.info?.emailId && !isOpenLinkFlow ? true : false}
Expand All @@ -393,7 +393,7 @@ setWaterCharges(Malbafees/2)
isMandatory={false}
optionKey="i18nKey"
name="email"
defaultValue={value?.additionalDetails?.selfCertificationCharges?.BPA_OTHER_CHARGES || ""}
defaultValue={value?.additionalDetails?.selfCertificationCharges?.BPA_OTHER_CHARGES }
value={otherCharges}
onChange={(e) => {setOtherCharges(e.target.value),sessionStorage.setItem("otherCharges",e.target.value)}}
//disable={userInfo?.info?.emailId && !isOpenLinkFlow ? true : false}
Expand All @@ -407,7 +407,7 @@ setWaterCharges(Malbafees/2)
isMandatory={false}
optionKey="i18nKey"
name="email"
defaultValue={value?.additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT || ""}
defaultValue={value?.additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT }
value={lessAdjusment}
onChange={(e) => {setLessAdjusment(e.target.value),sessionStorage.setItem("lessAdjusment",e.target.value)}}
//disable={userInfo?.info?.emailId && !isOpenLinkFlow ? true : false}
Expand All @@ -419,7 +419,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={onSubmit} disabled={(!isEditApplication) && (!development||!otherCharges||!lessAdjusment)} id/>
<SubmitBar label={t("BPA_SEND_TO_CITIZEN_LABEL")} onSubmit={onSubmit} disabled={ (!development||!otherCharges||!lessAdjusment)} id/>
</Card>
</React.Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ const EmployeeApp = ({ path }) => {
<Switch>
<PrivateRoute path={`${path}/stakeholder-inbox/stakeholder/:id`} component={ApplicationDetail} />
<PrivateRoute path={`${path}/search/application/stakeholder/:id`} component={ApplicationDetail} />
<PrivateRoute path={`${path}/search/application/editApplication/bpa/:id`} component={BpaApplicationDetail} />
<PrivateRoute path={`${path}/search/application/bpa/:id`} component={BpaApplicationDetail} />
<PrivateRoute path={`${path}/search/application`} component={(props) => <Search {...props} parentRoute={path} />} />
<PrivateRoute path={`${path}/inbox/editApplication/bpa/:id`} component={BpaApplicationDetail} />
<PrivateRoute path={`${path}/inbox/bpa/:id`} component={BpaApplicationDetail} />
<PrivateRoute path={`${path}/inbox`} component={(props) => <Inbox {...props} parentRoute={path} />} />
<PrivateRoute path={`${path}/stakeholder-inbox`} component={(props) => <StakeholderInbox {...props} parentRoute={path} />} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function ApplicationDetailsContent({
isInfoLabel = false
}) {
const { t } = useTranslation();

let isEditApplication=window.location.href.includes("editApplication") && window.location.href.includes("bpa") ;
const ownersSequences= applicationDetails?.applicationData?.owners
console.log("appl", applicationDetails)

Expand Down Expand Up @@ -350,7 +350,7 @@ console.log("appl", applicationDetails)
</div>
{detail?.belowComponent && <detail.belowComponent />}
{detail?.additionalDetails?.inspectionReport && (
<ScruntinyDetails scrutinyDetails={detail?.additionalDetails} paymentsList={paymentsList} />
<ScruntinyDetails scrutinyDetails={detail?.additionalDetails} paymentsList={paymentsList} additionalDetails={applicationDetails?.applicationData?.additionalDetails} />
)}
{applicationDetails?.applicationData?.additionalDetails?.fieldinspection_pending?.length > 0 && detail?.additionalDetails?.fiReport && (
<InspectionReport fiReport={applicationDetails?.applicationData?.additionalDetails?.fieldinspection_pending} />
Expand All @@ -370,7 +370,7 @@ console.log("appl", applicationDetails)
{detail?.additionalDetails?.owners && <PropertyOwners owners={detail?.additionalDetails?.owners} />}
{detail?.additionalDetails?.units && <TLTradeUnits units={detail?.additionalDetails?.units} />}
{detail?.additionalDetails?.accessories && <TLTradeAccessories units={detail?.additionalDetails?.accessories} />}
{detail?.additionalDetails?.permissions && workflowDetails?.data?.nextActions?.length > 0 && (
{!isEditApplication && detail?.additionalDetails?.permissions && workflowDetails?.data?.nextActions?.length > 0 && (
<PermissionCheck applicationData={applicationDetails?.applicationData} t={t} permissions={detail?.additionalDetails?.permissions} />
)}
{detail?.additionalDetails?.obpsDocuments && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
import { StatusTable, Row, PDFSvg, CardLabel, CardSubHeader } from "@upyog/digit-ui-react-components";
import React, { Fragment } from "react";
import { StatusTable, Row, PDFSvg, CardLabel, CardSubHeader,TextInput } from "@upyog/digit-ui-react-components";
import React, { Fragment,useEffect,useState } from "react";
import { useTranslation } from "react-i18next";

const ScruntinyDetails = ({ scrutinyDetails, paymentsList=[] }) => {
const ScruntinyDetails = ({ scrutinyDetails, paymentsList=[],additionalDetails }) => {
const isEditApplication = window.location.href.includes("editApplication") && window.location.href.includes("bpa") ;
const [development, setDevelopment] = useState()
const [otherCharges, setOtherCharges] = useState()
const [lessAdjusment, setLessAdjusment] = useState()
useEffect(()=>{
setDevelopment(additionalDetails?.selfCertificationCharges?.BPA_DEVELOPMENT_CHARGES);
sessionStorage.setItem("development",additionalDetails?.selfCertificationCharges?.BPA_DEVELOPMENT_CHARGES);
setOtherCharges(additionalDetails?.selfCertificationCharges?.BPA_OTHER_CHARGES);
sessionStorage.setItem("otherCharges",additionalDetails?.selfCertificationCharges?.BPA_OTHER_CHARGES);
setLessAdjusment(additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT);
sessionStorage.setItem("lessAdjusment",additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT);
},[additionalDetails])

const { t } = useTranslation();
let count = 0;
const getTextValues = (data) => {
Expand All @@ -26,6 +39,58 @@ const ScruntinyDetails = ({ scrutinyDetails, paymentsList=[] }) => {
return <CardLabel style={{fontWeight:"400"}}>{value?.title}</CardLabel>
})}
</div>
{window.location.href.includes("employee") && scrutinyDetails?.values[0]?.title=="BPA_APPL_FEES_DETAILS" &&
<div>
<CardSubHeader>{t("BPA_P2_SUMMARY_FEE_EST")}</CardSubHeader>
<Row className="border-none" label={t(`BPA_COMMON_MALBA_AMT`)} text={`₹ ${additionalDetails?.selfCertificationCharges?.BPA_MALBA_CHARGES}`} />
<Row className="border-none" label={t(`BPA_COMMON_LABOUR_AMT`)} text={`₹ ${additionalDetails?.selfCertificationCharges?.BPA_LABOUR_CESS}`} />
<Row className="border-none" label={t(`BPA_COMMON_WATER_AMT`)} text={`₹ ${additionalDetails?.selfCertificationCharges?.BPA_WATER_CHARGES}`} />
<Row className="border-none" label={t(`BPA_COMMON_GAUSHALA_AMT`)} text={`₹ ${additionalDetails?.selfCertificationCharges?.BPA_GAUSHALA_CHARGES_CESS}`} />
<CardSubHeader>{t("BPA_P2_SUMMARY_FEE_EST_MANUAL")}</CardSubHeader>
{/* <Row className="border-none" label={t(`BPA_COMMON_DEVELOPMENT_AMT`)} text={`₹ ${additionalDetails?.selfCertificationCharges?.BPA_DEVELOPMENT_CHARGES}`} />
<Row className="border-none" label={t(`BPA_COMMON_OTHER_AMT`)} text={`₹ ${additionalDetails?.selfCertificationCharges?.BPA_OTHER_CHARGES}`} />
<Row className="border-none" label={t(`BPA_COMMON_LESS_AMT`)} text={`₹ ${additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT}`} /> */}
<CardLabel>{t("BPA_COMMON_DEVELOPMENT_AMT")}</CardLabel>
<TextInput
t={t}
type={"text"}
isMandatory={false}
optionKey="i18nKey"
name="development"
defaultValue={additionalDetails?.selfCertificationCharges?.BPA_DEVELOPMENT_CHARGES || ""}
value={development}
disabled={!isEditApplication}
onChange={(e) => {setDevelopment(e.target.value),sessionStorage.setItem("development",e.target.value)}}
/>
<CardLabel>{t("BPA_COMMON_OTHER_AMT")}</CardLabel>
<TextInput
t={t}
type={"text"}
isMandatory={false}
optionKey="i18nKey"
name="otherCharges"
defaultValue={additionalDetails?.selfCertificationCharges?.BPA_OTHER_CHARGES || ""}
value={otherCharges}
disabled={!isEditApplication}
onChange={(e) => {setOtherCharges(e.target.value),sessionStorage.setItem("otherCharges",e.target.value)}}
//disable={userInfo?.info?.emailId && !isOpenLinkFlow ? true : false}
//disable={editScreen}
//{...{ required: true, pattern: "[A-Za-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$", type: "email", title: t("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID") }}
/>
<CardLabel>{t("BPA_COMMON_LESS_AMT")}</CardLabel>
<TextInput
t={t}
type={"text"}
isMandatory={false}
optionKey="i18nKey"
name="lessAdjusment"
defaultValue={additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT || ""}
value={lessAdjusment}
disabled={!isEditApplication}
onChange={(e) => {setLessAdjusment(e.target.value),sessionStorage.setItem("lessAdjusment",e.target.value)}}
/>
</div>
}
<div>
{scrutinyDetails?.scruntinyDetails?.map((report, index) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useQueryClient } from "react-query";

import { Loader } from "@upyog/digit-ui-react-components";
import { Loader,SubmitBar } from "@upyog/digit-ui-react-components";

import ActionModal from "./Modal";

Expand All @@ -13,6 +13,7 @@ import ApplicationDetailsActionBar from "./components/ApplicationDetailsActionBa
import ApplicationDetailsWarningPopup from "./components/ApplicationDetailsWarningPopup";

const ApplicationDetails = (props) => {
let isEditApplication=window.location.href.includes("editApplication") && window.location.href.includes("bpa") ;
const tenantId = Digit.ULBService.getCurrentTenantId();
const state = Digit.ULBService.getStateId();
const { t } = useTranslation();
Expand Down Expand Up @@ -58,6 +59,9 @@ const ApplicationDetails = (props) => {

function onActionSelect(action) {
if (action) {
if(action?.action=="EDIT"){
window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]);
}
if(action?.isToast){
setShowToast({ key: "error", error: { message: action?.toastMessage } });
setTimeout(closeToast, 5000);
Expand All @@ -76,7 +80,7 @@ const ApplicationDetails = (props) => {
else {
window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${action?.redirectionUrll?.pathname}`);
}
} else if (!action?.redirectionUrl) {
} else if (!action?.redirectionUrl && action?.action!="EDIT") {
setShowModal(true);
} else {
history.push({
Expand Down Expand Up @@ -189,6 +193,28 @@ const ApplicationDetails = (props) => {
if (isLoading || isEnableLoader) {
return <Loader />;
}
const onSubmit =async(data)=> {
const bpaApplicationDetails = await Digit.OBPSService.BPASearch(tenantId, {applicationNo: applicationData?.applicationNo});
const bpaDetails={
BPA:bpaApplicationDetails.BPA[0]
}
//bpaDetails.BPA.riskType="HIGH"
bpaDetails.BPA.workflow={
"action": "EDIT",
"assignes": [],
"comments": null,
"varificationDocuments": null
}
bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development");
bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges");
bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment");
if (!bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES || !bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES || !bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT ){
alert("Please fill P2 Manual Fees");}
else{
const response = await Digit.OBPSService.update(bpaDetails, tenantId);
window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1]);
}
};

return (
<React.Fragment>
Expand Down Expand Up @@ -235,7 +261,8 @@ const ApplicationDetails = (props) => {
/>
) : null}
<ApplicationDetailsToast t={t} showToast={showToast} closeToast={closeToast} businessService={businessService} />
<ApplicationDetailsActionBar
{!isEditApplication? (
<ApplicationDetailsActionBar
workflowDetails={workflowDetails}
displayMenu={displayMenu}
onActionSelect={onActionSelect}
Expand All @@ -245,6 +272,9 @@ const ApplicationDetails = (props) => {
ActionBarStyle={ActionBarStyle}
MenuStyle={MenuStyle}
/>
):(<div >
<SubmitBar style={{ marginRight:20}} label={t("BPA_EDIT_UPDATE")} onSubmit={onSubmit} id/>
</div>)}
</React.Fragment>
) : (
<Loader />
Expand Down

0 comments on commit b53596e

Please sign in to comment.