Gutschriften manuell hinzufügen, Yard 0& tax

This commit is contained in:
Kevin Adametz 2021-05-12 15:44:48 +02:00
parent e670b92f5d
commit c02fffd883
24 changed files with 497 additions and 68 deletions

View file

@ -2,10 +2,37 @@
@section('content')
<style>
.td-entry-table-margin {
padding-bottom: 6px;
border-bottom: 1px solid rgb(221, 221, 221);
margin-bottom: 6px;
}
</style>
<div class="card">
<h6 class="card-header">
Zahlungen / offene Gutschriften
<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-credit"
data-back="{{url()->current()}}"
data-route="{{ route('modal_load') }}"><span class="far fa-plus-circle"></span> Gutschrift hinzufügen
</button>
</div>
</h6>
@if(isset($add_credit_error) && $add_credit_error)
<div class="col-sm-12">
<div class="alert alert-danger p-2 mt-2">
<ul>
<li>{{ $add_credit_error }}</li>
</ul>
</div>
</div>
@endif
<div class="card-datatable table-responsive pt-0">
<table class="datatables-style table table-striped table-bordered">
<thead>
@ -14,7 +41,7 @@
<th>{{__('Nachname') }}</th>
<th>{{__('E-Mail') }}</th>
<th>{{__('Betrag') }}</th>
<th>{{__('Aus Bestellung')}}</th>
<th>{{__('aus Bestellung / Gutschrift')}}</th>
<th>{{__('#')}}</th>
</tr>
</thead>
@ -24,19 +51,34 @@
<td>{{ $ShoppingOrderMargin->first_name }}</td>
<td>{{ $ShoppingOrderMargin->last_name }}</td>
<td>{{ $ShoppingOrderMargin->email }}</td>
<td>{!! \App\Services\UserMarign::getMontlyPartnerCommissionOpenByID($ShoppingOrderMargin->user_id, null, true) !!} &euro;</td>
<td>{!! \App\Services\UserMarign::getMontlyPartnerCommissionOpenByID($ShoppingOrderMargin->user_id, null, true, true) !!} &euro;</td>
<td>
@foreach (\App\Services\UserMarign::getOrderFromPartnerCommissionByID($ShoppingOrderMargin->user_id) as $order)
@if($order->shopping_order)
<a href="{{ route('admin_sales_customers_detail', [$order->shopping_order->id]) }}">
<div class="td-entry-table-margin"><a href="{{ route('admin_sales_customers_detail', [$order->shopping_order->id]) }}">
{{$order->shopping_order->shopping_user->billing_firstname }}
{{$order->shopping_order->shopping_user->billing_lastname }}
/ {{ $order->shopping_order->getLastShoppingPayment('reference') }}
/ {{ $order->shopping_order->getFormattedTotalWithoutCredit()."" }}
/ {{ $order->shopping_order->created_at->format("d.m.Y") }}
</a> <br>
</a>
</div>
@endif
@endforeach
@foreach (\App\Services\UserMarign::getUserCreditMarginByID($ShoppingOrderMargin->user_id) as $creditMaring)
<div class="td-entry-table-margin">
<i class="fa fa-plus-circle text-secondary"></i>
{!! nl2br($creditMaring->message) !!}
/ {{ $creditMaring->created_at->format("d.m.Y") }}
@if($deleteTime = $creditMaring->deleteTime())
/ <span class="no-line-break">
<a class="btn btn-danger btn-xs" href="{{ route('admin_payments_credit_delete', [$creditMaring->id, 'user_credit_margin']) }}" onclick="return confirm('Wirklich löschen?');">
<i class="ion ion-ios-trash"></i>
</a> noch {{ $deleteTime }} min.
</span>
@endif
</div>
@endforeach
</td>
<td>
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-credit"
@ -49,6 +91,39 @@
</td>
</tr>
@endforeach
@foreach ($onlyUserCreditMargins as $user_id => $onlyUserCreditMargin)
<tr>
<td>{{ $onlyUserCreditMargin['first_name'] }}</td>
<td>{{ $onlyUserCreditMargin['last_name'] }}</td>
<td>{{ $onlyUserCreditMargin['email'] }}</td>
<td>{!! formatNumber($onlyUserCreditMargin['sum']) !!} &euro;</td>
<td>
@foreach ($onlyUserCreditMargin['entries'] as $key => $creditMaring)
<div class="td-entry-table-margin">
<i class="fa fa-plus-circle text-secondary"></i>
{!! nl2br($creditMaring->message) !!}
/ {{ $creditMaring->created_at->format("d.m.Y") }}
@if($deleteTime = $creditMaring->deleteTime())
/ <span class="no-line-break">
<a class="btn btn-danger btn-xs" href="{{ route('admin_payments_credit_delete', [$creditMaring->id, 'user_credit_margin']) }}" onclick="return confirm('Wirklich löschen?');">
<i class="ion ion-ios-trash"></i>
</a> noch {{ $deleteTime }} min.
</span>
@endif
</div>
@endforeach
</td>
<td>
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-credit"
data-userid="{{ $onlyUserCreditMargin['user_id'] }}"
data-email="{{ $onlyUserCreditMargin['email'] }}"
data-back="{{url()->current()}}"
data-action="create_credit">
<span class="far fa-file-invoice-dollar"></span> <strong>Gutschrift erstellen</strong>
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@ -82,14 +157,15 @@
<td>
@foreach (\App\Services\UserMarign::getOrderFromPartnerCommissionPendingByID($ShoppingOrderMarginPending->user_id) as $order)
@if($order->shopping_order)
<div class="td-entry-table-margin"><a href="{{ route('admin_sales_customers_detail', [$order->shopping_order->id]) }}">
<a href="{{ route('admin_sales_customers_detail', [$order->shopping_order->id]) }}">
{{$order->shopping_order->shopping_user->billing_firstname }}
{{$order->shopping_order->shopping_user->billing_lastname }}
/ {{ $order->shopping_order->getLastShoppingPayment('reference') }}
/ {{$order->shopping_order->getFormattedTotalWithoutCredit()."" }}
/ {{ $order->shopping_order->created_at->format("d.m.Y") }}
</a> <br>
</a>
</div>
@endif
@endforeach
</td>
@ -130,7 +206,7 @@
<th>{{__('Betrag') }}</th>
<th>{{__('Datum') }}</th>
<th>{{__('Zahlung')}}</th>
<th>{{__('aus Bestellung')}}</th>
<th>{{__('aus Bestellung / Gutschrift')}}</th>
</tr>
</thead>
<tbody>