Merge branch 'main' of https://github.com/Ritikeshyadav/my-freeu into megha
This commit is contained in:
@@ -21,6 +21,7 @@ use Yajra\DataTables\Contracts\DataTable;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Carbon\CarbonPeriod;
|
||||
use File;
|
||||
|
||||
class ManageCommissionController extends Controller
|
||||
{
|
||||
@@ -97,6 +98,7 @@ class ManageCommissionController extends Controller
|
||||
|
||||
public function viewProduct($id, $product = 'product')
|
||||
{
|
||||
// dd($id,$product);
|
||||
return view('Admin.Pages.manage_commission.view_commission', [
|
||||
'product' => Product::with('category')->find($id),
|
||||
'product_name' => $product,
|
||||
|
||||
@@ -82,17 +82,18 @@ class MarketplaceFractionalRealEstateSeller extends Model
|
||||
// return $totalSellUnits += (int)$data->no_of_units_you_wish_to_buy;
|
||||
// });
|
||||
// $id = $this->id;
|
||||
if(MarketplaceBuyerForm::where(['associated_id'=>$id,'table' => 'marketplace_fre_sellers'])->exists())
|
||||
if(MarketplaceBuyerForm::where(['associated_id'=>$this->id,'table' => 'marketplace_fre_sellers'])->exists())
|
||||
{
|
||||
$getFREData = MarketplaceFractionalRealEstateSeller::where('id',$id)->first();
|
||||
$getFREData = MarketplaceFractionalRealEstateSeller::where('id',$this->id)->first();
|
||||
// dd((int)$getFREData->current_market_value_of_the_property <= 0);
|
||||
// $aifData = (int)$getFREData->no_of_units_you_wish_to_sell;
|
||||
// $remainUnits = $aifData - $totalSellUnits;
|
||||
if($getFREData->current_market_value_of_the_property <= 0)
|
||||
if((int)$getFREData->current_market_value_of_the_property <= 0)
|
||||
{
|
||||
return 'SOLD';
|
||||
}
|
||||
else{
|
||||
return 'OPEN';
|
||||
return 'OPEN';
|
||||
}
|
||||
}else{
|
||||
return 'OPEN';
|
||||
|
||||
@@ -36,7 +36,24 @@ class CommissionService
|
||||
}
|
||||
|
||||
public function commissionCalculation($product,$investmentValue){
|
||||
$grossCommissionedEarned = ($investmentValue * $product->trail_rate) / 100;
|
||||
$trail_rate = 0;
|
||||
if($product->return_type == 'Monthly')
|
||||
{
|
||||
$trail_rate += $product->trail_rate / 12 ;
|
||||
}
|
||||
if($product->return_type == 'Quarterly')
|
||||
{
|
||||
$trail_rate += $product->trail_rate / 4 ;
|
||||
}
|
||||
if($product->return_type == 'Half-Yearly')
|
||||
{
|
||||
$trail_rate += $product->trail_rate / 2 ;
|
||||
}
|
||||
if($product->return_type == 'Yearly')
|
||||
{
|
||||
$trail_rate += $product->trail_rate ;
|
||||
}
|
||||
$grossCommissionedEarned = ($investmentValue * $trail_rate) / 100;
|
||||
$gst = ($grossCommissionedEarned * $product->gst) / 100;
|
||||
$tds = ($grossCommissionedEarned * $product->tds) / 100;
|
||||
return [
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
@@ -95,8 +95,9 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-gray-600 fw-semibold">
|
||||
{{-- @dd($product) --}}
|
||||
{{-- @dd($products->toArray()) --}}
|
||||
@foreach ($products as $product)
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div
|
||||
@@ -113,32 +114,10 @@
|
||||
<td>{{ $product->category_name }}</td>
|
||||
<td>{{ number_format($product->rate ?? $product->upfront_rate ?? $product->trail_rate,2) }} %</td>
|
||||
<td>{{ $product->totalCommission }}</td>
|
||||
<td
|
||||
class="text-end d-flex align-items-center justify-content-around notexport">
|
||||
{{-- <a class="get-product-detail" date-rate="{{ $product->rate }}"
|
||||
data-description="{{ $product->description }}"
|
||||
data-commission="{{ $product->commission }}"
|
||||
data-commissiontype="{{ $product->commission_type }}"
|
||||
data-category="{{ $product->category_name }}"
|
||||
data-productname="{{ $product->product_name }}"
|
||||
data-id="{{ $product->id }}"
|
||||
data-mininvestment="{{ $product->minimum_investment }}">
|
||||
<i class="fa-regular fa-eye"></i>
|
||||
</a> --}}
|
||||
|
||||
{{-- <a class="edit-product-detail" data-rate="{{ $product->rate }}"
|
||||
data-description="{{ $product->description }}"
|
||||
data-commission="{{ $product->commission }}"
|
||||
data-commissiontype="{{ $product->commission_type }}"
|
||||
data-category="{{ $product->category_name }}"
|
||||
data-productname="{{ $product->product_name }}"
|
||||
data-id="{{ $product->id }}"
|
||||
data-mininvestment="{{ $product->minimum_investment }}">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
</a> --}}
|
||||
<td class="text-end d-flex align-items-center justify-content-around notexport">
|
||||
<a
|
||||
href="{{ route('get-product', ['id' => $product->id, 'product' => $product->product_name]) }}"><i
|
||||
class="fa-regular fa-eye"></i></a>
|
||||
class="fa-regular fa-eye"></i> </a>
|
||||
<a
|
||||
href="{{ route('edit-commission', ['id' => $product->id, 'product' => $product->product_name]) }}"><i
|
||||
class="fa-solid fa-pen-to-square"></i></a>
|
||||
|
||||
@@ -180,11 +180,12 @@
|
||||
<select class="form-select form-select-solid" data-control="select2" data-hide-search="true" data-placeholder="Select a Company" name="companies_id">
|
||||
|
||||
<option value="">Select a Company</option>
|
||||
|
||||
|
||||
|
||||
@foreach($companies as $key=>$company)
|
||||
|
||||
<option value="{{$key}}" {{$key == $products->realEstates->companies_id?'selected="selected"':null}}?>{{$company}}</option>
|
||||
<option value="{{$key}}" {{$key == $products->realEstates->platform_partner?'selected="selected"':null}}?>{{$company}}</option>
|
||||
|
||||
@endforeach
|
||||
|
||||
|
||||
Reference in New Issue
Block a user