This commit is contained in:
omkieit 2024-10-07 18:22:13 +05:30
parent cf4368f855
commit 7e09043dcb
4 changed files with 71 additions and 19 deletions

View File

@ -174,6 +174,10 @@ const propertySchema = mongoose.Schema({
type: Number, type: Number,
required: true, // Set to true if this field is mandatory required: true, // Set to true if this field is mandatory
}, },
costsAfterPropertyAcquisition:{
type: Number,
required: true, // Set to true if this field is mandatory
},
}); });
const PropertyModal = mongoose.model("property", propertySchema); const PropertyModal = mongoose.model("property", propertySchema);

File diff suppressed because one or more lines are too long

View File

@ -45,7 +45,7 @@
<script type="module" crossorigin src="/assets/index-KWwl6oqn.js"></script> <script type="module" crossorigin src="/assets/index-Cn1uia1n.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-iEl-il0E.css"> <link rel="stylesheet" crossorigin href="/assets/index-iEl-il0E.css">
</head> </head>

View File

@ -521,6 +521,17 @@ const Addproperty = () => {
}; };
const calculatecostsAfterPropertyAcquisition = () => {
const totalIncidentalCost = calculateTotalincidentalCost();
const totalUtilMaintenanceCost = calculatetotalutilMaintenanceCost();
const totalRenovationCost = calculaterenovationCost();
// Sum up all the values from the three functions
return totalIncidentalCost + totalUtilMaintenanceCost + totalRenovationCost;
};
@ -574,7 +585,8 @@ const Addproperty = () => {
formData.extwall && formData.extwall &&
formData.roofing && formData.roofing &&
formData.totalSqft && formData.totalSqft &&
formData.totalcashsurplus formData.totalcashsurplus &&
formData.costsAfterPropertyAcquisition
) { ) {
const totalCostsAtoB = calculateTotalCosts(); const totalCostsAtoB = calculateTotalCosts();
const totalCostsAtoBaftercredits = calculateTotalCostsWithCredits(); const totalCostsAtoBaftercredits = calculateTotalCostsWithCredits();
@ -2369,7 +2381,43 @@ const Addproperty = () => {
}} }}
/> />
<div className="row gy-3 align-items-center">
<span
className="col-md-4"
style={{
color: "#fda417",
fontSize: "14px",
fontWeight: "bold",
}}
>
Total Costs After Property Acquisition
</span>
<div className="col-md-4">
<input
type="text"
className="form-control"
name="costsAfterPropertyAcquisition"
value={calculatecostsAfterPropertyAcquisition()}
readOnly
style={{
borderColor: "#fda417", // Custom border color for the input field
color: "#fda417", // Optionally apply text color to the input text
textAlign: "right",
}}
// placeholder="Total Incidental Cost"
required
/>
</div>
</div>
<hr
style={{
borderColor: "#fda417", // Set the color of the line
borderWidth: "1px", // Optional: Adjust the thickness of the line
backgroundColor: "#fda417", // Optional: Apply color if using for background
height: "1px", // Optional: Set height to match the border width
}}
/>