This commit is contained in:
meghamalore
2024-05-07 19:13:54 +05:30
7 changed files with 776 additions and 352 deletions

View File

@@ -180,9 +180,9 @@ class OverviewController extends Controller
// return response()->json(['status' => 400, 'message' => 'This product has already been Sold']);
// }
// }
// $checkAlreadySold = MarketplaceBuyerForm::where(['id'=>$buyerId,'status'=>'Sold'])->first();
// if($checkAlreadySold)
// {
$checkAlreadySold = MarketplaceBuyerForm::where(['id'=>$buyerId,'status'=>'Sold'])->exists();
if(!$checkAlreadySold)
{
// $marketPlaceId = $checkAlreadySold->associated_id;
// if(MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->exists())
// {
@@ -206,28 +206,58 @@ class OverviewController extends Controller
// // }
// }else
if($status == 'Sold'){
// dd($request->all());
// if($status == 'Sold'){
$getMarketplaceBuyerUnit = MarketplaceBuyerForm::where('id', $buyerId)->first();
$marketPlaceId = $getMarketplaceBuyerUnit->associated_id;
$getUnits = (int)$getMarketplaceBuyerUnit->no_of_units_you_wish_to_buy;
$getUnits = (int)$getMarketplaceBuyerUnit->no_of_units_you_wish_to_buy ?? 0;
$getBuyingPurchaseValue = (int)$getMarketplaceBuyerUnit->getAttributes()['total_purchase_value'];
if(MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->exists())
{
$getAIFData = MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->first();
$oldUnit = (int)$getAIFData->no_of_units_you_wish_to_sell;
$newUnits = $oldUnit - (int)$getUnits;
if($newUnits >= 0)
{
$getAIFData = MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->first();
$oldUnit = (int)$getAIFData->no_of_units_you_wish_to_sell;
$newUnits = $oldUnit - (int)$getUnits;
if($newUnits >= 0)
{
$updateUnits = MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->update([
'no_of_units_you_wish_to_sell' => $newUnits,
]);
}
else{
return response()->json(['status' => 400, 'message' => 'Bid units is more than seller units with '.abs($newUnits).' units']);
}
$updateUnits = MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->update([
'no_of_units_you_wish_to_sell' => $newUnits,
]);
}
else{
return response()->json(['status' => 400, 'message' => 'Bid units is more than seller units with '.abs($newUnits).' units']);
}
}else if(MarketplaceFractionalRealEstateSeller::where('id',$marketPlaceId)->exists())
{
// dd('inside');
$getFREData = MarketplaceFractionalRealEstateSeller::where('id',$marketPlaceId)->first();
$freValue = (int)$getFREData->current_market_value_of_the_property;
$nowValue = $freValue - $getBuyingPurchaseValue;
$percentage = ($freValue - $getBuyingPurchaseValue) / $freValue * 100;
$expectedSellingPrice = (int)$getFREData->expected_selling_price;
$updateExpectedSellingPrice = $expectedSellingPrice * ($percentage / 100);
// dd($percentage,$updateExpectedSellingPrice);
if($nowValue <= 0)
{
$updatePrice = MarketplaceFractionalRealEstateSeller::where('id',$marketPlaceId)->update([
'current_market_value_of_the_property' => 0,
'expected_selling_price' => 0,
]);
}else if($nowValue > 0){
$updatePrice = MarketplaceFractionalRealEstateSeller::where('id',$marketPlaceId)->update([
'current_market_value_of_the_property' => $nowValue,
'expected_selling_price' => $updateExpectedSellingPrice,
]);
}
// else{
// return response()->json(['status' => 400, 'message' => 'Bid price is more than seller price with ₹'.abs($nowValue)]);
// }
}
// dd('outside');
}
// dd('hello');
$alreadySold = MarketplaceBuyerForm::where('id', $buyerId)->update([
'status' => $status
]);

View File

@@ -75,7 +75,7 @@ class MarketPlaceController extends Controller
// $marketplaceListed = [];
return [
@@ -121,45 +121,54 @@ class MarketPlaceController extends Controller
// $status = MarketplaceBuyerForm::where(['associated_id'=>$offering['data']->id,'status'=>'Sold'])->exists() ? 'SOLD':'OPEN';
$status = '';
$checkBIDExist = MarketplaceBuyerForm::where('associated_id', $offering['data']->id)->where('status', 'Sold')->exists();
if($checkBIDExist)
{
if ($checkBIDExist) {
$buyerData = MarketplaceBuyerForm::where('associated_id', $offering['data']->id)->where('status', 'Sold')->get();
// dd($buyerData->toArray());
if(MarketplaceAlternativeInvestmentFundSeller::where('id',$buyerData[0]->associated_id)->exists())
{
if (MarketplaceAlternativeInvestmentFundSeller::where('id', $buyerData[0]->associated_id)->exists()) {
$totalSellUnits = 0;
$buyerData->each(function($data) use($totalSellUnits){
$buyerData->each(function ($data) use ($totalSellUnits) {
return $totalSellUnits += (int)$data->no_of_units_you_wish_to_buy;
});
$getAIFData = MarketplaceAlternativeInvestmentFundSeller::where('id',$buyerData[0]->associated_id)->first();
$getAIFData = MarketplaceAlternativeInvestmentFundSeller::where('id', $buyerData[0]->associated_id)->first();
$aifData = (int)$getAIFData->no_of_units_you_wish_to_sell;
$remainUnits = $aifData - $totalSellUnits;
if($remainUnits <= 0)
if ($remainUnits <= 0) {
$status .= 'SOLD';
}
$status .= 'OPEN';
} elseif (MarketplaceFractionalRealEstateSeller::where('id', $buyerData[0]->associated_id)->exists()) {
$freData = MarketplaceFractionalRealEstateSeller::where('id', $buyerData[0]->associated_id)->first();
if($freData->current_market_value_of_the_property < 0)
{
$status .= 'SOLD';
}
$status .= 'OPEN';
}
elseif(MarketplaceFractionalRealEstateSeller::where('id',$buyerData[0]->associated_id)->exists()){
$status .= 'SOLD';
}
}else{
} else {
$status .= 'OPEN';
}
// dd($status);
$invested = $offering['invested'];
$totalInterestedBuyers = $offering['total-interested-buyers'];
$type = $offering['type'];
$ownProduct = $offering['own-product'];
$logged_in = auth()->guard('users')->check() == true ? true : false;
// dd('offering',$offering['invested_data']);
$investedData = $offering['invested_data'];
return view('Frontend.Pages.marketplace.view-offering', compact('offering', 'type', 'invested',
'totalInterestedBuyers', 'logged_in', 'ownProduct','investedData', 'status'));
return view('Frontend.Pages.marketplace.view-offering', compact(
'offering',
'type',
'invested',
'totalInterestedBuyers',
'logged_in',
'ownProduct',
'investedData',
'status'
));
}
public function viewOfferingData($slug)
@@ -172,7 +181,9 @@ class MarketPlaceController extends Controller
if (!auth()->guard('users')->check()) {
$offering['invested'] = false;
};
// $bidFor = '';
if (MarketplaceFractionalRealEstateSeller::where('slug', $slug)->exists()) {
// $bidFor .= 'fractional-real-estate';
$offering['type'] = 'fractional-real-estate';
$marketFRE = MarketplaceFractionalRealEstateSeller::where('slug', $slug)->first();
// if($user_id){
@@ -184,13 +195,14 @@ class MarketPlaceController extends Controller
$offering['total-interested-buyers'] = $this->checkInvestmentInterested($offering['data'], 'marketplace_fre_sellers')['total-interested-buyers'];
} elseif (MarketplaceAlternativeInvestmentFundSeller::where('slug', $slug)->exists()) {
// $bidFor .= 'alternative-investment-funds';
$offering['type'] = 'alternative-investment-funds';
$marketAIF = MarketplaceAlternativeInvestmentFundSeller::where('slug', $slug)->first();
$offering['own-product'] = $user_id != null ? MarketplaceSellerForm::where(['id' => $marketAIF->seller_forms_id, 'users_id' => $user_id])->exists() : '';
$offering['data'] = $marketAIF;
$offering['invested'] = $this->checkInvestmentInterested($offering['data'], 'marketplace_aif_sellers')['interested-status'];
$offering['invested_data'] = $this->checkInvestmentInterestedData($offering['data'], 'marketplace_aif_sellers')['interested-status-data'];
$offering['total-interested-buyers'] = $this->checkInvestmentInterested($offering['data'], 'marketplace_aif_sellers')['total-interested-buyers'];
} elseif (MarketplaceOtherProductsSeller::where('slug', $slug)->exists()) {
$offering['type'] = 'other-products';
@@ -212,7 +224,7 @@ class MarketPlaceController extends Controller
if (auth()->guard('users')->check()) {
$interestedStatus = MarketplaceBuyerForm::where(['users_id' => auth()->guard('users')->user()->id, 'table' => $table, 'associated_id' => $offering->id])->first();
}
return ['interested-status-data' => $interestedStatus ];
return ['interested-status-data' => $interestedStatus];
}
public function checkInvestmentInterested($offering, $table)
@@ -231,7 +243,7 @@ class MarketPlaceController extends Controller
public function buyerForm($slug)
{
$offering = $this->viewOfferingData($slug);
$table = $offering['type'];
$id = $offering['data']->id;
$userData = array();
@@ -259,26 +271,50 @@ class MarketPlaceController extends Controller
'contact_number' => $user->contact_number ?? null,
'email' => $user->email ?? $user->email,
];
return view('Frontend.Pages.profile.market-list.edit-buyer-form', compact('table', 'id', 'userData','investedData'));
return view('Frontend.Pages.profile.market-list.edit-buyer-form', compact('table', 'id', 'userData', 'investedData'));
}
public function buyerFormSubmit(Request $request)
{
$validator = Validator::make($request->all(), [
'id' => 'required',
'table' => 'required',
'name' => 'required',
'city' => 'required',
'country' => 'required',
'contact_number' => 'required|numeric|digits:10',
'email_id' => 'required',
'no_of_units_you_wish_to_buy' => 'required|numeric',
'offer_price_per_unit' => 'required|numeric',
], [
'required' => 'The :attribute field must be required',
'numeric' => 'The :attribute field must be in digits',
'digits' => 'The :attribute field must have 10 digits',
]);
// dd($request->all());
if($request->table == 'alternative-investment-funds')
{
$validator = Validator::make($request->all(), [
'id' => 'required',
'table' => 'required',
'name' => 'required',
'city' => 'required',
'country' => 'required',
'contact_number' => 'required|numeric|digits:10',
'email_id' => 'required',
'no_of_units_you_wish_to_buy' => 'required|numeric',
'offer_price_per_unit' => 'required|numeric',
], [
'required' => 'The :attribute field must be required',
'numeric' => 'The :attribute field must be in digits',
'digits' => 'The :attribute field must have 10 digits',
]);
}else
{
$validator = Validator::make($request->all(), [
'id' => 'required',
'table' => 'required',
'name' => 'required',
'city' => 'required',
'country' => 'required',
'contact_number' => 'required|numeric|digits:10',
'email_id' => 'required',
'email_id' => 'required',
// 'no_of_units_you_wish_to_buy' => 'required|numeric',
// 'offer_price_per_unit' => 'required|numeric',
], [
'required' => 'The :attribute field must be required',
'numeric' => 'The :attribute field must be in digits',
'digits' => 'The :attribute field must have 10 digits',
]);
}
$validationMessage = $this->validationError($validator);
@@ -306,8 +342,8 @@ class MarketPlaceController extends Controller
'country' => $request->country,
'contact_number' => $request->contact_number,
'email_id' => $request->email_id,
'no_of_units_you_wish_to_buy' => $request->no_of_units_you_wish_to_buy,
'offer_price_per_unit' => $request->offer_price_per_unit,
'no_of_units_you_wish_to_buy' => $request->no_of_units_you_wish_to_buy ?? 0,
'offer_price_per_unit' => $request->offer_price_per_unit ?? 0,
'total_purchase_value' => $request->total_purchase_value,
]);
if ($buyerForm) {
@@ -326,23 +362,41 @@ class MarketPlaceController extends Controller
//update form start
public function buyerFormSubmitUpdate(Request $request)
{
$validator = Validator::make($request->all(), [
'marketplaceBuyerFormId' => 'required',
'id' => 'required',
'table' => 'required',
'name' => 'required',
'city' => 'required',
'country' => 'required',
'contact_number' => 'required|numeric|digits:10',
'email_id' => 'required',
'no_of_units_you_wish_to_buy' => 'required|numeric',
'offer_price_per_unit' => 'required|numeric',
], [
'required' => 'The :attribute field must be required',
'numeric' => 'The :attribute field must be in digits',
'digits' => 'The :attribute field must have 10 digits',
]);
// dd($request->all());
if ($request->table == 'alternative-investment-funds')
$validator = Validator::make($request->all(), [
'marketplaceBuyerFormId' => 'required',
'id' => 'required',
'table' => 'required',
'name' => 'required',
'city' => 'required',
'country' => 'required',
'contact_number' => 'required|numeric|digits:10',
'email_id' => 'required',
'no_of_units_you_wish_to_buy' => 'required|numeric',
'offer_price_per_unit' => 'required|numeric',
], [
'required' => 'The :attribute field must be required',
'numeric' => 'The :attribute field must be in digits',
'digits' => 'The :attribute field must have 10 digits',
]);
else {
$validator = Validator::make($request->all(), [
'marketplaceBuyerFormId' => 'required',
'id' => 'required',
'table' => 'required',
'name' => 'required',
'city' => 'required',
'country' => 'required',
'contact_number' => 'required|numeric|digits:10',
'email_id' => 'required',
'total_purchase_value' => 'required',
], [
'required' => 'The :attribute field must be required',
'numeric' => 'The :attribute field must be in digits',
'digits' => 'The :attribute field must have 10 digits',
]);
}
$validationMessage = $this->validationError($validator);
if ($validationMessage) {
@@ -360,20 +414,23 @@ class MarketPlaceController extends Controller
$productName = \DB::table($table)->where('id', $request->id)->value('security_name');
}
$buyerForm = MarketplaceBuyerForm::where('id',$request->marketplaceBuyerFormId)->update([
'users_id' => auth()->guard('users')->user()->id,
'associated_id' => $request->id,
'table' => $table,
'name' => $request->name,
'city' => $request->city,
'country' => $request->country,
'contact_number' => $request->contact_number,
'email_id' => $request->email_id,
'no_of_units_you_wish_to_buy' => $request->no_of_units_you_wish_to_buy,
'offer_price_per_unit' => $request->offer_price_per_unit,
'total_purchase_value' => $request->total_purchase_value,
]);
if ($buyerForm) {
$checkAlreadySold = MarketplaceBuyerForm::where(['id' => $request->marketplaceBuyerFormId, 'status' => 'Sold'])->doesntExist();
if ($checkAlreadySold) {
$buyerForm = MarketplaceBuyerForm::where('id', $request->marketplaceBuyerFormId)->update([
'users_id' => auth()->guard('users')->user()->id,
'associated_id' => $request->id,
'table' => $table,
'name' => $request->name,
'city' => $request->city,
'country' => $request->country,
'contact_number' => $request->contact_number,
'email_id' => $request->email_id,
'no_of_units_you_wish_to_buy' => $request->no_of_units_you_wish_to_buy ?? 0,
'offer_price_per_unit' => $request->offer_price_per_unit ?? 0,
'total_purchase_value' => $request->total_purchase_value,
]);
if ($buyerForm) {
}
$name = auth()->guard('users')->user()->name;
$notify['message'] = "$name has Updated a buyer form for $productName!";
$type = 'Buyer Form';
@@ -382,10 +439,12 @@ class MarketPlaceController extends Controller
$data->notify(new UserAdmin($notify, $type));
}
return response()->json(['status' => 200, 'message' => "Buyer Form Updated For Successfully"]);
} else {
return response()->json(['status' => 400, 'message' => "This product has been already sold to you"]);
}
return response()->json(['status' => 400, 'message' => "Buyer Form Could Not Be Updated!"]);
}
//update formm end
public function buyerFormAPI($slug)
{
@@ -509,7 +568,7 @@ class MarketPlaceController extends Controller
$productName = \DB::table($table)->where('id', $request->id)->value('security_name');
}
$buyerForm = MarketplaceBuyerForm::where('id',$request->marketplaceBuyerFormId)->update([
$buyerForm = MarketplaceBuyerForm::where('id', $request->marketplaceBuyerFormId)->update([
'users_id' => $request->user()->id,
'associated_id' => $request->id,
'table' => $table,
@@ -554,7 +613,6 @@ class MarketPlaceController extends Controller
$offering['invested'] = $this->checkInvestmentInterestedAPI($offering['data'], 'marketplace_fre_sellers')['interested-status'];
$offering['invested-data'] = $this->checkInvestmentInterestedDataAPI($offering['data'], 'marketplace_fre_sellers')['interested-status-data']; //new added
$offering['total-interested-buyers'] = $this->checkInvestmentInterestedAPI($offering['data'], 'marketplace_fre_sellers')['total-interested-buyers'];
} elseif (MarketplaceAlternativeInvestmentFundSeller::where('slug', $slug)->exists()) {
$offering['type'] = 'alternative-investment-funds';
$marketAIF = MarketplaceAlternativeInvestmentFundSeller::where('slug', $slug)->first();
@@ -563,9 +621,8 @@ class MarketPlaceController extends Controller
$offering['invested'] = $this->checkInvestmentInterestedAPI($offering['data'], 'marketplace_aif_sellers')['interested-status'];
$offering['invested-data'] = $this->checkInvestmentInterestedDataAPI($offering['data'], 'marketplace_aif_sellers')['interested-status-data'];
$offering['total-interested-buyers'] = $this->checkInvestmentInterestedAPI($offering['data'], 'marketplace_aif_sellers')['total-interested-buyers'];
} elseif (MarketplaceOtherProductsSeller::where('slug', $slug)->exists()) {
$offering['type'] = 'other-products';
$marketOP = MarketplaceOtherProductsSeller::where('slug', $slug)->first();
@@ -586,7 +643,7 @@ class MarketPlaceController extends Controller
if (request()->user()) {
$interestedStatus = MarketplaceBuyerForm::where(['users_id' => request()->user()->id, 'table' => $table, 'associated_id' => $offering->id])->first();
}
return ['interested-status-data' => $interestedStatus ];
return ['interested-status-data' => $interestedStatus];
}
public function checkInvestmentInterestedAPI($offering, $table)

View File

@@ -61,18 +61,19 @@ class MarketplaceFractionalRealEstateSeller extends Model
public function getSoldStatusAttribute($id)
{
return MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->exists() ? 'SOLD' : 'OPEN';
$buyerData = MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->get();
$totalSellUnits = 0;
$buyerData->each(function($data) use($totalSellUnits){
return $totalSellUnits += (int)$data->no_of_units_you_wish_to_buy;
});
if(MarketplaceFractionalRealEstateSeller::where('id',$buyerData->associated_id)->exists())
// return MarketplaceBuyerForm::where('associated_id', $id)->where('status', 'Sold')->exists() ? 'SOLD' : 'OPEN';
// dd($id);
// $buyerData = MarketplaceBuyerForm::where('associated_id', $this->id)->where('status', 'Sold')->get();
// $totalSellUnits = 0;
// $buyerData->each(function($data) use($totalSellUnits){
// return $totalSellUnits += (int)$data->no_of_units_you_wish_to_buy;
// });
if(MarketplaceFractionalRealEstateSeller::where('id',$id)->exists())
{
$getAIFData = MarketplaceFractionalRealEstateSeller::where('id',$buyerData->associated_id)->first();
$aifData = (int)$getAIFData->no_of_units_you_wish_to_sell;
$remainUnits = $aifData - $totalSellUnits;
if($remainUnits < 0)
$getFREData = MarketplaceFractionalRealEstateSeller::where('id',$id)->first();
// $aifData = (int)$getFREData->no_of_units_you_wish_to_sell;
// $remainUnits = $aifData - $totalSellUnits;
if($getFREData->current_market_value_of_the_property < 0)
{
return 'SOLD';
}

View File

@@ -485,7 +485,7 @@ h4.inner-title {
.assets-card .middle-sec {
display: flex;
background-color: #e8c69f;
padding:8px 7px;
padding: 8px 7px;
align-items: center;
justify-content: space-between;
}
@@ -4601,6 +4601,18 @@ button.swal2-confirm.btn.btn-primary.popup-button {
background-color: #c18948 !important;
border: none;
}
#exampleModalCenter button.close {
border: none;
background-color: transparent;
font-size: 29px;
}
#exampleModalCenter .modal-header.p-2 {
display: flex;
justify-content: end;
}
#exampleModalCenter .modal-content a.yellow-btn {
height: 42px;
}
/*======responsive=====*/

View File

@@ -70,14 +70,14 @@
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-header p-2">
{{-- <h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5> --}}
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<h4 class="text-center">Please Login To Show Interest.</h4>
<h5 class="text-center">Please Login To Show Interest.</h5>
</div>
<div class="modal-footer">
{{-- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> --}}

View File

@@ -33,7 +33,8 @@
</div>
<div class="form">
<div class="container">
<form id="marketplace-buyer-form" method="POST">
@if($table == 'alternative-investment-funds')
<form id="marketplace-buyer-form-for-aif" method="POST">
@csrf
<input type="hidden" id="id" name="id" value="{{$id}}">
<input type="hidden" id="table" name="table" value="{{$table}}">
@@ -88,6 +89,63 @@
</div>
</div>
</form>
@else
<form id="marketplace-buyer-form-for-fre" method="POST">
@csrf
<input type="hidden" id="id" name="id" value="{{$id}}">
<input type="hidden" id="table" name="table" value="{{$table}}">
<div class="row">
<div class="form-group col-md-6">
<label>Name</label>
<input type="text" name="name" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" value="{{$userData->name}}">
</div>
<div class="form-group col-md-6">
<label>City</label>
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="city">
</div>
<div class="form-group col-md-6">
<label>Country</label>
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="country">
</div>
<div class="form-group col-md-6">
<label>Contact Number</label>
<input type="text" name="contact_number" minlength="10" maxlength="10" onkeydown="return /^[0-9]{9}+$/i.test(event.key)" value="{{$userData->contact_number}}">
</div>
<div class="form-group col-md-6">
<label>Email</label>
<input type="email" name="email_id" id="email_id" value="{{$userData->email}}">
</div>
{{-- <div class="form-group col-md-6">
<label>No. Of Units You Wish To Buy</label>
<input type="number" name="no_of_units_you_wish_to_buy" id="no_of_units_you_wish_to_buy" placeholder="Eg: 500">
</div>
<div class="form-group col-md-6">
<label>Offer Price per Unit</label>
<input type="number" name="offer_price_per_unit" id="offer_price_per_unit" placeholder="Eg: 500">
</div> --}}
<div class="form-group col-md-6">
<label>Total Purchase Value</label>
<input type="number" name="total_purchase_value">
</div>
<div class="form-check">
<h4>Declaration</h4>
<input class="form-check-input" type="checkbox" id="checkbox-1" name="declaration" />
<label class="form-check-label" for="checkbox-1">I hereby declare that the details furnished above are true and correct to the best of my knowledge and belief and I undertake to inform you of any changes therein, immediately. In case any of the above information is found to be false or untrue or misleading or misrepresenting, I am aware that I may be held liable for it.</label>
</div>
<div class="form-group col-md-12">
<div class="bg-warning text-center">
Need Help? <br>
If you are experiencing any difficulties filling out the required information, we are here to help. Please reach out to us at info@freeu.in
</div>
</div>
<div class="text-center form-group col-md-12">
<button type="submit" id="submit-btn" class="blue-btn text-center">Submit</button>
<button type="submit" id="loaderBtn" class="blue-btn d-none text-center"><span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Loading...</button>
</div>
</div>
</form>
@endif
</div>
</div>
</div>
@@ -98,10 +156,11 @@
$.validator.addMethod("ValidEmail",function(value){
return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(value);
},"Please enter valid email");
$("#marketplace-buyer-form").validate({
$.validator.addMethod("ValidEmail",function(value){
return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(value);
},"Please enter valid email");
$("#marketplace-buyer-form-for-aif").validate({
// jQuery.validator.addMethod('isEmailValid',function(value){
// return /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(value);
// },"Invalid email. Please enter a valid email address.");
@@ -187,54 +246,142 @@
});
},
});
$("#marketplace-buyer-form-for-fre").validate({
// jQuery.validator.addMethod('isEmailValid',function(value){
// return /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(value);
// },"Invalid email. Please enter a valid email address.");
ignore: [],
debug: false,
rules: {
name: "required",
city: "required",
country: "required",
contact_number: {
required: true,
digits: true,
minlength: 10,
maxlength: 10,
},
email_id: {
required: true,
email: true,
ValidEmail: true,
// isEmailValid:true,
},
// no_of_units_you_wish_to_buy: {
// required: true,
// digits: true
// },
// offer_price_per_unit: {
// required: true,
// digits: true
// },
declaration: "required",
total_purchase_value: "required",
},
messages: {
name: 'Please enter your name',
city: 'Please enter your city',
country: 'Please enter your country',
contact_number: {
required: 'Please enter your contact number',
digits: 'Please enter digits',
minlength: 'Contact Number should be 10 digits',
maxlength: 'Contact Number should be 10 digits',
},
email_id: {
required: " Please enter a valid email",
ValidEmail:"invalid email",
email: " invalid email",
},
// no_of_units_you_wish_to_buy: {
// required: 'Please enter no. of units you wish to buy',
// digits: 'Please enter digits'
// },
// offer_price_per_unit: {
// required: 'Please enter offer price per unit',
// digits: 'Please enter digits'
// },
declaration: 'Please check declaration',
total_purchase_value: 'Please enter purchase value'
},
submitHandler: function(form) {
var formData = new FormData(form);
$.ajax({
url: "{{route('marketplace-buyer-form')}}",
type: "POST",
data: formData,
beforeSend: function() {
$('#loaderBtn').removeClass('d-none');
$('#submit-btn').addClass('d-none');
},
processData: false,
contentType: false,
dataType: "json",
success: function(result) {
if (result.status == 200) {
toastr.success(result.message);
setTimeout(function (){
window.location.href = '{{route("market_place")}}';
},5000);
}
if (result.status == 400) {
$('#submit-btn').removeClass('d-none');
$('#loaderBtn').addClass('d-none');
toastr.warning(result.message);
}
},
});
},
});
$(document).ready(function(){
var unit = 0;
var price = 0;
$('#no_of_units_you_wish_to_buy').keyup(function() {
unit = 0 * 1;
var no_of_units = $('#no_of_units_you_wish_to_buy').val();
unit = unit + no_of_units;
totalValue(unit,price);
});
$(document).ready(function(){
var unit = 0;
var price = 0;
$('#no_of_units_you_wish_to_buy').keyup(function() {
unit = 0 * 1;
var no_of_units = $('#no_of_units_you_wish_to_buy').val();
unit = unit + no_of_units;
totalValue(unit,price);
});
// taking price
$('#offer_price_per_unit').keyup(function() {
price = 0 * 1;
var price_per_units = $('#offer_price_per_unit').val();
price = price + price_per_units;
totalValue(unit,price);
});
// alert(unit * price);
// var total = unit * price;
// $('#total_purchase_value').val(total);
// totalPrice();
// if (no_of_units != "") {
// if ($('#offer_price_per_unit').val() != "") {
// var total_price = no_of_units * $('#offer_price_per_unit').val();
// $('#total_purchase_value').val(total_price);
// }
// }
// taking price
$('#offer_price_per_unit').keyup(function() {
price = 0 * 1;
var price_per_units = $('#offer_price_per_unit').val();
price = price + price_per_units;
totalValue(unit,price);
});
// alert(unit * price);
// var total = unit * price;
// $('#total_purchase_value').val(total);
// totalPrice();
// if (no_of_units != "") {
// if ($('#offer_price_per_unit').val() != "") {
// var total_price = no_of_units * $('#offer_price_per_unit').val();
// $('#total_purchase_value').val(total_price);
// }
// }
// $('#offer_price_per_unit').keyup(function() {
// var price_per_units = $('#offer_price_per_unit').val();
// if (no_of_units != "") {
// if (price_per_units != "") {
// var total_price = no_of_units * price_per_units;
// $('#total_purchase_value').val(total_price);
// }
// }
// $('#offer_price_per_unit').keyup(function() {
// var price_per_units = $('#offer_price_per_unit').val();
// if (no_of_units != "") {
// if (price_per_units != "") {
// var total_price = no_of_units * price_per_units;
// $('#total_purchase_value').val(total_price);
// }
// }
// });
// });
// });
});
});
function totalValue(unit,price){
total = unit * price ;
$('#total_purchase_value').val(total);
}
function totalValue(unit,price){
total = unit * price ;
$('#total_purchase_value').val(total);
}
</script>
@endsection

View File

@@ -1,7 +1,7 @@
@extends('Frontend.layouts.master')
@section('content')
<div class="market-list">
{{-- <div class="banner right-ivestment">
<div class="market-list">
{{-- <div class="banner right-ivestment">
<div class="container row">
<div class="col-md-6 content" data-aos="fade-right">
<h1 class="invest-header si-hd">EDIT your investment's <br>today!</h1>
@@ -16,220 +16,398 @@
</div>
</div>
</div> --}}
<div class="banner right-ivestment">
<div class="container row">
<div class="content" data-aos="fade-right">
<h1 class="invest-header si-hd text-center">Edit your investment's today!</h1>
<ul class="si-hd_p p-0 d-flex justify-content-between">
<li>Verified Buyers</li>
<li>Expert Verification</li>
<li>Sell From Your Home</li>
</ul>
<div class="banner right-ivestment">
<div class="container row">
<div class="content" data-aos="fade-right">
<h1 class="invest-header si-hd text-center">Edit your investment's today!</h1>
<ul class="si-hd_p p-0 d-flex justify-content-between">
<li>Verified Buyers</li>
<li>Expert Verification</li>
<li>Sell From Your Home</li>
</ul>
</div>
<div class="col-md-6 bgn-image" data-aos="fade-left">
{{-- <img src="/public/assets/media/FrontendImages/r-invest.png"> --}}
</div>
</div>
</div>
<div class="col-md-6 bgn-image" data-aos="fade-left">
{{-- <img src="/public/assets/media/FrontendImages/r-invest.png"> --}}
</div>
</div>
</div>
<div class="form">
<div class="container">
<form id="marketplace-buyer-form-update" method="POST">
@csrf
<input type="hidden" id="marketplaceBuyerFormId" name="marketplaceBuyerFormId" value="{{$investedData->id}}">
<input type="hidden" id="id" name="id" value="{{$id}}">
<input type="hidden" id="table" name="table" value="{{$table}}">
<div class="row">
<div class="form-group col-md-6">
<label>Name</label>
<input type="text" name="name" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" value="{{$investedData->name}}">
</div>
<div class="form-group col-md-6">
<label>City</label>
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="city" value="{{$investedData->city}}">
</div>
<div class="form-group col-md-6">
<label>Country</label>
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="country" value="{{$investedData->country}}">
</div>
<div class="form-group col-md-6">
<label>Contact Number</label>
<input type="text" name="contact_number" minlength="10" maxlength="10"
onkeydown="return /^[0-9]{9}+$/i.test(event.key)" value="{{$investedData->contact_number}}" >
</div>
<div class="form-group col-md-6">
<label>Email</label>
<input type="email" name="email_id" id="email_id" value="{{$investedData->email_id}}" >
</div>
<div class="form-group col-md-6">
<div class="form">
<div class="container">
@if ($table == 'alternative-investment-funds')
{{-- @if ($table == 'fractional') --}}
<form id="marketplace-buyer-form-update-for-aif" method="POST">
@csrf
<input type="hidden" id="marketplaceBuyerFormId" name="marketplaceBuyerFormId"
value="{{ $investedData->id }}">
<input type="hidden" id="id" name="id" value="{{ $id }}">
<input type="hidden" id="table" name="table" value="{{ $table }}">
<div class="row">
<div class="form-group col-md-6">
<label>Name</label>
<input type="text" name="name" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)"
value="{{ $investedData->name }}">
</div>
<div class="form-group col-md-6">
<label>City</label>
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="city"
value="{{ $investedData->city }}">
</div>
<div class="form-group col-md-6">
<label>Country</label>
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="country"
value="{{ $investedData->country }}">
</div>
<div class="form-group col-md-6">
<label>Contact Number</label>
<input type="text" name="contact_number" minlength="10" maxlength="10"
onkeydown="return /^[0-9]{9}+$/i.test(event.key)"
value="{{ $investedData->contact_number }}">
</div>
<div class="form-group col-md-6">
<label>Email</label>
<input type="email" name="email_id" id="email_id" value="{{ $investedData->email_id }}">
</div>
<div class="form-group col-md-6">
<label>No. Of Units You Wish To Buy</label>
<input type="number" name="no_of_units_you_wish_to_buy" id="no_of_units_you_wish_to_buy"
placeholder="Eg: 500" value="{{ $investedData->no_of_units_you_wish_to_buy }}">
</div>
<div class="form-group col-md-6">
<label>Offer Price per Unit</label>
<input type="number" name="offer_price_per_unit" id="offer_price_per_unit"
placeholder="Eg: 500"
value="{{ preg_replace('/[^0-9]/', '', $investedData->offer_price_per_unit) }}">
{{-- {{preg_replace('/[^0-9]/', '', $investedData->offer_price_per_unit)}} --}}
</div>
<div class="form-group col-md-6">
<label>Total Purchase Value</label>
<input type="number" name="total_purchase_value" id="total_purchase_value" readonly
value="{{ preg_replace('/[^0-9]/', '', $investedData->total_purchase_value) }}">
</div>
<div class="form-check">
<h4>Declaration</h4>
<input class="form-check-input" type="checkbox" id="checkbox-1" name="declaration" />
<label class="form-check-label" for="checkbox-1">I hereby declare that the details furnished
above are true and correct to the best of my knowledge and belief and I undertake to
inform you of any changes therein, immediately. In case any of the above information is
found to be false or untrue or misleading or misrepresenting, I am aware that I may be
held liable for it.</label>
</div>
<div class="form-group col-md-12">
<div class="bg-warning text-center">
Need Help? <br>
If you are experiencing any difficulties filling out the required information, we are
here to help. Please reach out to us at info@freeu.in
</div>
</div>
<div class="text-center form-group col-md-12">
<button type="submit" id="submit-btn" class="blue-btn text-center">Update Your Bid</button>
<button type="submit" id="loaderBtn" class="blue-btn d-none text-center"><span
class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Loading...</button>
</div>
</div>
</form>
@else
<form id="marketplace-buyer-form-update-for-fre" method="POST">
@csrf
<input type="hidden" id="marketplaceBuyerFormId" name="marketplaceBuyerFormId"
value="{{ $investedData->id }}">
<input type="hidden" id="id" name="id" value="{{ $id }}">
<input type="hidden" id="table" name="table" value="{{ $table }}">
<div class="row">
<div class="form-group col-md-6">
<label>Name</label>
<input type="text" name="name" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)"
value="{{ $investedData->name }}">
</div>
<div class="form-group col-md-6">
<label>City</label>
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="city"
value="{{ $investedData->city }}">
</div>
<div class="form-group col-md-6">
<label>Country</label>
<input type="text" onkeydown="return /^[a-zA-Z\s]+$/i.test(event.key)" name="country"
value="{{ $investedData->country }}">
</div>
<div class="form-group col-md-6">
<label>Contact Number</label>
<input type="text" name="contact_number" minlength="10" maxlength="10"
onkeydown="return /^[0-9]{9}+$/i.test(event.key)"
value="{{ $investedData->contact_number }}">
</div>
<div class="form-group col-md-6">
<label>Email</label>
<input type="email" name="email_id" id="email_id"
value="{{ $investedData->email_id }}">
</div>
{{-- <div class="form-group col-md-6">
<label>No. Of Units You Wish To Buy</label>
<input type="number" name="no_of_units_you_wish_to_buy" id="no_of_units_you_wish_to_buy" placeholder="Eg: 500" value="{{$investedData->no_of_units_you_wish_to_buy}}">
</div>
<div class="form-group col-md-6">
<label>Offer Price per Unit</label>
<input type="number" name="offer_price_per_unit" id="offer_price_per_unit" placeholder="Eg: 500" value="{{preg_replace('/[^0-9]/', '', $investedData->offer_price_per_unit)}}">
{{-- {{preg_replace('/[^0-9]/', '', $investedData->offer_price_per_unit)}} --}}
</div>
<div class="form-group col-md-6">
<label>Total Purchase Value</label>
<input type="number" name="total_purchase_value" id="total_purchase_value" readonly value="{{preg_replace('/[^0-9]/', '', $investedData->total_purchase_value)}}">
</div>
<div class="form-check">
<h4>Declaration</h4>
<input class="form-check-input" type="checkbox" id="checkbox-1" name="declaration" />
<label class="form-check-label" for="checkbox-1">I hereby declare that the details furnished above are true and correct to the best of my knowledge and belief and I undertake to inform you of any changes therein, immediately. In case any of the above information is found to be false or untrue or misleading or misrepresenting, I am aware that I may be held liable for it.</label>
</div>
<div class="form-group col-md-12">
<div class="bg-warning text-center">
Need Help? <br>
If you are experiencing any difficulties filling out the required information, we are here to help. Please reach out to us at info@freeu.in
</div>
</div>
<div class="text-center form-group col-md-12">
<button type="submit" id="submit-btn" class="blue-btn text-center">Update Your Bid</button>
<button type="submit" id="loaderBtn" class="blue-btn d-none text-center"><span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Loading...</button>
</div>
</div> --}}
<div class="form-group col-md-6">
<label>Total Purchase Value</label>
<input type="number" name="total_purchase_value"
value="{{ preg_replace('/[^0-9]/', '', $investedData->total_purchase_value) }}">
</div>
<div class="form-check">
<h4>Declaration</h4>
<input class="form-check-input" type="checkbox" id="checkbox-1" name="declaration" />
<label class="form-check-label" for="checkbox-1">I hereby declare that the details
furnished above are true and correct to the best of my knowledge and belief and I
undertake to inform you of any changes therein, immediately. In case any of the above
information is found to be false or untrue or misleading or misrepresenting, I am aware
that I may be held liable for it.</label>
</div>
<div class="form-group col-md-12">
<div class="bg-warning text-center">
Need Help? <br>
If you are experiencing any difficulties filling out the required information, we are
here to help. Please reach out to us at info@freeu.in
</div>
</div>
<div class="text-center form-group col-md-12">
<button type="submit" id="submit-btn" class="blue-btn text-center">Update Your
Bid</button>
<button type="submit" id="loaderBtn" class="blue-btn d-none text-center"><span
class="spinner-border spinner-border-sm" role="status"
aria-hidden="true"></span>
Loading...</button>
</div>
</div>
</form>
@endif
</div>
</form>
</div>
</div>
</div>
</div>
@endsection
@section('scripts')
<script>
$.validator.addMethod("ValidEmail",function(value){
<script>
$.validator.addMethod("ValidEmail", function(value) {
return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(value);
},"Please enter valid email");
$("#marketplace-buyer-form-update").validate({
// jQuery.validator.addMethod('isEmailValid',function(value){
// return /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(value);
// },"Invalid email. Please enter a valid email address.");
ignore: [],
debug: false,
rules: {
name: "required",
city: "required",
country: "required",
contact_number: {
required: true,
digits: true,
minlength: 10,
maxlength: 10,
},
email_id: {
required: true,
email: true,
ValidEmail: true,
// isEmailValid:true,
},
no_of_units_you_wish_to_buy: {
required: true,
digits: true
},
offer_price_per_unit: {
required: true,
digits: true
},
declaration: "required",
},
messages: {
name: 'Please enter your name',
city: 'Please enter your city',
country: 'Please enter your country',
contact_number: {
required: 'Please enter your contact number',
digits: 'Please enter digits',
minlength: 'Contact Number should be 10 digits',
maxlength: 'Contact Number should be 10 digits',
},
email_id: {
required: " Please enter a valid email",
ValidEmail:"invalid email",
email: " invalid email"
},
no_of_units_you_wish_to_buy: {
required: 'Please enter no. of units you wish to buy',
digits: 'Please enter digits'
},
offer_price_per_unit: {
required: 'Please enter offer price per unit',
digits: 'Please enter digits'
},
declaration: 'Please check declaration'
},
submitHandler: function(form) {
var formData = new FormData(form);
$.ajax({
url: "{{route('marketplace-buyer-form-update')}}",
type: "POST",
data: formData,
beforeSend: function() {
$('#loaderBtn').removeClass('d-none');
$('#submit-btn').addClass('d-none');
}, "Please enter valid email");
$("#marketplace-buyer-form-update-for-aif").validate({
// jQuery.validator.addMethod('isEmailValid',function(value){
// return /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(value);
// },"Invalid email. Please enter a valid email address.");
ignore: [],
debug: false,
rules: {
name: "required",
city: "required",
country: "required",
contact_number: {
required: true,
digits: true,
minlength: 10,
maxlength: 10,
},
processData: false,
contentType: false,
dataType: "json",
success: function(result) {
if (result.status == 200) {
toastr.success(result.message);
setTimeout(function (){
window.location.href = '{{route("market_place")}}';
},5000);
}
if (result.status == 400) {
$('#submit-btn').removeClass('d-none');
$('#loaderBtn').addClass('d-none');
toastr.warning(result.message);
}
email_id: {
required: true,
email: true,
ValidEmail: true,
// isEmailValid:true,
},
no_of_units_you_wish_to_buy: {
required: true,
digits: true
},
offer_price_per_unit: {
required: true,
digits: true
},
declaration: "required",
},
messages: {
name: 'Please enter your name',
city: 'Please enter your city',
country: 'Please enter your country',
contact_number: {
required: 'Please enter your contact number',
digits: 'Please enter digits',
minlength: 'Contact Number should be 10 digits',
maxlength: 'Contact Number should be 10 digits',
},
email_id: {
required: " Please enter a valid email",
ValidEmail: "invalid email",
email: " invalid email"
},
no_of_units_you_wish_to_buy: {
required: 'Please enter no. of units you wish to buy',
digits: 'Please enter digits'
},
offer_price_per_unit: {
required: 'Please enter offer price per unit',
digits: 'Please enter digits'
},
declaration: 'Please check declaration'
},
submitHandler: function(form) {
var formData = new FormData(form);
$.ajax({
url: "{{ route('marketplace-buyer-form-update') }}",
type: "POST",
data: formData,
beforeSend: function() {
$('#loaderBtn').removeClass('d-none');
$('#submit-btn').addClass('d-none');
},
processData: false,
contentType: false,
dataType: "json",
success: function(result) {
if (result.status == 200) {
toastr.success(result.message);
setTimeout(function() {
window.location.href = '{{ route('market_place') }}';
}, 5000);
}
if (result.status == 400) {
$('#submit-btn').removeClass('d-none');
$('#loaderBtn').addClass('d-none');
toastr.warning(result.message);
}
},
});
},
});
$("#marketplace-buyer-form-update-for-fre").validate({
// jQuery.validator.addMethod('isEmailValid',function(value){
// return /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(value);
// },"Invalid email. Please enter a valid email address.");
ignore: [],
debug: false,
rules: {
name: "required",
city: "required",
country: "required",
contact_number: {
required: true,
digits: true,
minlength: 10,
maxlength: 10,
},
email_id: {
required: true,
email: true,
ValidEmail: true,
// isEmailValid:true,
},
// no_of_units_you_wish_to_buy: {
// required: true,
// digits: true
// },
// offer_price_per_unit: {
// required: true,
// digits: true
// },
declaration: "required",
},
messages: {
name: 'Please enter your name',
city: 'Please enter your city',
country: 'Please enter your country',
contact_number: {
required: 'Please enter your contact number',
digits: 'Please enter digits',
minlength: 'Contact Number should be 10 digits',
maxlength: 'Contact Number should be 10 digits',
},
email_id: {
required: " Please enter a valid email",
ValidEmail: "invalid email",
email: " invalid email"
},
// no_of_units_you_wish_to_buy: {
// required: 'Please enter no. of units you wish to buy',
// digits: 'Please enter digits'
// },
// offer_price_per_unit: {
// required: 'Please enter offer price per unit',
// digits: 'Please enter digits'
// },
declaration: 'Please check declaration'
},
submitHandler: function(form) {
var formData = new FormData(form);
$.ajax({
url: "{{ route('marketplace-buyer-form-update') }}",
type: "POST",
data: formData,
beforeSend: function() {
$('#loaderBtn').removeClass('d-none');
$('#submit-btn').addClass('d-none');
},
processData: false,
contentType: false,
dataType: "json",
success: function(result) {
if (result.status == 200) {
toastr.success(result.message);
setTimeout(function() {
window.location.href = '{{ route('market_place') }}';
}, 5000);
}
if (result.status == 400) {
$('#submit-btn').removeClass('d-none');
$('#loaderBtn').addClass('d-none');
toastr.warning(result.message);
}
},
});
},
});
$(document).ready(function() {
//the below code is updated by hririk on 5-4-24
var unit = $('#no_of_units_you_wish_to_buy').val();
var price = $('#offer_price_per_unit').val();
$('#no_of_units_you_wish_to_buy').keyup(function() {
unit = 0 * 1;
var no_of_units = $('#no_of_units_you_wish_to_buy').val();
unit = unit + no_of_units;
totalValue(unit, price);
});
},
});
$(document).ready(function(){
//the below code is updated by hririk on 5-4-24
var unit = $('#no_of_units_you_wish_to_buy').val();
var price = $('#offer_price_per_unit').val();
$('#no_of_units_you_wish_to_buy').keyup(function() {
unit = 0 * 1;
var no_of_units = $('#no_of_units_you_wish_to_buy').val();
unit = unit + no_of_units;
totalValue(unit,price);
});
// taking price
$('#offer_price_per_unit').keyup(function() {
price = 0 * 1;
var price_per_units = $('#offer_price_per_unit').val();
console.log("ss",price_per_units);
price = price + price_per_units;
console.log(unit,price);
totalValue(unit,price);
});
// taking price
$('#offer_price_per_unit').keyup(function() {
price = 0 * 1;
var price_per_units = $('#offer_price_per_unit').val();
console.log("ss", price_per_units);
price = price + price_per_units;
console.log(unit, price);
totalValue(unit, price);
});
// alert(unit * price);
// var total = unit * price;
// $('#total_purchase_value').val(total);
// totalPrice();
// if (no_of_units != "") {
// if ($('#offer_price_per_unit').val() != "") {
// var total_price = no_of_units * $('#offer_price_per_unit').val();
// $('#total_purchase_value').val(total_price);
// }
// }
// $('#offer_price_per_unit').keyup(function() {
// var price_per_units = $('#offer_price_per_unit').val();
// if (no_of_units != "") {
// if (price_per_units != "") {
// var total_price = no_of_units * price_per_units;
@@ -237,13 +415,12 @@ $(document).ready(function(){
// }
// }
// });
// });
});
// });
});
function totalValue(unit,price){
total = unit * price ;
$('#total_purchase_value').val(total);
}
</script>
@endsection
function totalValue(unit, price) {
total = unit * price;
$('#total_purchase_value').val(total);
}
</script>
@endsection