This commit is contained in:
omkieit 2024-10-10 22:19:02 +05:30
parent 95d7c7b00b
commit c8d2af7902
3 changed files with 483 additions and 489 deletions

File diff suppressed because one or more lines are too long

View File

@ -45,7 +45,7 @@
<script type="module" crossorigin src="/assets/index-CJfbdL2a.js"></script> <script type="module" crossorigin src="/assets/index-qn9aVrHm.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

@ -67,16 +67,35 @@ const Addproperty = () => {
{ title: "Real Estates fees", price: "0" }, { title: "Real Estates fees", price: "0" },
], ],
renovationCost: [ renovationCost: [
{ title: "Demolition: Removing existing structures or finishes", price: "0"}, {
title: "Demolition: Removing existing structures or finishes",
price: "0",
},
{ title: "Framing: Making structural changes or additions", price: "0" }, { title: "Framing: Making structural changes or additions", price: "0" },
{ title: "Plumbing: Installing or modifying plumbing systems", price: "0"}, {
title: "Plumbing: Installing or modifying plumbing systems",
price: "0",
},
{ title: "Electrical: Updating wiring and fixtures", price: "0" }, { title: "Electrical: Updating wiring and fixtures", price: "0" },
{ title: "HVAC: Installing or upgrading heating and cooling systems", price: "0"}, {
title: "HVAC: Installing or upgrading heating and cooling systems",
price: "0",
},
{ title: "Insulation: Adding or replacing insulation", price: "0" }, { title: "Insulation: Adding or replacing insulation", price: "0" },
{ title: "Drywall: Hanging and finishing drywall", price: "0" }, { title: "Drywall: Hanging and finishing drywall", price: "0" },
{ title: "Interior Finishes: Painting, flooring, cabinetry, and fixtures", price: "0"}, {
{ title:"Exterior Work: Addressing siding, roofing, or landscaping, if applicable", price: "0"}, title: "Interior Finishes: Painting, flooring, cabinetry, and fixtures",
{ title: "Final Inspections: Ensuring everything meets codes", price: "0"}, price: "0",
},
{
title:
"Exterior Work: Addressing siding, roofing, or landscaping, if applicable",
price: "0",
},
{
title: "Final Inspections: Ensuring everything meets codes",
price: "0",
},
{ title: "Punch List: Completing any remaining task", price: "0" }, { title: "Punch List: Completing any remaining task", price: "0" },
], ],
sellingPriceBtoC: "0", sellingPriceBtoC: "0",
@ -94,9 +113,7 @@ const Addproperty = () => {
{ title: "Payoff of 2nd Mortgage", price: "0" }, { title: "Payoff of 2nd Mortgage", price: "0" },
{ title: "Payoff 3rd Mortgage", price: "0" }, { title: "Payoff 3rd Mortgage", price: "0" },
], ],
adjustments:[ adjustments: [{ title: "adjustments", price: "0" }],
{ title: "adjustments", price: "0"},
],
incomestatement: [ incomestatement: [
{ title: "income statement", price: "0" }, { title: "income statement", price: "0" },
{ title: "income statement", price: "0" }, { title: "income statement", price: "0" },
@ -367,7 +384,6 @@ const Addproperty = () => {
return totalcashAdjustments + totalcredits + totalPurchaseCosts; return totalcashAdjustments + totalcredits + totalPurchaseCosts;
}; };
const addincidentalCost = () => { const addincidentalCost = () => {
setFormData((prevData) => ({ setFormData((prevData) => ({
...prevData, ...prevData,
@ -437,9 +453,7 @@ const Addproperty = () => {
}; };
const deletecarryCosts = (index) => { const deletecarryCosts = (index) => {
const updatedcarryCosts = formData.carryCosts.filter( const updatedcarryCosts = formData.carryCosts.filter((_, i) => i !== index);
(_, i) => i !== index
);
setFormData((prevData) => ({ setFormData((prevData) => ({
...prevData, ...prevData,
carryCosts: updatedcarryCosts, carryCosts: updatedcarryCosts,
@ -464,16 +478,14 @@ const Addproperty = () => {
// If valid number, update state, otherwise show the alert // If valid number, update state, otherwise show the alert
if (isNumber || value === "") { if (isNumber || value === "") {
const updatedcarryCosts = formData.carryCosts.map( const updatedcarryCosts = formData.carryCosts.map((carryCosts, i) =>
(carryCosts, i) =>
i === index i === index
? { ...carryCosts, price: value, isInvalid: false } // Reset isInvalid if valid number ? { ...carryCosts, price: value, isInvalid: false } // Reset isInvalid if valid number
: carryCosts : carryCosts
); );
setFormData({ ...formData, carryCosts: updatedcarryCosts }); setFormData({ ...formData, carryCosts: updatedcarryCosts });
} else { } else {
const updatedcarryCosts = formData.carryCosts.map( const updatedcarryCosts = formData.carryCosts.map((carryCosts, i) =>
(carryCosts, i) =>
i === index i === index
? { ...carryCosts, isInvalid: true } // Set isInvalid true for invalid input ? { ...carryCosts, isInvalid: true } // Set isInvalid true for invalid input
: carryCosts : carryCosts
@ -561,19 +573,22 @@ const Addproperty = () => {
}; };
const calculatetotalCoststoBuyAtoB = () => { const calculatetotalCoststoBuyAtoB = () => {
const totalRenovationsandHoldingCost = calculatetotalRenovationsandHoldingCost(); const totalRenovationsandHoldingCost =
const totalCashRequiredonSettlement = calculateTotalCashRequiredonSettlement(); calculatetotalRenovationsandHoldingCost();
const totalCashRequiredonSettlement =
calculateTotalCashRequiredonSettlement();
// Sum up all the values from the three functions // Sum up all the values from the three functions
return totalRenovationsandHoldingCost + totalCashRequiredonSettlement; return totalRenovationsandHoldingCost + totalCashRequiredonSettlement;
}; };
const addcostPaidOutofClosing = () => { const addcostPaidOutofClosing = () => {
setFormData((prevData) => ({ setFormData((prevData) => ({
...prevData, ...prevData,
costPaidOutofClosing: [...prevData.costPaidOutofClosing, { title: "", price: "" }], costPaidOutofClosing: [
...prevData.costPaidOutofClosing,
{ title: "", price: "" },
],
})); }));
}; };
@ -611,7 +626,10 @@ const Addproperty = () => {
? { ...costPaidOutofClosing, price: value, isInvalid: false } // Reset isInvalid if valid number ? { ...costPaidOutofClosing, price: value, isInvalid: false } // Reset isInvalid if valid number
: costPaidOutofClosing : costPaidOutofClosing
); );
setFormData({ ...formData, costPaidOutofClosing: updatedcostPaidOutofClosing }); setFormData({
...formData,
costPaidOutofClosing: updatedcostPaidOutofClosing,
});
} else { } else {
const updatedcostPaidOutofClosing = formData.costPaidOutofClosing.map( const updatedcostPaidOutofClosing = formData.costPaidOutofClosing.map(
(costPaidOutofClosing, i) => (costPaidOutofClosing, i) =>
@ -619,27 +637,30 @@ const Addproperty = () => {
? { ...costPaidOutofClosing, isInvalid: true } // Set isInvalid true for invalid input ? { ...costPaidOutofClosing, isInvalid: true } // Set isInvalid true for invalid input
: costPaidOutofClosing : costPaidOutofClosing
); );
setFormData({ ...formData, costPaidOutofClosing: updatedcostPaidOutofClosing }); setFormData({
...formData,
costPaidOutofClosing: updatedcostPaidOutofClosing,
});
} }
}; };
// Calculate total from costPaidOutofClosing array // Calculate total from costPaidOutofClosing array
const calculateTotalcostPaidOutofClosing = () => { const calculateTotalcostPaidOutofClosing = () => {
return formData.costPaidOutofClosing.reduce((total, costPaidOutofClosing) => { return formData.costPaidOutofClosing.reduce(
(total, costPaidOutofClosing) => {
const price = parseFloat(costPaidOutofClosing.price); const price = parseFloat(costPaidOutofClosing.price);
return total + (isNaN(price) ? 0 : price); // Ensure only valid numbers are added return total + (isNaN(price) ? 0 : price); // Ensure only valid numbers are added
}, 0); },
0
);
}; };
const calculateTotalCosttoSellBtoC = () => { const calculateTotalCosttoSellBtoC = () => {
const sekkingPriceBtoC = formData.sellingPriceBtoC; const sekkingPriceBtoC = formData.sellingPriceBtoC;
const costPaidOutofClosing = calculateTotalcostPaidOutofClosing(); const costPaidOutofClosing = calculateTotalcostPaidOutofClosing();
return sekkingPriceBtoC - costPaidOutofClosing; return sekkingPriceBtoC - costPaidOutofClosing;
}; };
const addadjustments = () => { const addadjustments = () => {
setFormData((prevData) => ({ setFormData((prevData) => ({
...prevData, ...prevData,
@ -675,16 +696,14 @@ const Addproperty = () => {
// If valid number, update state, otherwise show the alert // If valid number, update state, otherwise show the alert
if (isNumber || value === "") { if (isNumber || value === "") {
const updatedadjustments = formData.adjustments.map( const updatedadjustments = formData.adjustments.map((adjustments, i) =>
(adjustments, i) =>
i === index i === index
? { ...adjustments, price: value, isInvalid: false } // Reset isInvalid if valid number ? { ...adjustments, price: value, isInvalid: false } // Reset isInvalid if valid number
: adjustments : adjustments
); );
setFormData({ ...formData, adjustments: updatedadjustments }); setFormData({ ...formData, adjustments: updatedadjustments });
} else { } else {
const updatedadjustments = formData.adjustments.map( const updatedadjustments = formData.adjustments.map((adjustments, i) =>
(adjustments, i) =>
i === index i === index
? { ...adjustments, isInvalid: true } // Set isInvalid true for invalid input ? { ...adjustments, isInvalid: true } // Set isInvalid true for invalid input
: adjustments : adjustments
@ -707,8 +726,6 @@ const Addproperty = () => {
return sellingPriceBtoC + totaladjustments; return sellingPriceBtoC + totaladjustments;
}; };
const addincomestatement = () => { const addincomestatement = () => {
setFormData((prevData) => ({ setFormData((prevData) => ({
...prevData, ...prevData,
@ -770,32 +787,57 @@ const Addproperty = () => {
}, 0); }, 0);
}; };
const calculatenetBtoCsalevalue = () => { const calculatenetBtoCsalevalue = () => {
const totalincomestatement = calculateTotalincomestatement(); const totalincomestatement = calculateTotalincomestatement();
const totalcosttosellbtoc = calculateTotalCosttoSellBtoC(); const totalcosttosellbtoc = calculateTotalCosttoSellBtoC();
return totalincomestatement + totalcosttosellbtoc; return totalincomestatement + totalcosttosellbtoc;
} };
const calculateNetProfitBeforeFinancingCosts = () => { const calculateNetProfitBeforeFinancingCosts = () => {
const netBtoCsalevalue = calculatenetBtoCsalevalue(); // const netBtoCsalevalue = parseFloat(calculatenetBtoCsalevalue());
const shorttermrental= formData.shorttermrental; // const shorttermrental = parseFloat(formData.shorttermrental);
const OtherIncome = formData.OtherIncome; // const OtherIncome = parseFloat(formData.OtherIncome);
const InsuranceClaim = formData.InsuranceClaim; // const InsuranceClaim = parseFloat(formData.InsuranceClaim);
const LongTermRental= formData.LongTermRental; // const LongTermRental = parseFloat(formData.LongTermRental);
const totalCoststoBuyAtoB=calculatetotalCoststoBuyAtoB(); // const totalCoststoBuyAtoB = parseFloat(calculatetotalCoststoBuyAtoB());
return netBtoCsalevalue + shorttermrental + OtherIncome + InsuranceClaim + LongTermRental - totalCoststoBuyAtoB; const netBtoCsalevalue = isNaN(parseFloat(calculatenetBtoCsalevalue()))
} ? 0
: parseFloat(calculatenetBtoCsalevalue());
const shorttermrental = isNaN(parseFloat(formData.shorttermrental))
? 0
: parseFloat(formData.shorttermrental);
const OtherIncome = isNaN(parseFloat(formData.OtherIncome))
? 0
: parseFloat(formData.OtherIncome);
const InsuranceClaim = isNaN(parseFloat(formData.InsuranceClaim))
? 0
: parseFloat(formData.InsuranceClaim);
const LongTermRental = isNaN(parseFloat(formData.LongTermRental))
? 0
: parseFloat(formData.LongTermRental);
const totalCoststoBuyAtoB = isNaN(
parseFloat(calculatetotalCoststoBuyAtoB())
)
? 0
: parseFloat(calculatetotalCoststoBuyAtoB());
// Calculate the sum first, then subtract the total costs
const totalIncome =
netBtoCsalevalue +
shorttermrental +
OtherIncome +
InsuranceClaim +
LongTermRental;
const netProfitBeforeFinancingCosts = totalIncome - totalCoststoBuyAtoB;
return netProfitBeforeFinancingCosts;
};
const calculateNetProfit = () => { const calculateNetProfit = () => {
const NetProfitBeforeFinancingCosts = calculateNetProfitBeforeFinancingCosts(); const NetProfitBeforeFinancingCosts =
calculateNetProfitBeforeFinancingCosts();
const FinancingCostClosingCost = formData.FinancingCostClosingCost; const FinancingCostClosingCost = formData.FinancingCostClosingCost;
return NetProfitBeforeFinancingCosts - FinancingCostClosingCost; return NetProfitBeforeFinancingCosts - FinancingCostClosingCost;
} };
const handleSubmit = () => { const handleSubmit = () => {
if ( if (
@ -839,23 +881,28 @@ const calculatenetBtoCsalevalue = () =>{
formData.FinancingCostClosingCost formData.FinancingCostClosingCost
) { ) {
const totalPurchaseCosts = calculateTotalPurchaseCosts(); const totalPurchaseCosts = calculateTotalPurchaseCosts();
const totalPurchaseCostsaftercredits = calculateTotalPurchaseCostsWithCredits(); const totalPurchaseCostsaftercredits =
calculateTotalPurchaseCostsWithCredits();
const totalcashAdjustments = calculatecashAdjustments(); const totalcashAdjustments = calculatecashAdjustments();
const totalincidentalCost = calculateTotalincidentalCost(); const totalincidentalCost = calculateTotalincidentalCost();
const totalcredits = calculateTotalCredits(); const totalcredits = calculateTotalCredits();
const totalcashrequiredonsettlement = calculateTotalCashRequiredonSettlement(); const totalcashrequiredonsettlement =
calculateTotalCashRequiredonSettlement();
const totalcarryCosts = calculatetotalcarryCosts(); const totalcarryCosts = calculatetotalcarryCosts();
const totalrenovationCost = calculaterenovationCost(); const totalrenovationCost = calculaterenovationCost();
const totalRenovationsandHoldingCost = calculatetotalRenovationsandHoldingCost(); const totalRenovationsandHoldingCost =
calculatetotalRenovationsandHoldingCost();
const totalCoststoBuyAtoB = calculatetotalCoststoBuyAtoB(); const totalCoststoBuyAtoB = calculatetotalCoststoBuyAtoB();
const costPaidOutofClosing = calculateTotalcostPaidOutofClosing(); const costPaidOutofClosing = calculateTotalcostPaidOutofClosing();
const totaladjustments = calculateTotaladjustments(); const totaladjustments = calculateTotaladjustments();
const fundsavailablefordistribution = calculatefundsavailablefordistribution(); const fundsavailablefordistribution =
calculatefundsavailablefordistribution();
const grossproceedsperHUD = calculateTotalCosttoSellBtoC(); const grossproceedsperHUD = calculateTotalCosttoSellBtoC();
const totalCosttoSellBtoC = calculateTotalCosttoSellBtoC(); const totalCosttoSellBtoC = calculateTotalCosttoSellBtoC();
const totalincomestatement = calculateTotalincomestatement(); const totalincomestatement = calculateTotalincomestatement();
const netBtoCsalevalue = calculatenetBtoCsalevalue(); const netBtoCsalevalue = calculatenetBtoCsalevalue();
const netprofitbeforefinancingcosts = calculateNetProfitBeforeFinancingCosts(); const netprofitbeforefinancingcosts =
calculateNetProfitBeforeFinancingCosts();
const NetProfit = calculateNetProfit(); const NetProfit = calculateNetProfit();
// Add user info to formData, including the propertyTaxInfo array // Add user info to formData, including the propertyTaxInfo array
@ -885,7 +932,7 @@ const calculatenetBtoCsalevalue = () =>{
totalincomestatement: totalincomestatement, totalincomestatement: totalincomestatement,
netBtoCsalevalue: netBtoCsalevalue, netBtoCsalevalue: netBtoCsalevalue,
netprofitbeforefinancingcosts: netprofitbeforefinancingcosts, netprofitbeforefinancingcosts: netprofitbeforefinancingcosts,
NetProfit:NetProfit NetProfit: NetProfit,
}; };
// Check if propertyTaxInfo is an array and has values // Check if propertyTaxInfo is an array and has values
@ -948,7 +995,6 @@ const calculatenetBtoCsalevalue = () =>{
} }
}; };
return ( return (
<> <>
<div className="container tabs-wrap"> <div className="container tabs-wrap">
@ -1995,7 +2041,6 @@ Renovation Risk
}} }}
/> />
<div className="row gy-3 align-items-center"> <div className="row gy-3 align-items-center">
<span <span
className="col-md-4" className="col-md-4"
@ -2010,8 +2055,7 @@ Renovation Risk
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${formData.isPurchaseCostInvalid ? "is-invalid" : ""
formData.isPurchaseCostInvalid ? "is-invalid" : ""
}`} }`}
value={formData.purchaseCost} value={formData.purchaseCost}
name="purchaseCost" name="purchaseCost"
@ -2083,8 +2127,7 @@ Renovation Risk
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${cost.isInvalid ? "is-invalid" : ""
cost.isInvalid ? "is-invalid" : ""
}`} // Apply 'is-invalid' class when invalid }`} // Apply 'is-invalid' class when invalid
value={cost.price} value={cost.price}
onChange={(e) => handlePriceChange(e, index)} // Use a new handler for price validation onChange={(e) => handlePriceChange(e, index)} // Use a new handler for price validation
@ -2191,8 +2234,7 @@ Renovation Risk
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${credits.isInvalid ? "is-invalid" : ""
credits.isInvalid ? "is-invalid" : ""
}`} // Apply 'is-invalid' class when invalid }`} // Apply 'is-invalid' class when invalid
value={credits.price} value={credits.price}
onChange={(e) => handleCreditPriceChange(e, index)} // New handler for price validation onChange={(e) => handleCreditPriceChange(e, index)} // New handler for price validation
@ -2340,8 +2382,7 @@ Renovation Risk
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${cost.isInvalid ? "is-invalid" : ""
cost.isInvalid ? "is-invalid" : ""
}`} // Apply 'is-invalid' class when invalid }`} // Apply 'is-invalid' class when invalid
value={cost.price} value={cost.price}
onChange={(e) => onChange={(e) =>
@ -2425,7 +2466,6 @@ Renovation Risk
}} }}
/> />
<div className="row gy-3 align-items-center"> <div className="row gy-3 align-items-center">
<span <span
className="col-md-4" className="col-md-4"
@ -2455,8 +2495,6 @@ Renovation Risk
</div> </div>
</div> </div>
<hr <hr
style={{ style={{
borderColor: "#fda417", // Set the color of the line borderColor: "#fda417", // Set the color of the line
@ -2497,8 +2535,7 @@ Renovation Risk
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${cost.isInvalid ? "is-invalid" : ""
cost.isInvalid ? "is-invalid" : ""
}`} // Apply 'is-invalid' class when invalid }`} // Apply 'is-invalid' class when invalid
value={cost.price} value={cost.price}
onChange={(e) => handleincidentalCostChange(e, index)} // Use a new handler for price validation onChange={(e) => handleincidentalCostChange(e, index)} // Use a new handler for price validation
@ -2598,11 +2635,7 @@ Renovation Risk
className="form-control" className="form-control"
value={cost.title} value={cost.title}
onChange={(e) => onChange={(e) =>
handlecarryCostsTitle( handlecarryCostsTitle(index, "title", e.target.value)
index,
"title",
e.target.value
)
} }
placeholder="Title" placeholder="Title"
required required
@ -2611,13 +2644,10 @@ Renovation Risk
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${cost.isInvalid ? "is-invalid" : ""
cost.isInvalid ? "is-invalid" : ""
}`} // Apply 'is-invalid' class when invalid }`} // Apply 'is-invalid' class when invalid
value={cost.price} value={cost.price}
onChange={(e) => onChange={(e) => handlecarryCostsChange(e, index)} // Use a new handler for price validation
handlecarryCostsChange(e, index)
} // Use a new handler for price validation
placeholder="Price" placeholder="Price"
style={{ textAlign: "right" }} style={{ textAlign: "right" }}
required required
@ -2731,8 +2761,7 @@ Renovation Risk
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${cost.isInvalid ? "is-invalid" : ""
cost.isInvalid ? "is-invalid" : ""
}`} // Apply 'is-invalid' class when invalid }`} // Apply 'is-invalid' class when invalid
value={cost.price} 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
@ -2895,7 +2924,6 @@ Renovation Risk
}} }}
/> />
<div className="row gy-3 align-items-center"> <div className="row gy-3 align-items-center">
<span <span
className="col-md-4" className="col-md-4"
@ -2910,8 +2938,7 @@ Renovation Risk
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${formData.isPurchaseCostInvalid ? "is-invalid" : ""
formData.isPurchaseCostInvalid ? "is-invalid" : ""
}`} }`}
name="sellingPriceBtoC" name="sellingPriceBtoC"
value={formData.sellingPriceBtoC} value={formData.sellingPriceBtoC}
@ -2956,8 +2983,6 @@ Renovation Risk
}} }}
/> />
<span <span
style={{ style={{
color: "#fda417", color: "#fda417",
@ -2989,11 +3014,12 @@ Renovation Risk
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${cost.isInvalid ? "is-invalid" : ""
cost.isInvalid ? "is-invalid" : ""
}`} // Apply 'is-invalid' class when invalid }`} // Apply 'is-invalid' class when invalid
value={cost.price} value={cost.price}
onChange={(e) => handlecostPaidOutofClosingChange(e, index)} // Use a new handler for price validation onChange={(e) =>
handlecostPaidOutofClosingChange(e, index)
} // Use a new handler for price validation
placeholder="Price" placeholder="Price"
style={{ textAlign: "right" }} style={{ textAlign: "right" }}
required required
@ -3072,7 +3098,6 @@ Renovation Risk
}} }}
/> />
<div className="row gy-3 align-items-center"> <div className="row gy-3 align-items-center">
<span <span
className="col-md-4" className="col-md-4"
@ -3111,7 +3136,6 @@ Renovation Risk
}} }}
/> />
<div className="row gy-3 align-items-center"> <div className="row gy-3 align-items-center">
<span <span
className="col-md-4" className="col-md-4"
@ -3150,8 +3174,6 @@ Renovation Risk
}} }}
/> />
<span <span
style={{ style={{
color: "#fda417", color: "#fda417",
@ -3170,11 +3192,7 @@ Renovation Risk
className="form-control" className="form-control"
value={cost.title} value={cost.title}
onChange={(e) => onChange={(e) =>
handleadjustmentsTitle( handleadjustmentsTitle(index, "title", e.target.value)
index,
"title",
e.target.value
)
} }
placeholder="Title" placeholder="Title"
required required
@ -3183,8 +3201,7 @@ Renovation Risk
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${cost.isInvalid ? "is-invalid" : ""
cost.isInvalid ? "is-invalid" : ""
}`} // Apply 'is-invalid' class when invalid }`} // Apply 'is-invalid' class when invalid
value={cost.price} value={cost.price}
onChange={(e) => handleadjustmentsChange(e, index)} // Use a new handler for price validation onChange={(e) => handleadjustmentsChange(e, index)} // Use a new handler for price validation
@ -3266,7 +3283,6 @@ Renovation Risk
}} }}
/> />
<div className="row gy-3 align-items-center"> <div className="row gy-3 align-items-center">
<span <span
className="col-md-4" className="col-md-4"
@ -3296,7 +3312,6 @@ Renovation Risk
</div> </div>
</div> </div>
<hr <hr
style={{ style={{
borderColor: "#fda417", // Set the color of the line borderColor: "#fda417", // Set the color of the line
@ -3337,8 +3352,7 @@ Income Statement Adjustments:
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${cost.isInvalid ? "is-invalid" : ""
cost.isInvalid ? "is-invalid" : ""
}`} // Apply 'is-invalid' class when invalid }`} // Apply 'is-invalid' class when invalid
value={cost.price} value={cost.price}
onChange={(e) => handleincomestatementChange(e, index)} // Use a new handler for price validation onChange={(e) => handleincomestatementChange(e, index)} // Use a new handler for price validation
@ -3420,8 +3434,6 @@ Income Statement Adjustments:
}} }}
/> />
<div className="row gy-3 align-items-center"> <div className="row gy-3 align-items-center">
<span <span
className="col-md-4" className="col-md-4"
@ -3448,7 +3460,6 @@ Income Statement Adjustments:
// placeholder="Total Incidental Cost" // placeholder="Total Incidental Cost"
required required
/> />
</div> </div>
</div> </div>
<hr <hr
@ -3460,9 +3471,6 @@ Income Statement Adjustments:
}} }}
/> />
<span <span
style={{ style={{
color: "#fda417", color: "#fda417",
@ -3511,8 +3519,7 @@ Income Statement Adjustments:
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${formData.isfundspriortoclosingInvalid ? "is-invalid" : ""
formData.isfundspriortoclosingInvalid ? "is-invalid" : ""
}`} }`}
value={formData.fundspriortoclosing} value={formData.fundspriortoclosing}
name="fundspriortoclosing" name="fundspriortoclosing"
@ -3585,11 +3592,9 @@ Income Statement Adjustments:
</div> </div>
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${formData.isPurchaseCostInvalid ? "is-invalid" : ""
formData.isPurchaseCostInvalid ? "is-invalid" : ""
}`} }`}
value={formData.shorttermrental} value={formData.shorttermrental}
name="shorttermrental" name="shorttermrental"
@ -3621,7 +3626,6 @@ Income Statement Adjustments:
Please enter a valid number. Please enter a valid number.
</div> </div>
)} )}
</div> </div>
</div> </div>
<br /> <br />
@ -3640,8 +3644,7 @@ Income Statement Adjustments:
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${formData.isPurchaseCostInvalid ? "is-invalid" : ""
formData.isPurchaseCostInvalid ? "is-invalid" : ""
}`} }`}
value={formData.OtherIncome} value={formData.OtherIncome}
name="OtherIncome" name="OtherIncome"
@ -3691,8 +3694,7 @@ Income Statement Adjustments:
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${formData.isPurchaseCostInvalid ? "is-invalid" : ""
formData.isPurchaseCostInvalid ? "is-invalid" : ""
}`} }`}
value={formData.InsuranceClaim} value={formData.InsuranceClaim}
name="InsuranceClaim" name="InsuranceClaim"
@ -3742,8 +3744,7 @@ Income Statement Adjustments:
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${formData.isPurchaseCostInvalid ? "is-invalid" : ""
formData.isPurchaseCostInvalid ? "is-invalid" : ""
}`} }`}
value={formData.LongTermRental} value={formData.LongTermRental}
name="LongTermRental" name="LongTermRental"
@ -3824,8 +3825,9 @@ Income Statement Adjustments:
<div className="col-md-4"> <div className="col-md-4">
<input <input
type="text" type="text"
className={`form-control ${ className={`form-control ${formData.isFinancingCostClosingCostInvalid
formData.isFinancingCostClosingCostInvalid ? "is-invalid" : "" ? "is-invalid"
: ""
}`} }`}
value={formData.FinancingCostClosingCost} value={formData.FinancingCostClosingCost}
name="FinancingCostClosingCost" name="FinancingCostClosingCost"
@ -3860,7 +3862,6 @@ Income Statement Adjustments:
</div> </div>
</div> </div>
<br /> <br />
<div className="row gy-3 align-items-center"> <div className="row gy-3 align-items-center">
@ -3889,16 +3890,9 @@ Income Statement Adjustments:
// placeholder="Total Incidental Cost" // placeholder="Total Incidental Cost"
required required
/> />
</div> </div>
</div> </div>
<div className="col-md-4"> <div className="col-md-4">
<button <button
className="btn btn-primary back" className="btn btn-primary back"