Skip to content

Commit

Permalink
Merge pull request #1174 from deepa-s-13/Dev-2.0
Browse files Browse the repository at this point in the history
OBPAS CHANGES: SELF CERTIFICATION
  • Loading branch information
sriranjan-s authored Jul 2, 2024
2 parents fc81fe8 + d76da6e commit e82cae7
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ export const OBPSService = {
{ title: "BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL", value: edcr?.applicationSubType },
{ title: "BPA_BASIC_DETAILS_OCCUPANCY_LABEL", value: edcr?.planDetail?.planInformation?.occupancy },
{ title: "BPA_BASIC_DETAILS_RISK_TYPE_LABEL", value: `WF_BPA_${riskType}`, isInsert: true, },
{ title: "BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL", value: edcr?.planDetail?.planInformation?.applicantName },
// { title: "BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL", value: edcr?.planDetail?.planInformation?.applicantName },
]
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ const getMohallaLocale = (value = "", tenantId = "") => {
title: t("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),
value: t(`WF_BPA_${application?.riskType}`) || "NA"
},
{
title: t("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),
value: application?.data?.edcrDetails?.planDetail?.planInformation?.applicantName || "NA"
},
// {
// title: t("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),
// value: application?.data?.edcrDetails?.planDetail?.planInformation?.applicantName || "NA"
// },

]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,22 @@ setWaterCharges(Malbafees/2)
}

function onSubmitCheck(){
if(development && otherCharges && lessAdjusment){
if(!development){
sessionStorage.setItem("development",0)
}
if(!lessAdjusment){
sessionStorage.setItem("lessAdjusment",0)
}
if(!otherCharges){
sessionStorage.setItem("otherCharges",0)
}
if(parseInt(lessAdjusment)>(parseInt(development)+parseInt(otherCharges)+parseInt(malbafees)+parseInt(labourCess)+parseInt(waterCharges)+parseInt(gaushalaFees))){
alert(t("Enterd Less Adjustment amount is invalid"));
}
else{
onSubmit();
}
}}
}
}

