Fewos in CRM,

Fewo Clients Bookings
create / edit / delelte
via API in DB
This commit is contained in:
Kevin Adametz 2019-03-28 14:53:16 +01:00
parent aebfb0586a
commit c0c2a1822c
55 changed files with 9787 additions and 1486 deletions

View file

@ -0,0 +1,41 @@
@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
<h4 class="font-weight-bold py-3 mb-1">
Kunden @if($id == "new") <span class="text-primary">anlegen</span> @else {{"(ID: ".$id.")"}} verwalten @endif
</h4>
{!! Form::open(['url' => route('travel_user_booking_fewo_detail', [$id]), 'class' => 'form-horizontal']) !!}
<input type="hidden" name="id" id="id" value="{{$id}}">
@include('travel.user.booking.form')
<div class="text-left mt-3">
<button type="submit" name="action" value="saveAll" class="btn btn-submit">{{ __('save changes') }}</button>&nbsp;
<a href="{{route('travel_user_booking_fewos')}}" class="btn btn-default">{{ __('back') }}</a>
</div>
{!! Form::close() !!}
@endsection

View file

@ -0,0 +1,144 @@
<div class="card mb-2">
<div class="card-body">
<div class="form-row">
<div class="form-group col-md-6">
<label class="form-label">{{ __('Kunde') }}*</label>
<select class="selectpicker" data-style="btn-light" name="travel_user_id" data-live-search="true" required>
{!! HTMLHelper::getTravelUserOptions($travel_user_booking_fewo->travel_user_id) !!}
</select>
</div>
<div class="form-group col-md-6">
<label class="form-label">{{ __('FeWo') }}*</label>
<select class="selectpicker" data-style="btn-light" name="fewo_lodging_id" required>
{!! HTMLHelper::getFewoLodgingOptions($travel_user_booking_fewo->fewo_lodging_id) !!}
</select>
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-6">
<label class="form-label" for="invoice_number">{{ __('Rechnungsnummer') }}</label>
{{ Form::text('invoice_number', $travel_user_booking_fewo->invoice_number, array('placeholder'=>__('Rechnungsnummer'), 'class'=>'form-control')) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="booking_date">{{ __('Buchungsdatum') }}*</label>
{{ Form::text('booking_date', $travel_user_booking_fewo->booking_date, array('placeholder'=>__('Buchungsdatum'), 'class'=>'form-control datepicker-base', 'required'=>true)) }}
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-4">
<label class="form-label" for="adults">{{ __('Erwachsene') }}</label>
{{ Form::text('adults', $travel_user_booking_fewo->adults, array('placeholder'=>__('Erwachsene'), 'class'=>'form-control')) }}
</div>
<div class="form-group col-sm-4">
<label class="form-label" for="children">{{ __('Kinder') }}</label>
{{ Form::text('children', $travel_user_booking_fewo->children, array('placeholder'=>__('Kinder'), 'class'=>'form-control')) }}
</div>
<div class="form-group col-sm-4">
<label class="form-label" for="persons">{{ __('Personen Gesamt') }}*</label>
{{ Form::text('persons', $travel_user_booking_fewo->persons, array('placeholder'=>__('Personen'), 'class'=>'form-control', 'readonly')) }}
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-6">
<label class="form-label" for="from_date">{{ __('Datum von') }}*</label>
{{ Form::text('from_date', $travel_user_booking_fewo->from_date, array('placeholder'=>__('Datum von'), 'class'=>'form-control datepicker-base', 'required'=>true)) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="to_date">{{ __('Datum bis') }}*</label>
{{ Form::text('to_date', $travel_user_booking_fewo->to_date, array('placeholder'=>__('Datum bis'), 'class'=>'form-control datepicker-base', 'required'=>true)) }}
</div>
<div class="form-group col-sm-12">
<em>Änderungen werden nicht bei den Reservierungen geändert!</em>
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-3">
<label class="form-label" for="price_travel">{{ __('Preis Übernachtungen') }}*</label>
{{ Form::text('price_travel', $travel_user_booking_fewo->price_travel, array('placeholder'=>__('Preis Übernachtungen'), 'class'=>'form-control')) }}
</div>
<div class="form-group col-sm-3">
<label class="form-label" for="price_service">{{ __('Preis Service-Gebühr') }}*</label>
{{ Form::text('price_service', $travel_user_booking_fewo->price_service, array('placeholder'=>__('Preis Service-Gebühr'), 'class'=>'form-control')) }}
</div>
<div class="form-group col-sm-3">
<label class="form-label" for="price_deposit">{{ __('Preis Kaution') }}*</label>
{{ Form::text('price_deposit', $travel_user_booking_fewo->price_deposit, array('placeholder'=>__('Preis Kaution'), 'class'=>'form-control')) }}
</div>
<div class="form-group col-sm-3">
<label class="form-label" for="price_total">{{ __('Preis Gesamt') }}*</label>
{{ Form::text('price_total', $travel_user_booking_fewo->price_total, array('placeholder'=>__('Preis Gesamt'), 'class'=>'form-control', 'readonly')) }}
</div>
</div>
<hr>
<div class="form-row">
<div class="col-sm-12">
<label class="form-label">Eingetragen in</label>
</div>
<div class="form-group col-sm-4">
<label class="custom-control custom-checkbox">
{!! Form::checkbox('is_calendar_fewo_direct', 1, $travel_user_booking_fewo->is_calendar_fewo_direct, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('FEWO Direkt')}}</span>
</label>
</div>
<div class="form-group col-sm-4">
<label class="custom-control custom-checkbox">
{!! Form::checkbox('is_calendar_hrs', 1, $travel_user_booking_fewo->is_calendar_hrs, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('HRS')}}</span>
</label>
</div>
<div class="form-group col-sm-4">
<label class="custom-control custom-checkbox">
{!! Form::checkbox('is_calendar_stern_tours', 1, $travel_user_booking_fewo->is_calendar_stern_tours, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('STERN TOURS')}}</span>
</label>
</div>
</div>
<div class="form-row">
<div class="col-sm-6">
<div class="form-group">
<label class="form-label">{{ __('Status') }}*</label>
<select class="selectpicker" data-style="btn-light" name="status" required>
{!! \App\Models\TravelUserBookingFewo::getStatuesOptions($travel_user_booking_fewo->status) !!}
</select>
</div>
<div class="form-group">
<label class="form-label">{{ __('Kanal') }}*</label>
<select class="selectpicker" data-style="btn-light" name="travel_booking_fewo_channel_id" required>
{!! HTMLHelper::getTravelBookingFewoChannelOptions($travel_user_booking_fewo->travel_booking_fewo_channel_id) !!}
</select>
</div>
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="status_text">{{ __('Notiz') }}</label>
{{ Form::textarea('status_text', $travel_user_booking_fewo->status_text, ['class' => 'form-control', 'rows'=>4]) }}
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-12">
<label class="form-label" for="notice">{{ __('Bemerkung Kunde') }}*</label>
{{ Form::textarea('notice', $travel_user_booking_fewo->notice, ['class' => 'form-control', 'rows'=>4]) }}
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,97 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-3 mb-1">
{{ __('Buchungen') }} FeWo
</h4>
<div class="card">
<div class="card-datatable table-responsive py-2">
<div class="mr-4 mb-2 text-right">
<a href="{{ route('travel_user_booking_fewo_detail', ['new']) }}" class="btn btn-sm btn-primary">Neue Buchung anlegen</a>
</div>
<table id="datatables-default" class="table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 10px;">&nbsp;</th>
<th>{{__('ID')}}</th>
<th>{{__('FeWo')}}</th>
<th>{{__('Kunde')}}</th>
<th>{{__('vom')}}</th>
<th>{{__('bis')}}</th>
<th>{{__('Eingetragen')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Datum')}}</th>
<th style="max-width: 60px;">{{__('delete')}}</th>
</tr>
</thead>
</table>
<div class="mr-4 mt-2 text-right">
<a href="{{ route('travel_user_booking_fewo_detail', ['new']) }}" class="btn btn-sm btn-primary">Neue Buchung anlegen</a>
</div>
</div>
</div>
<script>
$( document ).ready(function() {
$('#datatables-default').dataTable({
"processing": true,
"serverSide": true,
"searching": false,
"ajax": '{!! route('data_table_travel_user_booking_fewos') !!}',
"columns": [
{ data: 'action_edit', orderable: false, searchable: false},
{ data: 'id', name: 'id' },
{ data: 'fewo_lodging', name: 'fewo_lodging' },
{ data: 'travel_user', name: 'travel_user', orderable: false, },
{ data: 'from_date', name: 'from_date' },
{ data: 'to_date', name: 'to_date' },
{ data: 'is_calendar', name: 'is_calendar', orderable: false },
{ data: 'status_name', name: 'status_name' },
{ data: 'booking_date', name: 'booking_date' },
{ data: 'action_delete', orderable: false, searchable: false},
],
"order": [[ 1, "desc" ]],
"bLengthChange": false,
"iDisplayLength": 50,
"language": {
"url": "/js/German.json"
},
/*initComplete: function () {
this.api().columns(2).every( function () {
var column = this;
var title = $(column.header()).html();
var select = $('<select class="selectpicker"><option value="">'+title+'</option></select>')
.appendTo( $(column.header()).empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
if(d !== ""){
var text = $(d+' span').text();
if(text != "" && text != "-"){
select.append( '<option value="'+$(d).data('order')+'">'+ $(d+' span').text()+'</option>' );
}
}
} );
} );
$('.selectpicker').selectpicker();
}*/
});
});
</script>
@endsection