mivita/resources/views/admin/payment/credit_detail.blade.php
2026-01-23 17:35:23 +01:00

466 lines
24 KiB
PHP

@extends('layouts.layout-2')
@section('content')
<style>
.td-entry-table-margin {
padding-bottom: 6px;
border-bottom: 1px solid rgb(221, 221, 221);
margin-bottom: 6px;
}
div.card-header {
border-bottom: none;
}
.user-view-table tr:first-child td {
border-top: none;
}
.user-view-table tr:first-child td {
border-top: none;
}
.table th, .table td {
border-top: none;
}
.table tbody th, .table tbody td {
border-bottom: 1px solid #d6d6de;
}
.card hr {
border-color: #d7d700
}
</style>
<div class="card">
<h5 class="card-header">
{{ __('team.payout_details') }}
<br>
{{ __('pdf.credit_note') }} | {{ $user_credit->date }} | {{ $user_credit->full_number }} |
{{ $user_credit->user->account->first_name }} {{ $user_credit->user->account->last_name }}
({{ $user_credit->user->email }})
</h5>
@foreach ($dates as $date => $dateObj)
@if (isset($collection->calc_bot[$date]))
@php($cbot = $collection->calc_bot[$date])
<div class="card-header">
<table class="table user-view-table m-0">
<tbody>
<tr>
<td>{{ __('team.date') }}:</td>
<td>
<strong> {{ HTMLHelper::getMonth($cbot->date->month) }}
{{ $cbot->date->year }}</strong> | {{ __('team.completed') }}
@if ($cbot->business_user->isSave())
<span class="badge badge-outline-success"><i class="fa fa-check-circle"></i></span>
@else
<span class="badge badge-outline-warning-dark"><i class="fa fa-times"></i></span>
@endif
</td>
</tr>
<tr>
<td>{{ __('team.career_level') }}:</td>
<td>
{{ \App\Services\TranslationHelper::transUserLevelName($cbot->business_user->user_level_name) }}
&nbsp;
<span class="badge badge-outline-success"> {{ __('team.KU') }}
{{ $cbot->business_user->qual_kp }} / {{ __('team.PP') }}
{{ formatNumber($cbot->business_user->qual_pp, 0) }}</span>
</td>
</tr>
<tr>
<td>{{ __('team.shop_commission') }}:</td>
<td>
{{ $cbot->business_user->margin_shop }} %
</td>
</tr>
<tr>
<td>{{ __('team.consultant_margin') }}:</td>
<td>
{{ $cbot->business_user->margin }} %
</td>
</tr>
<tr>
<td><strong>{{ __('team.commission_total') }}:</strong></td>
<td>
<span class="badge badge-secondary" style="font-size: 1em;"><strong>{{ formatNumber($cbot->business_user->getCommissionTotal()) }} &euro;</strong></span>
</td>
</tr>
</tbody>
</table>
</div>
<hr>
@endif
{{-- Eigene Marge --}}
@if (isset($collection->own_order[$date]))
@php($order = $collection->own_order[$date])
@if (isset($cbot))
<div class="card-header">
<table class="table user-view-table m-0">
<tbody>
<tr>
<td>
<strong>{{ __('team.own') }} {{ __('tables.margin') }} </strong>
</td>
<td>
<span class="badge badge-info"
style="font-size: 1em;"><strong>
{{ formatNumber($cbot->business_user->getSalesVolumeTotalMargin()) }}
&euro;</strong></span>
&nbsp;
({{ __('team.net_turnover') }}:
{{ formatNumber($cbot->business_user->sales_volume_total) }} &euro; /
{{ $cbot->business_user->margin }} %)
<br>
<em>{{ __('team.consultant_margin_info') }}</em>
</td>
</tr>
</tbody>
</table>
</div>
@endif
<div class="card-body table-responsive pt-0 pb-0">
<table class="datatables-style table table-striped ">
<thead>
<tr>
<th>{{ __('tables.date') }}</th>
<th>{{ __('tables.net_sales') }}</th>
<th>{{ __('tables.margin') }} %</th>
<th>{{ __('tables.margin') }} &euro;</th>
<th>{{ __('tables.order') }}</th>
</tr>
</thead>
<tbody>
@foreach ($order->user_sales_volumes as $user_sales_volume)
<tr>
<td>{{ $user_sales_volume->date }}</td>
<td>{{ formatNumber($user_sales_volume->total_net) }} &euro;</td>
<td>{{ $cbot->business_user->margin }} %</td>
<td>{{ formatNumber($user_sales_volume->caluCommissonTotalNet($cbot->business_user->margin)) }} &euro;</td>
<td>
{{ $user_sales_volume->shopping_order_id }}
@if ($user_sales_volume->shopping_order)
<br><span
class="small">{{ $user_sales_volume->shopping_order->getShoppingUserFullName() }}</span>
@endif
</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr style="background-color: #28c3d7; color:#fff;">
<td class="text-left"><b>{{ __('tables.total') }}<b></td>
<td>{{ formatNumber($order->credit_total_net) }} &euro;</td>
<td>&nbsp;</td>
<td><strong>{{ formatNumber($cbot->business_user->getSalesVolumeTotalMargin()) }} &euro;</strong></td>
<td>&nbsp;</td>
</tr>
</tfoot>
</table>
</div>
<hr>
@endif
{{-- Provision Shop --}}
@if (isset($collection->commission_shop[$date]))
@php($cs = $collection->commission_shop[$date])
@if (isset($cbot))
<div class="card-header">
<table class="table user-view-table m-0">
<tbody>
<tr>
<td>
<strong>{{ __('team.commission_shop') }}</strong>
</td>
<td>
<span class="badge badge-primary"
style="font-size: 1em;"><strong>{{ formatNumber($cbot->business_user->commission_shop_sales) }}
&euro;</strong></span>
&nbsp;
({{ __('team.sales_store_net') }}:
{{ formatNumber($cbot->business_user->sales_volume_total_shop) }} &euro; /
{{ $cbot->business_user->margin_shop }} %)
</td>
</tr>
</tbody>
</table>
</div>
@endif
<div class="card-body table-responsive pt-0 pb-0">
<table class="datatables-style table table-striped ">
<thead>
<tr>
<th>{{ __('tables.date') }}</th>
<th>{{ __('tables.net_sales') }}</th>
<th>{{__('tables.commission')}} %</th>
<th>{{__('tables.commission')}} &euro;</th>
<th>{{ __('tables.order') }}</th>
</tr>
</thead>
<tbody>
@foreach ($cs->user_sales_volumes as $user_sales_volume)
<tr>
<td>{{ $user_sales_volume->date }}</td>
<td>{{ formatNumber($user_sales_volume->total_net) }} &euro;</td>
<td>{{ $cbot->business_user->margin_shop }} %</td>
<td>{{ formatNumber($user_sales_volume->caluCommissonTotalNet($cbot->business_user->margin_shop)) }} &euro;</td>
<td>
{{ $user_sales_volume->shopping_order_id }}
@if ($user_sales_volume->shopping_order)
<br><span class="small">{{ $user_sales_volume->shopping_order->getShoppingUserFullName() }}</span>
@endif
</td>
</tr>
@endforeach
@if (isset($collection->commission_credit[$date]))
@php($ccredits = $collection->commission_credit[$date])
@foreach ($ccredits as $credit)
<tr>
<td>{{ $credit->date }}</td>
<td>{{ formatNumber($credit->total_net) }} &euro;</td>
<td>{{ $cbot->business_user->margin_shop }} %</td>
<td>{{ formatNumber($credit->caluCommissonTotalNet($cbot->business_user->margin_shop)) }} &euro;</td>
<td>{{ __('pdf.credit_note') }}<br><span class="small">{{ $credit->info }}</span></td>
</tr>
@endforeach
@endif
</tbody>
<tfoot>
<tr style="background-color: #b5c49b;">
<td class="text-left"><b>{{ __('tables.total') }}</b></td>
<td>{{ formatNumber($cs->user_sales_volumes_total->month_shop_total_net) }} &euro;</td>
<td>&nbsp;</td>
<td><strong>{{ formatNumber($cbot->business_user->commission_shop_sales) }} &euro;</strong></td>
<td>&nbsp;</td>
</tr>
</tfoot>
</table>
</div>
<hr>
@endif
{{-- Points Registration
@if (isset($collection->commission_registration[$date]))
@php($cr = $collection->commission_registration[$date])
<div class="card-header">
<table class="table user-view-table m-0">
<tbody>
<tr>
<td colspan="2">
<strong>{{ __('tables.points') }} {{ __('payment.registration') }}</strong>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card-body table-responsive pt-0 pb-0">
<table class="datatables-style table table-striped ">
<thead>
<tr>
<th>{{ __('tables.date') }}</th>
<th>{{ __('tables.points') }}</th>
<th>{{ __('tables.info') }}</th>
</tr>
</thead>
<tbody>
@foreach ($cr->user_sales_volumes as $user_sales_volume)
<tr>
<td>{{ $user_sales_volume->date }}</td>
<td>{{ $user_sales_volume->getFormattedPoints() }}</td>
<td>{{ $user_sales_volume->info }}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<td class="text-right"> {{ __('tables.total') }} </td>
<td><strong>{{ $cr->credit_total_points }}</strong></td>
<td>&nbsp;</td>
</tr>
</tfoot>
</table>
</div>
<hr>
@endif
--}}
@if (isset($cbot))
{{-- Payline Points / Provision / Tiefenbonus
<div class="card-header">
<table class="table user-view-table m-0">
<tbody>
<tr>
<td colspan="2">
<strong>{{ __('tables.total') }} </strong>
</td>
</tr>
<tr>
<td>{{ __('team.net_turnover') }}:</td>
<td>
<strong>{{ formatNumber($cbot->business_user->sales_volume_total_sum) }} &euro;</strong>
({{ __('team.own') }}: {{ formatNumber($cbot->business_user->sales_volume_total) }} &euro; | {{ __('team.shop') }}: {{ formatNumber($cbot->business_user->sales_volume_total_shop) }} &euro;)
</td>
</tr>
<tr>
<td>{{ __('team.customer_points') }}:</td>
<td>
<strong>{{ formatNumber($cbot->business_user->sales_volume_points_KP_sum, 0) }} {{ __('team.KU') }}</strong>
({{ __('team.own') }}: {{ formatNumber($cbot->business_user->sales_volume_KP_points, 0) }} | {{ __('team.shop') }}: {{ formatNumber($cbot->business_user->sales_volume_points_shop, 0) }})
&nbsp; <span class="badge {{ $cbot->business_user->isQualKP() ? 'badge-outline-success' : 'badge-outline-warning-dark' }}"> {{ __('team.KU') }} {{ $cbot->business_user->qual_kp }}</span>
</td>
</tr>
</tbody>
</table>
</div>
--}}
{{-- Payline Points / Provision / Tiefenbonus
<hr>
<div class="card-header">
<table class="table user-view-table m-0">
<tbody>
@if($cbot->business_user->version == 2)
<tr>
<td>{{ __('team.payline_points') }}:</td>
<td>
<strong>{{ formatNumber($cbot->business_user->payline_points, 0) }} {{ __('team.PP') }}</strong>
</td>
</tr>
<tr>
<td>{{ __('team.qualification_points') }} :</td>
<td>
<strong>{{ formatNumber($cbot->business_user->payline_points_qual_kp, 0) }} {{ __('team.PP') }}</strong> (+ {{ __('team.volume_KU') }})
</td>
</tr>
<tr>
<td>{{ __('team.current_commission_level') }}:</td>
<td>
@if($cbot->business_user->isQualLevel())
<span class="badge {{ $cbot->business_user->isQualEqualLevel() ? 'badge-outline-success' : 'badge-outline-info' }}">
{{ __('team.KU') }} {{ formatNumber($cbot->business_user->sales_volume_points_KP_sum, 0) }} /
<strong>{{ formatNumber($cbot->business_user->qual_user_level['qual_kp'], 0) }}</strong> |
{{ __('team.PP') }} {{ formatNumber($cbot->business_user->payline_points_qual_kp, 0) }} /
<strong>{{ formatNumber($cbot->business_user->qual_user_level['qual_pp'], 0) }}</strong>
| {{ \App\Services\TranslationHelper::transUserLevelName($cbot->business_user->qual_user_level['name']) }}</span>
@endif
</td>
</tr>
<tr>
<td><strong>{{ __('team.commission_payline') }}:</strong></td>
<td>
<span class="badge badge-primary" style="font-size: 1em;"><strong>{{ formatNumber($cbot->business_user->commission_pp_total) }} &euro;</strong></span>
</td>
</tr>
<tr>
<td><strong>{{ __('team.commission_WB') }}:</strong></td>
<td>
<span class="badge badge-primary" style="font-size: 1em;"><strong>{{ formatNumber($cbot->business_user->commission_growth_total) }} &euro;</strong></span>
</td>
</tr>
@endif
</tbody>
</table>
</div>
--}}
{{-- Table Payline Points / Provision / Tiefenbonus
<div class="card-body table-responsive pt-0 pb-0">
<table class="datatables-style table table-striped ">
<thead>
<tr>
<th>{{__('tables.line')}}</th>
<th>{{__('tables.points')}}</th>
<th>{{__('tables.commission')}} %</th>
<th>{{__('tables.commission')}} &euro;</th>
</tr>
</thead>
<tbody>
@foreach ($cbot->business_user->business_lines as $line => $object)
<tr>
<td>
@if($line <= $cbot->business_user->getQualLevelPaylines())
<div class="font-weight-bolder line-height-1 my-2 text-dark badge badge-outline-success">{{ $line }}. {{ __('team.PP') }}</div>
@elseif($line <= $cbot->business_user->isQualLevelGrowth($line))
<div class="font-weight-bolder line-height-1 my-2 text-dark badge badge-outline-warning-dark">{{ $line }}. {{ __('team.WB') }}</div>
@else
<div class="font-weight-bolder line-height-1 my-2 text-dark badge badge-outline-dark">{{ $line }}.</div>
@endif
</td>
<td>{{ formatNumber($cbot->getKeybyLine($line, 'points'), 0) }}</td>
<td>{{ formatNumber($cbot->getKeybyLine($line, 'margin'), 1) }} %</td>
<td>{{ formatNumber($cbot->getKeybyLine($line, 'commission'), 2) }} &euro;</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<td>{{__('tables.total')}}</td>
<td>{{ formatNumber($cbot->business_user->total_pp, 0) }}</td>
<td>&nbsp;</td>
<td><strong>{{ formatNumber($cbot->business_user->commission_pp_total, 2) }} &euro;</strong></td>
</tr>
</tfoot>
</table>
</div>
<hr>
--}}
<div class="card-header">
<table class="table user-view-table m-0">
<tbody>
@if($cbot->business_user->version == 2)
<tr>
<td><strong>{{ __('team.commission_payline') }}:</strong></td>
<td>
<span class="badge badge-secondary" style="font-size: 1em;"><strong>{{ formatNumber($cbot->business_user->commission_pp_total) }} &euro;</strong></span>
</td>
</tr>
<tr>
<td><strong>{{ __('team.commission_WB') }}:</strong></td>
<td>
<span class="badge badge-secondary" style="font-size: 1em;"><strong>{{ formatNumber($cbot->business_user->commission_growth_total) }} &euro;</strong></span>
</td>
</tr>
@endif
</tbody>
</table>
</div>
<div class="card-body table-responsive pt-0 pb-0">
<table class="datatables-style table table-striped ">
<thead>
<tr>
<th>{{__('tables.line')}}</th>
<th>{{ __('shop.name') }}</th>
<th>{{__('tables.points')}}</th>
<th>{{__('tables.commission')}} %</th>
<th>{{__('tables.commission')}} &euro;</th>
<th>{{ __('tables.level') }}</th>
</tr>
</thead>
<tbody>
{!! \App\Services\BusinessPlan\SalesPointsVolumeHelper::getBusinessUsersTable($cbot, 'line') !!}
</tbody>
</table>
</div>
@endif
@endforeach
</div>
@endsection