278 lines
14 KiB
PHP
278 lines
14 KiB
PHP
{!! Form::open(['action' => $route, 'class' => 'modal-content', 'enctype' => 'multipart/form-data']) !!}
|
||
<div class="modal-header">
|
||
<h5 class="modal-title">
|
||
Business Points
|
||
<span class="font-weight-light">bearbeiten</span>
|
||
</h5>
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<input type="hidden" name="action" value="{{$data['action']}}">
|
||
<input type="hidden" name="id" value="{{$data['id']}}">
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col">
|
||
<label for="change_member_key" class="form-label">{{ __('Passwort eingeben') }}*</label>
|
||
<input type="text" class="form-control" name="change_member_key" id="change_member_key"
|
||
placeholder="mivita" required>
|
||
</div>
|
||
</div>
|
||
{{-- Basis-Informationen --}}
|
||
<div class="table-responsive">
|
||
<table class="table table-bordered table-striped">
|
||
<thead>
|
||
<tr>
|
||
<th>{{__('tables.date')}}</th>
|
||
<th>{{__('tables.points')}}</th>
|
||
<th>Umsatz netto</th>
|
||
<th>{{__('tables.status')}}</th>
|
||
<th>Berater</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@if($userSalesVolume)
|
||
<tr>
|
||
<td>{{ $userSalesVolume->date }}</td>
|
||
<td>
|
||
<strong class="{{ $userSalesVolume->points < 0 ? 'text-danger' : '' }}">
|
||
{{ $userSalesVolume->getFormattedPoints() }}
|
||
</strong>
|
||
</td>
|
||
<td class="{{ $userSalesVolume->total_net < 0 ? 'text-danger' : '' }}">
|
||
{{ formatNumber($userSalesVolume->total_net) }} €
|
||
</td>
|
||
<td>
|
||
<span class="badge badge-{{ $userSalesVolume->getStatusColor() }}">
|
||
{{ $userSalesVolume->getStatusType() }}
|
||
</span>
|
||
</td>
|
||
<td>@if($userSalesVolume->user)
|
||
{{ $userSalesVolume->user->getFullName() }}
|
||
@else
|
||
<span class="text-muted">nicht zugewiesen</span>
|
||
@endif
|
||
</td>
|
||
</tr>
|
||
@if($userSalesVolume->message)
|
||
<tr>
|
||
<td colspan="5"><i class="fa fa-info-circle"></i> {{ $userSalesVolume->message }}</td>
|
||
</tr>
|
||
@endif
|
||
@endif
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
{{-- Erweiterte Informationen --}}
|
||
@if($userSalesVolume)
|
||
<div class="row mb-3">
|
||
<div class="col-md-6">
|
||
<h6 class="mb-2"><strong>Verknüpfungen</strong></h6>
|
||
<div class="list-group list-group-flush">
|
||
{{-- Bestellung --}}
|
||
@if($userSalesVolume->shopping_order)
|
||
<div class="list-group-item px-0 py-2">
|
||
<strong>Bestellung:</strong>
|
||
@if($userSalesVolume->status === 1)
|
||
<a href="{{ route('admin_sales_users_detail', [$userSalesVolume->shopping_order->id]) }}"
|
||
class="btn btn-xs btn-primary" target="_blank">
|
||
<i class="fa fa-shopping-cart"></i> #{{ $userSalesVolume->shopping_order->id }}
|
||
</a>
|
||
@elseif($userSalesVolume->status === 2 || $userSalesVolume->status === 3)
|
||
<a href="{{ route('admin_sales_customers_detail', [$userSalesVolume->shopping_order->id]) }}"
|
||
class="btn btn-xs btn-secondary" target="_blank">
|
||
<i class="fa fa-shopping-cart"></i> #{{ $userSalesVolume->shopping_order->id }}
|
||
</a>
|
||
@elseif($userSalesVolume->status === 6)
|
||
@php
|
||
$route = ($userSalesVolume->shopping_order->payment_for === 6 || $userSalesVolume->shopping_order->payment_for === 7)
|
||
? route('admin_sales_customers_detail', [$userSalesVolume->shopping_order->id])
|
||
: route('admin_sales_users_detail', [$userSalesVolume->shopping_order->id]);
|
||
@endphp
|
||
<a href="{{ $route }}" class="btn btn-xs btn-danger" target="_blank">
|
||
<i class="fa fa-undo"></i> #{{ $userSalesVolume->shopping_order->id }} (Storno)
|
||
</a>
|
||
@endif
|
||
</div>
|
||
@endif
|
||
|
||
{{-- Rechnung --}}
|
||
@if($userSalesVolume->user_invoice)
|
||
<div class="list-group-item px-0 py-2">
|
||
@if($userSalesVolume->user_invoice->cancellation)
|
||
<strong>Stornorechnung:</strong>
|
||
<span class="badge badge-danger">Storno</span>
|
||
<a href="{{ route('storage_file', [$userSalesVolume->user_invoice->shopping_order_id, 'cancellation', 'stream']) }}"
|
||
class="btn btn-xs btn-danger" target="_blank">
|
||
<i class="fa fa-file-pdf"></i> {{ $userSalesVolume->user_invoice->full_number }}
|
||
</a>
|
||
{{-- Link zur Original-Rechnung --}}
|
||
@if($userSalesVolume->shopping_order && $userSalesVolume->shopping_order->user_invoice)
|
||
<br><small class="text-muted">Original:
|
||
<a href="{{ route('storage_file', [$userSalesVolume->shopping_order->id, 'invoice', 'stream']) }}"
|
||
class="text-muted" target="_blank">
|
||
{{ $userSalesVolume->shopping_order->user_invoice->full_number }}
|
||
</a>
|
||
</small>
|
||
@endif
|
||
@else
|
||
<strong>Rechnung:</strong>
|
||
<a href="{{ route('storage_file', [$userSalesVolume->user_invoice->shopping_order_id, 'invoice', 'stream']) }}"
|
||
class="btn btn-xs btn-info" target="_blank">
|
||
<i class="fa fa-file-pdf"></i> {{ $userSalesVolume->user_invoice->full_number }}
|
||
</a>
|
||
@endif
|
||
</div>
|
||
@endif
|
||
|
||
{{-- Info/Notiz --}}
|
||
@if($userSalesVolume->info)
|
||
<div class="list-group-item px-0 py-2">
|
||
<strong>Notiz:</strong> {{ $userSalesVolume->info }}
|
||
</div>
|
||
@endif
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-md-6">
|
||
<h6 class="mb-2"><strong>Monatssummen (kumuliert)</strong></h6>
|
||
<div class="list-group list-group-flush">
|
||
<div class="list-group-item px-0 py-2">
|
||
<strong>KP-Punkte (Eigene):</strong>
|
||
<span class="badge badge-primary">{{ formatNumber($userSalesVolume->month_KP_points) }}</span>
|
||
</div>
|
||
<div class="list-group-item px-0 py-2">
|
||
<strong>TP-Punkte (Team):</strong>
|
||
<span class="badge badge-success">{{ formatNumber($userSalesVolume->month_TP_points) }}</span>
|
||
</div>
|
||
<div class="list-group-item px-0 py-2">
|
||
<strong>Shop-Punkte:</strong>
|
||
<span class="badge badge-secondary">{{ formatNumber($userSalesVolume->month_shop_points) }}</span>
|
||
</div>
|
||
<div class="list-group-item px-0 py-2">
|
||
<strong>Umsatz (netto):</strong>
|
||
{{ formatNumber($userSalesVolume->month_total_net) }} €
|
||
</div>
|
||
<div class="list-group-item px-0 py-2">
|
||
<strong>Shop-Umsatz:</strong>
|
||
{{ formatNumber($userSalesVolume->month_shop_total_net) }} €
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
{{-- Status-Details --}}
|
||
<div class="row mb-3">
|
||
<div class="col-md-12">
|
||
<h6 class="mb-2"><strong>Status-Details</strong></h6>
|
||
<div class="d-flex flex-wrap gap-2">
|
||
<span class="badge badge-{{ $userSalesVolume->getStatusColor() }} mr-2">
|
||
<i class="fa fa-tag"></i> {{ $userSalesVolume->getStatusType() }}
|
||
</span>
|
||
<span class="badge badge-{{ $userSalesVolume->getStatusPointsColor() }} mr-2">
|
||
<i class="fa fa-calculator"></i> {{ $userSalesVolume->getStatusPointsType() }}
|
||
</span>
|
||
@if($userSalesVolume->status_turnover)
|
||
<span class="badge badge-{{ $userSalesVolume->getStatusTurnoverColor() }} mr-2">
|
||
<i class="fa fa-chart-line"></i> {{ $userSalesVolume->getStatusTurnoverType() }}
|
||
</span>
|
||
@endif
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
{{-- Änderungshistorie (Syslog) --}}
|
||
@if($userSalesVolume->syslog && count($userSalesVolume->syslog) > 0)
|
||
<div class="row mb-3">
|
||
<div class="col-md-12">
|
||
<h6 class="mb-2"><strong>Änderungshistorie</strong></h6>
|
||
<div class="alert alert-light p-2">
|
||
<ul class="mb-0 pl-3">
|
||
@foreach($userSalesVolume->syslog as $timestamp => $log_entry)
|
||
<li><small><code>{{ $timestamp }}</code>: {{ $log_entry }}</small></li>
|
||
@endforeach
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
@endif
|
||
|
||
{{-- Timestamps --}}
|
||
<div class="row mb-3">
|
||
<div class="col-md-12">
|
||
<small class="text-muted">
|
||
<i class="fa fa-clock"></i> Erstellt: {{ $userSalesVolume->created_at->format('d.m.Y H:i:s') }}
|
||
@if($userSalesVolume->updated_at && $userSalesVolume->updated_at != $userSalesVolume->created_at)
|
||
| Aktualisiert: {{ $userSalesVolume->updated_at->format('d.m.Y H:i:s') }}
|
||
@endif
|
||
</small>
|
||
</div>
|
||
</div>
|
||
@endif
|
||
|
||
<hr>
|
||
@if($userSalesVolume->isCurrentMonthYear())
|
||
<div class="form-row">
|
||
<div class="form-group col-sm-4">
|
||
<label for="points" class="form-label">{{__('Points')}}</label>
|
||
{{ Form::text('points', $userSalesVolume->getFormattedPoints(), array('class'=>'form-control', 'id'=>'points')) }}
|
||
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-4">
|
||
<label for="status_points" class="form-label">{{ __('Points berechnen für') }}*</label>
|
||
{{ Form::select('status_points', \App\Models\UserSalesVolume::$statusPointsTypes , $userSalesVolume->status_points, array('class'=>'custom-select', 'id'=>'status_points')) }}
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="form-row">
|
||
<div class="form-group col-sm-4">
|
||
<label for="total_net" class="form-label">{{__('Umsatz netto')}}</label>
|
||
{{ Form::text('total_net', formatNumber($userSalesVolume->total_net), array('class'=>'form-control', 'id'=>'total_net')) }}
|
||
</div>
|
||
</div>
|
||
@if($userSalesVolume->status === 4)
|
||
<div class="form-row">
|
||
<div class="form-group col-sm-4">
|
||
<label for="status_turnover" class="form-label">{{__('Umsatz berechnen als')}}*</label>
|
||
{{ Form::select('status_turnover', \App\Models\UserSalesVolume::getTransTurnoverTypes() , $userSalesVolume->status_turnover, array('class'=>'custom-select', 'id'=>'status_turnover')) }}
|
||
</div>
|
||
</div>
|
||
<em>Bei einer Gutschrift kann der Umsatz als Beraterbestellung oder Shopbestellung (wird provisioniert) verrechnet werden</em>
|
||
@endif
|
||
<hr>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-sm-12">
|
||
<label for="info" class="form-label">{{__('Notiz/Grund')}}</label>
|
||
{{ Form::text('info', $userSalesVolume->info, array('placeholder'=>__('max 200 Zeichen'), 'class'=>'form-control', 'id'=>'info', 'maxlength'=>200)) }}
|
||
</div>
|
||
</div>
|
||
|
||
<label class="custom-control custom-checkbox">
|
||
{!! Form::checkbox('is_checked_action', 1, 0, ['class' => 'custom-control-input', 'id' => 'is_checked_action', 'required'=>true]) !!}
|
||
<span class="custom-control-label">ja, Points / Umsatz ändern</span>
|
||
</label>
|
||
@else
|
||
Points können nicht mehr geändet werden werden.
|
||
@endif
|
||
<hr>
|
||
<i>Points können nur innerhalb des akutellen Monats geändert werden, da sonst die monatliche Auswertung schon berechnet ist.
|
||
Danach können Points für den akutellen Monat manuell gutgeschrieben werden.</i><br>
|
||
{{-- <a class="btn btn-sm btn-default mt-2" href="{{ route('admin_business_points') }}">Business -> Points gutschreiben</a> --}}
|
||
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('close') }}</button>
|
||
<button type="submit" class="btn btn-primary">{{__('take over')}}</button>
|
||
|
||
</div>
|
||
{!! Form::close() !!}
|
||
|
||
|
||
<script type="text/javascript">
|
||
$( document ).ready(function() {
|
||
});
|
||
</script>
|