done
This commit is contained in:
parent
e365da1c7a
commit
ec25e4d637
File diff suppressed because one or more lines are too long
|
@ -45,7 +45,7 @@
|
|||
|
||||
|
||||
|
||||
<script type="module" crossorigin src="/assets/index-BiIJaVB0.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-CKYSXRdS.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-iEl-il0E.css">
|
||||
</head>
|
||||
|
||||
|
|
|
@ -209,7 +209,7 @@ const Addproperty = () => {
|
|||
let value = e.target.value;
|
||||
|
||||
// Remove the dollar sign before validating
|
||||
value = value.replace(/^\$/, '').trim(); // Remove '$' if it exists
|
||||
value = value.replace(/^\$/, "").trim(); // Remove '$' if it exists
|
||||
|
||||
// Use a regular expression to allow only numbers and decimals
|
||||
const isNumber = /^\d*\.?\d*$/.test(value);
|
||||
|
@ -230,8 +230,7 @@ const Addproperty = () => {
|
|||
);
|
||||
setFormData({ ...formData, costPaidAtoB: updatedCosts });
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
const calculateTotalPurchaseCosts = () => {
|
||||
const totalCostsFromArray = formData.costPaidAtoB.reduce((total, cost) => {
|
||||
|
@ -272,8 +271,6 @@ const Addproperty = () => {
|
|||
const handleCreditPriceChange = (e, index) => {
|
||||
const value = e.target.value;
|
||||
|
||||
|
||||
|
||||
// Regular expression to allow only numbers and optional decimals
|
||||
const isNumber = /^\d*\.?\d*$/.test(value);
|
||||
|
||||
|
@ -845,10 +842,10 @@ const Addproperty = () => {
|
|||
return NetProfitBeforeFinancingCosts - FinancingCostClosingCost;
|
||||
};
|
||||
|
||||
const calculaterateofreturn =() => {
|
||||
const calculaterateofreturn = () => {
|
||||
const rateofreturn = calculateNetProfit();
|
||||
return rateofreturn;
|
||||
}
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (
|
||||
|
@ -945,7 +942,7 @@ const Addproperty = () => {
|
|||
netBtoCsalevalue: netBtoCsalevalue,
|
||||
netprofitbeforefinancingcosts: netprofitbeforefinancingcosts,
|
||||
NetProfit: NetProfit,
|
||||
rateofreturn:rateofreturn
|
||||
rateofreturn: rateofreturn,
|
||||
};
|
||||
|
||||
// Check if propertyTaxInfo is an array and has values
|
||||
|
@ -1939,24 +1936,36 @@ const Addproperty = () => {
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<p><span style={{
|
||||
<p>
|
||||
<span
|
||||
style={{
|
||||
color: "#fda417",
|
||||
fontSize: "14px",
|
||||
fontWeight: "bold",
|
||||
}}>[M-D-Y] </span>: <span style={{
|
||||
}}
|
||||
>
|
||||
[M-D-Y]{" "}
|
||||
</span>
|
||||
:{" "}
|
||||
<span
|
||||
style={{
|
||||
color: "#000000",
|
||||
fontSize: "14px",
|
||||
fontWeight: "normal",
|
||||
}}>{new Date(formData.closeDateAtoB).toLocaleDateString('en-US', {
|
||||
month: 'numeric',
|
||||
day: 'numeric',
|
||||
year: 'numeric'
|
||||
})}</span></p>
|
||||
</div>
|
||||
|
||||
}}
|
||||
>
|
||||
{new Date(formData.closeDateAtoB).toLocaleDateString(
|
||||
"en-US",
|
||||
{
|
||||
month: "numeric",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
}
|
||||
)}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div className="row gy-3">
|
||||
{/* Close Date B to C */}
|
||||
|
@ -1991,23 +2000,34 @@ const Addproperty = () => {
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<p><span style={{
|
||||
<p>
|
||||
<span
|
||||
style={{
|
||||
color: "#fda417",
|
||||
fontSize: "14px",
|
||||
fontWeight: "bold",
|
||||
}}>[M-D-Y] : </span>
|
||||
<span style={{
|
||||
}}
|
||||
>
|
||||
[M-D-Y] :{" "}
|
||||
</span>
|
||||
<span
|
||||
style={{
|
||||
color: "#000000",
|
||||
fontSize: "14px",
|
||||
fontWeight: "normal",
|
||||
}}>{new Date(formData.closeDateBtoC).toLocaleDateString('en-US', {
|
||||
month: 'numeric',
|
||||
day: 'numeric',
|
||||
year: 'numeric'
|
||||
})}</span>
|
||||
|
||||
}}
|
||||
>
|
||||
{new Date(formData.closeDateBtoC).toLocaleDateString(
|
||||
"en-US",
|
||||
{
|
||||
month: "numeric",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
}
|
||||
)}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="row gy-3 align-items-center">
|
||||
|
@ -2081,10 +2101,7 @@ const Addproperty = () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
<div className="row gy-3 align-items-center">
|
||||
<span
|
||||
|
@ -2114,8 +2131,6 @@ const Addproperty = () => {
|
|||
</div>
|
||||
<br />
|
||||
|
||||
|
||||
|
||||
<hr
|
||||
style={{
|
||||
borderColor: "#fda417", // Set the color of the line
|
||||
|
@ -2125,7 +2140,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={{
|
||||
|
@ -2139,11 +2154,13 @@ 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}`} // Display the dollar sign in the input
|
||||
name="purchaseCost"
|
||||
onChange={(e) => {
|
||||
let value = e.target.value.replace(/[^\d.]/g, ''); // Remove anything that’s not a digit or decimal point
|
||||
let value = e.target.value.replace(/[^\d.]/g, ""); // Remove anything that’s not a digit or decimal point
|
||||
const isValid = /^\d*\.?\d*$/.test(value); // Regex to allow only numbers and decimal points
|
||||
setFormData({
|
||||
...formData,
|
||||
|
@ -2172,9 +2189,7 @@ const Addproperty = () => {
|
|||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<hr
|
||||
style={{
|
||||
|
@ -2212,7 +2227,9 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${cost.isInvalid ? "is-invalid" : ""}`}
|
||||
className={`form-control ${
|
||||
cost.isInvalid ? "is-invalid" : ""
|
||||
}`}
|
||||
value={`$ ${cost.price}`}
|
||||
onChange={(e) => handlePriceChange(e, index)}
|
||||
placeholder="Price"
|
||||
|
@ -2235,8 +2252,7 @@ const Addproperty = () => {
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
))}
|
||||
|
||||
<div className="col-md-4">
|
||||
<button
|
||||
|
@ -2281,8 +2297,7 @@ const Addproperty = () => {
|
|||
}}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr
|
||||
style={{
|
||||
|
@ -2320,7 +2335,8 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${credits.isInvalid ? "is-invalid" : ""
|
||||
className={`form-control ${
|
||||
credits.isInvalid ? "is-invalid" : ""
|
||||
}`} // Apply 'is-invalid' class when invalid
|
||||
value={credits.price}
|
||||
onChange={(e) => handleCreditPriceChange(e, index)} // New handler for price validation
|
||||
|
@ -2468,7 +2484,8 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${cost.isInvalid ? "is-invalid" : ""
|
||||
className={`form-control ${
|
||||
cost.isInvalid ? "is-invalid" : ""
|
||||
}`} // Apply 'is-invalid' class when invalid
|
||||
value={cost.price}
|
||||
onChange={(e) =>
|
||||
|
@ -2621,7 +2638,8 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${cost.isInvalid ? "is-invalid" : ""
|
||||
className={`form-control ${
|
||||
cost.isInvalid ? "is-invalid" : ""
|
||||
}`} // Apply 'is-invalid' class when invalid
|
||||
value={cost.price}
|
||||
onChange={(e) => handleincidentalCostChange(e, index)} // Use a new handler for price validation
|
||||
|
@ -2730,7 +2748,8 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${cost.isInvalid ? "is-invalid" : ""
|
||||
className={`form-control ${
|
||||
cost.isInvalid ? "is-invalid" : ""
|
||||
}`} // Apply 'is-invalid' class when invalid
|
||||
value={cost.price}
|
||||
onChange={(e) => handlecarryCostsChange(e, index)} // Use a new handler for price validation
|
||||
|
@ -2847,7 +2866,8 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${cost.isInvalid ? "is-invalid" : ""
|
||||
className={`form-control ${
|
||||
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
|
||||
|
@ -3024,7 +3044,8 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${formData.isPurchaseCostInvalid ? "is-invalid" : ""
|
||||
className={`form-control ${
|
||||
formData.isPurchaseCostInvalid ? "is-invalid" : ""
|
||||
}`}
|
||||
name="sellingPriceBtoC"
|
||||
value={formData.sellingPriceBtoC}
|
||||
|
@ -3100,7 +3121,8 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${cost.isInvalid ? "is-invalid" : ""
|
||||
className={`form-control ${
|
||||
cost.isInvalid ? "is-invalid" : ""
|
||||
}`} // Apply 'is-invalid' class when invalid
|
||||
value={cost.price}
|
||||
onChange={(e) =>
|
||||
|
@ -3287,7 +3309,8 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${cost.isInvalid ? "is-invalid" : ""
|
||||
className={`form-control ${
|
||||
cost.isInvalid ? "is-invalid" : ""
|
||||
}`} // Apply 'is-invalid' class when invalid
|
||||
value={cost.price}
|
||||
onChange={(e) => handleadjustmentsChange(e, index)} // Use a new handler for price validation
|
||||
|
@ -3438,7 +3461,8 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${cost.isInvalid ? "is-invalid" : ""
|
||||
className={`form-control ${
|
||||
cost.isInvalid ? "is-invalid" : ""
|
||||
}`} // Apply 'is-invalid' class when invalid
|
||||
value={cost.price}
|
||||
onChange={(e) => handleincomestatementChange(e, index)} // Use a new handler for price validation
|
||||
|
@ -3605,7 +3629,8 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${formData.isfundspriortoclosingInvalid ? "is-invalid" : ""
|
||||
className={`form-control ${
|
||||
formData.isfundspriortoclosingInvalid ? "is-invalid" : ""
|
||||
}`}
|
||||
value={formData.fundspriortoclosing}
|
||||
name="fundspriortoclosing"
|
||||
|
@ -3680,7 +3705,8 @@ 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.shorttermrental}
|
||||
name="shorttermrental"
|
||||
|
@ -3730,7 +3756,8 @@ 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.OtherIncome}
|
||||
name="OtherIncome"
|
||||
|
@ -3780,7 +3807,8 @@ 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.InsuranceClaim}
|
||||
name="InsuranceClaim"
|
||||
|
@ -3830,7 +3858,8 @@ 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.LongTermRental}
|
||||
name="LongTermRental"
|
||||
|
@ -3911,7 +3940,8 @@ const Addproperty = () => {
|
|||
<div className="col-md-4">
|
||||
<input
|
||||
type="text"
|
||||
className={`form-control ${formData.isFinancingCostClosingCostInvalid
|
||||
className={`form-control ${
|
||||
formData.isFinancingCostClosingCostInvalid
|
||||
? "is-invalid"
|
||||
: ""
|
||||
}`}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue