done
This commit is contained in:
parent
63d13247c1
commit
3148ade7c0
|
@ -66,6 +66,12 @@ const propertySchema = mongoose.Schema({
|
|||
type: Number,
|
||||
default: new Date().getFullYear(),
|
||||
},
|
||||
closeDataAtoB:{
|
||||
type: Number,
|
||||
},
|
||||
closeDataBtoC:{
|
||||
type: Number,
|
||||
},
|
||||
purchaseCost: {
|
||||
type: Number,
|
||||
required: true, // Set to true if this field is mandatory
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -45,7 +45,7 @@
|
|||
|
||||
|
||||
|
||||
<script type="module" crossorigin src="/assets/index-C-cZIHwO.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-BbbEpMBr.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-iEl-il0E.css">
|
||||
</head>
|
||||
|
||||
|
|
|
@ -65,16 +65,35 @@ const Addproperty = () => {
|
|||
{ title: "Real Estates fees", price: "" },
|
||||
],
|
||||
renovationCost: [
|
||||
{ title: "Demolition: Removing existing structures or finishes", price: "" },
|
||||
{
|
||||
title: "Demolition: Removing existing structures or finishes",
|
||||
price: "",
|
||||
},
|
||||
{ title: "Framing: Making structural changes or additions", price: "" },
|
||||
{ title: "Plumbing: Installing or modifying plumbing systems", price: "" },
|
||||
{
|
||||
title: "Plumbing: Installing or modifying plumbing systems",
|
||||
price: "",
|
||||
},
|
||||
{ title: "Electrical: Updating wiring and fixtures", price: "" },
|
||||
{ title: "HVAC: Installing or upgrading heating and cooling systems", price: "" },
|
||||
{
|
||||
title: "HVAC: Installing or upgrading heating and cooling systems",
|
||||
price: "",
|
||||
},
|
||||
{ title: "Insulation: Adding or replacing insulation", price: "" },
|
||||
{ title: "Drywall: Hanging and finishing drywall", price: "" },
|
||||
{ title: "Interior Finishes: Painting, flooring, cabinetry, and fixtures", price: "" },
|
||||
{ title: "Exterior Work: Addressing siding, roofing, or landscaping, if applicable", price: "" },
|
||||
{ title: "Final Inspections: Ensuring everything meets codes", price: "" },
|
||||
{
|
||||
title: "Interior Finishes: Painting, flooring, cabinetry, and fixtures",
|
||||
price: "",
|
||||
},
|
||||
{
|
||||
title:
|
||||
"Exterior Work: Addressing siding, roofing, or landscaping, if applicable",
|
||||
price: "",
|
||||
},
|
||||
{
|
||||
title: "Final Inspections: Ensuring everything meets codes",
|
||||
price: "",
|
||||
},
|
||||
{ title: "Punch List: Completing any remaining task", price: "" },
|
||||
],
|
||||
});
|
||||
|
@ -389,7 +408,6 @@ const Addproperty = () => {
|
|||
}, 0);
|
||||
};
|
||||
|
||||
|
||||
const addutilMaintenanceCost = () => {
|
||||
setFormData((prevData) => ({
|
||||
...prevData,
|
||||
|
@ -451,14 +469,6 @@ const Addproperty = () => {
|
|||
}, 0);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const addrenovationCost = () => {
|
||||
setFormData((prevData) => ({
|
||||
...prevData,
|
||||
|
@ -520,7 +530,6 @@ const Addproperty = () => {
|
|||
}, 0);
|
||||
};
|
||||
|
||||
|
||||
const calculatecostsAfterPropertyAcquisition = () => {
|
||||
const totalIncidentalCost = calculateTotalincidentalCost();
|
||||
const totalUtilMaintenanceCost = calculatetotalutilMaintenanceCost();
|
||||
|
@ -530,14 +539,6 @@ const Addproperty = () => {
|
|||
return totalIncidentalCost + totalUtilMaintenanceCost + totalRenovationCost;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const handleNumericInput = (e) => {
|
||||
const value = e.target.value;
|
||||
|
||||
|
@ -586,7 +587,9 @@ const Addproperty = () => {
|
|||
formData.roofing &&
|
||||
formData.totalSqft &&
|
||||
formData.totalcashsurplus &&
|
||||
formData.sellpricebtoc
|
||||
formData.sellpricebtoc &&
|
||||
formData.closeDataAtoB &&
|
||||
formData.closeDataBtoC
|
||||
) {
|
||||
const totalCostsAtoB = calculateTotalCosts();
|
||||
const totalCostsAtoBaftercredits = calculateTotalCostsWithCredits();
|
||||
|
@ -594,8 +597,9 @@ const Addproperty = () => {
|
|||
const totalincidentalCost = calculateTotalincidentalCost();
|
||||
const totalcredits = calculateTotalCredits();
|
||||
const totalutilMaintenanceCost = calculatetotalutilMaintenanceCost();
|
||||
const totalrenovationCost= calculaterenovationCost();
|
||||
const costsAfterPropertyAcquisition= calculatecostsAfterPropertyAcquisition();
|
||||
const totalrenovationCost = calculaterenovationCost();
|
||||
const costsAfterPropertyAcquisition =
|
||||
calculatecostsAfterPropertyAcquisition();
|
||||
|
||||
// Add user info to formData, including the propertyTaxInfo array
|
||||
const formDataWithUserInfo = {
|
||||
|
@ -612,8 +616,8 @@ const Addproperty = () => {
|
|||
totalcashAdjustments: totalcashAdjustments,
|
||||
totalincidentalCost: totalincidentalCost,
|
||||
totalutilMaintenanceCost: totalutilMaintenanceCost,
|
||||
totalrenovationCost:totalrenovationCost,
|
||||
costsAfterPropertyAcquisition:costsAfterPropertyAcquisition,
|
||||
totalrenovationCost: totalrenovationCost,
|
||||
costsAfterPropertyAcquisition: costsAfterPropertyAcquisition,
|
||||
};
|
||||
|
||||
// Check if propertyTaxInfo is an array and has values
|
||||
|
@ -1551,38 +1555,80 @@ const Addproperty = () => {
|
|||
borderRadius: "8px",
|
||||
}}
|
||||
>
|
||||
<h3
|
||||
style={{
|
||||
color: "#fda417",
|
||||
border: "#fda417",
|
||||
fontSize: "20px",
|
||||
fontWeight: "normal",
|
||||
}}
|
||||
>
|
||||
Property Acquisition A to B:
|
||||
</h3>
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
{/* <div className="form-floating mb-3">
|
||||
<span style={{
|
||||
color: "#fda417",
|
||||
fontSize: "14px",
|
||||
fontWeight: "bold",
|
||||
}}>Purchase Cost</span>
|
||||
|
||||
<div className="row gy-3">
|
||||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className="form-control"
|
||||
value={formData.purchaseCost}
|
||||
onChange={(e) =>
|
||||
setFormData({
|
||||
...formData,
|
||||
purchaseCost: e.target.value,
|
||||
})
|
||||
}
|
||||
placeholder="Enter Purchase Cost"
|
||||
placeholder="Close Date A to B"
|
||||
required
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
<div className="col-md-4">
|
||||
<input
|
||||
type="date"
|
||||
className="form-control"
|
||||
value={formData.closeDataAtoB}
|
||||
placeholder="Close Date A to B"
|
||||
style={{ textAlign: "right" }}
|
||||
required
|
||||
/>
|
||||
</div> */}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div className="row gy-3">
|
||||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className="form-control"
|
||||
placeholder="Close Date B to C"
|
||||
required
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-md-4">
|
||||
<input
|
||||
type="date"
|
||||
className="form-control"
|
||||
value={formData.closeDataBtoC}
|
||||
placeholder="Close Date B to C"
|
||||
style={{ textAlign: "right" }}
|
||||
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
|
||||
}}
|
||||
/>
|
||||
|
||||
<span
|
||||
style={{
|
||||
color: "#fda417",
|
||||
fontSize: "14px",
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
Property Acquisition A to B:
|
||||
</span>
|
||||
|
||||
<br />
|
||||
<div className="row gy-3">
|
||||
<div className="col-md-4">
|
||||
<input
|
||||
|
@ -1596,7 +1642,9 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${formData.isPurchaseCostInvalid ? "is-invalid" : ""}`}
|
||||
className={`form-control ${
|
||||
formData.isPurchaseCostInvalid ? "is-invalid" : ""
|
||||
}`}
|
||||
value={formData.purchaseCost}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
|
@ -1627,8 +1675,7 @@ const Addproperty = () => {
|
|||
Please enter a valid number.
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr
|
||||
style={{
|
||||
|
@ -2285,9 +2332,7 @@ const Addproperty = () => {
|
|||
}}
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<span
|
||||
<span
|
||||
style={{
|
||||
color: "#fda417",
|
||||
fontSize: "14px",
|
||||
|
@ -2305,7 +2350,11 @@ const Addproperty = () => {
|
|||
className="form-control"
|
||||
value={cost.title}
|
||||
onChange={(e) =>
|
||||
handlerenovationCostTitle(index, "title", e.target.value)
|
||||
handlerenovationCostTitle(
|
||||
index,
|
||||
"title",
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
placeholder="Title"
|
||||
required
|
||||
|
@ -2313,7 +2362,7 @@ const Addproperty = () => {
|
|||
fontSize: "10px", // Set the desired font size
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="col-md-4">
|
||||
<input
|
||||
|
@ -2322,9 +2371,7 @@ const Addproperty = () => {
|
|||
cost.isInvalid ? "is-invalid" : ""
|
||||
}`} // Apply 'is-invalid' class when invalid
|
||||
value={cost.price}
|
||||
onChange={(e) =>
|
||||
handlerenovationCostChange(e, index)
|
||||
} // Use a new handler for price validation
|
||||
onChange={(e) => handlerenovationCostChange(e, index)} // Use a new handler for price validation
|
||||
placeholder="Price"
|
||||
style={{ textAlign: "right" }}
|
||||
required
|
||||
|
@ -2403,7 +2450,7 @@ const Addproperty = () => {
|
|||
}}
|
||||
/>
|
||||
|
||||
<div className="row gy-3 align-items-center">
|
||||
<div className="row gy-3 align-items-center">
|
||||
<span
|
||||
className="col-md-4"
|
||||
style={{
|
||||
|
@ -2441,8 +2488,7 @@ const Addproperty = () => {
|
|||
}}
|
||||
/>
|
||||
|
||||
|
||||
<div className="row gy-3 align-items-center">
|
||||
<div className="row gy-3 align-items-center">
|
||||
<span
|
||||
className="col-md-4"
|
||||
style={{
|
||||
|
@ -2456,7 +2502,9 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${formData.isInvalid ? "is-invalid" : ""}`}
|
||||
className={`form-control ${
|
||||
formData.isInvalid ? "is-invalid" : ""
|
||||
}`}
|
||||
name="sellpricebtoc"
|
||||
value={formData.sellpricebtoc}
|
||||
onChange={(e) => {
|
||||
|
@ -2488,11 +2536,7 @@ const Addproperty = () => {
|
|||
Please enter a valid number.
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr
|
||||
|
@ -2504,11 +2548,6 @@ const Addproperty = () => {
|
|||
}}
|
||||
/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div className="col-md-4">
|
||||
<button
|
||||
className="btn btn-primary back"
|
||||
|
|
Loading…
Reference in New Issue