diff --git a/app/Http/Controllers/Admin/ManageUserProductController.php b/app/Http/Controllers/Admin/ManageUserProductController.php index a111a36..0a47c1d 100644 --- a/app/Http/Controllers/Admin/ManageUserProductController.php +++ b/app/Http/Controllers/Admin/ManageUserProductController.php @@ -174,9 +174,10 @@ class ManageUserProductController extends Controller $customID .= $count; // dd($customID); $companies = Company::active()->get(); - + $data = MonthlyUpdateMaster::get(); + // dd($data); // return view('Admin.Pages.manage_investors..manage_user_product.manage_user_add', compact('users','aifProductNames','freProductNames','p2pProductNames','ifaProductNames','lbfProductNames','cagaProductNames','vdProductNames','hyfProductNames','sdiProductNames','idProductNames','companies')); - return view('Admin.Pages.manage_investors.manage_user_product.manage_user_add', compact('users', 'aifProductNames', 'freProductNames', 'companies','customID')); + return view('Admin.Pages.manage_investors.manage_user_product.manage_user_add', compact('users', 'aifProductNames', 'freProductNames', 'companies','customID','data')); } public function userProduct(Request $request){ @@ -306,19 +307,19 @@ class ManageUserProductController extends Controller Excel::import(new ImportMontlyUpdateAlternativeInvestmentFund, $request->file('productFile')); } - if ($categories == 'Liquiloans') { - Excel::import(new ImportMonthlyP2PLiquiloans, $request->file('productFile')); - } + // if ($categories == 'Liquiloans') { + // Excel::import(new ImportMonthlyP2PLiquiloans, $request->file('productFile')); + // } - if ($categories == 'Faircent') { - Excel::import(new ImportMonthlyP2PFaircent, $request->file('productFile')); - } + // if ($categories == 'Faircent') { + // Excel::import(new ImportMonthlyP2PFaircent, $request->file('productFile')); + // } - if ($categories == 'FinancePeer') { - Excel::import(new ImportMonthlyP2PFinancePeer, $request->file('productFile')); - } + // if ($categories == 'FinancePeer') { + // Excel::import(new ImportMonthlyP2PFinancePeer, $request->file('productFile')); + // } - return back()->with('success', "Monthly Update Imported Successfully."); + return redirect()->route('manage-user-product')->with('success', "Monthly Update Imported Successfully."); } public function validationError($validator) diff --git a/app/Imports/ImportMontlyUpdateAlternativeInvestmentFund.php b/app/Imports/ImportMontlyUpdateAlternativeInvestmentFund.php index b58ab51..e13105e 100644 --- a/app/Imports/ImportMontlyUpdateAlternativeInvestmentFund.php +++ b/app/Imports/ImportMontlyUpdateAlternativeInvestmentFund.php @@ -44,8 +44,9 @@ class ImportMontlyUpdateAlternativeInvestmentFund implements ToCollection, With Validator::make($rows->toArray(), $this->rules(), $this->customValidationMessages($rows))->validate(); foreach ($rows as $row) { - - MonthlyUpdateAlternativeInvestmentFund::create([ + if($row['commitment_amount'] != null && $row['contribution_amount'] != null && $row['contribution_called_amount'] != null && $row['contribution_uncalled_amount'] != null) + { + MonthlyUpdateAlternativeInvestmentFund::create([ 'custom_id' => $row['custom_id'] ?? null, 'commitment_amount' => $row['commitment_amount'] ?? 0, 'contribution_amount' => $row['contribution_amount'] ?? 0, @@ -64,5 +65,6 @@ class ImportMontlyUpdateAlternativeInvestmentFund implements ToCollection, With 'no_of_units_held' => $row['no_of_units_held'] ?? 0, ]); } + } } } diff --git a/app/Imports/ImportMontlyUpdateFractionalRealEstate.php b/app/Imports/ImportMontlyUpdateFractionalRealEstate.php index 263763e..6f26046 100644 --- a/app/Imports/ImportMontlyUpdateFractionalRealEstate.php +++ b/app/Imports/ImportMontlyUpdateFractionalRealEstate.php @@ -44,20 +44,23 @@ class ImportMontlyUpdateFractionalRealEstate implements ToCollection, WithHeadin { Validator::make($rows->toArray(), $this->rules(), $this->customValidationMessages($rows))->validate(); - foreach ($rows as $row) { - MonthlyUpdateFractionalRealEstate::create([ - 'custom_id' => $row['custom_id'], - 'total_value_of_the_property' => $row['total_value_of_the_property'], - 'investment_value' => $row['investment_value'], - 'investment_date' => $row['investment_date'], - 'total_gross_interest' => $row['total_gross_interest'], - 'tds' => $row['tds'], - 'total_net_interest' => $row['total_net_interest'], - 'gross_entry_yield' => $row['gross_entry_yield'], - 'target_return' => $row['target_return'], - 'absolute_return_till_date' => $row['absolute_return_till_date'], - ]); + foreach ($rows as $row) { + if($row['investment_value'] != null && $row['total_net_interest'] != null && $row['total_gross_interest'] != null && $row['total_value_of_the_property'] != null) + { + MonthlyUpdateFractionalRealEstate::create([ + 'custom_id' => $row['custom_id'], + 'total_value_of_the_property' => $row['total_value_of_the_property'] ?? 0, + 'investment_value' => $row['investment_value'] ?? 0, + 'investment_date' => $row['investment_date'], + 'total_gross_interest' => $row['total_gross_interest'] ?? 0, + 'tds' => $row['tds'] ?? 0, + 'total_net_interest' => $row['total_net_interest'] ?? 0, + 'gross_entry_yield' => $row['gross_entry_yield'] ?? 0, + 'target_return' => $row['target_return'] ?? 0, + 'absolute_return_till_date' => $row['absolute_return_till_date'], + ]); + } } } } 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 e118b65..91fc3a7 100644 --- a/resources/views/Admin/Pages/manage_commission/manage_commission.blade.php +++ b/resources/views/Admin/Pages/manage_commission/manage_commission.blade.php @@ -110,7 +110,7 @@