mivita/resources/views/admin/payment/salesvolume.blade.php
2025-08-12 18:01:59 +02:00

118 lines
4.8 KiB
PHP

@extends('layouts.layout-2')
@section('content')
@if ($errors->any())
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
</div>
</div>
@endif
<div class="card">
<h5 class="card-header">
{{ __('navigation.sales_volumes') }} {{ __('navigation.products') }} (nach Rechnungen)
</h5>
<div class="card-body">
{!! Form::open(['action' => route('admin_payments_sales_volumes_download'), 'class' => '']) !!}
{!! Form::hidden('key', 'value') !!}
<button type="submit" name="action" value="export" class="btn btn-sm btn-primary mb-2"><i class="ion ion-md-download"></i> &nbsp;Export kompakte Liste als xls</button>
&nbsp; &nbsp;
<button type="submit" name="action" value="exportfull_paid_invoice" class="btn btn-sm btn-primary mb-2"><i class="ion ion-md-download"></i> &nbsp;Export vollständige Liste als xls</button>
<hr>
<div class="form-row align-items-center px-0 pb-2 pt-0">
<div class="col-6 col-sm-4 col-md-4 col-lg-4 mb-1">
<select class="custom-select on_change_select_filter" name="payment_sales_vol_filter_month">
@foreach($filter_months as $key=>$value)
<option value="{{$key}}" @if(session('payment_sales_vol_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_select_filter" name="payment_sales_vol_filter_year">
@foreach($filter_years as $key=>$value)
<option value="{{$value}}" @if(session('payment_sales_vol_filter_year') == $value) selected @endif>{{$value}}</option>
@endforeach
</select>
</div>
</div>
{!! Form::close() !!}
<div class="card">
<div class="card-datatable table-responsive">
<table class="table table-striped table-bordered" id="datatable-sales-volume">
<thead>
<tr>
<th>{{__('#') }}</th>
<th>{{__('tables.product')}}</th>
<th>{{__('tables.article_no')}}</th>
<th>{{__('tables.quantity')}}</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script>
$( document ).ready(function() {
var oTable = $('#datatable-sales-volume').DataTable({
"processing": true,
"serverSide": true,
"stateSave": true,
"searching": false,
ajax: {
url: '{!! route('admin_payments_sales_volumes_datatable') !!}',
data: function(d) {
d.payment_sales_vol_filter_month = $('select[name=payment_sales_vol_filter_month]').val();
d.payment_sales_vol_filter_year = $('select[name=payment_sales_vol_filter_year]').val();
}
},
"order": [[0, "asc" ]],
"columns": [
{ data: 'id', orderable: true, searchable: false },
{ data: 'name', name: 'name', orderable: true, searchable: false },
{ data: 'number', name: 'number', orderable: true, searchable: false },
{ data: 'value', name: 'value', orderable: true, searchable: false },
],
"bLengthChange": false,
"iDisplayLength": 100,
"language": {
"url": "/js/datatables-{{ \App::getLocale() }}.json"
}
});
$('select.on_change_select_filter').on('change', function(){
oTable.draw();
});
$('input.on_keyup_input_filter').on('keyup', function(){
oTable.draw();
});
});
</script>
@endsection