last 12.21

This commit is contained in:
Kevin Adametz 2021-12-25 02:53:44 +01:00
parent 73e38a006e
commit 3df0e93c2c
14 changed files with 395 additions and 43 deletions

View file

@ -11,6 +11,7 @@ use App\Models\Status;
use App\Services\Util; use App\Services\Util;
use App\Models\Booking; use App\Models\Booking;
use App\Models\TravelAgenda; use App\Models\TravelAgenda;
use App\Models\TravelCompany;
use App\Models\ServiceProvider; use App\Models\ServiceProvider;
use Illuminate\Validation\Rules\In; use Illuminate\Validation\Rules\In;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
@ -29,6 +30,8 @@ class ReportController extends Controller
{ {
$data = [ $data = [
'filter_lead_status' => Status::get()->pluck('name', 'id')->toArray(), 'filter_lead_status' => Status::get()->pluck('name', 'id')->toArray(),
'filter_travel_companies' => TravelCompany::where('active', true)->get()->pluck('name', 'id')->toArray(),
]; ];
return view('admin.report.bookings', $data); return view('admin.report.bookings', $data);
} }
@ -38,10 +41,24 @@ class ReportController extends Controller
$data = [ $data = [
'serviceProviders' => ServiceProvider::all(), 'serviceProviders' => ServiceProvider::all(),
'filter_lead_status' => Status::get()->pluck('name', 'id')->toArray(), 'filter_lead_status' => Status::get()->pluck('name', 'id')->toArray(),
'filter_travel_companies' => TravelCompany::where('active', true)->get()->pluck('name', 'id')->toArray(),
]; ];
return view('admin.report.service_providers', $data); return view('admin.report.service_providers', $data);
} }
public function checkBookings()
{
$data = [
'filter_lead_status' => Status::get()->pluck('name', 'id')->toArray(),
'filter_travel_companies' => TravelCompany::where('active', true)->get()->pluck('name', 'id')->toArray(),
];
return view('admin.report.check_bookings', $data);
}
//checkBookingsDatatable
private function prozessBookingSearch() private function prozessBookingSearch()
{ {
@ -59,6 +76,10 @@ class ReportController extends Controller
$q->whereIn('status_id', Request::get('filter_lead_status_id')); $q->whereIn('status_id', Request::get('filter_lead_status_id'));
}); });
} }
if(Request::get('filter_travel_company_id') != ""){
$query->whereIn("travel_company_id", Request::get('filter_travel_company_id'));
}
if(Request::get('filter_travel_date_from') != ""){ if(Request::get('filter_travel_date_from') != ""){
$travel_date_from = Carbon::parse(Request::get('filter_travel_date_from'))->format("Y-m-d"); $travel_date_from = Carbon::parse(Request::get('filter_travel_date_from'))->format("Y-m-d");
$query->where("start_date", '>=', $travel_date_from); $query->where("start_date", '>=', $travel_date_from);
@ -86,7 +107,9 @@ class ReportController extends Controller
return \DataTables::eloquent($query) return \DataTables::eloquent($query)
->with('price_total_sum', function() use ($query) { ->with('price_total_sum', function() use ($query) {
return Util::_number_format($query->sum('price')); $price1 = with(clone $query)->whereNull('canceled')->sum('price');
$price2 = with(clone $query)->whereNotNull('canceled')->sum('price_canceled');
return Util::_number_format($price1+$price2);
}) })
->with('price_total_total_sum', function() use ($query) { ->with('price_total_total_sum', function() use ($query) {
return Util::_number_format($query->sum('price_total')); return Util::_number_format($query->sum('price_total'));
@ -108,6 +131,9 @@ class ReportController extends Controller
->addColumn('customer.fullName', function (Booking $booking) { ->addColumn('customer.fullName', function (Booking $booking) {
return $booking->customer->fullName(); return $booking->customer->fullName();
}) })
->addColumn('price', function (Booking $booking) {
return $booking->booking_strono ? $booking->price_canceled : $booking->price;
})
->addColumn('proceeds', function (Booking $booking) { ->addColumn('proceeds', function (Booking $booking) {
return $booking->proceeds(); return $booking->proceeds();
}) })
@ -161,6 +187,7 @@ class ReportController extends Controller
->orderColumn('id', 'id $1') ->orderColumn('id', 'id $1')
->orderColumn('start_date', 'start_date $1') ->orderColumn('start_date', 'start_date $1')
->orderColumn('end_date', 'end_date $1') ->orderColumn('end_date', 'end_date $1')
->orderColumn('price', 'price $1')
->orderColumn('booking_date', 'booking_date $1') ->orderColumn('booking_date', 'booking_date $1')
->orderColumn('customer.fullName', 'customer.firstname $1') ->orderColumn('customer.fullName', 'customer.firstname $1')
->orderColumn('customer.firstname', 'customer.firstname $1') ->orderColumn('customer.firstname', 'customer.firstname $1')
@ -230,7 +257,7 @@ class ReportController extends Controller
$new = true; $new = true;
foreach ($export->service_provider_entries as $service_provider_entry){ foreach ($export->service_provider_entries as $service_provider_entry){
if($new){ if($new){
$total_price += $export->getPriceRaw(); $total_price += $export->isCanceled() ? $export->getPriceCanceledRaw() : $export->getPriceRaw();
$total_price_total += $export->getPriceTotalRaw(); $total_price_total += $export->getPriceTotalRaw();
$total_proceeds += $export->proceeds(true); $total_proceeds += $export->proceeds(true);
} }
@ -240,7 +267,7 @@ class ReportController extends Controller
'Status' => $new ? $export->lead->status->name : "", 'Status' => $new ? $export->lead->status->name : "",
'Storno' => $new ? $storno_date : "", 'Storno' => $new ? $storno_date : "",
'MyJack Nr.' => $new ? $export->merlin_order_number : "", 'MyJack Nr.' => $new ? $export->merlin_order_number : "",
'Organisation' => $new ? $export->price : "", 'Organisation' => $new ? ($export->isCanceled() ? $export->price_canceled : $export->price) : "",
'Reisepreis' => $new ? $export->price_total : "", 'Reisepreis' => $new ? $export->price_total : "",
'Erlös' => $new ? $export->proceeds() : "", 'Erlös' => $new ? $export->proceeds() : "",
'Kunde' => $new ? $export->customer->fullName() : "", 'Kunde' => $new ? $export->customer->fullName() : "",
@ -260,13 +287,14 @@ class ReportController extends Controller
$new = false; $new = false;
} }
}else{ }else{
$total_price += $export->getPriceRaw(); $total_price += $export->booking->isCanceled() ? $export->booking->getPriceCanceledRaw() : $export->booking->getPriceRaw();
$columns[] = array( $columns[] = array(
'BuchungsID' => $export->id, 'BuchungsID' => $export->id,
'Status' => $export->lead->status->name, 'Status' => $export->lead->status->name,
'Storno' => $storno_date, 'Storno' => $storno_date,
'MyJack Nr.' => $export->merlin_order_number, 'MyJack Nr.' => $export->merlin_order_number,
'Organisation' => $export->price, 'Organisation' => $export->price,
'Organisation' => $export->isCanceled() ? $export->price_canceled : $export->price,
'Reisepreis' => $export->price_total, 'Reisepreis' => $export->price_total,
'Erlös' => $export->proceeds(), 'Erlös' => $export->proceeds(),
'Kunde' => $export->customer->fullName(), 'Kunde' => $export->customer->fullName(),
@ -330,7 +358,11 @@ class ReportController extends Controller
}); });
}); });
} }
if(Request::get('filter_travel_company_id') != ""){
$query->whereHas('booking', function ($q) {
$q->whereIn("travel_company_id", Request::get('filter_travel_company_id'));
});
}
if(Request::get('filter_is_cleared') != ""){ if(Request::get('filter_is_cleared') != ""){
$query->where('is_cleared', '=', Request::get('filter_is_cleared')); $query->where('is_cleared', '=', Request::get('filter_is_cleared'));
} }
@ -366,8 +398,11 @@ class ReportController extends Controller
$price = 0; $price = 0;
$isset = []; $isset = [];
foreach ($all as $v){ foreach ($all as $v){
$price += in_array($v->booking->lead_id, $isset) ? 0 : $v->booking->getPriceRaw(); if(!in_array($v->booking->lead_id, $isset)){
$price += $v->booking->isCanceled() ? $v->booking->getPriceCanceledRaw() : $v->booking->getPriceRaw();
}
$isset[] = $v->booking->lead_id; $isset[] = $v->booking->lead_id;
} }
return Util::_number_format($price); return Util::_number_format($price);
}) })
@ -409,6 +444,9 @@ class ReportController extends Controller
->addColumn('booking.customer.fullName', function (ServiceProviderEntry $serviceProviderEntry) { ->addColumn('booking.customer.fullName', function (ServiceProviderEntry $serviceProviderEntry) {
return $serviceProviderEntry->booking->customer->fullName(); return $serviceProviderEntry->booking->customer->fullName();
}) })
->addColumn('booking.price', function (ServiceProviderEntry $serviceProviderEntry) {
return $serviceProviderEntry->booking->booking_strono ? $serviceProviderEntry->booking->price_canceled : $serviceProviderEntry->booking->price;
})
->addColumn('booking.proceeds', function (ServiceProviderEntry $serviceProviderEntry) { ->addColumn('booking.proceeds', function (ServiceProviderEntry $serviceProviderEntry) {
return $serviceProviderEntry->booking->proceeds(); return $serviceProviderEntry->booking->proceeds();
}) })
@ -447,6 +485,7 @@ class ReportController extends Controller
} }
}) })
->orderColumn('booking.id', 'booking.id $1') ->orderColumn('booking.id', 'booking.id $1')
->orderColumn('booking.price', 'booking.price $1')
->orderColumn('booking.start_date', 'booking.start_date $1') ->orderColumn('booking.start_date', 'booking.start_date $1')
->orderColumn('booking.end_date', 'booking.end_date $1') ->orderColumn('booking.end_date', 'booking.end_date $1')
->orderColumn('booking.customer.firstname', 'booking.customer.firstname $1') ->orderColumn('booking.customer.firstname', 'booking.customer.firstname $1')
@ -513,7 +552,7 @@ class ReportController extends Controller
foreach($exports as $export) { foreach($exports as $export) {
$new = in_array($export->booking->id, $isset) ? false : true; $new = in_array($export->booking->id, $isset) ? false : true;
if($new){ if($new){
$total_price += $export->booking->getPriceRaw(); $total_price += $export->booking->isCanceled() ? $export->booking->getPriceCanceledRaw() : $export->booking->getPriceRaw();
$total_price_total += $export->booking->getPriceTotalRaw(); $total_price_total += $export->booking->getPriceTotalRaw();
$total_proceeds += $export->booking->proceeds(true); $total_proceeds += $export->booking->proceeds(true);
} }
@ -524,7 +563,7 @@ class ReportController extends Controller
'CRM Nr' => $new ? $export->booking->lead_id : "", 'CRM Nr' => $new ? $export->booking->lead_id : "",
'Kunde' => $new ? $export->booking->customer->name : "", 'Kunde' => $new ? $export->booking->customer->name : "",
'Reisedatum' => $new ? $export->booking->getStartDateFormat() : "", 'Reisedatum' => $new ? $export->booking->getStartDateFormat() : "",
'Organisation' => $new ? $export->booking->price : "", 'Organisation' => $new ? ($export->booking->isCanceled() ? $export->booking->price_canceled : $export->booking->price) : "",
'Gesamtreisepreis' => $new ? $export->booking->price_total : "", 'Gesamtreisepreis' => $new ? $export->booking->price_total : "",
'Reiseland' => $new && $export->booking->travel_country ? $export->booking->travel_country->name : "", 'Reiseland' => $new && $export->booking->travel_country ? $export->booking->travel_country->name : "",
'Reiseprogramm' => $new && $export->booking->travel_agenda ? $export->booking->travel_agenda->name : "", 'Reiseprogramm' => $new && $export->booking->travel_agenda ? $export->booking->travel_agenda->name : "",
@ -622,6 +661,75 @@ class ReportController extends Controller
} }
return Excel::download(new ReportCollectionExport($columns, $headers), $filename.'.xls'); return Excel::download(new ReportCollectionExport($columns, $headers), $filename.'.xls');
} }
public function checkBookingsDatatable()
{
$query = $this->prozessBookingSearch();
return \DataTables::eloquent($query)
->addColumn('id', function (Booking $booking) {
return '<a data-order="' . $booking->id . '" href="' . route('booking_detail', [$booking->id]) . '" data-id="' . $booking->id . '">' . $booking->id . '</a>';
})
->addColumn('old_crm', function (Booking $booking) {
return '<a data-order="'.$booking->id.'" href="'.make_old_url('booking/'.$booking->id.'/edit').'" data-id="'.$booking->id.'">'.$booking->id.'</a>';
})
->addColumn('id', function (Booking $booking) {
return '<a data-order="' . $booking->id . '" href="' . route('booking_detail', [$booking->id]) . '" data-id="' . $booking->id . '">' . $booking->id . '</a>';
})
->addColumn('price', function (Booking $booking) {
return $booking->price;
})
->addColumn('service_total', function (Booking $booking) {
return $booking->getServiceTotal();
})
->addColumn('price_total', function (Booking $booking) {
return $booking->price_total;
})
->addColumn('check_total', function (Booking $booking) {
$check = $booking->getPriceRaw() + $booking->getServiceTotal(true);
return ($booking->getPriceTotalRaw() != $check) ? '<span class="badge badge-danger">'.Util::_number_format($check).'</span>' : "";
})
->addColumn('price_canceled', function (Booking $booking) {
return $booking->isCanceled() ? $booking->price_canceled : "";
})
->addColumn('start_date', function (Booking $booking) {
return $booking->getStartDateFormat();
})
->addColumn('end_date', function (Booking $booking) {
return $booking->getEndDateFormat();
})
->addColumn('booking_date', function (Booking $booking) {
return $booking->getBookingDateFormat();
})
->addColumn('lead.status_id', function (Booking $booking) {
if($booking->lead && $booking->lead->status_id){
$color = $booking->lead->status->color;
$icon = "";
if($booking->lead->status_id == 14 && $booking->lead->is_rebook){
$color = '#94ae59';
$icon = '<i class="fa fa-check-circle"></i> ';
}
if($booking->lead->status_id == 14 && !$booking->lead->is_rebook){
$icon = '<i class="fa fa-times-circle"></i> ';
}
return '<span data-order="'.$booking->lead->status_id.'"><span class="badge badge-dark" style="background-color: '.$color.'">'.$icon.$booking->lead->status->name.'</span></span>';
}
return '<span data-order="0">-</span>';
})
->orderColumn('id', 'id $1')
->orderColumn('old_crm', 'old_crm $1')
->orderColumn('start_date', 'start_date $1')
->orderColumn('end_date', 'end_date $1')
->orderColumn('price', 'price $1')
->orderColumn('booking_date', 'booking_date $1')
->orderColumn('customer.firstname', 'customer.firstname $1')
->orderColumn('customer.name', 'customer.name $1')
//->orderColumn('lead.status_id', 'lead.status_id $1')
//->orderColumn('is_cleared', 'is_cleared $1')
->rawColumns(['id', 'old_crm', 'check_total', 'lead.status_id'])
->make(true);
}
} }

View file

@ -38,7 +38,8 @@ class ContentLinkController extends Controller
//content_links //content_links
public function index() public function index()
{ {
/*$query = Booking::with('booking_draft_items')->select('booking.*')->where('new_drafts', true);
/*$query = Booking::with('booking_draft_items')->select('booking.*')->where('new_drafts', true);
$query->whereHas('booking_draft_items', function ($q) { $query->whereHas('booking_draft_items', function ($q) {
$q->where('comfort', true); $q->where('comfort', true);
@ -49,10 +50,27 @@ class ContentLinkController extends Controller
$booking->save(); $booking->save();
} }
*/ */
dd("nothing");
$bookings = Booking::orderBy('id', 'DESC')->offset(0)->limit(1000)->get();
// dd("nothing");
$val = []; $val = [];
$text = ""; $text = "";
/* $travelGuides = TravelGuide::all();
$data = [
'text' => $text,
'bookings' => $bookings,
];
return view('sys.tools.links', $data);
}
/*
clean code
$travelGuides = TravelGuide::all();
foreach ($travelGuides as $travelGuide){ foreach ($travelGuides as $travelGuide){
if(strpos($travelGuide->full_text, "<h1><br></h1>") !== false){ if(strpos($travelGuide->full_text, "<h1><br></h1>") !== false){
$val[$travelGuide->id] = "<h1><br></h1>"; $val[$travelGuide->id] = "<h1><br></h1>";
@ -71,13 +89,6 @@ class ContentLinkController extends Controller
// $new_text = preg_replace('/<h1[^>]*>([\s\S]*?)<\/h1[^>]*>/', '', $TravelGuide->full_text); // $new_text = preg_replace('/<h1[^>]*>([\s\S]*?)<\/h1[^>]*>/', '', $TravelGuide->full_text);
*/ */
$data = [
'text' => $text,
'values' => $val,
];
return view('sys.tools.links', $data);
}
public function store() public function store()
{ {

View file

@ -695,29 +695,37 @@ class Booking extends Model
$travel_price_children = 0; $travel_price_children = 0;
$total_adult = 0; $total_adult = 0;
$total_children = 0; $total_children = 0;
$travel_adult = 0;
$travel_children = 0;
foreach ($this->booking_draft_items as $booking_draft_item) { foreach ($this->booking_draft_items as $booking_draft_item) {
//24 Rundreise //24 Rundreise ist der Grundeintrag für die Reise
if($booking_draft_item->draft_type_id == 24){ if($booking_draft_item->draft_type_id == 24){
$travel_draft_item = $booking_draft_item; $travel_draft_item = $booking_draft_item;
continue; continue;
} }
$prices = $booking_draft_item->getItemPrice(); $prices = $booking_draft_item->getItemPrice();
//Grundpreis Reise //Grundpreis Reise //pro Persopn im Zimmer
if($booking_draft_item->draft_type_id == 30){ if($booking_draft_item->draft_type_id == 30){
$travel_price_adult += $prices['adult']; $travel_price_adult += $prices['adult'];
$travel_price_children += $prices['children']; $travel_price_children += $prices['children'];
$travel_adult += $booking_draft_item->adult;
$travel_children += $booking_draft_item->children;
} }
$total_adult += $prices['adult']; $total_adult += $prices['adult'];
$total_children += $prices['children']; $total_children += $prices['children'];
} }
if($travel_draft_item){ if($travel_draft_item){
$travel_draft_item->setPriceAdultRaw($travel_price_adult); $travel_draft_item->setPriceAdultRaw($travel_price_adult);
$travel_draft_item->setPriceChildrenRaw($travel_price_children); $travel_draft_item->setPriceChildrenRaw($travel_price_children);
$travel_draft_item->adult = $travel_adult;
$travel_draft_item->children = $travel_children;
$travel_draft_item->save(); $travel_draft_item->save();
} }
$this->price = $total_adult + $total_children; $this->price = $total_adult + $total_children;
$this->price_total = $this->getPriceRaw() + $this->getServiceTotal(true);
$this->save(); $this->save();
} }

View file

@ -151,6 +151,7 @@ class BookingRepository extends BaseRepository {
'deposit_total' => $data['deposit_total'] ? Util::_clean_float($data['deposit_total']) : 0, 'deposit_total' => $data['deposit_total'] ? Util::_clean_float($data['deposit_total']) : 0,
'final_payment' => $data['final_payment'] ? Util::_clean_float($data['final_payment']) : 0, 'final_payment' => $data['final_payment'] ? Util::_clean_float($data['final_payment']) : 0,
'final_payment_date' => $data['final_payment_date'] ? _reformat_date($data['final_payment_date']) : null, 'final_payment_date' => $data['final_payment_date'] ? _reformat_date($data['final_payment_date']) : null,
'price_total' => ($this->model->getPriceRaw() + $this->model->getServiceTotal(true)),
]; ];
$this->model->fill($fill); $this->model->fill($fill);
$this->model->save(); $this->model->save();
@ -197,6 +198,9 @@ class BookingRepository extends BaseRepository {
} }
} }
} }
$this->model->price_total = ($this->model->getPriceRaw() + $this->model->getServiceTotal(true));
$this->model->save();
return $this->model; return $this->model;
} }

View file

@ -57,8 +57,7 @@ class FileRepository extends BaseRepository {
$this->originalName = $file->getClientOriginalName(); $this->originalName = $file->getClientOriginalName();
$this->extension = strtolower($file->getClientOriginalExtension()); $this->extension = strtolower($file->getClientOriginalExtension());
$this->mine = $file->getClientMimeType(); $this->mine = $file->getClientMimeType();
$this->size = $file->getClientSize(); $this->size = $file->getSize();
$this->makeFilename(); $this->makeFilename();
//$dir = $this->model->getInvoiceStorageAttDir(); //$dir = $this->model->getInvoiceStorageAttDir();

View file

@ -11,7 +11,7 @@
<div class="ui-bordered px-4 pt-3 mb-0"> <div class="ui-bordered px-4 pt-3 mb-0">
<div class="form-row align-items-center"> <div class="form-row align-items-center">
<div class="col-12 col-md-4 mb-2"> <div class="col-12 col-md-3 mb-2">
<label class="form-label" for="filter_lead_status_id">Filter Status</label> <label class="form-label" for="filter_lead_status_id">Filter Status</label>
<select class="selectpicker" data-style="btn-default" name="filter_lead_status_id[]" id="filter_lead_status_id" multiple> <select class="selectpicker" data-style="btn-default" name="filter_lead_status_id[]" id="filter_lead_status_id" multiple>
@foreach($filter_lead_status as $id=>$name) @foreach($filter_lead_status as $id=>$name)
@ -19,7 +19,14 @@
@endforeach @endforeach
</select> </select>
</div> </div>
<div class="col-12 col-md-3 mb-2">
<label class="form-label" for="filter_travel_company_id">Filter Veranstalter</label>
<select class="selectpicker" data-style="btn-default" name="filter_travel_company_id[]" id="filter_travel_company_id" data-live-search="true" multiple>
@foreach($filter_travel_companies as $id=>$name)
<option value="{{$id}}" @if($id == 1 or $id == 47) selected @endif>{{$name}}</option>
@endforeach
</select>
</div>
<div class="col-12 col-md-3 mb-2"> <div class="col-12 col-md-3 mb-2">
<label class="form-label">Reisedatum</label> <label class="form-label">Reisedatum</label>
<div class="row"> <div class="row">
@ -88,11 +95,11 @@
<tbody></tbody> <tbody></tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="3">Total</td> <td colspan="4">Total</td>
<td id="price_total_sum">0</td> <td id="price_total_sum">0</td>
<td id="price_total_total_sum">0</td> <td id="price_total_total_sum">0</td>
<td id="proceed_total_sum">0</td> <td id="proceed_total_sum">0</td>
<td colspan="5"></td> <td colspan="6"></td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
@ -117,6 +124,7 @@
d.filter_booking_date_from = $('input[name=filter_booking_date_from]').val(); d.filter_booking_date_from = $('input[name=filter_booking_date_from]').val();
d.filter_booking_date_to = $('input[name=filter_booking_date_to]').val(); d.filter_booking_date_to = $('input[name=filter_booking_date_to]').val();
d.filter_db_lead_status_id = $('#filter_lead_status_id').val(); d.filter_db_lead_status_id = $('#filter_lead_status_id').val();
d.filter_travel_company_id = $('#filter_travel_company_id').val();
} }
}, },
"columns": [ "columns": [
@ -148,7 +156,8 @@
$('#proceed_total_sum').html(settings.json.proceed_total_sum); $('#proceed_total_sum').html(settings.json.proceed_total_sum);
} }
}); });
$('#filter_service_provider_id, #filter_is_cleared, #filter_sort_by, #filter_lead_status_id').on('change', function(){ $('#filter_service_provider_id, #filter_is_cleared, #filter_sort_by, #filter_lead_status_id, #filter_travel_company_id').on('change', function(){
console.log("asd");
table.order( [ 11, 'desc' ] ).draw(); table.order( [ 11, 'desc' ] ).draw();
}); });
$('.datepicker-base').on('change', function(){ $('.datepicker-base').on('change', function(){

View file

@ -0,0 +1,157 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-3 mb-1">
Buchungen Preise überprüfen
</h4>
<div class="card">
{!! Form::open(['url' => route('admin_report_export_bookings'), 'class' => '']) !!}
{!! Form::hidden('order', '[[7, "asc"]]', ['id'=>'order_table']) !!}
<div class="ui-bordered px-4 pt-3 mb-0">
<div class="form-row align-items-center">
<div class="col-12 col-md-3 mb-2">
<label class="form-label" for="filter_lead_status_id">Filter Status</label>
<select class="selectpicker" data-style="btn-default" name="filter_lead_status_id[]" id="filter_lead_status_id" multiple>
@foreach($filter_lead_status as $id=>$name)
<option value="{{$id}}">{{$name}}</option>
@endforeach
</select>
</div>
<div class="col-12 col-md-3 mb-2">
<label class="form-label" for="filter_travel_company_id">Filter Veranstalter</label>
<select class="selectpicker" data-style="btn-default" name="filter_travel_company_id[]" id="filter_travel_company_id" data-live-search="true" multiple>
@foreach($filter_travel_companies as $id=>$name)
<option value="{{$id}}" @if($id == 1 or $id == 47) selected @endif>{{$name}}</option>
@endforeach
</select>
</div>
<div class="col-12 col-md-3 mb-2">
<label class="form-label">Reisedatum</label>
<div class="row">
<div class="input-group col-6 pr-0">
<div class="input-group-prepend">
<span class="input-group-text">von</span>
</div>
<input class="form-control datepicker-base" name="filter_travel_date_from" type="text" value="">
</div>
<div class="input-group col-6 pl-1">
<div class="input-group-prepend">
<span class="input-group-text">bis</span>
</div>
<input class="form-control datepicker-base" name="filter_travel_date_to" type="text" value="">
</div>
</div>
</div>
<div class="col-12 col-md-3 mb-2">
<label class="form-label">Buchungsdatum</label>
<div class="row">
<div class="input-group col-6 pr-0">
<div class="input-group-prepend">
<span class="input-group-text">von</span>
</div>
<input class="form-control datepicker-base" name="filter_booking_date_from" type="text" value="">
</div>
<div class="input-group col-6 pl-1">
<div class="input-group-prepend">
<span class="input-group-text">bis</span>
</div>
<input class="form-control datepicker-base" name="filter_booking_date_to" type="text" value="">
</div>
</div>
</div>
<div class="col-12 mb-4">
<a href="{{ route('admin_report_bookings') }}" class="btn icon-btn btn-sm btn-outline-dark">
<span class="fa fa-sync"></span>
</a>
</div>
</div>
</div>
<div class="card-datatable table-responsive">
<table class="datatables-report table table-striped table-bordered">
<thead>
<tr>
<th>BuchungsID</th>
<th>v2</th>
<th>{{__('Status')}}</th>
<th>{{__('Organisation')}}</th>
<th>{{__('Vermittlung')}}</th>
<th>{{__('Gesamtpreis')}}</th>
<th>{{__('Check')}}</th>
<th>{{__('Strono')}}</th>
<th>{{__('Vorname')}}</th>
<th>{{__('Nachname')}}</th>
<th>{{__('Reisedatum')}}</th>
<th>{{__('bis')}}</th>
<th>{{__('Buchungsdatum')}}</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
{!! Form::close() !!}
</div>
<script>
$( document ).ready(function() {
var table = $('.datatables-report').DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": '{!! route( 'admin_report_check_bookings_datatable' ) !!}',
"data": function(d) {
d.filter_travel_date_from = $('input[name=filter_travel_date_from]').val();
d.filter_travel_date_to = $('input[name=filter_travel_date_to]').val();
d.filter_booking_date_from = $('input[name=filter_booking_date_from]').val();
d.filter_booking_date_to = $('input[name=filter_booking_date_to]').val();
d.filter_db_lead_status_id = $('#filter_lead_status_id').val();
d.filter_travel_company_id = $('#filter_travel_company_id').val();
}
},
"columns": [
{ data: 'id', name: 'id' },
{ data: 'old_crm', name: 'old_crm' },
{ data: 'lead.status_id', name: 'lead.status_id', orderable: false, searchable: false },
{ data: 'price', name: 'price' },
{ data: 'service_total', name: 'service_total' },
{ data: 'price_total', name: 'price_total' },
{ data: 'check_total', name: 'check_total', orderable: false },
{ data: 'price_canceled', name: 'price_canceled', orderable: false },
{ data: 'customer.firstname', name: 'customer.firstname', orderable: true },
{ data: 'customer.name', name: 'customer.name', orderable: true },
{ data: 'start_date', name: 'start_date' },
{ data: 'end_date', name: 'end_date' },
{ data: 'booking_date', name: 'booking_date' },
],
"order": [[ 0, "desc" ]],
"orderSequence": ["desc", "asc"],
"bLengthChange": false,
"iDisplayLength": 100,
"language": {
"url": "/js/German.json"
},
drawCallback: function (settings) {
$('#order_table').val(table.order());
}
});
$('#filter_service_provider_id, #filter_is_cleared, #filter_sort_by, #filter_lead_status_id, #filter_travel_company_id').on('change', function(){
table.order( [ 0, 'desc' ] ).draw();
});
$('.datepicker-base').on('change', function(){
table.order( [ 0, 'desc' ] ).draw();
});
});
</script>
@endsection

View file

@ -53,7 +53,15 @@
<option value="0">Nein</option> <option value="0">Nein</option>
</select> </select>
</div> </div>
<div class="col-12 mb-4"> <div class="col-6 col-md-3 mb-2">
<label class="form-label" for="filter_travel_company_id">Filter Veranstalter</label>
<select class="selectpicker" data-style="btn-default" name="filter_travel_company_id[]" id="filter_travel_company_id" data-live-search="true" multiple>
@foreach($filter_travel_companies as $id=>$name)
<option value="{{$id}}" @if($id == 1 or $id == 47) selected @endif>{{$name}}</option>
@endforeach
</select>
</div>
<div class="col-6 col-md-3 mt-3">
<a href="{{ route('admin_report_providers') }}" class="btn icon-btn btn-sm btn-outline-dark"> <a href="{{ route('admin_report_providers') }}" class="btn icon-btn btn-sm btn-outline-dark">
<span class="fa fa-sync"></span> <span class="fa fa-sync"></span>
</a> </a>
@ -83,11 +91,11 @@
<tbody></tbody> <tbody></tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="4">Total</td> <td colspan="5">Total</td>
<td id="price_total_sum">0</td> <td id="price_total_sum">0</td>
<td id="price_total_total_sum">0</td> <td id="price_total_total_sum">0</td>
<td id="proceed_total_sum">0</td> <td id="proceed_total_sum">0</td>
<td colspan="3"></td> <td colspan="4"></td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
@ -114,6 +122,7 @@
d.filter_travel_date_to = $('input[name=filter_travel_date_to]').val(); d.filter_travel_date_to = $('input[name=filter_travel_date_to]').val();
d.filter_is_cleared = $('select[name=filter_is_cleared]').val(); d.filter_is_cleared = $('select[name=filter_is_cleared]').val();
d.filter_db_lead_status_id = $('#filter_lead_status_id').val(); d.filter_db_lead_status_id = $('#filter_lead_status_id').val();
d.filter_travel_company_id = $('#filter_travel_company_id').val();
} }
}, },
"columns": [ "columns": [
@ -147,7 +156,7 @@
} }
}); });
$('#filter_service_provider_id, #filter_is_cleared, #filter_sort_by, #filter_lead_status_id').on('change', function(){ $('#filter_service_provider_id, #filter_is_cleared, #filter_sort_by, #filter_lead_status_id, #filter_travel_company_id').on('change', function(){
table.order( [ 10, 'asc' ] ).draw(); table.order( [ 10, 'asc' ] ).draw();
}); });
$('.datepicker-base').on('change', function(){ $('.datepicker-base').on('change', function(){

View file

@ -372,12 +372,19 @@
<li class="sidenav-item{{ Request::is('admin/report/bookings') ? ' active' : '' }}"> <li class="sidenav-item{{ Request::is('admin/report/bookings') ? ' active' : '' }}">
<a href="{{ route('admin_report_bookings') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-bed"></i><div>{{ __('Buchungen & Leistungen') }}</div></a> <a href="{{ route('admin_report_bookings') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-bed"></i><div>{{ __('Buchungen & Leistungen') }}</div></a>
</li> </li>
@endif @endif
@if(Auth::user()->isPermission('sua-re-pp')) @if(Auth::user()->isPermission('sua-re-pp'))
<li class="sidenav-item{{ Request::is('admin/report/providers') ? ' active' : '' }}"> <li class="sidenav-item{{ Request::is('admin/report/providers') ? ' active' : '' }}">
<a href="{{ route('admin_report_providers') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-cash"></i><div>{{ __('Leistungsträger-Zahlungen') }}</div></a> <a href="{{ route('admin_report_providers') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-cash"></i><div>{{ __('Leistungsträger-Zahlungen') }}</div></a>
</li> </li>
@endif @endif
@if(Auth::user()->isPermission('sua-re-bo'))
<li class="sidenav-item{{ Request::is('admin/report/check/bookings') ? ' active' : '' }}">
<a href="{{ route('admin_report_check_bookings') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-flash"></i><div>{{ __('Preise pürfen') }}</div></a>
</li>
@endif
</ul> </ul>
</li> </li>
@endif @endif
@ -399,7 +406,7 @@
</a> </a>
<ul class="sidenav-menu"> <ul class="sidenav-menu">
<li class="sidenav-item{{ Request::is('sysadmin/tools/content_links') ? ' active' : '' }}"> <li class="sidenav-item{{ Request::is('sysadmin/tools/content_links') ? ' active' : '' }}">
<a href="{{ route('sysadmin_tools_content_links') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-settings"></i><div>{{ __('Tree from HTML') }}</div></a> <a href="{{ route('sysadmin_tools_content_links') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-settings"></i><div>{{ __('todo some') }}</div></a>
</li> </li>
<li class="sidenav-item{{ Request::is('sysadmin/tools/tree') ? ' active' : '' }}"> <li class="sidenav-item{{ Request::is('sysadmin/tools/tree') ? ' active' : '' }}">
<a href="{{ route('sysadmin_tools_tree') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-settings"></i><div>{{ __('Tree') }}</div></a> <a href="{{ route('sysadmin_tools_tree') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-settings"></i><div>{{ __('Tree') }}</div></a>

View file

@ -23,27 +23,60 @@
<div class="card mb-4"> <div class="card mb-4">
<div class="card-body"> <div class="card-body">
<!-- Controls --> <!-- Controls -->
{!! Form::open(['url' => route('sysadmin_tools_content_links'), 'class' => '']) !!} {!! Form::open(['url' => route('sysadmin_tools_content_links'), 'class' => '']) !!}
<div class="form-group mb-1"> <div class="form-group mb-1">
<label class="form-label" for="description">Description</label> <label class="form-label" for="description">Description</label>
{{ Form::textarea('text', $text, array('class'=>'form-control', 'rows'=>20)) }}
</div> </div>
<button type="submit" class="btn btn-primary"><i class="ion"></i> action</button> <button type="submit" class="btn btn-primary"><i class="ion"></i> action</button>
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
@if(count($values)>0)
<div class="card-body"> <div class="card-body">
<!-- Controls --> <!-- Controls -->
@foreach($values as $key=>$value)
{{ $key }} || {{$value}}<br>
@endforeach <div class="table-responsive">
<table class="table user-view-table m-0">
<thead>
<tr>
<th>ID</th>
<th>Nachname</th>
<th>Organisation</th>
<th>Service</th>
<th>Gesamt</th>
<th>Check</th>
<th>Storno</th>
</tr>
</thead>
<tbody>
@foreach($bookings as $booking)
<tr>
<td><a href="{{ route('booking_detail', [$booking->id]) }}">{{ $booking->id }}</a></td>
<td>{{ $booking->customer->fullName() }}</td>
<td>{{ $booking->price }}</td>
<td>{{ $booking->getServiceTotal() }}</td>
<td>{{ $booking->price_total }}</td>
<td>@if($booking->getPriceTotalRaw() != ($booking->getPriceRaw() + $booking->getServiceTotal(true)))
{{ ($booking->getPriceRaw() + $booking->getServiceTotal(true)) }}
@endif
</td>
<td>@if($booking->isCanceled()) {{ $booking->price_canceled }} @endif</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div> </div>
@endif
</div> </div>
@endsection @endsection

View file

@ -12,8 +12,12 @@
*/ */
Auth::routes(); Auth::routes([
'register' => false, // Registration Routes...
//'reset' => false, // Password Reset Routes...
'verify' => false, // Email Verification Routes...
]);
Route::get('/logout', function(){ Route::get('/logout', function(){
Auth::logout(); Auth::logout();
\App\Services\MyGoogle2FA::logout(); \App\Services\MyGoogle2FA::logout();
@ -433,6 +437,9 @@ Route::group(['middleware' => ['superadmin', '2fa']], function() {
Route::get('/admin/report/bookings', 'Admin\ReportController@bookings')->name('admin_report_bookings'); Route::get('/admin/report/bookings', 'Admin\ReportController@bookings')->name('admin_report_bookings');
Route::get('/admin/report/datatable/bookings', 'Admin\ReportController@bookingsDatatable')->name('admin_report_bookings_datatable'); Route::get('/admin/report/datatable/bookings', 'Admin\ReportController@bookingsDatatable')->name('admin_report_bookings_datatable');
Route::post('/admin/report/export/bookings', 'Admin\ReportController@bookingsExport')->name('admin_report_export_bookings'); Route::post('/admin/report/export/bookings', 'Admin\ReportController@bookingsExport')->name('admin_report_export_bookings');
Route::get('/admin/report/check/bookings', 'Admin\ReportController@checkBookings')->name('admin_report_check_bookings');
Route::get('/admin/report/check/datatable/bookings', 'Admin\ReportController@checkBookingsDatatable')->name('admin_report_check_bookings_datatable');
}); });
Route::group(['middleware' => ['auth.permission:sua-re-pp']], function() { Route::group(['middleware' => ['auth.permission:sua-re-pp']], function() {

BIN
vendor.tar Normal file

Binary file not shown.