Booking edit v3
This commit is contained in:
parent
6706d28f51
commit
6880c7e989
20 changed files with 691 additions and 97 deletions
32
app/Http/Controllers/AjaxController.php
Normal file
32
app/Http/Controllers/AjaxController.php
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\TravelAgenda;
|
||||||
|
use App\Services\Model;
|
||||||
|
use Request;
|
||||||
|
|
||||||
|
class AjaxController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function load(){
|
||||||
|
$data = Request::all();
|
||||||
|
$ret = "";
|
||||||
|
$status = false;
|
||||||
|
if(Request::ajax()){
|
||||||
|
|
||||||
|
if($data['action'] === 'load_travelagenda_by_country' && isset($data['travel_country_id'])){
|
||||||
|
$ret = Model::getTravelAgendaArray(true, $data['travel_country_id']);
|
||||||
|
$status = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,12 @@ use App\Models\Booking;
|
||||||
use App\Models\Customer;
|
use App\Models\Customer;
|
||||||
use App\Models\BookingFile;
|
use App\Models\BookingFile;
|
||||||
use App\Models\BookingNotice;
|
use App\Models\BookingNotice;
|
||||||
|
use App\Models\ServiceProvider;
|
||||||
use App\Models\BookingDraftItem;
|
use App\Models\BookingDraftItem;
|
||||||
|
use App\Models\BookingServiceItem;
|
||||||
|
use App\Models\Participant;
|
||||||
|
use App\Models\ServiceProviderEntry;
|
||||||
|
use App\Models\TravelCompany;
|
||||||
use App\Repositories\DraftRepository;
|
use App\Repositories\DraftRepository;
|
||||||
use App\Repositories\BookingRepository;
|
use App\Repositories\BookingRepository;
|
||||||
use App\Repositories\BookingFileRepository;
|
use App\Repositories\BookingFileRepository;
|
||||||
|
|
@ -100,6 +105,27 @@ class BookingController extends Controller
|
||||||
return redirect(route('booking_detail', [$booking->id])."#collapseBookingPrice");
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingPrice");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($data['action'] === 'update_service_provider_entry'){
|
||||||
|
$booking = $this->bookingRepo->updateServiceProviderEntry($id, $data);
|
||||||
|
\Session()->flash('alert-save', '1');
|
||||||
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingProvider");
|
||||||
|
}
|
||||||
|
|
||||||
|
if($data['action'] === 'update_booking_service_item'){
|
||||||
|
$booking = $this->bookingRepo->updateBookingServiceItem($id, $data);
|
||||||
|
\Session()->flash('alert-save', '1');
|
||||||
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingProvider");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if($data['action'] === 'update_booking_participant'){
|
||||||
|
$booking = $this->bookingRepo->updateBookingParticipant($id, $data);
|
||||||
|
\Session()->flash('alert-save', '1');
|
||||||
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingParticipant");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -230,7 +256,6 @@ class BookingController extends Controller
|
||||||
return redirect(route('booking_detail', [$booking->id]));
|
return redirect(route('booking_detail', [$booking->id]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function loadModal(){
|
public function loadModal(){
|
||||||
$data = Request::all();
|
$data = Request::all();
|
||||||
$ret = "";
|
$ret = "";
|
||||||
|
|
@ -283,16 +308,63 @@ class BookingController extends Controller
|
||||||
|
|
||||||
public function action($action, $id=false){
|
public function action($action, $id=false){
|
||||||
|
|
||||||
|
if(!$booking = Booking::find($id)){
|
||||||
|
abort(404);
|
||||||
|
}
|
||||||
|
|
||||||
if($action === 'change_travel_dates'){
|
if($action === 'change_travel_dates'){
|
||||||
if($booking = Booking::find($id)){
|
|
||||||
$draftRepo = new DraftRepository($booking);
|
$draftRepo = new DraftRepository($booking);
|
||||||
$draftRepo->change_dates_drafts_from_booking(Request::get('change_travel_start_date'));
|
$draftRepo->change_dates_drafts_from_booking(Request::get('change_travel_start_date'));
|
||||||
\Session()->flash('alert-success', __('Datum der Reise wurde geändert'));
|
\Session()->flash('alert-success', __('Datum der Reise wurde geändert'));
|
||||||
return redirect(route('booking_detail', [$booking->id]));
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingOrganisation");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
if($action === 'service_provider_entry_add_discount'){
|
||||||
|
$ServiceProvider = ServiceProvider::where('type', 'discount')->where('active',true)->first();
|
||||||
|
ServiceProviderEntry::create([
|
||||||
|
'booking_id' => $booking->id,
|
||||||
|
'service_provider_id' => $ServiceProvider->id,
|
||||||
|
'type' => 'discount',
|
||||||
|
]);
|
||||||
|
\Session()->flash('alert-success', __('Leistungsträger neuer Rabatt hinzugefügt'));
|
||||||
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingProvider");
|
||||||
|
}
|
||||||
|
|
||||||
|
if($action === 'service_provider_entry_add_payment'){
|
||||||
|
$ServiceProvider = ServiceProvider::where('type', 'payment')->where('active',true)->first();
|
||||||
|
ServiceProviderEntry::create([
|
||||||
|
'booking_id' => $booking->id,
|
||||||
|
'service_provider_id' => $ServiceProvider->id,
|
||||||
|
'type' => 'payment',
|
||||||
|
]);
|
||||||
|
\Session()->flash('alert-success', __('Leistungsträger neue Zahlung hinzugefügt'));
|
||||||
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingProvider");
|
||||||
|
}
|
||||||
|
|
||||||
|
if($action === 'booking_service_item_add'){
|
||||||
|
$TravelCompany = TravelCompany::where('active',true)->first();
|
||||||
|
BookingServiceItem::create([
|
||||||
|
'booking_id' => $booking->id,
|
||||||
|
'travel_company_id' => $TravelCompany->id,
|
||||||
|
'travel_date' => now(),
|
||||||
|
]);
|
||||||
|
\Session()->flash('alert-success', __('Reiseveranstalter neue Leistung hinzugefügt'));
|
||||||
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingCompany");
|
||||||
|
}
|
||||||
|
|
||||||
|
if($action === 'booking_participant_add'){
|
||||||
|
Participant::create([
|
||||||
|
'booking_id' => $booking->id,
|
||||||
|
'nationality_id' => 1,
|
||||||
|
'participant_salutation_id' => 1,
|
||||||
|
|
||||||
|
]);
|
||||||
|
\Session()->flash('alert-success', __('Neuen Teilnehmer hinzugefügt'));
|
||||||
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingParticipant");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function delete($id, $del="booking"){
|
public function delete($id, $del="booking"){
|
||||||
|
|
||||||
|
|
@ -309,22 +381,50 @@ class BookingController extends Controller
|
||||||
$fileRepo->delete();
|
$fileRepo->delete();
|
||||||
$booking_file->delete();
|
$booking_file->delete();
|
||||||
\Session()->flash('alert-success', 'Datei gelöscht');
|
\Session()->flash('alert-success', 'Datei gelöscht');
|
||||||
return redirect(route('booking_detail', [$booking->id]));
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingFiles");
|
||||||
}
|
}
|
||||||
if($del === 'booking_notice'){
|
if($del === 'booking_notice'){
|
||||||
$booking_notice = BookingNotice::findOrFail($id);
|
$booking_notice = BookingNotice::findOrFail($id);
|
||||||
$booking = $booking_notice->booking;
|
$booking = $booking_notice->booking;
|
||||||
$booking_notice->delete();
|
$booking_notice->delete();
|
||||||
\Session()->flash('alert-success', 'Notiz gelöscht');
|
\Session()->flash('alert-success', 'Notiz gelöscht');
|
||||||
return redirect(route('booking_detail', [$booking->id]));
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingNotice");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($del === 'passolution_file'){
|
if($del === 'passolution_file'){
|
||||||
$booking = Booking::findOrFail($id);
|
$booking = Booking::findOrFail($id);
|
||||||
$booking->resyncPassolutionPDF();
|
$booking->resyncPassolutionPDF();
|
||||||
\Session()->flash('alert-success', 'Passolution erneuert');
|
\Session()->flash('alert-success', 'Passolution erneuert');
|
||||||
return redirect(route('booking_detail', [$booking->id]));
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingFiles");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($del === 'service_provider_entry'){
|
||||||
|
$ServiceProviderEntry = ServiceProviderEntry::findOrFail($id);
|
||||||
|
$booking = $ServiceProviderEntry->booking;
|
||||||
|
$ServiceProviderEntry->delete();
|
||||||
|
\Session()->flash('alert-success', 'Leistungsträger gelöscht');
|
||||||
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingProvider");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if($del === 'booking_service_item'){
|
||||||
|
$BookingServiceItem = BookingServiceItem::findOrFail($id);
|
||||||
|
$booking = $BookingServiceItem->booking;
|
||||||
|
$BookingServiceItem->delete();
|
||||||
|
\Session()->flash('alert-success', 'Reiseveranstalter gelöscht');
|
||||||
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingCompany");
|
||||||
|
}
|
||||||
|
|
||||||
|
if($del === 'participant'){
|
||||||
|
$Participant = Participant::findOrFail($id);
|
||||||
|
$booking = $Participant->booking;
|
||||||
|
$Participant->delete();
|
||||||
|
\Session()->flash('alert-success', 'Teilnehmer gelöscht');
|
||||||
|
return redirect(route('booking_detail', [$booking->id])."#collapseBookingParticipant");
|
||||||
|
}
|
||||||
|
|
||||||
return redirect(route('requests'));
|
return redirect(route('requests'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -591,7 +591,6 @@ class Booking extends Model
|
||||||
if(empty($nats)){
|
if(empty($nats)){
|
||||||
$nats['de'] = 'de';
|
$nats['de'] = 'de';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($nats as $nat){
|
foreach ($nats as $nat){
|
||||||
$data = [
|
$data = [
|
||||||
'nat' => $nat,
|
'nat' => $nat,
|
||||||
|
|
@ -778,7 +777,7 @@ class Booking extends Model
|
||||||
{
|
{
|
||||||
$total = 0;
|
$total = 0;
|
||||||
foreach ($this->service_provider_entries as $entry){
|
foreach ($this->service_provider_entries as $entry){
|
||||||
$total += $entry->getAmountRaw() / $entry->factor;
|
$total += $entry->getAmountRaw() / $entry->getFactortRaw();
|
||||||
}
|
}
|
||||||
return $raw ? $total : Util::_number_format($total);
|
return $raw ? $total : Util::_number_format($total);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,10 @@ class BookingServiceItem extends Model
|
||||||
return $this->belongsTo(TravelCompany::class);
|
return $this->belongsTo(TravelCompany::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setServicePriceAttribute($value)
|
||||||
|
{
|
||||||
|
$this->attributes['service_price'] = Util::_clean_float($value);
|
||||||
|
}
|
||||||
public function getServicePriceAttribute()
|
public function getServicePriceAttribute()
|
||||||
{
|
{
|
||||||
return Util::_number_format($this->attributes['service_price']);
|
return Util::_number_format($this->attributes['service_price']);
|
||||||
|
|
@ -92,4 +95,35 @@ class BookingServiceItem extends Model
|
||||||
{
|
{
|
||||||
return $this->attributes['service_price'];
|
return $this->attributes['service_price'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setCommissionAttribute($value)
|
||||||
|
{
|
||||||
|
$this->attributes['commission'] = Util::_clean_float($value);
|
||||||
|
}
|
||||||
|
public function getCommissionAttribute()
|
||||||
|
{
|
||||||
|
return Util::_number_format($this->attributes['commission']);
|
||||||
|
}
|
||||||
|
public function getCommissionRaw()
|
||||||
|
{
|
||||||
|
return $this->attributes['commission'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setServicePriceRefundAttribute($value)
|
||||||
|
{
|
||||||
|
$this->attributes['service_price_refund'] = Util::_clean_float($value);
|
||||||
|
}
|
||||||
|
public function getServicePriceRefundAttribute()
|
||||||
|
{
|
||||||
|
return Util::_number_format($this->attributes['service_price_refund']);
|
||||||
|
}
|
||||||
|
public function getServicePriceRefundRaw()
|
||||||
|
{
|
||||||
|
return $this->attributes['service_price_refund'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setServicePriceRefundRaw($value)
|
||||||
|
{
|
||||||
|
return $this->attributes['service_price_refund'] = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
41
app/Models/Branch.php
Normal file
41
app/Models/Branch.php
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Reliese Model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Branch
|
||||||
|
*
|
||||||
|
* @property int $id
|
||||||
|
* @property string $name
|
||||||
|
*
|
||||||
|
* @property Collection|Booking[] $bookings
|
||||||
|
* @property Collection|SfGuardUser[] $sf_guard_users
|
||||||
|
*
|
||||||
|
* @package App\Models
|
||||||
|
*/
|
||||||
|
class Branch extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'branch';
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'name'
|
||||||
|
];
|
||||||
|
|
||||||
|
public function bookings()
|
||||||
|
{
|
||||||
|
return $this->hasMany(Booking::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function sf_guard_users()
|
||||||
|
{
|
||||||
|
return $this->hasMany(SfGuardUser::class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -97,6 +97,23 @@ class ServiceProviderEntry extends Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setFactorAttribute($value)
|
||||||
|
{
|
||||||
|
$this->attributes['factor'] = floatval(preg_replace("/[^0-9.-]/", "", str_replace(',', '.', $value)));
|
||||||
|
}
|
||||||
|
public function getFactorAttribute()
|
||||||
|
{
|
||||||
|
return Util::_number_format($this->attributes['factor'], 4);
|
||||||
|
}
|
||||||
|
public function getFactortRaw()
|
||||||
|
{
|
||||||
|
return $this->attributes['factor'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setAmountAttribute($value)
|
||||||
|
{
|
||||||
|
$this->attributes['amount'] = Util::_clean_float($value);
|
||||||
|
}
|
||||||
public function getAmountAttribute()
|
public function getAmountAttribute()
|
||||||
{
|
{
|
||||||
return Util::_number_format($this->attributes['amount']);
|
return Util::_number_format($this->attributes['amount']);
|
||||||
|
|
@ -105,7 +122,10 @@ class ServiceProviderEntry extends Model
|
||||||
{
|
{
|
||||||
return $this->attributes['amount'];
|
return $this->attributes['amount'];
|
||||||
}
|
}
|
||||||
|
public function setAmountEurAttribute($value)
|
||||||
|
{
|
||||||
|
$this->attributes['amount_eur'] = Util::_clean_float($value);
|
||||||
|
}
|
||||||
public function getAmountEurAttribute()
|
public function getAmountEurAttribute()
|
||||||
{
|
{
|
||||||
return Util::_number_format($this->attributes['amount_eur']);
|
return Util::_number_format($this->attributes['amount_eur']);
|
||||||
|
|
@ -135,4 +155,5 @@ class ServiceProviderEntry extends Model
|
||||||
if(!$this->attributes['payment_date']){ return ""; }
|
if(!$this->attributes['payment_date']){ return ""; }
|
||||||
return Carbon::parse($this->attributes['payment_date'])->format(\Util::formatDateDB());
|
return Carbon::parse($this->attributes['payment_date'])->format(\Util::formatDateDB());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,10 @@ use Auth;
|
||||||
use App\Models\Lead;
|
use App\Models\Lead;
|
||||||
use App\Services\Util;
|
use App\Services\Util;
|
||||||
use App\Models\Booking;
|
use App\Models\Booking;
|
||||||
|
use App\Models\Participant;
|
||||||
use App\Models\BookingNotice;
|
use App\Models\BookingNotice;
|
||||||
|
use App\Models\BookingServiceItem;
|
||||||
|
use App\Models\ServiceProviderEntry;
|
||||||
use App\Models\BookingCompanyService;
|
use App\Models\BookingCompanyService;
|
||||||
use App\Models\BookingCountryService;
|
use App\Models\BookingCountryService;
|
||||||
use App\Models\BookingProviderService;
|
use App\Models\BookingProviderService;
|
||||||
|
|
@ -79,8 +82,12 @@ class BookingRepository extends BaseRepository {
|
||||||
'start_date' => $data['start_date'] ? _reformat_date($data['start_date']) : null,
|
'start_date' => $data['start_date'] ? _reformat_date($data['start_date']) : null,
|
||||||
'end_date' => $data['end_date'] ? _reformat_date($data['end_date']) : null,
|
'end_date' => $data['end_date'] ? _reformat_date($data['end_date']) : null,
|
||||||
'title' => $data['title'],
|
'title' => $data['title'],
|
||||||
|
'pax' => $data['pax'],
|
||||||
|
'travel_documents' => $data['travel_documents'],
|
||||||
'paying_out' => $data['paying_out'],
|
'paying_out' => $data['paying_out'],
|
||||||
'paying_out_status' => $data['paying_out_status'],
|
'paying_out_status' => $data['paying_out_status'],
|
||||||
|
'branch_id' => $data['branch_id'],
|
||||||
|
'travel_company_id' => $data['travel_company_id'],
|
||||||
'airline_id' => $data['airline_id'],
|
'airline_id' => $data['airline_id'],
|
||||||
'refund' => $data['refund'],
|
'refund' => $data['refund'],
|
||||||
'refund_date' => _reformat_date($data['refund_date']),
|
'refund_date' => _reformat_date($data['refund_date']),
|
||||||
|
|
@ -141,6 +148,74 @@ class BookingRepository extends BaseRepository {
|
||||||
return $this->model;
|
return $this->model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateServiceProviderEntry($id, $data){
|
||||||
|
$this->model = Booking::findOrFail($id);
|
||||||
|
if(isset($data['service_provider_entry'])){
|
||||||
|
foreach($data['service_provider_entry'] as $spe_id => $fill){
|
||||||
|
$ServiceProviderEntry = ServiceProviderEntry::findOrFail($spe_id);
|
||||||
|
if($ServiceProviderEntry->booking_id !== $this->model->id){
|
||||||
|
abort(500);
|
||||||
|
}
|
||||||
|
$fill['is_cleared'] = isset($fill['is_cleared']) ? true : false;
|
||||||
|
$fill['payment_date'] = isset($fill['payment_date']) ? _reformat_date($fill['payment_date']) : null;
|
||||||
|
$ServiceProviderEntry->fill($fill);
|
||||||
|
$ServiceProviderEntry->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateBookingServiceItem($id, $data){
|
||||||
|
$this->model = Booking::findOrFail($id);
|
||||||
|
if(isset($data['booking_service_item'])){
|
||||||
|
foreach($data['booking_service_item'] as $bsi_id => $fill){
|
||||||
|
$BookingServiceItem = BookingServiceItem::findOrFail($bsi_id);
|
||||||
|
if($BookingServiceItem->booking_id !== $this->model->id){
|
||||||
|
abort(500);
|
||||||
|
}
|
||||||
|
$fill['is_commission_locked'] = isset($fill['is_commission_locked']) ? true : false;
|
||||||
|
$fill['travel_date'] = isset($fill['travel_date']) ? _reformat_date($fill['travel_date']) : now();
|
||||||
|
$BookingServiceItem->fill($fill);
|
||||||
|
$BookingServiceItem->save();
|
||||||
|
|
||||||
|
if($fill['is_commission_locked'] === true){
|
||||||
|
$service_price_refund = 0;
|
||||||
|
if($BookingServiceItem->getServicePriceRaw() > 0){
|
||||||
|
$service_price_refund = $BookingServiceItem->getServicePriceRaw() / 100 * $BookingServiceItem->travel_company->getPercentageRaw();
|
||||||
|
}
|
||||||
|
$BookingServiceItem->setServicePriceRefundRaw($service_price_refund);
|
||||||
|
$BookingServiceItem->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateBookingParticipant($id, $data){
|
||||||
|
$this->model = Booking::findOrFail($id);
|
||||||
|
if(isset($data['participant'])){
|
||||||
|
foreach($data['participant'] as $p_id => $fill){
|
||||||
|
$Participant = Participant::findOrFail($p_id);
|
||||||
|
if($Participant->booking_id !== $this->model->id){
|
||||||
|
abort(500);
|
||||||
|
}
|
||||||
|
$fill['participant_child'] = isset($fill['participant_child']) ? true : false;
|
||||||
|
$fill['participant_birthdate'] = isset($fill['participant_birthdate']) ? _reformat_date($fill['participant_birthdate']) : null;
|
||||||
|
$Participant->fill($fill);
|
||||||
|
$Participant->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//main
|
||||||
|
$this->model->participant_salutation_id = isset($data['participant_salutation_id']) ? $data['participant_salutation_id'] : 1;
|
||||||
|
$this->model->participant_name = isset($data['participant_name']) ? $data['participant_name'] : "";
|
||||||
|
$this->model->participant_firstname = isset($data['participant_firstname']) ? $data['participant_firstname'] : "";
|
||||||
|
$this->model->nationality_id = isset($data['nationality_id']) ? $data['nationality_id'] : 1;
|
||||||
|
$this->model->participant_birthdate = isset($data['participant_birthdate']) ? _reformat_date($data['participant_birthdate']) : 1;
|
||||||
|
$this->model->save();
|
||||||
|
return $this->model;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
|
use App\Models\Branch;
|
||||||
use App\Models\Status;
|
use App\Models\Status;
|
||||||
|
use App\Models\Salutation;
|
||||||
use App\Models\SfGuardUser;
|
use App\Models\SfGuardUser;
|
||||||
use App\Models\Sym\TravelCountry as SymTravelCountry;
|
|
||||||
use App\Models\TravelAgenda;
|
use App\Models\TravelAgenda;
|
||||||
|
use App\Models\TravelCompany;
|
||||||
use App\Models\TravelCountry;
|
use App\Models\TravelCountry;
|
||||||
use App\Models\TravelCategory;
|
use App\Models\TravelCategory;
|
||||||
|
use App\Models\ServiceProvider;
|
||||||
|
use App\Models\TravelNationality;
|
||||||
|
use App\Models\Sym\TravelCountry as SymTravelCountry;
|
||||||
|
|
||||||
class Model
|
class Model
|
||||||
{
|
{
|
||||||
|
|
@ -27,14 +32,18 @@ class Model
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getTravelAgendaArray($emtpy = false){
|
public static function getTravelAgendaArray($emtpy = false, $travelcountry_id = false){
|
||||||
$TravelAgenda = TravelAgenda::orderBy('name')->get()->pluck('name', 'id');
|
if($travelcountry_id){
|
||||||
|
$TravelAgenda = TravelAgenda::where('travelcountry_id', $travelcountry_id)->where('active', true)->orderBy('name')->get()->pluck('name', 'id');
|
||||||
|
}else{
|
||||||
|
$TravelAgenda = TravelAgenda::orderBy('name')->get()->pluck('name', 'id');
|
||||||
|
}
|
||||||
return $emtpy ? $TravelAgenda->prepend('-', 0) : $TravelAgenda;
|
return $emtpy ? $TravelAgenda->prepend('-', 0) : $TravelAgenda;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getSymTravelCountryArray($emtpy = false){
|
public static function getSymTravelCountryArray($emtpy = false){
|
||||||
$TravelAgenda = SymTravelCountry::orderBy('name')->get()->pluck('name', 'id');
|
$SymTravelCountry = SymTravelCountry::orderBy('name')->get()->pluck('name', 'id');
|
||||||
return $emtpy ? $TravelAgenda->prepend('-', 0) : $TravelAgenda;
|
return $emtpy ? $SymTravelCountry->prepend('-', 0) : $SymTravelCountry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getStatusArray($emtpy = false){
|
public static function getStatusArray($emtpy = false){
|
||||||
|
|
@ -42,5 +51,33 @@ class Model
|
||||||
return $emtpy ? $Status->prepend('-', 0) : $Status;
|
return $emtpy ? $Status->prepend('-', 0) : $Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getTravelCompanyArray($emtpy = false){
|
||||||
|
$TravelCompany = TravelCompany::where('active', true)->orderBy('name')->get()->pluck('name', 'id');
|
||||||
|
return $emtpy ? $TravelCompany->prepend('-', 0) : $TravelCompany;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getBranchArray($emtpy = false){
|
||||||
|
$Branch = Branch::orderBy('name')->get()->pluck('name', 'id');
|
||||||
|
return $emtpy ? $Branch->prepend('-', 0) : $Branch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getServiceProviderArray($emtpy = false, $type='payment'){
|
||||||
|
$ServiceProvider = ServiceProvider::where('type', $type)->orderBy('name')->get()->pluck('name', 'id');
|
||||||
|
return $emtpy ? $ServiceProvider->prepend('-', 0) : $ServiceProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getSalutationArray($emtpy = false){
|
||||||
|
$Salutation = Salutation::orderBy('name')->get()->pluck('name', 'id');
|
||||||
|
return $emtpy ? $Salutation->prepend('-', 0) : $Salutation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getTravelNationalityArray($emtpy = false){
|
||||||
|
$TravelNationality = TravelNationality::where('active', true)->orderBy('name')->get()->pluck('name', 'id');
|
||||||
|
return $emtpy ? $TravelNationality->prepend('-', 0) : $TravelNationality;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -95,7 +95,6 @@ class Passolution
|
||||||
$client = new Client();
|
$client = new Client();
|
||||||
$res = $client->get($url, [
|
$res = $client->get($url, [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if($res->getStatusCode() == 200){
|
if($res->getStatusCode() == 200){
|
||||||
$body = $res->getBody();
|
$body = $res->getBody();
|
||||||
$body = json_decode($body);
|
$body = json_decode($body);
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ class Util
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function _number_format($value){
|
public static function _number_format($value, $dec=2){
|
||||||
return number_format(($value), 2, ',', '.');
|
return number_format(($value), $dec, ',', '.');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateBranchTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('branch', function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
|
$table->string('name', 255);
|
||||||
|
$table->primary('id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('branch');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,6 +7,20 @@ $('.iq-save-bar').closest('form').find(':input, select, textarea').keydown(funct
|
||||||
showIqSaveBar($(this).closest('form'));
|
showIqSaveBar($(this).closest('form'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function _floatNumber(n) {
|
||||||
|
'use strict';
|
||||||
|
n = n.replace(/\./g, '').replace(',', '.');
|
||||||
|
return parseFloat(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _formatNumber(n) {
|
||||||
|
n = parseFloat(n).toFixed(2);
|
||||||
|
if(isNaN(n)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return n.replace(".", ",");
|
||||||
|
}
|
||||||
|
|
||||||
CookiesAddJSONValue = function(name, value) {
|
CookiesAddJSONValue = function(name, value) {
|
||||||
var elements = [];
|
var elements = [];
|
||||||
if(Cookies.get(name)){
|
if(Cookies.get(name)){
|
||||||
|
|
@ -193,7 +207,9 @@ $(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
function ajax_object_action(event, object, callback) {
|
function ajax_object_action(event, object, callback) {
|
||||||
event.preventDefault();
|
if(event){
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
var data = {};
|
var data = {};
|
||||||
$.each(object.data(), function(index, value){
|
$.each(object.data(), function(index, value){
|
||||||
if(typeof value !== 'object'){
|
if(typeof value !== 'object'){
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-sm-6 col-md-4">
|
<div class="form-group col-sm-6 col-md-4">
|
||||||
<label class="form-label" for="travelagenda_id">{{ __('Reiseprogramm') }}</label>
|
<label class="form-label" for="travelagenda_id">{{ __('Reiseprogramm') }}</label>
|
||||||
{{ Form::select('travelagenda_id', \App\Services\Model::getTravelAgendaArray(true) , $booking->travelagenda_id, array('class'=>'custom-select', 'id'=>'travelagenda_id')) }}
|
{{ Form::select('travelagenda_id', \App\Services\Model::getTravelAgendaArray(true, $booking->travel_country_id) , $booking->travelagenda_id, array('class'=>'custom-select', 'id'=>'travelagenda_id')) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-sm-6 col-md-4">
|
<div class="form-group col-sm-6 col-md-4">
|
||||||
<label class="form-label" for="travel_category_id">{{ __('Reiseart') }}</label>
|
<label class="form-label" for="travel_category_id">{{ __('Reiseart') }}</label>
|
||||||
|
|
@ -60,6 +60,26 @@
|
||||||
{{ Form::text('title', $booking->title, array('placeholder'=>__('Reisetitel'), 'class'=>'form-control', 'id'=>'title')) }}
|
{{ Form::text('title', $booking->title, array('placeholder'=>__('Reisetitel'), 'class'=>'form-control', 'id'=>'title')) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-sm-6 col-md-3">
|
||||||
|
<label class="form-label" for="pax">{{ __('Pax') }}</label>
|
||||||
|
{{ Form::select('pax', range(0, 80) , $booking->pax, array('class'=>'custom-select', 'id'=>'pax')) }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-sm-6 col-md-3">
|
||||||
|
<label class="form-label" for="travel_documents">{{ __('Reiseunterlagen') }}</label>
|
||||||
|
{{ Form::select('travel_documents', [0=>'nicht vollständig', 1=>'vollständig'], $booking->travel_documents, array('class'=>'custom-select', 'id'=>'travel_documents')) }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-sm-6 col-md-3">
|
||||||
|
<label class="form-label" for="branch_id">{{ __('Filiale') }}</label>
|
||||||
|
{{ Form::select('branch_id', \App\Services\Model::getBranchArray(false) , $booking->branch_id, array('class'=>'custom-select', 'id'=>'branch_id')) }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-sm-6 col-md-3">
|
||||||
|
<label class="form-label" for="travel_company_id">{{ __('Reiseveranstalter') }}</label>
|
||||||
|
{{ Form::select('travel_company_id', \App\Services\Model::getTravelCompanyArray(false) , $booking->travel_company_id, array('class'=>'custom-select', 'id'=>'travel_company_id')) }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h5 class="card-title mt-3 mb-1">Status</h5>
|
<h5 class="card-title mt-3 mb-1">Status</h5>
|
||||||
<hr class="mt-0">
|
<hr class="mt-0">
|
||||||
|
|
@ -138,9 +158,32 @@
|
||||||
<button type="submit" name="action" value="update_booking" class="btn btn-sm btn-secondary">{{ __('save changes') }}</button>
|
<button type="submit" name="action" value="update_booking" 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('bookings')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
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>
|
||||||
|
|
@ -10,61 +10,77 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>Veranstalter</th>
|
<th>Veranstalter</th>
|
||||||
<th>Bezeichnung</th>
|
<th>Bezeichnung</th>
|
||||||
<th>Abreisedatum</th>
|
<th>Datum</th>
|
||||||
<th>Reisepreis inkl. MwSt</th>
|
<th>Preis inkl. MwSt €</th>
|
||||||
<th>Rabatt</th>
|
<th>Rabatt €</th>
|
||||||
<th>Erzielte Provision</th>
|
<th>Erzielte Provision €</th>
|
||||||
|
<th>Lock</th>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
<th> </th>
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
@if($booking->booking_service_items)
|
@if($booking->booking_service_items)
|
||||||
@foreach($booking->booking_service_items as $item)
|
@foreach($booking->booking_service_items as $item)
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
{{$item->travel_company->name}}
|
{{ Form::select('booking_service_item['.$item->id.'][travel_company_id]', \App\Services\Model::getTravelCompanyArray(false) , $item->travel_company_id, array('class'=>'custom-select', 'id'=>'booking_service_item_'.$item->id.'_travel_company_id')) }}
|
||||||
<!--<a href="#" target="_blank" class="badge badge-md badge-primary">
|
|
||||||
</a>-->
|
|
||||||
</th>
|
</th>
|
||||||
<td>{{$item->name}}</td>
|
<td>
|
||||||
<td>{{\App\Services\Util::_format_date($item->travel_data, 'date')}}</td>
|
{{ Form::text('booking_service_item['.$item->id.'][name]', $item->name, array('placeholder'=>__('Bezeichnung'), 'class'=>'form-control', 'id'=>'booking_service_item_'.$item->id.'_name')) }}
|
||||||
<td>{{$item->service_price}}</td>
|
</td>
|
||||||
<td>{{$item->commission}}</td>
|
<td>
|
||||||
<td>{{$item->service_price_refund}}</td>
|
{{ Form::text('booking_service_item['.$item->id.'][travel_date]', _format_date($item->travel_date), array('placeholder'=>__('Datum'), 'class'=>'form-control datepicker-base', 'id'=>'booking_service_item_'.$item->id.'_travel_date')) }}
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ Form::text('booking_service_item['.$item->id.'][service_price]', $item->service_price, array('placeholder'=>__('in Euro'), 'class'=>'form-control calculate_refund_service_price', 'data-bsi-id'=>$item->id, 'data-bsi-percentage'=>$item->travel_company->getPercentageRaw(), 'id'=>'booking_service_item_'.$item->id.'_service_price')) }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ Form::text('booking_service_item['.$item->id.'][commission]', $item->commission, array('placeholder'=>__('in Euro'), 'class'=>'form-control', 'id'=>'booking_service_item_'.$item->id.'_commission')) }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ Form::text('booking_service_item['.$item->id.'][service_price_refund]', $item->service_price_refund, array('placeholder'=>__('in Euro'), 'class'=>'form-control', 'id'=>'booking_service_item_'.$item->id.'_service_price_refund')) }}
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<label class="custom-control custom-checkbox mt-2">
|
<label class="custom-control custom-checkbox mt-2">
|
||||||
{!! Form::checkbox('booking_service_item['.$item->id.']', 1, $item->is_commission_locked, ['class'=>'custom-control-input', 'disabled']) !!}
|
{!! Form::checkbox('booking_service_item['.$item->id.'][is_commission_locked]', 1, $item->is_commission_locked, ['class'=>'custom-control-input calculate_refund_service_price', 'data-bsi-id'=>$item->id, 'data-bsi-percentage'=>$item->travel_company->getPercentageRaw(), 'id'=>'booking_service_item_'.$item->id.'_locked']) !!}
|
||||||
<span class="custom-control-label"></span>
|
<span class="custom-control-label">{{ $item->travel_company->percentage }}%</span>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<i class="fa fa-trash-alt"></i>
|
<a class="btn btn-sm text-danger" href="{{ route('booking_delete', [$item->id, 'booking_service_item']) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-trash-alt"></i></a>
|
||||||
{{--<a class="btn text-danger" href="#" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-trash-alt"></i></a> --}}
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{{--
|
<div class="col-12">
|
||||||
<div class="text-right d-block w-100">
|
<hr>
|
||||||
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal"
|
<div class="text-left mt-3">
|
||||||
data-target="#modals-load-content"
|
<button type="submit" name="action" value="update_booking_service_item" class="btn btn-sm btn-secondary">{{ __('save changes') }}</button>
|
||||||
data-id="new-file"
|
<a href="{{route('bookings')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
||||||
data-model="bookingFile"
|
<a href="{{route('booking_action', ['booking_service_item_add', $booking->id])}}" class="btn btn-sm btn-primary float-right ml-2"><i class="fa fa-plus-circle"></i> {{ __('Neue Leistung') }}</a>
|
||||||
data-action="modal-upload-booking-file"
|
</div>
|
||||||
data-url=""
|
</div>
|
||||||
data-redirect="back"
|
|
||||||
data-booking_id="{{$booking->id}}"
|
|
||||||
data-route="#"><i class="ion ion-md-cloud-upload"></i> Datei hinzufügen</button>
|
|
||||||
</div>
|
|
||||||
--}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('input.calculate_refund_service_price').on('change', function(){
|
||||||
|
var _bsi_id = $(this).data('bsi-id');
|
||||||
|
var _percentage = $(this).data('bsi-percentage');
|
||||||
|
if($('#booking_service_item_'+_bsi_id+'_locked').is(':checked')){
|
||||||
|
var _service_price = _floatNumber($('#booking_service_item_'+_bsi_id+'_service_price').val());
|
||||||
|
var eur = 0;
|
||||||
|
if(_service_price > 0){
|
||||||
|
eur = _service_price / 100 * _percentage;
|
||||||
|
}
|
||||||
|
$('#booking_service_item_'+_bsi_id+'_service_price_refund').val(_formatNumber(eur));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
|
||||||
92
resources/views/booking/_detail_participant.blade.php
Normal file
92
resources/views/booking/_detail_participant.blade.php
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
<div class="card mb-2">
|
||||||
|
<h6 class="card-header bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseBookingParticipant" aria-expanded="false" aria-controls="collapseBookingParticipant">
|
||||||
|
<strong style="line-height: 1.6em">Teilnehmer</strong>
|
||||||
|
</h6>
|
||||||
|
<div class="collapse" id="collapseBookingParticipant">
|
||||||
|
<div class="card-body row">
|
||||||
|
<div class="table-responsive" id="booking_files_table">
|
||||||
|
<table class="table table-striped table-sm">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Anrede</th>
|
||||||
|
<th>Vorname</th>
|
||||||
|
<th>Nachname</th>
|
||||||
|
<th>Geburtsdatum</th>
|
||||||
|
<th>Nationalität</th>
|
||||||
|
<th>Kind</th>
|
||||||
|
<th> </th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
{{ Form::select('participant_salutation_id', \App\Services\Model::getSalutationArray(false) , $booking->participant_salutation_id, array('class'=>'custom-select', 'id'=>'participant_salutation_id')) }}
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
{{ Form::text('participant_firstname', $booking->participant_firstname, array('placeholder'=>__('Vorname'), 'class'=>'form-control', 'id'=>'participant_firstname')) }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ Form::text('participant_name', $booking->participant_name, array('placeholder'=>__('Nachname'), 'class'=>'form-control', 'id'=>'participant_name')) }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ Form::text('participant_birthdate', _format_date($booking->participant_birthdate), array('placeholder'=>__('Datum'), 'class'=>'form-control datepicker-base', 'id'=>'participant_birthdate')) }}
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ Form::select('nationality_id', \App\Services\Model::getTravelNationalityArray(false) , $booking->nationality_id, array('class'=>'custom-select', 'id'=>'nationality_id')) }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@if($booking->participants)
|
||||||
|
@foreach($booking->participants as $item)
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
{{ Form::select('participant['.$item->id.'][participant_salutation_id]', \App\Services\Model::getSalutationArray(false) , $item->participant_salutation_id, array('class'=>'custom-select', 'id'=>'participant_'.$item->id.'_participant_salutation_id')) }}
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
{{ Form::text('participant['.$item->id.'][participant_firstname]', $item->participant_firstname, array('placeholder'=>__('Vorname'), 'class'=>'form-control', 'id'=>'participant_'.$item->id.'_participant_firstname')) }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ Form::text('participant['.$item->id.'][participant_name]', $item->participant_name, array('placeholder'=>__('Nachname'), 'class'=>'form-control', 'id'=>'participant_'.$item->id.'_participant_name')) }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ Form::text('participant['.$item->id.'][participant_birthdate]', _format_date($item->participant_birthdate), array('placeholder'=>__('Datum'), 'class'=>'form-control datepicker-base', 'id'=>'participant_'.$item->id.'_participant_birthdate')) }}
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ Form::select('participant['.$item->id.'][nationality_id]', \App\Services\Model::getTravelNationalityArray(false) , $item->nationality_id, array('class'=>'custom-select', 'id'=>'participant_'.$item->id.'_nationality_id')) }}
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<label class="custom-control custom-checkbox mt-2">
|
||||||
|
{!! Form::checkbox('participant['.$item->id.'][participant_child]', 1, $item->participant_child, ['class'=>'custom-control-input', 'id'=>'participant_'.$item->id.'_participant_child']) !!}
|
||||||
|
<span class="custom-control-label"></span>
|
||||||
|
</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a class="btn btn-sm text-danger" href="{{ route('booking_delete', [$item->id, 'participant']) }}" 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_booking_participant" 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', ['booking_participant_add', $booking->id])}}" class="btn btn-sm btn-primary float-right ml-2"><i class="fa fa-plus-circle"></i> {{ __('Neuen Teilnehmer') }}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
<strong style="line-height: 1.6em">Leistungsträger</strong>
|
<strong style="line-height: 1.6em">Leistungsträger</strong>
|
||||||
</h6>
|
</h6>
|
||||||
<div class="collapse" id="collapseBookingProvider">
|
<div class="collapse" id="collapseBookingProvider">
|
||||||
|
|
||||||
<div class="card-body row">
|
<div class="card-body row">
|
||||||
<div class="table-responsive" id="booking_files_table">
|
<div class="table-responsive" id="booking_files_table">
|
||||||
<table class="table table-striped table-sm">
|
<table class="table table-striped table-sm">
|
||||||
|
|
@ -17,7 +16,6 @@
|
||||||
<th>Re.Nr.</th>
|
<th>Re.Nr.</th>
|
||||||
<th>bezahlt</th>
|
<th>bezahlt</th>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
@ -26,43 +24,89 @@
|
||||||
@foreach($booking->service_provider_entries as $item)
|
@foreach($booking->service_provider_entries as $item)
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
{{$item->service_provider->name}}
|
{{ 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')) }}
|
||||||
<!--<a href="#" target="_blank" class="badge badge-md badge-primary">
|
|
||||||
</a>-->
|
|
||||||
</th>
|
</th>
|
||||||
<td>{{$item->amount}}</td>
|
|
||||||
<td>{{$item->factor}}</td>
|
|
||||||
<td>{{$item->amount_eur}}</td>
|
|
||||||
<td>{{\App\Services\Util::_format_date($item->payment_date, 'date')}}</td>
|
|
||||||
<td>{{$item->invoice_number}}</td>
|
|
||||||
<td>
|
<td>
|
||||||
<label class="custom-control custom-checkbox mt-2">
|
{{ 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')) }}
|
||||||
{!! Form::checkbox('service_provider_entry['.$item->id.']', 1, $item->is_cleared, ['class'=>'custom-control-input', 'disabled']) !!}
|
</td>
|
||||||
<span class="custom-control-label"></span>
|
<td>
|
||||||
</label>
|
{{ 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>
|
||||||
<td>
|
<td>
|
||||||
<i class="fa fa-trash-alt"></i>
|
{{ 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)) }}
|
||||||
{{--<a class="btn text-danger" href="#" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-trash-alt"></i></a> --}} </td>
|
</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>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{{--
|
<div class="col-12">
|
||||||
<div class="text-right d-block w-100">
|
<hr>
|
||||||
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal"
|
<div class="text-left mt-3">
|
||||||
data-target="#modals-load-content"
|
<button type="submit" name="action" value="update_service_provider_entry" class="btn btn-sm btn-secondary">{{ __('save changes') }}</button>
|
||||||
data-id="new-file"
|
<a href="{{route('bookings')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
||||||
data-model="bookingFile"
|
|
||||||
data-action="modal-upload-booking-file"
|
<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>
|
||||||
data-url=""
|
<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>
|
||||||
data-redirect="back"
|
</div>
|
||||||
data-booking_id="{{$booking->id}}"
|
</div>
|
||||||
data-route="#"><i class="ion ion-md-cloud-upload"></i> Datei hinzufügen</button>
|
|
||||||
</div>
|
|
||||||
--}}
|
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,11 @@
|
||||||
MyJack
|
MyJack
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseBookingParticipant">
|
||||||
|
Teilnehmer
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseBookingPrice">
|
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseBookingPrice">
|
||||||
Preis
|
Preis
|
||||||
|
|
@ -121,6 +126,9 @@
|
||||||
<!-- MyJack -->
|
<!-- MyJack -->
|
||||||
@include('booking._detail_myjack')
|
@include('booking._detail_myjack')
|
||||||
|
|
||||||
|
<!-- MyJack -->
|
||||||
|
@include('booking._detail_participant')
|
||||||
|
|
||||||
<!-- Preis -->
|
<!-- Preis -->
|
||||||
@include('booking._detail_price')
|
@include('booking._detail_price')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@
|
||||||
|
|
||||||
<!-- Application javascripts -->
|
<!-- Application javascripts -->
|
||||||
<script src="{{ mix('/js/application.js') }}"></script>
|
<script src="{{ mix('/js/application.js') }}"></script>
|
||||||
<script src="{{ asset('/js/custom.js') }}?v=9{{ get_file_last_time('/js/custom.js') }}"></script>
|
<script src="{{ asset('/js/custom.js') }}?v=10{{ get_file_last_time('/js/custom.js') }}"></script>
|
||||||
|
|
||||||
|
|
||||||
@include('asset.js')
|
@include('asset.js')
|
||||||
|
|
|
||||||
|
|
@ -41,16 +41,16 @@
|
||||||
@if($customer_mail->customer)
|
@if($customer_mail->customer)
|
||||||
<p><strong>Kunde: </strong>
|
<p><strong>Kunde: </strong>
|
||||||
{{ $customer_mail->customer->getSalutation() }} {{ $customer_mail->customer->title }} {{ $customer_mail->customer->firstname }} {{ $customer_mail->customer->name }}
|
{{ $customer_mail->customer->getSalutation() }} {{ $customer_mail->customer->title }} {{ $customer_mail->customer->firstname }} {{ $customer_mail->customer->name }}
|
||||||
@if($customer_mail->booking)
|
@if($customer_mail->customer)
|
||||||
({{$customer_mail->booking->id}})
|
({{$customer_mail->customer->id}})
|
||||||
@endif
|
@endif
|
||||||
</p>
|
</p>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if($customer_mail->booking)
|
@if($customer_mail->booking)
|
||||||
<p><strong>Buchung: </strong>
|
<p><strong>Buchung: </strong>
|
||||||
@if($value->booking->fewo_lodging_id) {{ $value->booking->fewo_lodging->name." | " }} @endif
|
@if($customer_mail->booking->fewo_lodging_id) {{ $customer_mail->booking->fewo_lodging->name." | " }} @endif
|
||||||
({{ $value->booking->id }})
|
({{ $customer_mail->booking->id }})
|
||||||
</p>
|
</p>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
@ -58,6 +58,7 @@
|
||||||
<span class="badge badge-success">Mail gesendet</span>
|
<span class="badge badge-success">Mail gesendet</span>
|
||||||
<p>Datum: {{$customer_mail->sent_at}}</p>
|
<p>Datum: {{$customer_mail->sent_at}}</p>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if($customer_mail->fail)
|
@if($customer_mail->fail)
|
||||||
<span class="badge badge-danger">Mail Fehler</span>
|
<span class="badge badge-danger">Mail Fehler</span>
|
||||||
<p>{{$customer_mail->error }}</p>
|
<p>{{$customer_mail->error }}</p>
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,9 @@ Route::group(['middleware' => ['admin']], function()
|
||||||
Route::post('/modal/load', 'ModalController@load')->name('modal_load');
|
Route::post('/modal/load', 'ModalController@load')->name('modal_load');
|
||||||
|
|
||||||
Route::post('/iq/content/modal/load', 'IQ\ContentModalController@load')->name('iq_content_modal_load');
|
Route::post('/iq/content/modal/load', 'IQ\ContentModalController@load')->name('iq_content_modal_load');
|
||||||
|
|
||||||
|
Route::post('customer_mail/ajax', 'CustomerMailController@ajax')->name('customer_mail_ajax');
|
||||||
|
|
||||||
//trees
|
//trees
|
||||||
Route::get('/iq/content/tree/index', 'IQ\ContentTreeController@index')->name('iq_content_tree_index');
|
Route::get('/iq/content/tree/index', 'IQ\ContentTreeController@index')->name('iq_content_tree_index');
|
||||||
Route::get('/iq/content/tree/detail/{id}/{node_id?}/{area_section_id?}', 'IQ\ContentTreeController@detail')->name('iq_content_tree_detail');
|
Route::get('/iq/content/tree/detail/{id}/{node_id?}/{area_section_id?}', 'IQ\ContentTreeController@detail')->name('iq_content_tree_detail');
|
||||||
|
|
@ -109,7 +112,7 @@ Route::group(['middleware' => ['admin']], function()
|
||||||
Route::get('/customer_mail/data/table', 'CustomerMailController@getRequests')->name('customer_mail_data_table');
|
Route::get('/customer_mail/data/table', 'CustomerMailController@getRequests')->name('customer_mail_data_table');
|
||||||
Route::get('/email_template/data/table', 'CustomerMailController@getEmailTemplates')->name('email_template_data_table');
|
Route::get('/email_template/data/table', 'CustomerMailController@getEmailTemplates')->name('email_template_data_table');
|
||||||
Route::get('/customer_mail/delete/{id}', 'CustomerMailController@delete')->name('customer_mail_delete');
|
Route::get('/customer_mail/delete/{id}', 'CustomerMailController@delete')->name('customer_mail_delete');
|
||||||
Route::post('customer_mail/ajax', 'CustomerMailController@ajax')->name('customer_mail_ajax');
|
Route::post('/ajax/load/data', 'AjaxController@load')->name('ajax_load_data');
|
||||||
Route::get('/customer_mail/delete/{id}', 'CustomerMailController@delete')->name('customer_mail_delete');
|
Route::get('/customer_mail/delete/{id}', 'CustomerMailController@delete')->name('customer_mail_delete');
|
||||||
|
|
||||||
Route::get('/customer_mail/detail/{id}', 'CustomerMailController@detail')->name('customer_mail_detail');
|
Route::get('/customer_mail/detail/{id}', 'CustomerMailController@detail')->name('customer_mail_detail');
|
||||||
|
|
@ -191,6 +194,7 @@ Route::group(['middleware' => ['admin']], function()
|
||||||
Route::post('/booking/detail/{id}', 'BookingController@store')->name('booking_detail');
|
Route::post('/booking/detail/{id}', 'BookingController@store')->name('booking_detail');
|
||||||
Route::get('/booking/draft_item/delete/{id}', 'BookingController@draftItemDelete')->name('booking_draft_item_delete');
|
Route::get('/booking/draft_item/delete/{id}', 'BookingController@draftItemDelete')->name('booking_draft_item_delete');
|
||||||
Route::post('/booking/modal/load', 'BookingController@loadModal')->name('booking_modal_load');
|
Route::post('/booking/modal/load', 'BookingController@loadModal')->name('booking_modal_load');
|
||||||
|
Route::get('/booking/action/{action}/{id?}', 'BookingController@action')->name('booking_action');
|
||||||
Route::post('/booking/action/{action}/{id?}', 'BookingController@action')->name('booking_action');
|
Route::post('/booking/action/{action}/{id?}', 'BookingController@action')->name('booking_action');
|
||||||
Route::get('/booking/delete/{id}/{del?}', 'BookingController@delete')->name('booking_delete');
|
Route::get('/booking/delete/{id}/{del?}', 'BookingController@delete')->name('booking_delete');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue