diff --git a/app/Http/Controllers/Admin/OverviewController.php b/app/Http/Controllers/Admin/OverviewController.php index 4421491..03b26a3 100644 --- a/app/Http/Controllers/Admin/OverviewController.php +++ b/app/Http/Controllers/Admin/OverviewController.php @@ -208,59 +208,60 @@ class OverviewController extends Controller // }else // 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 ?? 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) + if($status == 'Sold'){ + $getMarketplaceBuyerUnit = MarketplaceBuyerForm::where('id', $buyerId)->first(); + $marketPlaceId = $getMarketplaceBuyerUnit->associated_id; + $getUnits = (int)$getMarketplaceBuyerUnit->no_of_units_you_wish_to_buy ?? 0; + $getBuyingPurchaseValue = (int)$getMarketplaceBuyerUnit->getAttributes()['total_purchase_value']; + if(MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->exists()) { - $updateUnits = MarketplaceAlternativeInvestmentFundSeller::where('id',$marketPlaceId)->update([ - 'no_of_units_you_wish_to_sell' => $newUnits, + $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']); + } + + }else if(MarketplaceFractionalRealEstateSeller::where('id',$marketPlaceId)->exists()) + { + // dd('inside'); + $getFREData = MarketplaceFractionalRealEstateSeller::where('id',$marketPlaceId)->first(); + if((int)$getFREData->current_market_value_of_the_property <= 0) + { + return response()->json(['status' => 400, 'message' => 'Product cannot be sold. because product has no value.']); + } + $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)]); + // } } - 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(); - if((int)$getFREData->current_market_value_of_the_property <= 0) - { - return response()->json(['status' => 400, 'message' => 'Product cannot be sold. because product has no value.']); - } - $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('outside'); } // dd('hello'); $alreadySold = MarketplaceBuyerForm::where('id', $buyerId)->update([ diff --git a/app/Http/Controllers/Frontend/GlobalRealAssetController.php b/app/Http/Controllers/Frontend/GlobalRealAssetController.php index 407e98c..68ba383 100644 --- a/app/Http/Controllers/Frontend/GlobalRealAssetController.php +++ b/app/Http/Controllers/Frontend/GlobalRealAssetController.php @@ -15,13 +15,15 @@ class GlobalRealAssetController extends Controller { $this->gre = $gre; } - public function index(){ + public function index() + { return view('Frontend.Pages.global-real-estate.index'); } - public function industrial(){ + public function industrial() + { // dd($this->gre->openGIRE()->getData()); - return view('Frontend.Pages.global-real-estate.industrial',[ + return view('Frontend.Pages.global-real-estate.industrial', [ 'openGIRE' => $this->gre->openGIRE()->getData(), 'fullyFundedGIRE' => $this->gre->fullyFundedGIRE()->getData(), 'resaleGIRE' => $this->gre->resaleGIRE()->getData(), @@ -30,9 +32,10 @@ class GlobalRealAssetController extends Controller } - public function residential(){ + public function residential() + { // dd($this->gre->openGRRE()->getData()); - return view('Frontend.Pages.global-real-estate.residential',[ + return view('Frontend.Pages.global-real-estate.residential', [ 'openGRRE' => $this->gre->openGRRE()->getData(), 'fullyFundedGRRE' => $this->gre->fullyFundedGRRE()->getData(), 'resaleGRRE' => $this->gre->resaleGRRE()->getData(), @@ -40,20 +43,21 @@ class GlobalRealAssetController extends Controller ]); } - public function commercial(){ + public function commercial() + { // dd($this->gre->openGCRE()->getData()); - return view('Frontend.Pages.global-real-estate.commercial',[ + return view('Frontend.Pages.global-real-estate.commercial', [ 'openGCRE' => $this->gre->openGCRE()->getData(), 'fullyFundedGCRE' => $this->gre->fullyFundedGCRE()->getData(), 'resaleGCRE' => $this->gre->resaleGCRE()->getData(), 'learnMore' => $this->gre->globalCommercialRealEstateLearnMore()->getData() ]); } - + public function globalIndustrialRealEstateAllData($type = 'Open') { try { - return (new test(Product::has('realEstate')->with('realEstate.photo')->globalIndustrialRealEstate()->where('type',$type)->active()->get())) + return (new test(Product::has('realEstate')->with('realEstate.photo')->globalIndustrialRealEstate()->where('type', $type)->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { @@ -64,7 +68,7 @@ class GlobalRealAssetController extends Controller public function globalResidentialRealEstateAllData($type = 'Open') { try { - return (new test(Product::has('realEstate')->with('realEstate.photo')->globalResidentialRealEstate()->where('type',$type)->active()->get())) + return (new test(Product::has('realEstate')->with('realEstate.photo')->globalResidentialRealEstate()->where('type', $type)->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { @@ -75,7 +79,7 @@ class GlobalRealAssetController extends Controller public function globalCommercialRealEstateAllData($type = 'Open') { try { - return (new test(Product::has('realEstate')->with('realEstate.photo')->globalCommercialRealEstate()->where('type',$type)->active()->get())) + return (new test(Product::has('realEstate')->with('realEstate.photo')->globalCommercialRealEstate()->where('type', $type)->active()->get())) ->response() ->setStatusCode(200); } catch (\Exception $e) { diff --git a/resources/views/Frontend/Pages/profile/market-list/buyer-form.blade.php b/resources/views/Frontend/Pages/profile/market-list/buyer-form.blade.php index 3bef721..c4264db 100644 --- a/resources/views/Frontend/Pages/profile/market-list/buyer-form.blade.php +++ b/resources/views/Frontend/Pages/profile/market-list/buyer-form.blade.php @@ -62,10 +62,12 @@
+
+
@@ -125,7 +127,8 @@
--}}
- + +

Declaration

@@ -359,5 +362,44 @@ $('#total_purchase_value').val(total); } + $(document).ready(function() { + $('#total_purchase_value').on('input', function() { + var inputValue = $(this).val(); + var errorElement = $('#purchase_value_error'); + + if (parseInt(inputValue) < 1) { + errorElement.show(); + } else { + errorElement.hide(); + } + }); + }); + + $(document).ready(function() { + $('#no_of_units_you_wish_to_buy').on('input', function() { + var inputValue = $(this).val(); + var errorElement = $('#no_of_units_value_error'); + + if (parseInt(inputValue) < 1) { + errorElement.show(); + } else { + errorElement.hide(); + } + }); + }); + + $(document).ready(function() { + $('#offer_price_per_unit').on('input', function() { + var inputValue = $(this).val(); + var errorElement = $('#offer_price_per_unit_value_error'); + + if (parseInt(inputValue) < 1) { + errorElement.show(); + } else { + errorElement.hide(); + } + }); + }); + @endsection \ No newline at end of file diff --git a/resources/views/components/angel-fund-product.blade.php b/resources/views/components/angel-fund-product.blade.php index d0d37bb..cf74df7 100644 --- a/resources/views/components/angel-fund-product.blade.php +++ b/resources/views/components/angel-fund-product.blade.php @@ -22,8 +22,10 @@

{{ $data->alternative_investment_fund->fund_name }}

-

Category: {{ $data->categorys->category_name }}

+

Category: {{ $data->categorys->category_name }}

+
+ {{--
--}}

Minimum Investment: {{ $data->alternative_investment_fund->minimum_investment }}

diff --git a/resources/views/components/fractional-real-estate-product.blade.php b/resources/views/components/fractional-real-estate-product.blade.php index 9b92918..2770796 100644 --- a/resources/views/components/fractional-real-estate-product.blade.php +++ b/resources/views/components/fractional-real-estate-product.blade.php @@ -28,27 +28,29 @@

{{ $freData->fractional_real_estate->property_name_and_location }}

+

Category: {{ $freData->categorys->category_name }}

+
{{--

Expected IRR: {{ $freData->fractional_real_estate->expected_irr }} %

--}} -
+ {{--
--}} {{-- --}} -
+ {{--

Expected IRR: {{ $freData->fractional_real_estate->expected_irr }} %

-

+

--}} {{--

Target IRR: {{ $data->alternative_investment_fund->target_irr }}

|

Tenure From Final Date: {{ $data->alternative_investment_fund->tenure_from_final_date }}

--}} -
+ {{-- --}}

Minimum Investment: {{ $freData->fractional_real_estate->minimum_investment ?? 'N/A' }}

{{--

{{ $freData->fractional_real_estate->property_description }}

--}} diff --git a/resources/views/components/fund-for-distressed-asset-product.blade.php b/resources/views/components/fund-for-distressed-asset-product.blade.php index eaa217e..f175a6e 100644 --- a/resources/views/components/fund-for-distressed-asset-product.blade.php +++ b/resources/views/components/fund-for-distressed-asset-product.blade.php @@ -19,8 +19,10 @@

{{$data->alternative_investment_fund->fund_name}}

-

Category: {{$data->categorys->category_name}}

+

Category: {{$data->categorys->category_name}}

+
+ {{--
+
--}}

Minimum Investment: {{$data->alternative_investment_fund->minimum_investment}}

{{$data->description}}

diff --git a/resources/views/components/global-commercial-real-estate-product.blade.php b/resources/views/components/global-commercial-real-estate-product.blade.php index 831fa5e..63d2855 100644 --- a/resources/views/components/global-commercial-real-estate-product.blade.php +++ b/resources/views/components/global-commercial-real-estate-product.blade.php @@ -20,8 +20,10 @@

{{$data->real_estate->property_name}}

-

Category: {{$data->categorys->category_name}}

+

Category: {{$data->categorys->category_name}}

+
+ {{--
+
--}}

Total Price: {{$data->real_estate->total_price}}

{{$data->description}}

diff --git a/resources/views/components/global-hedge-fund-product.blade.php b/resources/views/components/global-hedge-fund-product.blade.php index e684bb4..aa852df 100644 --- a/resources/views/components/global-hedge-fund-product.blade.php +++ b/resources/views/components/global-hedge-fund-product.blade.php @@ -18,8 +18,10 @@

{{$ghfData->funds->issuer}}

-

Category: {{$ghfData->categorys->category_name}}

+

Category: {{$ghfData->categorys->category_name}}

+
+ {{--
+
--}}

Minimum Investment: {{$ghfData->funds->minimum_investment}}

{{$ghfData->funds->fund_description}}

diff --git a/resources/views/components/global-industrial-real-estate-product.blade.php b/resources/views/components/global-industrial-real-estate-product.blade.php index 5aa7091..353db9e 100644 --- a/resources/views/components/global-industrial-real-estate-product.blade.php +++ b/resources/views/components/global-industrial-real-estate-product.blade.php @@ -1,27 +1,31 @@
diff --git a/resources/views/components/global-private-credit-fund-product.blade.php b/resources/views/components/global-private-credit-fund-product.blade.php index aca3f5d..398c0a3 100644 --- a/resources/views/components/global-private-credit-fund-product.blade.php +++ b/resources/views/components/global-private-credit-fund-product.blade.php @@ -24,8 +24,10 @@

{{ $data->funds->fund_name }}

-

Category: {{ $data->categorys->category_name }}

+

Category: {{ $data->categorys->category_name }}

+
+ {{--
--}}

Minimum Investment: {{ $data->funds->minimum_investment }} diff --git a/resources/views/components/global-private-equity-fund-product.blade.php b/resources/views/components/global-private-equity-fund-product.blade.php index 25e1535..33ab361 100644 --- a/resources/views/components/global-private-equity-fund-product.blade.php +++ b/resources/views/components/global-private-equity-fund-product.blade.php @@ -21,8 +21,10 @@ src="{{ asset('public/assets/media/FrontendImages/equity-funds.svg') }}">

{{ $gireData->funds->fund_name }}

-

Category: {{$gireData->categorys->category_name}}

+

Category: {{$gireData->categorys->category_name}}

+
+ {{--
+
--}}

Total Price: {{ $gireData->funds->fund_aum }}

{{ $gireData->funds->fund_description }}

diff --git a/resources/views/components/global-residential-real-estate-product.blade.php b/resources/views/components/global-residential-real-estate-product.blade.php index 475a2b4..4ffbc66 100644 --- a/resources/views/components/global-residential-real-estate-product.blade.php +++ b/resources/views/components/global-residential-real-estate-product.blade.php @@ -20,8 +20,10 @@

{{$data->real_estate->property_name}}

-

Category: {{$data->categorys->category_name}}

+

Category: {{$data->categorys->category_name}}

+
+ {{--
+
--}}

Total Price: {{$data->real_estate->total_price}}

{{$data->real_estate->property_location}}

diff --git a/resources/views/components/global-venture-capital-fund-product.blade.php b/resources/views/components/global-venture-capital-fund-product.blade.php index a093d74..0b72d0e 100644 --- a/resources/views/components/global-venture-capital-fund-product.blade.php +++ b/resources/views/components/global-venture-capital-fund-product.blade.php @@ -35,10 +35,10 @@

{{ $gireData->funds->fund_name }}

- -

Category: {{ $gireData->categorys->category_name }}

-
+

Category: {{ $gireData->categorys->category_name }}

+
+ {{--
+
--}}
diff --git a/resources/views/components/hedge-fund-product.blade.php b/resources/views/components/hedge-fund-product.blade.php index 7b54e90..30decb2 100644 --- a/resources/views/components/hedge-fund-product.blade.php +++ b/resources/views/components/hedge-fund-product.blade.php @@ -21,8 +21,10 @@

{{ $data->alternative_investment_fund->fund_name }}

-

Category: {{ $data->categorys->category_name }}

+

Category: {{ $data->categorys->category_name }}

+
+ {{--
--}}

Minimum Investment: {{ $data->alternative_investment_fund->minimum_investment }}

diff --git a/resources/views/components/indian-commercial-real-estate-product.blade.php b/resources/views/components/indian-commercial-real-estate-product.blade.php index 4487662..3ee48d1 100644 --- a/resources/views/components/indian-commercial-real-estate-product.blade.php +++ b/resources/views/components/indian-commercial-real-estate-product.blade.php @@ -20,7 +20,7 @@

{{$data->realEstate->property_name}}

Category: {{$data->categorys->category_name}}

-
+ {{--
+
--}}

Total Price: {{$data->realEstate->total_price}}

{{$data->description}}

diff --git a/resources/views/components/indian-industrial-real-estate-product.blade.php b/resources/views/components/indian-industrial-real-estate-product.blade.php index 768638b..27732c3 100644 --- a/resources/views/components/indian-industrial-real-estate-product.blade.php +++ b/resources/views/components/indian-industrial-real-estate-product.blade.php @@ -21,7 +21,7 @@

{{$ffdaData->realEstate->property_name}}

Category: {{$ffdaData->categorys->category_name}}

-
+ {{--
+
--}}

Minimum Investment: {{$ffdaData->realEstate->total_price}}

{{$ffdaData->realEstate->facilities_features}}

diff --git a/resources/views/components/indian-residential-real-estate-product.blade.php b/resources/views/components/indian-residential-real-estate-product.blade.php index f5f663f..5aff656 100644 --- a/resources/views/components/indian-residential-real-estate-product.blade.php +++ b/resources/views/components/indian-residential-real-estate-product.blade.php @@ -20,7 +20,7 @@

{{$ffdaData->realEstate->property_name}}

Category: {{$ffdaData->categorys->category_name}}

-
+ {{--
+
--}}

Minimum Investment: {{$ffdaData->realEstate->price_range}}

{{$ffdaData->description}}

diff --git a/resources/views/components/infrastructure-fund-product.blade.php b/resources/views/components/infrastructure-fund-product.blade.php index 1893fd7..742c913 100644 --- a/resources/views/components/infrastructure-fund-product.blade.php +++ b/resources/views/components/infrastructure-fund-product.blade.php @@ -20,8 +20,10 @@

{{$data->alternative_investment_fund->fund_name}}

-

Category: {{$data->categorys->category_name}}

+

Category: {{$data->categorys->category_name}}

+
+ {{--
+
--}}

Minimum Investment: {{$data->alternative_investment_fund->minimum_investment}}

{{$data->description}}

diff --git a/resources/views/components/long-only-equity-funds.blade.php b/resources/views/components/long-only-equity-funds.blade.php index cd599a4..4a19c73 100644 --- a/resources/views/components/long-only-equity-funds.blade.php +++ b/resources/views/components/long-only-equity-funds.blade.php @@ -23,8 +23,10 @@

{{ $data->alternative_investment_fund->fund_name }}

-

Category: {{ $data->categorys->category_name }}

+

Category: {{ $data->categorys->category_name }}

+
+ {{--
--}}

Minimum Investment: {{ $data->alternative_investment_fund->minimum_investment }}

diff --git a/resources/views/components/p-i-p-e-fund-product.blade.php b/resources/views/components/p-i-p-e-fund-product.blade.php index c0e4ced..2301ccd 100644 --- a/resources/views/components/p-i-p-e-fund-product.blade.php +++ b/resources/views/components/p-i-p-e-fund-product.blade.php @@ -19,8 +19,10 @@

{{$data->alternative_investment_fund->fund_name}}

-

Category: {{$data->categorys->category_name}}

+

Category: {{$data->categorys->category_name}}

+
+ {{--
+
--}}

Minimum Investment: {{$data->alternative_investment_fund->minimum_investment}}

{{$data->description}}

diff --git a/resources/views/components/private-credit-fund-product.blade.php b/resources/views/components/private-credit-fund-product.blade.php index 97509af..4279835 100644 --- a/resources/views/components/private-credit-fund-product.blade.php +++ b/resources/views/components/private-credit-fund-product.blade.php @@ -24,8 +24,10 @@

{{ $data->alternative_investment_fund->fund_name }}

-

Category: {{ $data->categorys->category_name }}

+

Category: {{ $data->categorys->category_name }}

+
+ {{--
--}} {{--
--}} -

Target IRR:{{ $data->alternative_investment_fund->target_irr ?? 'N/A'}} + {{--

Target IRR:{{ $data->alternative_investment_fund->target_irr ?? 'N/A'}}

| -

Tenure From Final Date:{{ $data->alternative_investment_fund->tenure_from_final_date ?? 'N/A' }}

+

Tenure From Final Date:{{ $data->alternative_investment_fund->tenure_from_final_date ?? 'N/A' }}

--}} {{--
--}} -
+ {{--
--}}

Minimum Investment: {{ $data->alternative_investment_fund->minimum_investment ?? 'N/A' }} diff --git a/resources/views/components/private-equity-fund-product.blade.php b/resources/views/components/private-equity-fund-product.blade.php index 23062fb..df9bcca 100644 --- a/resources/views/components/private-equity-fund-product.blade.php +++ b/resources/views/components/private-equity-fund-product.blade.php @@ -21,8 +21,10 @@

{{ $data->alternative_investment_fund->fund_name }}

-

Category: {{ $data->categorys->category_name }}

+

Category: {{ $data->categorys->category_name }}

+
+ {{--
--}}

Minimum Investment: {{ $data->alternative_investment_fund->minimum_investment }}

diff --git a/resources/views/components/private-real-estate-fund-product.blade.php b/resources/views/components/private-real-estate-fund-product.blade.php index 8dde7bf..2639364 100644 --- a/resources/views/components/private-real-estate-fund-product.blade.php +++ b/resources/views/components/private-real-estate-fund-product.blade.php @@ -21,8 +21,10 @@

{{ $data->alternative_investment_fund->fund_name }}

-

Category: {{ $data->categorys->category_name }}

+

Category: {{ $data->categorys->category_name }}

+
+ {{--
--}}

Minimum Investment: {{ $data->alternative_investment_fund->minimum_investment }}

diff --git a/resources/views/components/venture-capital-fund-product.blade.php b/resources/views/components/venture-capital-fund-product.blade.php index ff98a3b..7773898 100644 --- a/resources/views/components/venture-capital-fund-product.blade.php +++ b/resources/views/components/venture-capital-fund-product.blade.php @@ -20,8 +20,10 @@

{{$data->alternative_investment_fund->fund_name}}

+

Category: {{$data->categorys->category_name}}

-
+
+ {{--
+
--}}

Minimum Investment: {{$data->alternative_investment_fund->minimum_investment}}

{{$data->description}}