function setOtherChargesVal(value) {
if(/^[0-9]*$/.test(value)){
Expand Down Expand Up @@ -433,7 +441,7 @@ function selectfile(e) {
<Row className="border-none" label={t(`BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL`)} text={t(data?.serviceType)} />
<Row className="border-none" label={t(`BPA_BASIC_DETAILS_OCCUPANCY_LABEL`)} text={data?.occupancyType}/>
<Row className="border-none" label={t(`BPA_BASIC_DETAILS_RISK_TYPE_LABEL`)} text={t(`WF_BPA_${data?.riskType}`)} />
<Row className="border-none" label={t(`BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL`)} text={data?.applicantName} />
{/* <Row className="border-none" label={t(`BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL`)} text={data?.applicantName} /> */}
</StatusTable>
</Card>
<Card style={{paddingRight:"16px"}}>
Expand Down Expand Up @@ -659,6 +667,9 @@ function selectfile(e) {
//disable={editScreen}
{...{ required: true, pattern: /^[0-9]*$/ }}
/>
{parseInt(otherCharges)>0?
(
<div>
<CardLabel>{t("BPA_COMMON_OTHER_AMT_DISCRIPTION")}</CardLabel>
<TextArea
t={t}
Expand All @@ -668,7 +679,8 @@ function selectfile(e) {
value={otherChargesDisc}
onChange={(e) => {setOtherChargesDis(e.target.value)}}
{...{ required: true }}
/>
/></div>):null
}
<CardLabel>{t("BPA_COMMON_LESS_AMT")}</CardLabel>
<TextInput
t={t}
Expand All @@ -683,8 +695,10 @@ function selectfile(e) {
//disable={editScreen}
{...{ required: true, pattern: "^[0-9]*$" }}
/>
<CardLabel>{t("BPA_COMMON_LESS_AMT_FILE")}</CardLabel>
<UploadFile
{parseInt(lessAdjusment)>0 ?(
<div>
<CardLabel>{t("BPA_COMMON_LESS_AMT_FILE")}</CardLabel>
<UploadFile
id={"noc-doc"}
style={{marginBottom:"200px"}}
onUpload={selectfile}
Expand All @@ -696,10 +710,13 @@ function selectfile(e) {
error={errorFile}
uploadMessage={uploadMessage}
/>
{docLessAdjustment?.fileStoreIds?.length &&
</div>
):null
}
{(docLessAdjustment?.fileStoreIds?.length && parseInt(value?.additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT)>0) &&
<CardLabel style={{marginTop:"15px"}}>{t("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")}</CardLabel>
}
{docLessAdjustment?.fileStoreIds?.length &&
{(docLessAdjustment?.fileStoreIds?.length && parseInt(value?.additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT)>0) &&
<a target="_blank" href={docLessAdjustment?.fileStoreIds[0]?.url}>
<PDFSvg />
</a>
Expand Down Expand Up @@ -774,7 +791,7 @@ function selectfile(e) {
<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 || !otherChargesDisc || !Architectvalidations)} id/>
<SubmitBar label={t("BPA_SEND_TO_CITIZEN_LABEL")} onSubmit={onSubmitCheck} disabled={ ( !agree || !isOTPVerified || !Architectvalidations)} id/>
</Card>
</React.Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const CloseBtn = (props) => {
};

const ActionModal = ({ t, action, tenantId, state, id, closeModal, submitAction, actionData, applicationDetails, applicationData, businessService, moduleCode,workflowDetails,blockReason }) => {
console.log("applicationData",applicationData)
console.log("workflowDetails",workflowDetails)
const mutation1 = Digit.Hooks.obps.useObpsAPI(
applicationData?.landInfo?.address?.city ? applicationData?.landInfo?.address?.city : tenantId,
false
Expand Down Expand Up @@ -181,8 +183,8 @@ const ActionModal = ({ t, action, tenantId, state, id, closeModal, submitAction,
action: action?.action,
comment: data?.comments?.length > 0 ? data?.comments : null,
comments: data?.comments?.length > 0 ? data?.comments : null,
assignee: !selectedApprover?.uuid ? null : [selectedApprover?.uuid],
assignes: !selectedApprover?.uuid ? null : [selectedApprover?.uuid],
assignee: (workflowDetails?.data?.processInstances?.[0]?.state?.applicationStatus==="FIELDINSPECTION_INPROGRESS")? [workflowDetails?.data?.processInstances?.[0]?.assigner?.uuid]: !selectedApprover?.uuid ? null : [selectedApprover?.uuid],
assignes: (workflowDetails?.data?.processInstances?.[0]?.state?.applicationStatus==="FIELDINSPECTION_INPROGRESS")? [workflowDetails?.data?.processInstances?.[0]?.assigner?.uuid]: !selectedApprover?.uuid ? null : [selectedApprover?.uuid],
varificationDocuments: uploadedFile
? [
{
Expand All @@ -195,7 +197,7 @@ const ActionModal = ({ t, action, tenantId, state, id, closeModal, submitAction,
},
action: action?.action,
comment: data?.comments,
assignee: !selectedApprover?.uuid ? null : [selectedApprover?.uuid],
assignee: (workflowDetails?.data?.processInstances?.[0]?.state?.applicationStatus==="FIELDINSPECTION_INPROGRESS")? [workflowDetails?.data?.processInstances?.[0]?.assigner?.uuid]: !selectedApprover?.uuid ? null : [selectedApprover?.uuid],
wfDocuments: uploadedFile
? [
{
Expand All @@ -205,19 +207,16 @@ const ActionModal = ({ t, action, tenantId, state, id, closeModal, submitAction,
},
]
: null,
};
if (!sessionStorage.getItem("development") || !sessionStorage.getItem("otherCharges") || !sessionStorage.getItem("lessAdjusment") ){
closeModal()
alert(t("Please fill P2 Manual Fees"));}
else if(parseInt(sessionStorage.getItem("lessAdjusment"))>(parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(applicationData?.additionalDetails?.selfCertificationCharges?.BPA_MALBA_CHARGES)+parseInt(applicationData?.additionalDetails?.selfCertificationCharges?.BPA_LABOUR_CESS)+parseInt(applicationData?.additionalDetails?.selfCertificationCharges?.BPA_WATER_CHARGES)+parseInt(applicationData?.additionalDetails?.selfCertificationCharges?.BPA_GAUSHALA_CHARGES_CESS))){
};
if(parseInt(sessionStorage.getItem("lessAdjusment"))>(parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(applicationData?.additionalDetails?.selfCertificationCharges?.BPA_MALBA_CHARGES)+parseInt(applicationData?.additionalDetails?.selfCertificationCharges?.BPA_LABOUR_CESS)+parseInt(applicationData?.additionalDetails?.selfCertificationCharges?.BPA_WATER_CHARGES)+parseInt(applicationData?.additionalDetails?.selfCertificationCharges?.BPA_GAUSHALA_CHARGES_CESS))){
closeModal()
alert(t("Enterd Less Adjustment amount is invalid"));
}
else{
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.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development") || "0";
applicationData.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")|| "0";
applicationData.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment" )|| "0";
applicationData.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc" || "NA");
applicationData.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));

const nocDetails = applicationDetails?.nocData?.map(noc => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function selectfile(e) {
isMandatory={false}
optionKey="i18nKey"
name="development"
defaultValue={additionalDetails?.selfCertificationCharges?.BPA_DEVELOPMENT_CHARGES || ""}
defaultValue={additionalDetails?.selfCertificationCharges?.BPA_DEVELOPMENT_CHARGES || 0}
value={development}
disabled={!isEditApplication}
onChange={(e) => {setDevelopmentVal(e.target.value)}}
Expand All @@ -229,13 +229,15 @@ function selectfile(e) {
isMandatory={false}
optionKey="i18nKey"
name="otherCharges"
defaultValue={additionalDetails?.selfCertificationCharges?.BPA_OTHER_CHARGES || ""}
defaultValue={additionalDetails?.selfCertificationCharges?.BPA_OTHER_CHARGES || 0}
value={otherCharges}
disabled={!isEditApplication}
onChange={(e) => {setOtherChargesVal(e.target.value)}}
{...{ required: true, pattern: "^[0-9]*$", type: "text" }}
/>
<CardLabel>{t("BPA_COMMON_OTHER_AMT_DISCRIPTION")}</CardLabel>
{parseInt(otherCharges)>0?(
<div>
<CardLabel>{t("BPA_COMMON_OTHER_AMT_DISCRIPTION")}</CardLabel>
<TextArea
t={t}
type={"text"}
Expand All @@ -246,6 +248,8 @@ function selectfile(e) {
onChange={(e) => {setOtherChargesDis(e.target.value)}}
{...{ required: true }}
/>
</div>
):null}
<CardLabel>{t("BPA_COMMON_LESS_AMT")}</CardLabel>
<TextInput
t={t}
Expand All @@ -259,6 +263,8 @@ function selectfile(e) {
onChange={(e) => {setLessAdjusmentVal(e.target.value)}}
{...{ required: true, pattern: "^[0-9]*$", type: "text" }}
/>
{(parseInt(lessAdjusment)>0 && isEditApplication) ?(
<div>
<CardLabel>{t("BPA_COMMON_LESS_AMT_FILE")}</CardLabel>
<UploadFile
id={"noc-doc"}
Expand All @@ -273,10 +279,11 @@ function selectfile(e) {
error={errorFile}
uploadMessage={uploadMessage}
/>
{docLessAdjustment?.fileStoreIds?.length &&
</div>):null}
{(docLessAdjustment?.fileStoreIds?.length && parseInt(additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT)>0) &&
<CardLabel style={{marginTop:"15px"}}>{t("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")}</CardLabel>
}
{docLessAdjustment?.fileStoreIds?.length &&
{(docLessAdjustment?.fileStoreIds?.length && parseInt(additionalDetails?.selfCertificationCharges?.BPA_LESS_ADJUSMENT_PLOT)>0)&&
<a target="_blank" href={docLessAdjustment?.fileStoreIds[docLessAdjustment?.fileStoreIds?.length-1]?.url}>
<PDFSvg />
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,13 @@ const ApplicationDetails = (props) => {
"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");
bpaDetails.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc");
bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development") || "0";
bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges") ||"0";
bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")|| "0";
bpaDetails.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"|| "NA");
bpaDetails.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));
if (!bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES || !bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES || !bpaDetails.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT ){
alert(t("Please fill P2 Manual Fees"));}
else if(parseInt(sessionStorage.getItem("lessAdjusment"))>(parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(bpaDetails?.BPA?.additionalDetails?.selfCertificationCharges?.BPA_MALBA_CHARGES)+parseInt(bpaDetails?.BPA?.additionalDetails?.selfCertificationCharges?.BPA_LABOUR_CESS)+parseInt(bpaDetails?.BPA?.additionalDetails?.selfCertificationCharges?.BPA_WATER_CHARGES)+parseInt(bpaDetails?.BPA?.additionalDetails?.selfCertificationCharges?.BPA_GAUSHALA_CHARGES_CESS))){

if(parseInt(sessionStorage.getItem("lessAdjusment"))>(parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(bpaDetails?.BPA?.additionalDetails?.selfCertificationCharges?.BPA_MALBA_CHARGES)+parseInt(bpaDetails?.BPA?.additionalDetails?.selfCertificationCharges?.BPA_LABOUR_CESS)+parseInt(bpaDetails?.BPA?.additionalDetails?.selfCertificationCharges?.BPA_WATER_CHARGES)+parseInt(bpaDetails?.BPA?.additionalDetails?.selfCertificationCharges?.BPA_GAUSHALA_CHARGES_CESS))){
alert(t("Enterd Less Adjustment amount is invalid"));
}
else{
Expand Down

0 comments on commit e82cae7

Please sign in to comment.