diff --git a/app/Http/Controllers/Admin/ManageCommissionController.php b/app/Http/Controllers/Admin/ManageCommissionController.php index 8e26b3f..839d585 100644 --- a/app/Http/Controllers/Admin/ManageCommissionController.php +++ b/app/Http/Controllers/Admin/ManageCommissionController.php @@ -40,30 +40,45 @@ class ManageCommissionController extends Controller if (!$check) { abort(404); } - $products = Product::query() - ->select(DB::raw('products.id, coalesce(fund.fund_name, re.property_name, sdi.product_name, p2p.scheme, fre.property_name_and_location,id.company_name,aif.fund_name,caga.project_name,hyf.security_name,lbf.company,sdi.product_name,vd.company_name) as product_name'), DB::raw('DATE_FORMAT(products.created_at, "%d-%b-%Y") as date'), 'categories.category_name', DB::raw('coalesce(sdi.minimum_investment,re.total_price, p2p.minimum_investment, fre.minimum_investment,id.minimum_investment,aif.minimum_investment,caga.minimum_investment,hyf.minimum_investment,lbf.minimum_investment,sdi.minimum_investment,vd.minimum_investment,fund.minimum_investment) as minimum_investment'), 'products.commission_type', 'products.rate', 'products.commission', 'products.description', DB::raw('coalesce(fre.companies_id,aif.companies_id,caga.companies_id,vd.companies_id) as companies_id'), 'upfront_rate', 'trail_rate') - ->leftJoin('securitized_debt_instruments as sdi', 'products.id', 'sdi.products_id') - ->leftJoin('fractional_real_estates as fre', 'products.id', 'fre.products_id') - ->leftJoin('peer_to_peer_lendings as p2p', 'products.id', 'p2p.products_id') - ->leftJoin('invoice_discountings as id', 'products.id', 'id.products_id') - ->leftJoin('alternative_investment_funds as aif', 'products.id', 'aif.products_id') - ->leftJoin('clean_and_green_assets as caga', 'products.id', 'caga.products_id') - ->leftJoin('high_yield_finances as hyf', 'products.id', 'hyf.products_id') - ->leftJoin('lease_based_financings as lbf', 'products.id', 'lbf.products_id') - ->leftJoin('venture_debts as vd', 'products.id', 'vd.products_id') - ->leftJoin('funds as fund', 'products.id', 'fund.products_id') - ->leftJoin('real_estates as re', 'products.id', 're.products_id') + // $products = Product::query() + // ->select(DB::raw('products.id, coalesce(fre.property_name_and_location,aif.fund_name) as product_name'), DB::raw('DATE_FORMAT(products.created_at, "%d-%b-%Y") as date'), 'categories.category_name', DB::raw('coalesce(fre.minimum_investment,aif.minimum_investment) as minimum_investment'), 'products.commission_type', 'products.rate', 'products.commission', 'products.description', DB::raw('coalesce(fre.companies_id,aif.companies_id) as companies_id'), 'upfront_rate', 'trail_rate') + // ->leftJoin('fractional_real_estates as fre', 'products.id', 'fre.products_id') + // ->leftJoin('alternative_investment_funds as aif', 'products.id', 'aif.products_id') + // ->join('categories', 'products.categories_id', 'categories.id') + // ->latest('products.created_at') + // ->get(); + // ->select(DB::raw('products.id, coalesce(fund.fund_name, re.property_name, sdi.product_name, p2p.scheme, fre.property_name_and_location,id.company_name,aif.fund_name,caga.project_name,hyf.security_name,lbf.company,sdi.product_name,vd.company_name) as product_name'), DB::raw('DATE_FORMAT(products.created_at, "%d-%b-%Y") as date'), 'categories.category_name', DB::raw('coalesce(sdi.minimum_investment,re.total_price, p2p.minimum_investment, fre.minimum_investment,id.minimum_investment,aif.minimum_investment,caga.minimum_investment,hyf.minimum_investment,lbf.minimum_investment,sdi.minimum_investment,vd.minimum_investment,fund.minimum_investment) as minimum_investment'), 'products.commission_type', 'products.rate', 'products.commission', 'products.description', DB::raw('coalesce(fre.companies_id,aif.companies_id,caga.companies_id,vd.companies_id) as companies_id'), 'upfront_rate', 'trail_rate') + // ->leftJoin('securitized_debt_instruments as sdi', 'products.id', 'sdi.products_id') + // ->leftJoin('peer_to_peer_lendings as p2p', 'products.id', 'p2p.products_id') + // ->leftJoin('invoice_discountings as id', 'products.id', 'id.products_id') + // ->leftJoin('clean_and_green_assets as caga', 'products.id', 'caga.products_id') + // ->leftJoin('high_yield_finances as hyf', 'products.id', 'hyf.products_id') + // ->leftJoin('lease_based_financings as lbf', 'products.id', 'lbf.products_id') + // ->leftJoin('venture_debts as vd', 'products.id', 'vd.products_id') + // ->leftJoin('funds as fund', 'products.id', 'fund.products_id') + // ->leftJoin('real_estates as re', 'products.id', 're.products_id') // ->join('fractional_real_estates as fr', 'companies.id', 'fr.companies_id') // ->leftJoin('alternative_investment_funds as aifp', 'companies.id', 'aifp.companies_id') // ->leftJoin('clean_and_green_assets as cagap', 'companies.id', 'cagap.companies_id') // ->leftJoin('venture_debts as vdp', 'companies.id', 'vdp.companies_id') - ->join('categories', 'products.categories_id', 'categories.id') // ->orderBy('products.created_at') - ->latest('products.created_at') - ->get(); - // dd($products); - $products->each(function ($value) { - $monthlyData = MonthlyUpdateMaster::where('products_id', $value->id)->get(); + // $product = Product::has('fractionalHasMany')->get(); + $products = Product::with('categorys')->get(); + // if($products->isNotEmpty()) + // { + foreach($products as $product) + { + if(FractionalRealEstate::where('products_id',$product->id)->exists()) + { + $product['data'] = FractionalRealEstate::where('products_id',$product->id)->first(); + } + if(AlternativeInvestmentFund::where('products_id',$product->id)->exists()) + { + $product['data'] = AlternativeInvestmentFund::where('products_id',$product->id)->first(); + } + + // geting total investment and total commission earned + $monthlyData = MonthlyUpdateMaster::where('products_id', $product->id)->get(); $totalCommission = 0; $totalInvestment = 0; if ($monthlyData->isNotEmpty()) { @@ -84,9 +99,13 @@ class ManageCommissionController extends Controller } } } - $value->totalInvestment = $totalInvestment; - $value->totalCommission = $totalCommission; - }); + $product['totalInvestment'] = $totalInvestment; + $product['totalCommission'] = $totalCommission; + } + // } + // dd($products->toArray()); + // $products->each(function ($value) { + // }); // dd($products->) return view('Admin.Pages.manage_commission.manage_commission', compact('products')); } diff --git a/app/Http/Controllers/Frontend/DashboardController.php b/app/Http/Controllers/Frontend/DashboardController.php index f18c8da..e4072ff 100644 --- a/app/Http/Controllers/Frontend/DashboardController.php +++ b/app/Http/Controllers/Frontend/DashboardController.php @@ -1070,14 +1070,14 @@ class DashboardController extends Controller 'fund_category' => 'required', 'fund_structure' => 'required', 'type_of_fund' => 'required', - 'fund_strategy' => 'required', - 'fund_manager_name' => 'required', - 'sponsor' => 'required', + // 'fund_strategy' => 'nullable', + // 'fund_manager_name' => 'nullable', + // 'sponsor' => 'nullable', // 'credit_rating' => 'required', 'total_capital_commitment' => 'required', 'uncalled_capital_commitment' => 'required', - 'date_of_final_close' => 'required', - 'tenure_from_final_close' => 'required', + // 'date_of_final_close' => 'required', + // 'tenure_from_final_close' => 'required', 'current_or_latest_nav' => 'required', 'no_of_units_held' => 'required', 'no_of_units_you_wish_to_sell' => 'required', @@ -1121,17 +1121,18 @@ class DashboardController extends Controller 'fund_category' => $request->fund_category, 'fund_structure' => $request->fund_structure, 'type_of_fund' => $request->type_of_fund, - 'fund_strategy' => $request->fund_strategy, - 'fund_manager_name' => $request->fund_manager_name, - 'sponsor' => $request->sponsor, - 'credit_rating' => $request->credit_rating, + 'fund_strategy' => $request->fund_strategy ?? null, + 'fund_manager_name' => $request->fund_manager_name ?? null, + 'sponsor' => $request->sponsor ?? null, + 'credit_rating' => $request->credit_rating ?? null, 'total_capital_commitment' => $request->total_capital_commitment, 'uncalled_capital_commitment' => $request->uncalled_capital_commitment, - 'date_of_final_close' => $request->date_of_final_close, - 'tenure_from_final_close' => $request->tenure_from_final_close, + 'date_of_final_close' => $request->date_of_final_close ?? null, + 'tenure_from_final_close' => $request->tenure_from_final_close ?? null, 'current_or_latest_nav' => $request->current_or_latest_nav, 'no_of_units_held' => $request->no_of_units_held, 'no_of_units_you_wish_to_sell' => $request->no_of_units_you_wish_to_sell, + 'og_no_of_units_wish_to_sell' => $request->no_of_units_you_wish_to_sell, 'expected_sale_per_unit' => $request->expected_sale_per_unit, 'listing_status' => 'Hide', 'status' => 'Pending', @@ -1151,10 +1152,10 @@ class DashboardController extends Controller $validator = Validator::make($request->all(), [ 'property_name' => 'required', 'property_address' => 'required', - 'property_grade' => 'required', + 'property_grade' => 'nullable', 'asset_type' => 'required', 'annual_rental_yield_earned' => 'required', - 'rental_escalation' => 'required', + 'rental_escalation' => 'nullable', 'fractional_real_estate_platform' => 'required', 'date_of_investment' => 'required', 'original_amount_invested' => 'required', @@ -1198,15 +1199,17 @@ class DashboardController extends Controller 'property_name' => $request->property_name, 'slug' => SlugService::createSlug(MarketplaceFractionalRealEstateSeller::class, 'slug', $request->property_name), 'property_address' => $request->property_address, - 'property_grade' => $request->property_grade, + 'property_grade' => $request->property_grade ?? null, 'asset_type' => $request->asset_type, 'annual_rental_yield_earned' => $request->annual_rental_yield_earned, - 'rental_escalation' => $request->rental_escalation, + 'rental_escalation' => $request->rental_escalation ?? null, 'fractional_real_estate_platform' => $request->fractional_real_estate_platform, 'date_of_investment' => $request->date_of_investment, 'original_amount_invested' => $request->original_amount_invested, 'current_market_value_of_the_property' => $request->current_market_value_of_the_property, 'expected_selling_price' => $request->expected_selling_price, + 'og_current_market_value_of_the_property' => $request->current_market_value_of_the_property, + 'og_expected_selling_price' => $request->expected_selling_price, 'listing_status' => 'Hide', 'status' => 'Pending', 'latest_valuation_date' => $request->latest_valuation_date, //latest_valuation_date added by hritik on 09-04-24 diff --git a/app/Http/Resources/GlobalFundResource.php b/app/Http/Resources/GlobalFundResource.php index 90305a1..edaa08e 100644 --- a/app/Http/Resources/GlobalFundResource.php +++ b/app/Http/Resources/GlobalFundResource.php @@ -28,7 +28,7 @@ class GlobalFundResource extends JsonResource return [ 'id' => $this->id, 'products_id' => $this->products_id, - 'product_images' => $imagePaths, + 'product_images' => $imagePaths, 'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null, 'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null, 'slug' => $this->slug, @@ -50,6 +50,7 @@ class GlobalFundResource extends JsonResource 'year1_return' => $this->year1_return, 'year3_return' => $this->year3_return, 'returns' => $this->returns, + 'date_as_on' => $this->date_as_on, // 'product_images' => ProductImage::where('product_xid',$this->products_id)->get(), ]; diff --git a/app/Http/Resources/RealEstateResource.php b/app/Http/Resources/RealEstateResource.php index 87b6272..8358d99 100644 --- a/app/Http/Resources/RealEstateResource.php +++ b/app/Http/Resources/RealEstateResource.php @@ -5,6 +5,7 @@ namespace App\Http\Resources; use App\Models\Product; use App\Resources\ProductPhotoResources; use Illuminate\Http\Resources\Json\JsonResource; +use App\Models\ProductImage; class RealEstateResource extends JsonResource { @@ -16,11 +17,23 @@ class RealEstateResource extends JsonResource */ public function toArray($request) { + $images = ProductImage::where('product_xid', $this->products_id)->get(); + $imagePaths = []; + if (!empty($images)) { + foreach ($images as $imageItem) { + $path = asset('public/' . $imageItem['images']); + $imagePaths[] = $path; + } + + } + return [ 'id' => $this->id, 'products_id' => $this->products_id, + 'product_images' => $imagePaths, 'presentation' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('presentation') : null, 'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null, + 'description' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('description') : null, 'property_name' => $this->property_name, 'slug' => $this->slug, 'property_location' => $this->property_location, @@ -65,6 +78,7 @@ class RealEstateResource extends JsonResource 'location' => $this->location, 'country' => $this->country, 'remarks' => $this->remarks, + 'minimum_investment' => $this->total_price, 'photos' => ProductPhotoResource::collection($this->realEstatePhoto), 'documents' => ProductPhotoResource::collection($this->realEstateDocuments) ]; diff --git a/public/assets/css/FrontendCss/style.css b/public/assets/css/FrontendCss/style.css index 80c99a8..f992b17 100644 --- a/public/assets/css/FrontendCss/style.css +++ b/public/assets/css/FrontendCss/style.css @@ -2074,7 +2074,7 @@ li.item.list-item:nth-child(even) { .logout-modal p.log-ctn { font-size: 18px; text-align: center !important; -} +} .logout-modal .log-btn { display: flex; @@ -6506,10 +6506,10 @@ button.swal2-confirm.btn.yellow-btn.popup-button { } .menubar .admin-profile .dropdown-menu { - width: 300px; + width: 280px; transform: translate(-40%, 40px) !important; padding: 10px; - height: 400px; + /* height: 400px; */ overflow-x: hidden; } .notifications .list-item p strong { @@ -6555,3 +6555,7 @@ button#modal_close span { .your-investment .accordion-button::after { transform: rotate(180deg) !important; } + +.admin-profile .dropdown .dropdown-menu { + max-height: 500px !important; +} diff --git a/resources/views/Admin/Pages/manage_commission/manage_commission.blade.php b/resources/views/Admin/Pages/manage_commission/manage_commission.blade.php index e80f195..76dd3ca 100644 --- a/resources/views/Admin/Pages/manage_commission/manage_commission.blade.php +++ b/resources/views/Admin/Pages/manage_commission/manage_commission.blade.php @@ -20,16 +20,16 @@

Manage Commission

+ begin::Svg Icon | path: icons/duotune/arrows/arr078.svg + + + + + + + + end::Svg Icon + -->