Reiseland Kontaktdaten, Rabatt API
This commit is contained in:
parent
8f29c15a2b
commit
70704be1ea
30 changed files with 471 additions and 95 deletions
|
|
@ -162,8 +162,8 @@ class DraftController extends Controller
|
|||
|
||||
$room_adult += $room['adult'];
|
||||
$room_children += $room['children'];
|
||||
$room_price_adult += ($room['price_adult'] * $room['adult']);
|
||||
$room_price_children += ($room['price_children'] * $room['children']);
|
||||
$room_price_adult += ($room['price_adult_full'] * $room['adult']);
|
||||
$room_price_children += ($room['price_children_full'] * $room['children']);
|
||||
|
||||
if(isset($room_names[$room['name']])){
|
||||
$room_names[$room['name']] = $room_names[$room['name']]+1;
|
||||
|
|
@ -188,9 +188,9 @@ class DraftController extends Controller
|
|||
'start_date' => $data['startDateStr'],
|
||||
'end_date' => $data['endDateStr'],
|
||||
'service' => $service,
|
||||
'price_adult' => $room['price_adult'],
|
||||
'price_adult' => $room['price_adult_full'],
|
||||
'adult' => $room['adult'],
|
||||
'price_children' => $room['price_children'],
|
||||
'price_children' => $room['price_children_full'],
|
||||
'children' => $room['children'],
|
||||
'pos' => 0,
|
||||
'in_pdf' => true,
|
||||
|
|
@ -375,6 +375,41 @@ class DraftController extends Controller
|
|||
'comfort' => $data['comfort']
|
||||
];
|
||||
}
|
||||
|
||||
$price_info_travel_discounts = [];
|
||||
|
||||
foreach ($data['discount'] as $travel_discount){
|
||||
|
||||
$service = trans('_vorlagen.aufpreis_option');
|
||||
$this->option = "";
|
||||
$service = $this->replaceService($service);
|
||||
|
||||
if($travel_discount['price'] > 0){
|
||||
$travel_discount['price'] = $travel_discount['price']*-1;
|
||||
}
|
||||
$price_info_travel_options[] = [
|
||||
'booking_id' => $data['booking_id'],
|
||||
'travel_program_id' => $data['travel_program_id'],
|
||||
'fewo_lodging_id' => null,
|
||||
'travel_class_id' => null,
|
||||
'draft_item_id' => null,
|
||||
'draft_type_id' => 42,
|
||||
'request_date' => $data['request_date'],
|
||||
'days_start' => null,
|
||||
'days_duration' => null,
|
||||
'start_date' => null,
|
||||
'end_date' => null,
|
||||
'service' => $service,
|
||||
'price_adult' => $travel_discount['price'],
|
||||
'adult' => $travel_discount['count'],
|
||||
'price_children' => 0,
|
||||
'children' => 0,
|
||||
'pos' => 0,
|
||||
'in_pdf' => true,
|
||||
'comfort' => $data['comfort']
|
||||
];
|
||||
}
|
||||
|
||||
$info_texts = [];
|
||||
$last_post = 0;
|
||||
foreach ($draft->draft_items as $draft_item){
|
||||
|
|
@ -522,6 +557,15 @@ class DraftController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
//set travel discount prices
|
||||
if(count($price_info_travel_discounts)){
|
||||
foreach ($price_info_travel_discounts as $price_info_travel_discount){
|
||||
$last_post ++;
|
||||
$price_info_travel_option['pos'] = $last_post;
|
||||
BookingDraftItem::create($price_info_travel_option);
|
||||
}
|
||||
}
|
||||
|
||||
//set travel options prices
|
||||
if(count($info_texts)){
|
||||
foreach ($info_texts as $info_text){
|
||||
|
|
|
|||
|
|
@ -50,12 +50,20 @@ class CMSContentController extends Controller
|
|||
return back()->withErrors($validator);
|
||||
}
|
||||
|
||||
if($data['id'] == "new"){
|
||||
if($data['id'] === "new"){
|
||||
CMSContent::create($data);
|
||||
//store in cms old Datebase
|
||||
\App\Models\Sym\CmsContent::create($data);
|
||||
}else{
|
||||
|
||||
$model = CMSContent::find($data['id']);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
|
||||
$m = \App\Models\Sym\CmsContent::find($data['id']);
|
||||
$m->fill($data);
|
||||
$m->save();
|
||||
|
||||
}
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('cms_content_all'));
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@ class CMSContentCountryController extends Controller
|
|||
{
|
||||
|
||||
$data = Input::all();
|
||||
|
||||
if(!isset($data['contact_lands'])){
|
||||
$data['contact_lands'] = null;
|
||||
}
|
||||
$model = TravelCountry::findOrFail($id);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
|
|
|
|||
|
|
@ -151,12 +151,15 @@ class DraftController extends Controller
|
|||
'name' => $data['name'],
|
||||
'active' => isset($data['active']) ? true : false,
|
||||
'color' => $data['color'],
|
||||
'pos' => $data['pos'],
|
||||
]);
|
||||
}else{
|
||||
$draft_type = DraftType::find($data['id']);
|
||||
$draft_type->name = $data['name'];
|
||||
$draft_type->active = isset($data['active']) ? true : false;
|
||||
$draft_type->color = $data['color'];
|
||||
$draft_type->pos = $data['pos'];
|
||||
|
||||
|
||||
$draft_type->save();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ class HomeController extends Controller
|
|||
|
||||
public function checkLogin($identify, $token, $show = false)
|
||||
{
|
||||
|
||||
if($identify){
|
||||
//user find by $identify
|
||||
$user = User::where('identify', '=', $identify)->first();
|
||||
|
|
@ -83,9 +84,11 @@ class HomeController extends Controller
|
|||
return abort(404);
|
||||
|
||||
}
|
||||
|
||||
if($sf_guard_user->token != $token){
|
||||
return abort(404);
|
||||
}
|
||||
|
||||
$time = Carbon::parse($sf_guard_user->token_at);
|
||||
$now = Carbon::now();
|
||||
$duration = $time->diffInSeconds($now);
|
||||
|
|
@ -123,6 +126,10 @@ class HomeController extends Controller
|
|||
if($show == 'travel_country'){
|
||||
return redirect(route('admin_settings_travel_country'));
|
||||
}
|
||||
if($show == 'cms_content_country'){
|
||||
return redirect(route('cms_content_country'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -201,9 +201,16 @@ class TravelUserBookingFewoController extends Controller
|
|||
})
|
||||
->addColumn('is_calendar', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
$back = "";
|
||||
$back .= $travel_user_booking_fewo->is_calendar_fewo_direct ? ' <span class="badge badge-pill badge-success"><i class="far fa-check"></i></span>' : ' <span class="badge badge-pill badge-danger"><i class="far fa-times"></i></span>';
|
||||
$back .= $travel_user_booking_fewo->is_calendar_hrs ? ' <span class="badge badge-pill badge-success"><i class="far fa-check"></i></span>' : ' <span class="badge badge-pill badge-danger"><i class="far fa-times"></i></span>';
|
||||
$back .= $travel_user_booking_fewo->is_calendar_stern_tours ? ' <span class="badge badge-pill badge-success"><i class="far fa-check"></i></span>' : ' <span class="badge badge-pill badge-danger"><i class="far fa-times"></i></span>';
|
||||
$back .= get_active_badge($travel_user_booking_fewo->is_calendar_fewo_direct, "FEWO Direkt")." ";
|
||||
$back .= get_active_badge($travel_user_booking_fewo->is_calendar_hrs, "HRS")." ";
|
||||
$back .= get_active_badge($travel_user_booking_fewo->is_calendar_stern_tours, "STERN TOURS");
|
||||
return $back;
|
||||
})
|
||||
->addColumn('is_mail', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
$back = "";
|
||||
$back .= get_active_badge($travel_user_booking_fewo->isSendUserMail(), "Mietbestätigung")." ";
|
||||
$back .= get_active_badge($travel_user_booking_fewo->isSendInfoMail(), "Anrreiseinfo")." ";
|
||||
$back .= get_active_badge($travel_user_booking_fewo->isSendServiceMail(), "Dienstleister Mail");
|
||||
return $back;
|
||||
})
|
||||
->addColumn('status_name', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
|
|
@ -212,7 +219,7 @@ class TravelUserBookingFewoController extends Controller
|
|||
->addColumn('action_delete', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
return '<a href="' . route('travel_user_booking_fewo_delete', [$travel_user_booking_fewo->id]) . '" class="btn icon-btn btn-sm btn-danger" onclick="return confirm(\''.__('Really delete entry?').'\');"><span class="far fa-trash"></span></a>';
|
||||
})
|
||||
->rawColumns(['action_edit', 'fewo_lodging', 'travel_user', 'is_calendar', 'action_delete'])
|
||||
->rawColumns(['action_edit', 'fewo_lodging', 'travel_user', 'is_calendar', 'is_mail', 'action_delete'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue