23-01-2026
This commit is contained in:
parent
a939cd51ef
commit
a8b395e20d
248 changed files with 29342 additions and 4805 deletions
|
|
@ -32,7 +32,7 @@
|
|||
<td>{{ __('team.career_level') }}:</td>
|
||||
<td>
|
||||
{{ \App\Services\TranslationHelper::transUserLevelName($TreeCalcBot->business_user->user_level_name) }}
|
||||
<span class="badge badge-outline-success"> {{ __('team.KU') }} {{ $TreeCalcBot->business_user->qual_kp }} / {{ __('team.PP') }} {{ formatNumber($TreeCalcBot->business_user->qual_pp, 0) }}</span>
|
||||
<span class="badge badge-outline-success"> {{ __('team.KU') }} {{ $TreeCalcBot->business_user->qual_kp }} / {{ __('team.PP') }} {{ formatNumber($TreeCalcBot->business_user->qual_pp) }}</span>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -71,8 +71,8 @@
|
|||
<tr>
|
||||
<td>{{ __('team.customer_points') }}:</td>
|
||||
<td>
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->sales_volume_points_KP_sum, 0) }} {{ __('team.KU') }}</strong>
|
||||
({{ __('team.own') }}: {{ formatNumber($TreeCalcBot->business_user->sales_volume_KP_points, 0) }} | {{ __('team.shop') }}: {{ formatNumber($TreeCalcBot->business_user->sales_volume_points_shop, 0) }})
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->sales_volume_points_KP_sum) }} {{ __('team.KU') }}</strong>
|
||||
({{ __('team.own') }}: {{ formatNumber($TreeCalcBot->business_user->sales_volume_KP_points) }} | {{ __('team.shop') }}: {{ formatNumber($TreeCalcBot->business_user->sales_volume_points_shop) }})
|
||||
<span class="badge {{ $TreeCalcBot->business_user->isQualKP() ? 'badge-outline-success' : 'badge-outline-warning-dark' }}"> {{ __('team.KU') }} {{ $TreeCalcBot->business_user->qual_kp }}</span>
|
||||
|
||||
</td>
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
<tr>
|
||||
<td>{{ __('team.qualification_points') }}:</td>
|
||||
<td>
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->total_qual_pp, 0) }} {{ __('team.TP') }}</strong> (+ {{ __('team.volume_KU') }})
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->total_qual_pp) }} {{ __('team.TP') }}</strong> (+ {{ __('team.volume_KU') }})
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -89,10 +89,10 @@
|
|||
<td>
|
||||
@if($TreeCalcBot->business_user->isQualLevel())
|
||||
<span class="badge {{ $TreeCalcBot->business_user->isQualEqualLevel() ? 'badge-outline-success' : 'badge-outline-info' }}">
|
||||
{{ __('team.KP') }} {{ formatNumber($TreeCalcBot->business_user->sales_volume_points_KP_sum, 0) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level['qual_kp'], 0) }}</strong> |
|
||||
{{ __('team.TP') }} {{ formatNumber($TreeCalcBot->business_user->total_qual_pp, 0) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level['qual_pp'], 0) }}</strong>
|
||||
{{ __('team.KP') }} {{ formatNumber($TreeCalcBot->business_user->sales_volume_points_KP_sum) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level['qual_kp']) }}</strong> |
|
||||
{{ __('team.TP') }} {{ formatNumber($TreeCalcBot->business_user->total_qual_pp) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level['qual_pp']) }}</strong>
|
||||
| {{ $TreeCalcBot->business_user->qual_user_level['name'] }}</span>
|
||||
@endif
|
||||
</td>
|
||||
|
|
@ -103,14 +103,14 @@
|
|||
<tr>
|
||||
<td>{{ __('team.payline_points') }}:</td>
|
||||
<td>
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->payline_points, 0) }} {{ __('team.PP') }}</strong>
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->payline_points) }} {{ __('team.PP') }}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{{ __('team.qualification_points') }} :</td>
|
||||
<td>
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->payline_points_qual_kp, 0) }} {{ __('team.PP') }}</strong> (+ {{ __('team.volume_KU') }})
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->payline_points_qual_kp) }} {{ __('team.PP') }}</strong> (+ {{ __('team.volume_KU') }})
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -118,10 +118,10 @@
|
|||
<td>
|
||||
@if($TreeCalcBot->business_user->isQualLevel())
|
||||
<span class="badge {{ $TreeCalcBot->business_user->isQualEqualLevel() ? 'badge-outline-success' : 'badge-outline-info' }}">
|
||||
{{ __('team.KU') }} {{ formatNumber($TreeCalcBot->business_user->sales_volume_points_KP_sum, 0) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level['qual_kp'], 0) }}</strong> |
|
||||
{{ __('team.PP') }} {{ formatNumber($TreeCalcBot->business_user->payline_points_qual_kp, 0) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level['qual_pp'], 0) }}</strong>
|
||||
{{ __('team.KU') }} {{ formatNumber($TreeCalcBot->business_user->calc_qual_kp) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level['qual_kp']) }}</strong> |
|
||||
{{ __('team.PP') }} {{ formatNumber($TreeCalcBot->business_user->payline_points_qual_kp) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level['qual_pp']) }}</strong>
|
||||
| {{ \App\Services\TranslationHelper::transUserLevelName($TreeCalcBot->business_user->qual_user_level['name']) }}</span>
|
||||
@endif
|
||||
</td>
|
||||
|
|
@ -131,10 +131,10 @@
|
|||
<td>{{ __('team.next_commission_level') }}:</td>
|
||||
<td>
|
||||
<span class="badge badge-outline-warning-dark">
|
||||
{{ __('team.KU') }} {{ formatNumber($TreeCalcBot->business_user->sales_volume_points_KP_sum, 0) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level_next['qual_kp'], 0) }}</strong> |
|
||||
{{ __('team.PP') }} {{ formatNumber($TreeCalcBot->business_user->payline_points_qual_kp, 0) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level_next['qual_pp'], 0) }}</strong>
|
||||
{{ __('team.KU') }} {{ formatNumber($TreeCalcBot->business_user->qual_user_level_next['_calculated_qual_kp']) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level_next['qual_kp']) }}</strong> |
|
||||
{{ __('team.PP') }} {{ formatNumber($TreeCalcBot->business_user->qual_user_level_next['_calculated_payline_points_qual_kp']) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->qual_user_level_next['qual_pp']) }}</strong>
|
||||
| {{ \App\Services\TranslationHelper::transUserLevelName($TreeCalcBot->business_user->qual_user_level_next['name']) }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -146,17 +146,17 @@
|
|||
<td>
|
||||
@if($TreeCalcBot->business_user->next_qual_user_level)
|
||||
<span class="badge badge-outline-success">
|
||||
{{ __('team.KU') }} {{ formatNumber($TreeCalcBot->business_user->sales_volume_points_KP_sum, 0) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->next_qual_user_level['qual_kp'], 0) }}</strong> |
|
||||
{{ __('team.TP') }} {{ formatNumber($TreeCalcBot->business_user->payline_points_qual_kp, 0) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->next_qual_user_level['qual_pp'], 0) }}</strong>
|
||||
{{ __('team.KU') }} {{ formatNumber($TreeCalcBot->business_user->next_qual_user_level['_calculated_qual_kp']) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->next_qual_user_level['qual_kp']) }}</strong> |
|
||||
{{ __('team.TP') }} {{ formatNumber($TreeCalcBot->business_user->next_qual_user_level['_calculated_payline_points_qual_kp']) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->next_qual_user_level['qual_pp']) }}</strong>
|
||||
| {{ \App\Services\TranslationHelper::transUserLevelName($TreeCalcBot->business_user->next_qual_user_level['name']) }}</span>
|
||||
@elseif($TreeCalcBot->business_user->next_can_user_level)
|
||||
<span class="badge badge-outline-warning-dark">
|
||||
{{ __('team.KU') }} {{ formatNumber($TreeCalcBot->business_user->sales_volume_points_KP_sum, 0) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->next_can_user_level['qual_kp'], 0) }}</strong> |
|
||||
{{ __('team.TP') }} {{ formatNumber($TreeCalcBot->business_user->payline_points_qual_kp, 0) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->next_can_user_level['qual_pp'], 0) }}</strong>
|
||||
{{ __('team.KU') }} {{ formatNumber($TreeCalcBot->business_user->next_can_user_level['_calculated_qual_kp']) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->next_can_user_level['qual_kp']) }}</strong> |
|
||||
{{ __('team.TP') }} {{ formatNumber($TreeCalcBot->business_user->next_can_user_level['_calculated_payline_points_qual_kp']) }} /
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->next_can_user_level['qual_pp']) }}</strong>
|
||||
| {{ \App\Services\TranslationHelper::transUserLevelName($TreeCalcBot->business_user->next_can_user_level['name']) }}</span>
|
||||
@else
|
||||
<span class="badge badge-outline-warning"><i class="fa fa-times"></i></span>
|
||||
|
|
@ -204,13 +204,13 @@
|
|||
{{-- <tr>
|
||||
<td>Team Points:</td>
|
||||
<td>
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->total_pp, 0) }} TP</strong>
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->total_pp) }} TP</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Qualifikation Team Points:</td>
|
||||
<td>
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->payline_points_qual_kp, 0) }} TP</strong> (+ Volumen KP)
|
||||
<strong>{{ formatNumber($TreeCalcBot->business_user->payline_points_qual_kp) }} TP</strong> (+ Volumen KP)
|
||||
</td>
|
||||
</tr>
|
||||
--}}
|
||||
|
|
@ -241,7 +241,7 @@
|
|||
<div class="font-weight-bolder line-height-1 my-2 text-dark badge badge-outline-dark">{{ $line }}.</div>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ formatNumber($TreeCalcBot->getKeybyLine($line, 'points'), 0) }}</td>
|
||||
<td>{{ formatNumber($TreeCalcBot->getKeybyLine($line, 'points')) }}</td>
|
||||
<td>{{ formatNumber($TreeCalcBot->getKeybyLine($line, 'margin'), 1) }} %</td>
|
||||
<td>{{ formatNumber($TreeCalcBot->getKeybyLine($line, 'commission'), 2) }} €</td>
|
||||
</tr>
|
||||
|
|
@ -250,7 +250,7 @@
|
|||
<tfoot>
|
||||
<tr>
|
||||
<td>{{__('tables.total')}}</td>
|
||||
<td>{{ formatNumber($TreeCalcBot->business_user->total_pp, 0) }}</td>
|
||||
<td>{{ formatNumber($TreeCalcBot->business_user->total_pp) }}</td>
|
||||
<td></td>
|
||||
<td><strong>{{ formatNumber($TreeCalcBot->business_user->commission_pp_total, 2) }} €</strong></td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
@if($userSalesVolume)
|
||||
<tr>
|
||||
<td>{{ $userSalesVolume->date }}</td>
|
||||
<td>{{ $userSalesVolume->points }}</td>
|
||||
<td>{{ $userSalesVolume->getFormattedPoints() }}</td>
|
||||
<td>{{ formatNumber($userSalesVolume->total_net) }} €</td>
|
||||
<td>{{ $userSalesVolume->getStatusType() }}</td>
|
||||
<td>@if($userSalesVolume->user)
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
<div class="form-row">
|
||||
<div class="form-group col-sm-4">
|
||||
<label for="points" class="form-label">{{__('Points')}}</label>
|
||||
{{ Form::text('points', $userSalesVolume->points, array('class'=>'form-control', 'id'=>'points')) }}
|
||||
{{ Form::text('points', $userSalesVolume->getFormattedPoints(), array('class'=>'form-control', 'id'=>'points')) }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,12 +6,23 @@
|
|||
Business Points
|
||||
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-load-content"
|
||||
data-id="new"
|
||||
data-action="add_user_sales_volume"
|
||||
data-back="{{url()->current()}}"
|
||||
data-route="{{ route('modal_load') }}"><span class="fa fa-plus-circle"></span> Points hinzufügen
|
||||
</button>
|
||||
<div class="d-flex">
|
||||
<form action="{{ route('admin_business_points_recalculate') }}" method="POST" style="display: none;" id="recalculate-form" onsubmit="return confirmRecalculate();" class="inline-block">
|
||||
@csrf
|
||||
<input type="hidden" name="points_filter_member_id" id="recalc_member_id" value="">
|
||||
<input type="hidden" name="points_filter_month" id="recalc_month" value="">
|
||||
<input type="hidden" name="points_filter_year" id="recalc_year" value="">
|
||||
<button type="submit" class="btn btn-sm btn-warning">
|
||||
<span class="fa fa-refresh"></span> Punkte neu berechnen
|
||||
</button>
|
||||
</form>
|
||||
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-load-content"
|
||||
data-id="new"
|
||||
data-action="add_user_sales_volume"
|
||||
data-back="{{url()->current()}}"
|
||||
data-route="{{ route('modal_load') }}"><span class="fa fa-plus-circle"></span> Points hinzufügen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</h5>
|
||||
|
||||
|
|
@ -65,6 +76,25 @@
|
|||
</div>
|
||||
{!! Form::close() !!}
|
||||
|
||||
<!-- Summen-Anzeige -->
|
||||
<div id="points-summary" style="display: none;" class="alert alert-info mx-4 mb-3">
|
||||
<h6 class="mb-3"><strong>Monatssummen für ausgewählten Berater</strong></h6>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<strong>KP-Punkte (Eigene):</strong> <span id="sum-kp-points">0</span><br>
|
||||
<small class="text-muted">Eigenumsatz: <span id="sum-kp-net">0</span> €</small>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<strong>TP-Punkte (Team):</strong> <span id="sum-tp-points">0</span><br>
|
||||
<small class="text-muted">Shop: <span id="sum-shop-points">0</span> Punkte</small>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<strong>Gesamtumsatz:</strong> <span id="sum-total-net">0</span> €<br>
|
||||
<small class="text-muted">Shop-Umsatz: <span id="sum-shop-net">0</span> €</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-datatable table-responsive pt-0">
|
||||
<table class="datatables-style table table-striped table-bordered" id="datatable-invoice">
|
||||
<thead>
|
||||
|
|
@ -94,6 +124,68 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
function toggleRecalculateButton() {
|
||||
var memberId = $('select[name=points_filter_member_id]').val();
|
||||
var month = $('select[name=points_filter_month]').val();
|
||||
var year = $('select[name=points_filter_year]').val();
|
||||
|
||||
if (memberId && month && year) {
|
||||
$('#recalc_member_id').val(memberId);
|
||||
$('#recalc_month').val(month);
|
||||
$('#recalc_year').val(year);
|
||||
$('#recalculate-form').show();
|
||||
loadSummary();
|
||||
} else {
|
||||
$('#recalculate-form').hide();
|
||||
$('#points-summary').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function loadSummary() {
|
||||
var memberId = $('select[name=points_filter_member_id]').val();
|
||||
var month = $('select[name=points_filter_month]').val();
|
||||
var year = $('select[name=points_filter_year]').val();
|
||||
|
||||
if (!memberId || !month || !year) {
|
||||
$('#points-summary').hide();
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '{!! route('admin_business_points_summary') !!}',
|
||||
type: 'GET',
|
||||
data: {
|
||||
points_filter_member_id: memberId,
|
||||
points_filter_month: month,
|
||||
points_filter_year: year
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.success && response.data) {
|
||||
var data = response.data;
|
||||
$('#sum-kp-points').text(data.total_KP_points.toLocaleString('de-DE'));
|
||||
$('#sum-tp-points').text(data.total_TP_points.toLocaleString('de-DE'));
|
||||
$('#sum-shop-points').text(data.month_shop_points.toLocaleString('de-DE'));
|
||||
$('#sum-kp-net').text(data.month_total_net.toLocaleString('de-DE', {minimumFractionDigits: 2, maximumFractionDigits: 2}));
|
||||
$('#sum-shop-net').text(data.month_shop_total_net.toLocaleString('de-DE', {minimumFractionDigits: 2, maximumFractionDigits: 2}));
|
||||
$('#sum-total-net').text(data.total_net.toLocaleString('de-DE', {minimumFractionDigits: 2, maximumFractionDigits: 2}));
|
||||
$('#points-summary').show();
|
||||
} else {
|
||||
$('#points-summary').hide();
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
$('#points-summary').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmRecalculate() {
|
||||
var month = $('#recalc_month').val();
|
||||
var year = $('#recalc_year').val();
|
||||
var monthPadded = month.toString().padStart(2, '0');
|
||||
return confirm('Möchten Sie die Punkte für den ausgewählten Berater im Monat ' + monthPadded + '/' + year + ' wirklich neu berechnen?');
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
var oTable = $('#datatable-invoice').DataTable({
|
||||
"processing": true,
|
||||
|
|
@ -132,13 +224,27 @@
|
|||
"url": "/js/datatables-{{ \App::getLocale() }}.json"
|
||||
}
|
||||
});
|
||||
|
||||
// Toggle button on filter change
|
||||
$('select.on_change_select').on('change', function(){
|
||||
toggleRecalculateButton();
|
||||
oTable.draw();
|
||||
});
|
||||
|
||||
$('input.on_keyup_input').on('keyup', function(){
|
||||
oTable.draw();
|
||||
});
|
||||
|
||||
// Initial toggle on page load
|
||||
toggleRecalculateButton();
|
||||
|
||||
// Reload summary after table draw completes
|
||||
oTable.on('draw', function() {
|
||||
var memberId = $('select[name=points_filter_member_id]').val();
|
||||
if (memberId) {
|
||||
loadSummary();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue