diff --git a/.idea/dataSources/09ce12d1-7f68-4ce4-9ab1-0229d6366fdb.xml b/.idea/dataSources/09ce12d1-7f68-4ce4-9ab1-0229d6366fdb.xml index 1d2a998..301c213 100644 --- a/.idea/dataSources/09ce12d1-7f68-4ce4-9ab1-0229d6366fdb.xml +++ b/.idea/dataSources/09ce12d1-7f68-4ce4-9ab1-0229d6366fdb.xml @@ -1,6 +1,6 @@ - + 5.7.25 InnoDB @@ -24,7 +24,6 @@ utf8_general_ci - 1 utf8_general_ci @@ -62,7 +61,6 @@ 1 utf8_general_ci - 1 utf8_general_ci diff --git a/.idea/dataSources/f7aaeef3-b8e1-45ca-9f6a-b9476048d5dd.xml b/.idea/dataSources/f7aaeef3-b8e1-45ca-9f6a-b9476048d5dd.xml index 1f60dea..0ef0fde 100644 --- a/.idea/dataSources/f7aaeef3-b8e1-45ca-9f6a-b9476048d5dd.xml +++ b/.idea/dataSources/f7aaeef3-b8e1-45ca-9f6a-b9476048d5dd.xml @@ -1,6 +1,6 @@ - + 5.6.39 InnoDB @@ -10,11 +10,9 @@ 1 latin1_swedish_ci - 1 utf8_general_ci - 1 latin1_swedish_ci diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 61d0d10..1fd68ae 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,6 +2,7 @@ + @@ -12,12 +13,29 @@ + + + - - - + + + + + + + + + + + + + + + + + @@ -61,6 +79,12 @@ + + + + + + + + + + + + + @@ -261,13 +294,11 @@ - - - - - - - + + + + + + + + + + + + + + @@ -467,6 +519,12 @@ + + + + + + diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php index 613d790..4a45a1a 100644 --- a/.phpstorm.meta.php +++ b/.phpstorm.meta.php @@ -5,7 +5,7 @@ namespace PHPSTORM_META { /** * PhpStorm Meta file, to provide autocomplete information for PhpStorm - * Generated on 2019-08-14 12:31:25. + * Generated on 2019-11-05 14:44:36. * * @author Barry vd. Heuvel * @see https://github.com/barryvdh/laravel-ide-helper diff --git a/_ide_helper.php b/_ide_helper.php index d95458c..22c1aa1 100644 --- a/_ide_helper.php +++ b/_ide_helper.php @@ -3,7 +3,7 @@ /** * A helper file for Laravel 5, to provide autocomplete information to your IDE - * Generated for Laravel 5.8.32 on 2019-08-14 12:31:25. + * Generated for Laravel 5.8.32 on 2019-11-05 14:44:35. * * This file should not be included in your code, only analyzed by your IDE! * diff --git a/_ide_helper_models.php b/_ide_helper_models.php index 5e607b5..5467345 100644 --- a/_ide_helper_models.php +++ b/_ide_helper_models.php @@ -92,10 +92,53 @@ namespace App\Models\Sym{ * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry newQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry query() + * @property string|null $contact_headline + * @property string|null $contact_text_1 + * @property string|null $contact_text_2 + * @property string|null $contact_text_3 + * @property string|null $contact_text_4 + * @property string|null $contact_footer + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactFooter($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactHeadline($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactText1($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactText2($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactText3($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactText4($value) */ class TravelCountry extends \Eloquent {} } +namespace App\Models\Sym{ +/** + * App\Models\Sym\CmsContent + * + * @property int $id + * @property string $name + * @property string $slug + * @property string $field + * @property string|null $text + * @property string|null $full_text + * @property int|null $integer + * @property float|null $decimal + * @property string|null $created_at + * @property string|null $updated_at + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent query() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereDecimal($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereField($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereFullText($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereInteger($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereSlug($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereText($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereUpdatedAt($value) + */ + class CmsContent extends \Eloquent {} +} + namespace App\Models\Sym{ /** * App\Models\Sym\ArrangementTemplate @@ -823,6 +866,24 @@ namespace App\Models{ * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry newQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry query() + * @property string|null $slug + * @property string|null $text_before + * @property string|null $text_after + * @property string|null $contact_headline + * @property string|null $contact_text_1 + * @property string|null $contact_text_2 + * @property string|null $contact_text_3 + * @property string|null $contact_text_4 + * @property string|null $contact_footer + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactFooter($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactHeadline($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactText1($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactText2($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactText3($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactText4($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereSlug($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereTextAfter($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereTextBefore($value) */ class TravelCountry extends \Eloquent {} } @@ -1307,6 +1368,8 @@ namespace App\Models{ * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType newQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType query() + * @property int|null $pos + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType wherePos($value) */ class DraftType extends \Eloquent {} } @@ -1397,6 +1460,8 @@ namespace App\Models{ * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUserBookingFewo whereTravelBookingFewoChannelId($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUserBookingFewo whereTravelUserId($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUserBookingFewo whereUpdatedAt($value) + * @property string|null $last_change_at + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUserBookingFewo whereLastChangeAt($value) */ class TravelUserBookingFewo extends \Eloquent {} } diff --git a/app/Http/Controllers/API/DraftController.php b/app/Http/Controllers/API/DraftController.php index b66c369..0f24042 100755 --- a/app/Http/Controllers/API/DraftController.php +++ b/app/Http/Controllers/API/DraftController.php @@ -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){ diff --git a/app/Http/Controllers/CMS/CMSContentController.php b/app/Http/Controllers/CMS/CMSContentController.php index 0787ee6..aa495f3 100755 --- a/app/Http/Controllers/CMS/CMSContentController.php +++ b/app/Http/Controllers/CMS/CMSContentController.php @@ -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')); diff --git a/app/Http/Controllers/CMS/CMSContentCountryController.php b/app/Http/Controllers/CMS/CMSContentCountryController.php index 7f02ba0..0254a7c 100755 --- a/app/Http/Controllers/CMS/CMSContentCountryController.php +++ b/app/Http/Controllers/CMS/CMSContentCountryController.php @@ -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(); diff --git a/app/Http/Controllers/DraftController.php b/app/Http/Controllers/DraftController.php index ec97efd..ff7b94b 100755 --- a/app/Http/Controllers/DraftController.php +++ b/app/Http/Controllers/DraftController.php @@ -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(); } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 382027c..c21e6ea 100755 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -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')); + } + } diff --git a/app/Http/Controllers/TravelUserBookingFewoController.php b/app/Http/Controllers/TravelUserBookingFewoController.php index f5b1ad5..2ef521d 100755 --- a/app/Http/Controllers/TravelUserBookingFewoController.php +++ b/app/Http/Controllers/TravelUserBookingFewoController.php @@ -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 ? ' ' : ' '; - $back .= $travel_user_booking_fewo->is_calendar_hrs ? ' ' : ' '; - $back .= $travel_user_booking_fewo->is_calendar_stern_tours ? ' ' : ' '; + $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 ''; }) - ->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); } diff --git a/app/Models/CMSContent.php b/app/Models/CMSContent.php index ec9420f..7ff2998 100644 --- a/app/Models/CMSContent.php +++ b/app/Models/CMSContent.php @@ -4,7 +4,6 @@ namespace App\Models; use Cviebrock\EloquentSluggable\Sluggable; use Illuminate\Database\Eloquent\Model; - /** * App\Models\CMSContent * diff --git a/app/Models/DraftType.php b/app/Models/DraftType.php index e2aeb2c..6ace5b6 100644 --- a/app/Models/DraftType.php +++ b/app/Models/DraftType.php @@ -24,6 +24,8 @@ use Illuminate\Database\Eloquent\Model; * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType newQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType query() + * @property int|null $pos + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType wherePos($value) */ class DraftType extends Model { @@ -32,7 +34,7 @@ class DraftType extends Model protected $table = 'draft_types'; protected $fillable = [ - 'name', 'active', 'color', + 'name', 'active', 'color', 'pos' ]; public function draft_items() diff --git a/app/Models/Sym/CmsContent.php b/app/Models/Sym/CmsContent.php new file mode 100644 index 0000000..a483afa --- /dev/null +++ b/app/Models/Sym/CmsContent.php @@ -0,0 +1,88 @@ + [ + 'source' => 'name' + ] + ]; + } + + public function _format_number($value){ + return preg_replace("/[^0-9,]/", "", $value); + } + + public function setDecimalAttribute($value) + { + $value = $this->_format_number($value); + $value = substr($value, -13); + $this->attributes['decimal'] = floatval(str_replace(',', '.', $value)); + } + + public function getDecimalAttribute() + { + if(isset($this->attributes['decimal'])){ + // 2 = decimal places | '.' = decimal seperator | ',' = thousand seperator + return number_format(($this->attributes['decimal']), 2, ',', '.'); + } + return ""; + } + + public function setIntegerAttribute($value) + { + $value = $this->_format_number($value); + $value = substr($value, -10); + $this->attributes['integer'] = intval($value); + } + +} diff --git a/app/Models/Sym/TravelCountry.php b/app/Models/Sym/TravelCountry.php index 8297170..e614ec4 100644 --- a/app/Models/Sym/TravelCountry.php +++ b/app/Models/Sym/TravelCountry.php @@ -20,6 +20,18 @@ use Illuminate\Database\Eloquent\Model; * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry newQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry query() + * @property string|null $contact_headline + * @property string|null $contact_text_1 + * @property string|null $contact_text_2 + * @property string|null $contact_text_3 + * @property string|null $contact_text_4 + * @property string|null $contact_footer + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactFooter($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactHeadline($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactText1($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactText2($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactText3($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactText4($value) */ class TravelCountry extends Model { @@ -32,6 +44,7 @@ class TravelCountry extends Model 'name', 'is_customer_country', 'active_backend', + 'contact_lands', 'contact_headline', 'contact_text_1', 'contact_text_2', @@ -41,6 +54,9 @@ class TravelCountry extends Model ]; + protected $casts = ['contact_lands' => 'array']; + + public $timestamps = false; diff --git a/app/Models/TravelCountry.php b/app/Models/TravelCountry.php index 3776fb7..8514f0e 100644 --- a/app/Models/TravelCountry.php +++ b/app/Models/TravelCountry.php @@ -37,6 +37,24 @@ use Illuminate\Support\Str; * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry newQuery() * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry query() + * @property string|null $slug + * @property string|null $text_before + * @property string|null $text_after + * @property string|null $contact_headline + * @property string|null $contact_text_1 + * @property string|null $contact_text_2 + * @property string|null $contact_text_3 + * @property string|null $contact_text_4 + * @property string|null $contact_footer + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactFooter($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactHeadline($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactText1($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactText2($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactText3($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactText4($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereSlug($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereTextAfter($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereTextBefore($value) */ class TravelCountry extends Model { @@ -52,6 +70,7 @@ class TravelCountry extends Model 'html_information', 'text_before', 'text_after', + 'contact_lands', 'contact_headline', 'contact_text_1', 'contact_text_2', @@ -65,6 +84,9 @@ class TravelCountry extends Model ]; + protected $casts = ['contact_lands' => 'array']; + + public $timestamps = false; public function travel_program_country() diff --git a/app/Models/TravelUserBookingFewo.php b/app/Models/TravelUserBookingFewo.php index cbe74df..db7e971 100644 --- a/app/Models/TravelUserBookingFewo.php +++ b/app/Models/TravelUserBookingFewo.php @@ -96,6 +96,8 @@ use App\Services\Util; * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUserBookingFewo whereTravelBookingFewoChannelId($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUserBookingFewo whereTravelUserId($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUserBookingFewo whereUpdatedAt($value) + * @property string|null $last_change_at + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUserBookingFewo whereLastChangeAt($value) */ class TravelUserBookingFewo extends Model { @@ -670,4 +672,27 @@ class TravelUserBookingFewo extends Model $this->travel_user->first_name." ".$this->travel_user->last_name." | ".$this->from_date." - ".$this->to_date." | ".$this->adults." + ".$this->children." (Erwachsene + Kinder)"; } + public function isSendUserMail(){ + if($this->send_user_mail != NULL){ + return true; + } + return false; + } + + public function isSendInfoMail(){ + if($this->send_info_mail != NULL){ + return true; + } + return false; + } + + public function isSendServiceMail(){ + if($this->send_service_mail != NULL){ + return true; + } + return false; + } + + + } diff --git a/app/Services/HTMLHelper.php b/app/Services/HTMLHelper.php index bab2157..3f0eca2 100644 --- a/app/Services/HTMLHelper.php +++ b/app/Services/HTMLHelper.php @@ -121,7 +121,7 @@ class HTMLHelper } public static function getDraftTypes($setId = false){ - $options = DraftType::all()->sortByDesc('id'); + $options = DraftType::all()->sortByDesc('id')->sortByDesc('pos'); $ret = ""; foreach ($options as $option){ $attr = ($option->id == $setId) ? 'selected="selected"' : ''; @@ -165,17 +165,23 @@ class HTMLHelper } public static function getTravelCountriesOptions($countryId = false){ + + $checked = []; + if($countryId){ + !is_array($countryId) ? $checked = array($countryId) : $checked = $countryId; + } + $options = TravelCountry::where('active_backend',1)->get(); $ret = ''; foreach ($options as $option){ - $attr = ($option->crm_id === $countryId) ? 'selected="selected"' : ''; + $attr = (in_array($option->crm_id, $checked)) ? 'selected="selected"' : ''; $ret .= '\n'; } return $ret; } - public static function getTravelUserOptions($id = false){ - $options = TravelUser::all(); + public static function getTravelUserOptions($id = false, $order = "ASC"){ + $options = TravelUser::orderBy('id', $order)->get(); $ret = ''; foreach ($options as $option){ $attr = ($option->id === $id) ? 'selected="selected"' : ''; diff --git a/app/Services/Util.php b/app/Services/Util.php index b6fc714..7142b43 100644 --- a/app/Services/Util.php +++ b/app/Services/Util.php @@ -35,8 +35,12 @@ class Util } public static function _clean_float($value){ - $groups = explode(".", preg_replace("/[^0-9.]/", "", str_replace(',', '.', $value))); - $lastGroup = array_pop($groups); + + $groups = explode(".", preg_replace("/[^0-9.-]/", "", str_replace(',', '.', $value))); + $lastGroup = 0; + if(count($groups) > 1){ + $lastGroup = array_pop($groups); + } $number = implode('', $groups); return (strlen($lastGroup) < 3) ? floatval($number.'.'.$lastGroup) : floatval($number.$lastGroup); } diff --git a/app/helpers.php b/app/helpers.php index 6171807..427e040 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -46,12 +46,16 @@ if (! function_exists('pre_slug')) { if (! function_exists('get_active_badge')) { - function get_active_badge($active) + function get_active_badge($active, $tooltip = false, $pos = "top") { - return $active ? '' : ''; + if($tooltip){ + $tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.$tooltip.'"'; + } + return $active ? '' : ''; } } + if (! function_exists('get_switcher_input')) { function get_switcher_input($active = false, $name = "", $label = "") { diff --git a/database/migrations/2018_10_19_114519_create_draft_types_table.php b/database/migrations/2018_10_19_114519_create_draft_types_table.php index c71b29e..5342612 100644 --- a/database/migrations/2018_10_19_114519_create_draft_types_table.php +++ b/database/migrations/2018_10_19_114519_create_draft_types_table.php @@ -18,6 +18,7 @@ class CreateDraftTypesTable extends Migration $table->string('name'); $table->string('color', 10)->nullable(); $table->boolean('active')->default(true); + $table->unsignedTinyInteger('pos')->default(0); $table->timestamps(); }); diff --git a/database/migrations/2018_10_29_193339_create_travel_country_table.php b/database/migrations/2018_10_29_193339_create_travel_country_table.php index 4b5723e..d6cc99e 100644 --- a/database/migrations/2018_10_29_193339_create_travel_country_table.php +++ b/database/migrations/2018_10_29_193339_create_travel_country_table.php @@ -27,6 +27,7 @@ class CreateTravelCountryTable extends Migration $table->string('text_before')->nullable(); $table->string('text_after')->nullable(); + $table->string('contact_lands')->nullable(); $table->string('contact_headline')->nullable(); $table->text('contact_text_1')->nullable(); $table->text('contact_text_2')->nullable(); diff --git a/resources/lang/de/_vorlagen.php b/resources/lang/de/_vorlagen.php index 5f67c43..4e89f7a 100755 --- a/resources/lang/de/_vorlagen.php +++ b/resources/lang/de/_vorlagen.php @@ -5,4 +5,5 @@ 'aufpreis_kategorie' => 'pro Person: #Kategorie#', 'aufpreis_flug' => 'Aufschlag für Abfahrts-/Abflugort pro Person: ab #Flughafen#', 'aufpreis_option' => 'pro Person: #Option#', + 'rabatt' => 'Rabatt', ); \ No newline at end of file diff --git a/resources/views/booking/detail.blade.php b/resources/views/booking/detail.blade.php index 7ec7736..03aeb2c 100755 --- a/resources/views/booking/detail.blade.php +++ b/resources/views/booking/detail.blade.php @@ -117,7 +117,7 @@ {{ Form::text('draft_item['.$booking_draft_item->id.'][end_date]', $booking_draft_item->end_date, array('placeholder'=>__('End Datum'), 'class'=>'form-control datepicker-base', 'id'=>'draft_item_'.$booking_draft_item->id.'_end_date')) }} - @if(in_array($booking_draft_item->draft_type_id, [24, 26, 30, 31, 32, 33, 34, 35, 36, 37, 41])) + @if(in_array($booking_draft_item->draft_type_id, [24, 26, 30, 31, 32, 33, 34, 35, 36, 37, 41, 42]))
+ {!! HTMLHelper::getTravelCountriesOptions($model->contact_lands) !!} + + Land/Länder müssen angeben sein, die Kontaktdaten des Landes (Reiselandes) werden nacheinander im PDF (RA, RB, Voucher) eingefügt. +
+ +
+

Kontaktdaten

diff --git a/resources/views/drafts/index.blade.php b/resources/views/drafts/index.blade.php index dd405d4..3261c08 100755 --- a/resources/views/drafts/index.blade.php +++ b/resources/views/drafts/index.blade.php @@ -79,6 +79,7 @@   + {{__('POS')}} {{__('Name')}} {{__('Farbe')}} {{__('sichtbar')}} @@ -93,12 +94,14 @@ data-id="{{ $value->id }}" data-name="{{ $value->name }}" data-color="{{ $value->color }}" - data-active="{{ $value->active }}"> + data-active="{{ $value->active }}" + data-pos="{{ $value->pos }}"> - {{ $value->name }} + {{ $value->pos }} + {{ $value->name }} @if($value->color)
{{ $value->color }} @@ -124,6 +127,7 @@ data-id="new" data-name="" data-active="1" + data-pos="0" >Neuen Typ anlegen @@ -147,6 +151,12 @@ +
+
+ + +
+
@@ -155,8 +165,6 @@
- -
@@ -213,28 +213,26 @@
@endif - @if($travel_user_booking_fewo->isInvoice()) - @if($travel_user_booking_fewo->send_user_mail) - - - @foreach($travel_user_booking_fewo->send_user_mail as $send_user_mail) - - - - - @endforeach - -
{!! key($send_user_mail) !!}
E-Mail versendet.
{!! nl2br(current($send_user_mail)) !!}
- @endif -
-
- {{ Form::textarea('send_mail_user_notice', '', ['placeholder'=>'Wichtige Hinweise in E-Mail, werden nur in die aktuelle E-Mail übernommen', 'class' => 'form-control autoExpand', 'rows'=>1]) }} -
-
-
-   -
+ @if($travel_user_booking_fewo->send_user_mail) + + + @foreach($travel_user_booking_fewo->send_user_mail as $send_user_mail) + + + + + @endforeach + +
{!! key($send_user_mail) !!}
E-Mail versendet.
{!! nl2br(current($send_user_mail)) !!}
@endif +
+
+ {{ Form::textarea('send_mail_user_notice', '', ['placeholder'=>'Wichtige Hinweise in E-Mail, werden nur in die aktuelle E-Mail übernommen', 'class' => 'form-control autoExpand', 'rows'=>1]) }} +
+
+
+   +
@@ -258,36 +256,34 @@ @endif -
-
- -
- {{ Form::textarea('info_mail_text', $travel_user_booking_fewo->info_mail_text, ['class' => 'form-control autoExpand', 'rows'=>1, 'id'=>'travel_info_user_text']) }} - Grundtext in ADMIN CMS > Inhalte > PDF Vorlage Anreiseinfo FeWo - (Änderungen werden hier gespeichert.) +
+
+ +
+ {{ Form::textarea('info_mail_text', $travel_user_booking_fewo->info_mail_text, ['class' => 'form-control autoExpand', 'rows'=>1, 'id'=>'travel_info_user_text']) }} + Grundtext in ADMIN CMS > Inhalte > PDF Vorlage Anreiseinfo FeWo + (Änderungen werden hier gespeichert.) -
- @if($travel_user_booking_fewo->isTravelInfo()) - @if($travel_user_booking_fewo->send_info_mail) - - - @foreach($travel_user_booking_fewo->send_info_mail as $send_info_mail) - - - - - @endforeach - -
{!! key($send_info_mail) !!}
E-Mail versendet.
{!! nl2br(current($send_info_mail)) !!}
- @endif -
-   -
+
+ @if($travel_user_booking_fewo->send_info_mail) + + + @foreach($travel_user_booking_fewo->send_info_mail as $send_info_mail) + + + + + @endforeach + +
{!! key($send_info_mail) !!}
E-Mail versendet.
{!! nl2br(current($send_info_mail)) !!}
@endif +
+   +
@endif diff --git a/resources/views/travel/user/booking/index.blade.php b/resources/views/travel/user/booking/index.blade.php index 25dc01a..d667150 100755 --- a/resources/views/travel/user/booking/index.blade.php +++ b/resources/views/travel/user/booking/index.blade.php @@ -20,6 +20,7 @@ {{__('vom')}} {{__('bis')}} {{__('Eingetragen')}} + {{__('Mails')}} {{__('Status')}} {{__('Datum')}} {{__('R.-Nr.')}} @@ -48,6 +49,7 @@ { data: 'from_date', name: 'from_date' }, { data: 'to_date', name: 'to_date' }, { data: 'is_calendar', name: 'is_calendar', orderable: false }, + { data: 'is_mail', name: 'is_mail', orderable: false }, { data: 'status_name', name: 'status_name' }, { data: 'booking_date', name: 'booking_date' }, { data: 'invoice_number', name: 'invoice_number' }, @@ -88,6 +90,7 @@ $('.selectpicker').selectpicker(); }*/ }); + $('#datatables-default').tooltip({selector: '[data-toggle="tooltip"]'}); }); diff --git a/storage/app/fewo/invoices/2019/9538.pdf b/storage/app/fewo/invoices/2019/9538.pdf new file mode 100644 index 0000000..f9b36ae Binary files /dev/null and b/storage/app/fewo/invoices/2019/9538.pdf differ