112 lines
6.7 KiB
PHP
Executable file
112 lines
6.7 KiB
PHP
Executable file
<div class="card mb-2">
|
|
<h6 class="card-header bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseBookingProvider" aria-expanded="false" aria-controls="collapseBookingProvider">
|
|
<strong style="line-height: 1.6em">Leistungsträger</strong>
|
|
</h6>
|
|
<div class="collapse" id="collapseBookingProvider">
|
|
<div class="card-body row">
|
|
<div class="table-responsive" id="booking_files_table">
|
|
<table class="table table-striped table-sm">
|
|
<thead>
|
|
<tr>
|
|
<th>Leistungsträger</th>
|
|
<th>Betrag</th>
|
|
<th>Faktor</th>
|
|
<th>Betrag €</th>
|
|
<th>Zahlungsdatum</th>
|
|
<th>Re.Nr.</th>
|
|
<th>bezahlt</th>
|
|
<th> </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
@if($booking->service_provider_entries)
|
|
@foreach($booking->service_provider_entries as $item)
|
|
<tr>
|
|
<th scope="row">
|
|
{{ Form::select('service_provider_entry['.$item->id.'][service_provider_id]', \App\Services\Model::getServiceProviderArray(false, $item->type) , $item->service_provider_id, array('class'=>'custom-select', 'id'=>'service_provider_entry_'.$item->id.'_service_provider_id')) }}
|
|
</th>
|
|
<td>
|
|
{{ Form::text('service_provider_entry['.$item->id.'][amount]', $item->amount, array('placeholder'=>__('Betrag'), 'class'=>'form-control calculate_amount_on_change', 'data-spe-id'=>$item->id, 'id'=>'service_provider_entry_'.$item->id.'_amount')) }}
|
|
</td>
|
|
<td>
|
|
{{ Form::text('service_provider_entry['.$item->id.'][factor]', $item->factor, array('placeholder'=>__('Faktor'), 'class'=>'form-control', 'id'=>'service_provider_entry_'.$item->id.'_factor', 'readonly'=>true)) }}
|
|
</td>
|
|
<td>
|
|
{{ Form::text('service_provider_entry['.$item->id.'][amount_eur]', $item->amount_eur, array('placeholder'=>__('Betrag'), 'class'=>'form-control', 'id'=>'service_provider_entry_'.$item->id.'_amount_eur', 'readonly'=>true)) }}
|
|
</td>
|
|
<td>
|
|
@if($item->type === 'payment')
|
|
{{ Form::text('service_provider_entry['.$item->id.'][payment_date]', _format_date($item->payment_date), array('placeholder'=>__('Datum'), 'class'=>'form-control datepicker-base', 'id'=>'service_provider_entry_'.$item->id.'_payment_date')) }}
|
|
@else
|
|
|
|
@endif
|
|
</td>
|
|
<td>
|
|
{{ Form::text('service_provider_entry['.$item->id.'][invoice_number]', $item->invoice_number, array('placeholder'=>__('Re.Nr.'), 'class'=>'form-control', 'id'=>'service_provider_entry_'.$item->id.'_invoice_number')) }}
|
|
</td>
|
|
<td>
|
|
@if($item->type === 'payment')
|
|
<label class="custom-control custom-checkbox mt-2">
|
|
{!! Form::checkbox('service_provider_entry['.$item->id.'][is_cleared]', 1, $item->is_cleared, ['class'=>'custom-control-input']) !!}
|
|
<span class="custom-control-label"></span>
|
|
</label>
|
|
@else
|
|
|
|
@endif
|
|
</td>
|
|
<td>
|
|
<a class="btn btn-sm text-danger" href="{{ route('booking_delete', [$item->id, 'service_provider_entry']) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-trash-alt"></i></a>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="col-12">
|
|
<hr>
|
|
<div class="text-left mt-3">
|
|
<button type="submit" name="action" value="update_service_provider_entry" class="btn btn-sm btn-secondary">{{ __('save changes') }}</button>
|
|
<a href="{{route('bookings')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
|
|
|
<a href="{{route('booking_action', ['service_provider_entry_add_discount', $booking->id])}}" class="btn btn-sm btn-primary float-right ml-2"><i class="fa fa-plus-circle"></i> {{ __('Neuer Rabatt') }}</a>
|
|
<a href="{{route('booking_action', ['service_provider_entry_add_payment', $booking->id])}}" class="btn btn-sm btn-primary float-right"><i class="fa fa-plus-circle"></i> {{ __('Neue Zahlung') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('input.calculate_amount_on_change').on('change, keyup', function(){
|
|
var _spe_id = $(this).data('spe-id');
|
|
var amount = _floatNumber($('#service_provider_entry_'+_spe_id+'_amount').val());
|
|
var factor = _floatNumber($('#service_provider_entry_'+_spe_id+'_factor').val());
|
|
var eur = amount/factor;
|
|
$('#service_provider_entry_'+_spe_id+'_amount_eur').val(_formatNumber(eur));
|
|
});
|
|
|
|
function callback_ajax_selected_travelagenda(data){
|
|
var $el = $("#travelagenda_id");
|
|
$el.empty(); // remove old options
|
|
$.each(data.html, function(key,value) {
|
|
$el.append($("<option></option>")
|
|
.attr("value", key).text(value));
|
|
});
|
|
}
|
|
function load_selected_travelagenda(){
|
|
var $elem = $('<div/>');
|
|
$elem.data('action', 'load_travelagenda_by_country');
|
|
$elem.data('travel_country_id', $('#travel_country_id').val());
|
|
$elem.data('url', '{{route('ajax_load_data')}}');
|
|
ajax_object_action(false, $elem, callback_ajax_selected_travelagenda);
|
|
}
|
|
$('#travel_country_id').on('change', function () {
|
|
load_selected_travelagenda();
|
|
});
|
|
});
|
|
</script>
|
|
|