This commit is contained in:
omkieit 2024-10-09 18:06:02 +05:30
parent 0e7abb67d3
commit 5a9e2aec56
4 changed files with 39 additions and 23 deletions

View File

@ -214,6 +214,14 @@ const propertySchema = mongoose.Schema({
type: Number,
required: true, // Set to true if this field is mandatory
},
purchaseCost:{
type: Number,
required: true, // Set to true if this field is mandatory
},
grossproceedsperHUD:{
type: Number,
required: true, // Set to true if this field is mandatory
},
});
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-D_QrejLk.js"></script>
<script type="module" crossorigin src="/assets/index-AvLYi7ml.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-iEl-il0E.css">
</head>

View File

@ -733,8 +733,8 @@ const Addproperty = () => {
formData.renovationRisk &&
formData.closeDateAtoB &&
formData.closeDateBtoC &&
formData.totalCosttoSellBtoC &&
formData.grossproceedsperHUD
formData.purchaseCost &&
formData.sellingPriceBtoC
) {
const totalPurchaseCosts = calculateTotalPurchaseCosts();
const totalPurchaseCostsaftercredits = calculateTotalPurchaseCostsWithCredits();
@ -748,6 +748,9 @@ const Addproperty = () => {
const totalCoststoBuyAtoB = calculatetotalCoststoBuyAtoB();
const costPaidOutofClosing = calculateTotalcostPaidOutofClosing();
const totaladjustments = calculateTotaladjustments();
const fundsavailablefordistribution = calculatefundsavailablefordistribution();
const grossproceedsperHUD = calculateTotalCosttoSellBtoC();
const totalCosttoSellBtoC = calculateTotalCosttoSellBtoC();
// Add user info to formData, including the propertyTaxInfo array
const formDataWithUserInfo = {
@ -769,7 +772,10 @@ const Addproperty = () => {
totalRenovationsandHoldingCost: totalRenovationsandHoldingCost,
totalCoststoBuyAtoB: totalCoststoBuyAtoB,
costPaidOutofClosing:costPaidOutofClosing,
totaladjustments:totaladjustments
totaladjustments:totaladjustments,
fundsavailablefordistribution:fundsavailablefordistribution,
grossproceedsperHUD:grossproceedsperHUD,
totalCosttoSellBtoC:totalCosttoSellBtoC
};
// Check if propertyTaxInfo is an array and has values
@ -1897,6 +1903,7 @@ Renovation Risk
formData.isPurchaseCostInvalid ? "is-invalid" : ""
}`}
value={formData.purchaseCost}
name="purchaseCost"
onChange={(e) => {
const value = e.target.value;
const isValid = /^\d*\.?\d*$/.test(value); // Regex to allow only numbers and decimal points
@ -2796,6 +2803,7 @@ Renovation Risk
className={`form-control ${
formData.isPurchaseCostInvalid ? "is-invalid" : ""
}`}
name="sellingPriceBtoC"
value={formData.sellingPriceBtoC}
onChange={(e) => {
const value = e.target.value;