10.April 2026
This commit is contained in:
parent
a00c42e770
commit
f58c709945
208 changed files with 19280 additions and 2914 deletions
|
|
@ -1,50 +1,47 @@
|
|||
@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;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.td-entry-table-margin {
|
||||
padding-bottom: 6px;
|
||||
border-bottom: 1px solid rgb(221, 221, 221);
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="card">
|
||||
<h5 class="card-header">
|
||||
Guthaben offen
|
||||
<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-id="new" data-action="add-user-credit" data-back="{{ url()->current() }}"
|
||||
data-route="{{ route('modal_load') }}"><span class="fa fa-plus-circle"></span> Guthaben hinzufügen
|
||||
</button>
|
||||
</div>
|
||||
</h5>
|
||||
|
||||
@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>
|
||||
@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>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card-datatable table-responsive pt-0">
|
||||
<table class="datatables-style table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{__('Account ID')}}</th>
|
||||
<th>{{__('First name')}}</th>
|
||||
<th>{{__('Last name') }}</th>
|
||||
<th>{{__('E-Mail') }}</th>
|
||||
<th>{{__('Betrag') }}</th>
|
||||
<th>{{__('Guthaben')}}</th>
|
||||
<th>{{__('#')}}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{ __('Account ID') }}</th>
|
||||
<th>{{ __('First name') }}</th>
|
||||
<th>{{ __('Last name') }}</th>
|
||||
<th>{{ __('E-Mail') }}</th>
|
||||
<th>{{ __('Betrag') }}</th>
|
||||
<th>{{ __('Guthaben') }}</th>
|
||||
<th>{{ __('#') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($user_credit_items as $user_credit_item)
|
||||
|
|
@ -57,28 +54,29 @@
|
|||
<td>
|
||||
@foreach ($user_credit_item['entries'] as $key => $credit)
|
||||
<div class="td-entry-table-margin">
|
||||
<i class="fa fa-plus-circle text-secondary"></i>
|
||||
{!! formatNumber($credit->credit) !!} € |
|
||||
<i class="fa fa-plus-circle text-secondary"></i>
|
||||
{!! formatNumber($credit->credit) !!} € |
|
||||
{{ formatTextWithLineBreaks($credit->message, true) }}
|
||||
/ {{ $credit->created_at->format("d.m.Y") }}
|
||||
@if($deleteTime = $credit->deleteTime())
|
||||
/ <span class="no-line-break">
|
||||
<a class="btn btn-danger btn-xs" href="{{ route('admin_payments_credit_delete', [$credit->id, 'user_credit_item']) }}" onclick="return confirm('Wirklich löschen?');">
|
||||
<i class="ion ion-ios-trash"></i>
|
||||
</a> noch {{ $deleteTime }} min.
|
||||
</span>
|
||||
@endif
|
||||
/ {{ $credit->created_at->format('d.m.Y') }}
|
||||
@if ($deleteTime = $credit->deleteTime())
|
||||
/ <span class="no-line-break">
|
||||
<a class="btn btn-danger btn-xs"
|
||||
href="{{ route('admin_payments_credit_delete', [$credit->id, 'user_credit_item']) }}"
|
||||
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-secondary" data-toggle="modal" data-target="#modals-credit"
|
||||
data-userid="{{ $user_credit_item['user_id'] }}"
|
||||
data-email="{{ $user_credit_item['email'] }}"
|
||||
data-back="{{url()->current()}}"
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-toggle="modal"
|
||||
data-target="#modals-credit" data-userid="{{ $user_credit_item['user_id'] }}"
|
||||
data-email="{{ $user_credit_item['email'] }}" data-back="{{ url()->current() }}"
|
||||
data-action="create_credit">
|
||||
<span class="fa fa-dollar-sign"></span> <strong>Guthaben auszahlen</strong>
|
||||
</button>
|
||||
<span class="fa fa-dollar-sign"></span> <strong>Guthaben auszahlen</strong>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
@ -88,147 +86,242 @@
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card mt-3">
|
||||
|
||||
<div class="card mt-3 mb-3" id="credit-stats-card">
|
||||
<div class="card-body py-3">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto text-muted small">
|
||||
<i class="fa fa-chart-bar mr-1"></i> Statistik:
|
||||
<span class="font-weight-bold text-dark" id="stats-credit-period">
|
||||
{{ $filter_months[session('credit_filter_month')] ?? '' }} {{ session('credit_filter_year') }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="col text-right d-flex justify-content-end">
|
||||
<div class="mr-4 text-center">
|
||||
<div class="text-muted" style="font-size:0.75rem;">Anzahl Gutschriften</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-primary" id="stats-credit-count">
|
||||
<i class="fa fa-spinner fa-spin fa-sm"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="text-muted" style="font-size:0.75rem;">Gesamtsumme</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-success" id="stats-credit-total">
|
||||
<i class="fa fa-spinner fa-spin fa-sm"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-0">
|
||||
<h5 class="card-header">
|
||||
Gutschriften / Auszahlungen
|
||||
Gutschriften / Auszahlungen
|
||||
</h5>
|
||||
<div class="card-body p-0">
|
||||
{!! Form::open(['action' => route('admin_payments_credit'), 'class' => 'form-horizontal', 'id'=>'form_filter_payment_credits']) !!}
|
||||
{!! Form::open([
|
||||
'action' => route('admin_payments_credit'),
|
||||
'class' => 'form-horizontal',
|
||||
'id' => 'form_filter_payment_credits',
|
||||
]) !!}
|
||||
|
||||
<div class="form-row align-items-center px-4 pb-2 pt-3">
|
||||
<div class="col-12 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||
<input class="form-control on_keyup_credits" name="credit_filter_name" type="text" value="{{session('credit_filter_name')}}" placeholder="Name">
|
||||
<input class="form-control on_keyup_credits" name="credit_filter_name" type="text"
|
||||
value="{{ session('credit_filter_name') }}" placeholder="Name">
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||
<select class="custom-select on_change_credits" name="credit_filter_month">
|
||||
@foreach($filter_months as $key=>$value)
|
||||
<option value="{{$key}}" @if(session('credit_filter_month') == $key) selected @endif>{{$value}}</option>
|
||||
|
||||
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||
<select class="custom-select on_change_credits" name="credit_filter_month">
|
||||
@foreach ($filter_months as $key => $value)
|
||||
<option value="{{ $key }}" @if (session('credit_filter_month') == $key) selected @endif>
|
||||
{{ $value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||
<select class="custom-select on_change_credits" name="credit_filter_year">
|
||||
@foreach($filter_years as $key=>$value)
|
||||
<option value="{{$value}}" @if(session('credit_filter_year') == $value) selected @endif>{{$value}}</option>
|
||||
@foreach ($filter_years as $key => $value)
|
||||
<option value="{{ $value }}" @if (session('credit_filter_year') == $value) selected @endif>
|
||||
{{ $value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
|
||||
<div class="card-datatable table-responsive pt-0">
|
||||
<table class="datatables-style table table-striped table-bordered" id="datatable-credit">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>{{__('G.Nr.')}}</th>
|
||||
<th>{{__('Gutschrift')}}</th>
|
||||
<th>{{__('First name')}}</th>
|
||||
<th>{{__('Last name') }}</th>
|
||||
<th>{{__('E-Mail') }}</th>
|
||||
<th>{{__('Betrag') }}</th>
|
||||
<th>{{__('Datum') }}</th>
|
||||
<th>{{__('Zahlung')}}</th>
|
||||
<th>{{__('aus Guthaben')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="card-datatable table-responsive pt-0">
|
||||
<table class="datatables-style table table-striped table-bordered" id="datatable-credit">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>{{ __('G.Nr.') }}</th>
|
||||
<th>{{ __('Gutschrift') }}</th>
|
||||
<th>{{ __('First name') }}</th>
|
||||
<th>{{ __('Last name') }}</th>
|
||||
<th>{{ __('E-Mail') }}</th>
|
||||
<th>{{ __('Betrag') }}</th>
|
||||
<th>{{ __('Datum') }}</th>
|
||||
<th>{{ __('Zahlung') }}</th>
|
||||
<th>{{ __('aus Guthaben') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modals-credit">
|
||||
<div class="modal-dialog">
|
||||
<form class="modal-content form-prevent-multiple-submits" action="{{ route('admin_payments_credit_create') }}" method="post">
|
||||
<form class="modal-content form-prevent-multiple-submits" action="{{ route('admin_payments_credit_create') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="userid" value="">
|
||||
<input type="hidden" name="action" value="create_credit">
|
||||
<input type="hidden" name="back" value="{{url()->current()}}">
|
||||
<input type="hidden" name="back" value="{{ url()->current() }}">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{{__('Gutschrift')}}</h5>
|
||||
<h5 class="modal-title">{{ __('Gutschrift') }}</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group col-sm-12">
|
||||
{{ Form::select('credit_option', ['create'=>'Gutschrift erstellen'], false, array('data-live-search'=>'false', 'class'=>'selectpicker')) }}
|
||||
{{ Form::select('credit_option', ['create' => 'Gutschrift erstellen'], false, ['data-live-search' => 'false', 'class' => 'selectpicker']) }}
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<label class="form-label" for="credit_date">{{ __('Gutschriftsdatum') }}</label>
|
||||
{!! Form::text('credit_date', \Carbon::now()->format("d.m.Y"), ['class'=>'form-control datepicker-base']) !!}
|
||||
{!! Form::text('credit_date', \Carbon::now()->format('d.m.Y'), ['class' => 'form-control datepicker-base']) !!}
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<label class="form-label" for="credit_number">{{ __('Gutschriftsnummer') }}</label>
|
||||
{!! Form::text('credit_number', App\Services\Credit::getCreditNumber(), ['class'=>'form-control', 'disabled']) !!}
|
||||
<em> nächste Gutschriftsnummer <a href="{{ route('admin_settings') }}"><i class="fa fa-edit"></i></a></em>
|
||||
{!! Form::text('credit_number', App\Services\Credit::getCreditNumber(), ['class' => 'form-control', 'disabled']) !!}
|
||||
<em> nächste Gutschriftsnummer <a href="{{ route('admin_settings') }}"><i
|
||||
class="fa fa-edit"></i></a></em>
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<label class="custom-control custom-checkbox">
|
||||
{!! Form::checkbox('credit_send_mail', 1, true, ['class'=>'custom-control-input']) !!}
|
||||
<span class="custom-control-label">Gutschrift an <span id="set_credit_send_mail">mail</span></span>
|
||||
{!! Form::checkbox('credit_send_mail', 1, true, ['class' => 'custom-control-input']) !!}
|
||||
<span class="custom-control-label">Gutschrift an <span
|
||||
id="set_credit_send_mail">mail</span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{__('close')}}</button>
|
||||
<button type="submit" class="btn btn-primary button-prevent-multiple-submits"><i class="spinner fa fa-spinner fa-spin"></i> {{ __('save')}}</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('close') }}</button>
|
||||
<button type="submit" class="btn btn-primary button-prevent-multiple-submits"><i
|
||||
class="spinner fa fa-spinner fa-spin"></i> {{ __('save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
function loadCreditStats() {
|
||||
var month = $('select[name=credit_filter_month]').val();
|
||||
var year = $('select[name=credit_filter_year]').val();
|
||||
var name = $('input[name=credit_filter_name]').val();
|
||||
$.getJSON('{!! route('admin_payments_credit_stats') !!}', {
|
||||
credit_filter_month: month,
|
||||
credit_filter_year: year,
|
||||
credit_filter_name: name
|
||||
}, function(data) {
|
||||
$('#stats-credit-count').text(data.count);
|
||||
$('#stats-credit-total').text(data.total + ' €');
|
||||
var monthName = $('select[name=credit_filter_month] option:selected').text();
|
||||
$('#stats-credit-period').text(monthName + ' ' + year);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
loadCreditStats();
|
||||
|
||||
var oTable = $('#datatable-credit').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
ajax: {
|
||||
url: '{!! route( 'admin_payments_credit_datatable') !!}',
|
||||
data: function(d) {
|
||||
d.credit_filter_name = $('input[name=credit_filter_name]').val();
|
||||
d.credit_filter_month = $('select[name=credit_filter_month]').val();
|
||||
d.credit_filter_year = $('select[name=credit_filter_year]').val();
|
||||
}
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
ajax: {
|
||||
url: '{!! route('admin_payments_credit_datatable') !!}',
|
||||
data: function(d) {
|
||||
d.credit_filter_name = $('input[name=credit_filter_name]').val();
|
||||
d.credit_filter_month = $('select[name=credit_filter_month]').val();
|
||||
d.credit_filter_year = $('select[name=credit_filter_year]').val();
|
||||
}
|
||||
},
|
||||
"order": [
|
||||
[0, "desc"]
|
||||
],
|
||||
"columns": [{
|
||||
data: 'id',
|
||||
searchable: false
|
||||
},
|
||||
"order": [[0, "desc" ]],
|
||||
"columns": [
|
||||
{ data: 'id', searchable: false },
|
||||
{ data: 'full_number', name: 'full_number' },
|
||||
{ data: 'view', name: 'view' },
|
||||
{ data: 'user.account.first_name', name: 'user.account.first_name', orderable: false },
|
||||
{ data: 'user.account.last_name', name: 'user.account.last_name', orderable: false },
|
||||
{ data: 'user.email', name: 'user.email', orderable: false },
|
||||
{ data: 'total', name: 'total' },
|
||||
{ data: 'date', name: 'date' },
|
||||
{ data: 'status', name: 'status', searchable: false },
|
||||
{ data: 'credits', name: 'credits', orderable: false },
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 100,
|
||||
"language": {
|
||||
"url": "/js/datatables-{{ \App::getLocale() }}.json"
|
||||
}
|
||||
});
|
||||
$('select.on_change_credits').on('change', function(){
|
||||
oTable.draw();
|
||||
});
|
||||
|
||||
$('input.on_keyup_credits').on('keyup', function(){
|
||||
oTable.draw();
|
||||
});
|
||||
$( document ).ready(function() {
|
||||
$('#modals-credit').on('show.bs.modal', function (event) {
|
||||
{
|
||||
data: 'full_number',
|
||||
name: 'full_number'
|
||||
},
|
||||
{
|
||||
data: 'view',
|
||||
name: 'view'
|
||||
},
|
||||
{
|
||||
data: 'user.account.first_name',
|
||||
name: 'user.account.first_name',
|
||||
orderable: false
|
||||
},
|
||||
{
|
||||
data: 'user.account.last_name',
|
||||
name: 'user.account.last_name',
|
||||
orderable: false
|
||||
},
|
||||
{
|
||||
data: 'user.email',
|
||||
name: 'user.email',
|
||||
orderable: false
|
||||
},
|
||||
{
|
||||
data: 'total',
|
||||
name: 'total'
|
||||
},
|
||||
{
|
||||
data: 'date',
|
||||
name: 'date'
|
||||
},
|
||||
{
|
||||
data: 'status',
|
||||
name: 'status',
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
data: 'credits',
|
||||
name: 'credits',
|
||||
orderable: false
|
||||
},
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 100,
|
||||
"language": {
|
||||
"url": "/js/datatables-{{ \App::getLocale() }}.json"
|
||||
}
|
||||
});
|
||||
$('select.on_change_credits').on('change', function() {
|
||||
oTable.draw();
|
||||
loadCreditStats();
|
||||
});
|
||||
|
||||
$('input.on_keyup_credits').on('keyup', function() {
|
||||
oTable.draw();
|
||||
loadCreditStats();
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$('#modals-credit').on('show.bs.modal', function(event) {
|
||||
var button = $(event.relatedTarget);
|
||||
if(event.relatedTarget){
|
||||
$(this).find(".modal-content input[name='userid']").val(button.data('userid'));
|
||||
$(this).find(".modal-body #set_credit_send_mail").html(button.data('email'));
|
||||
if (event.relatedTarget) {
|
||||
$(this).find(".modal-content input[name='userid']").val(button.data(
|
||||
'userid'));
|
||||
$(this).find(".modal-body #set_credit_send_mail").html(button.data(
|
||||
'email'));
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,50 +1,84 @@
|
|||
@extends('layouts.layout-2')
|
||||
|
||||
@section('content')
|
||||
<div class="card mb-3" id="invoice-stats-card">
|
||||
<div class="card-body py-3">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto text-muted small">
|
||||
<i class="fa fa-chart-bar mr-1"></i> Statistik:
|
||||
<span class="font-weight-bold text-dark" id="stats-invoice-period">
|
||||
{{ $filter_months[session('invoice_filter_month')] ?? '' }} {{ session('invoice_filter_year') }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="col text-right d-flex justify-content-end">
|
||||
<div class="mr-4 text-center">
|
||||
<div class="text-muted" style="font-size:0.75rem;">Anzahl Rechnungen</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-primary" id="stats-invoice-count">
|
||||
<i class="fa fa-spinner fa-spin fa-sm"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="text-muted" style="font-size:0.75rem;">Gesamtsumme</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-success" id="stats-invoice-total">
|
||||
<i class="fa fa-spinner fa-spin fa-sm"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h5 class="card-header">
|
||||
Finanzen / Rechnungen
|
||||
</h5>
|
||||
<div class="card-body p-0">
|
||||
{!! Form::open(['action' => route('admin_payments_invoice'), 'class' => 'form-horizontal', 'id'=>'form_filter_payment_invoices']) !!}
|
||||
{!! Form::open([
|
||||
'action' => route('admin_payments_invoice'),
|
||||
'class' => 'form-horizontal',
|
||||
'id' => 'form_filter_payment_invoices',
|
||||
]) !!}
|
||||
|
||||
<div class="form-row align-items-center px-4 pb-2 pt-3">
|
||||
<div class="col-12 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||
<input class="form-control on_keyup_invoice" name="invoice_filter_name" type="text" value="{{session('invoice_filter_name')}}" placeholder="Name">
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||
<select class="custom-select on_change_invoice" name="invoice_filter_month">
|
||||
@foreach($filter_months as $key=>$value)
|
||||
<option value="{{$key}}" @if(session('invoice_filter_month') == $key) selected @endif>{{$value}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||
<select class="custom-select on_change_invoice" name="invoice_filter_year">
|
||||
@foreach($filter_years as $key=>$value)
|
||||
<option value="{{$value}}" @if(session('invoice_filter_year') == $value) selected @endif>{{$value}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-row align-items-center px-4 pb-2 pt-3">
|
||||
<div class="col-12 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||
<input class="form-control on_keyup_invoice" name="invoice_filter_name" type="text"
|
||||
value="{{ session('invoice_filter_name') }}" placeholder="Name">
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
|
||||
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||
<select class="custom-select on_change_invoice" name="invoice_filter_month">
|
||||
@foreach ($filter_months as $key => $value)
|
||||
<option value="{{ $key }}" @if (session('invoice_filter_month') == $key) selected @endif>
|
||||
{{ $value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
|
||||
<select class="custom-select on_change_invoice" name="invoice_filter_year">
|
||||
@foreach ($filter_years as $key => $value)
|
||||
<option value="{{ $value }}" @if (session('invoice_filter_year') == $value) selected @endif>
|
||||
{{ $value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
|
||||
<div class="card-datatable table-responsive pt-0">
|
||||
<table class="datatables-style table table-striped table-bordered" id="datatable-invoice">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{__('tables.in_no')}}</th>
|
||||
<th>{{__('tables.invoice')}}</th>
|
||||
<th>{{__('tables.amount') }}</th>
|
||||
<th>{{__('tables.status')}}</th>
|
||||
<th>{{__('First name')}}</th>
|
||||
<th>{{__('Last name') }}</th>
|
||||
<th>{{__('E-Mail') }}</th>
|
||||
<th>{{__('tables.date') }}</th>
|
||||
<th>{{__('tables.art')}}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('tables.in_no') }}</th>
|
||||
<th>{{ __('tables.invoice') }}</th>
|
||||
<th>{{ __('tables.amount') }}</th>
|
||||
<th>{{ __('tables.status') }}</th>
|
||||
<th>{{ __('First name') }}</th>
|
||||
<th>{{ __('Last name') }}</th>
|
||||
<th>{{ __('E-Mail') }}</th>
|
||||
<th>{{ __('tables.date') }}</th>
|
||||
<th>{{ __('tables.art') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
|
|
@ -54,45 +88,106 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
function loadInvoiceStats() {
|
||||
var month = $('select[name=invoice_filter_month]').val();
|
||||
var year = $('select[name=invoice_filter_year]').val();
|
||||
var name = $('input[name=invoice_filter_name]').val();
|
||||
$.getJSON('{!! route('admin_payments_invoice_stats') !!}', {
|
||||
invoice_filter_month: month,
|
||||
invoice_filter_year: year,
|
||||
invoice_filter_name: name
|
||||
}, function(data) {
|
||||
$('#stats-invoice-count').text(data.count);
|
||||
$('#stats-invoice-total').text(data.total + ' €');
|
||||
var monthName = $('select[name=invoice_filter_month] option:selected').text();
|
||||
$('#stats-invoice-period').text(monthName + ' ' + year);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
loadInvoiceStats();
|
||||
|
||||
var oTable = $('#datatable-invoice').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
"stateSave": true,
|
||||
"searching": false,
|
||||
ajax: {
|
||||
url: '{!! route('admin_payments_invoice_datatable') !!}',
|
||||
data: function(d) {
|
||||
d.invoice_filter_name = $('input[name=invoice_filter_name]').val();
|
||||
d.invoice_filter_month = $('select[name=invoice_filter_month]').val();
|
||||
d.invoice_filter_year = $('select[name=invoice_filter_year]').val();
|
||||
}
|
||||
},
|
||||
"order": [[0, "desc" ]],
|
||||
"columns": [
|
||||
{ data: 'id', searchable: false },
|
||||
{ data: 'full_number', name: 'full_number' },
|
||||
{ data: 'invoice', name: 'invoice', orderable: false, searchable: false },
|
||||
{ data: 'total_shipping', name: 'total_shipping', orderable: false, searchable: false },
|
||||
{ data: 'txaction', name: 'txaction', orderable: false, searchable: false },
|
||||
{ data: 'shopping_order.shopping_user.billing_firstname', name: 'shopping_order.shopping_user.billing_firstname', orderable: false },
|
||||
{ data: 'shopping_order.shopping_user.billing_lastname', name: 'shopping_order.shopping_user.billing_lastname', orderable: false },
|
||||
{ data: 'shopping_order.shopping_user.billing_email', name: 'shopping_order.shopping_user.billing_email', orderable: false },
|
||||
{ data: 'created_at', name: 'created_at' },
|
||||
{ data: 'status', name: 'status', searchable: false },
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 100,
|
||||
"language": {
|
||||
"url": "/js/datatables-{{ \App::getLocale() }}.json"
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
"stateSave": true,
|
||||
"searching": false,
|
||||
ajax: {
|
||||
url: '{!! route('admin_payments_invoice_datatable') !!}',
|
||||
data: function(d) {
|
||||
d.invoice_filter_name = $('input[name=invoice_filter_name]').val();
|
||||
d.invoice_filter_month = $('select[name=invoice_filter_month]').val();
|
||||
d.invoice_filter_year = $('select[name=invoice_filter_year]').val();
|
||||
}
|
||||
});
|
||||
$('select.on_change_invoice').on('change', function(){
|
||||
},
|
||||
"order": [
|
||||
[0, "desc"]
|
||||
],
|
||||
"columns": [{
|
||||
data: 'id',
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
data: 'full_number',
|
||||
name: 'full_number'
|
||||
},
|
||||
{
|
||||
data: 'invoice',
|
||||
name: 'invoice',
|
||||
orderable: false,
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
data: 'total_shipping',
|
||||
name: 'total_shipping',
|
||||
orderable: false,
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
data: 'txaction',
|
||||
name: 'txaction',
|
||||
orderable: false,
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
data: 'shopping_order.shopping_user.billing_firstname',
|
||||
name: 'shopping_order.shopping_user.billing_firstname',
|
||||
orderable: false
|
||||
},
|
||||
{
|
||||
data: 'shopping_order.shopping_user.billing_lastname',
|
||||
name: 'shopping_order.shopping_user.billing_lastname',
|
||||
orderable: false
|
||||
},
|
||||
{
|
||||
data: 'shopping_order.shopping_user.billing_email',
|
||||
name: 'shopping_order.shopping_user.billing_email',
|
||||
orderable: false
|
||||
},
|
||||
{
|
||||
data: 'created_at',
|
||||
name: 'created_at'
|
||||
},
|
||||
{
|
||||
data: 'status',
|
||||
name: 'status',
|
||||
searchable: false
|
||||
},
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 100,
|
||||
"language": {
|
||||
"url": "/js/datatables-{{ \App::getLocale() }}.json"
|
||||
}
|
||||
});
|
||||
$('select.on_change_invoice').on('change', function() {
|
||||
oTable.draw();
|
||||
loadInvoiceStats();
|
||||
});
|
||||
|
||||
$('input.on_keyup_invoice').on('keyup', function(){
|
||||
$('input.on_keyup_invoice').on('keyup', function() {
|
||||
oTable.draw();
|
||||
loadInvoiceStats();
|
||||
});
|
||||
});
|
||||
/*$('#filter_sales_year').on('change', function(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue