diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3fb632e..c4711f0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,15 @@ - - - - + + + + + + + + + @@ -25,71 +30,50 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + - + + + + - - + + - + - + + - + + + @@ -139,15 +123,24 @@ + + + + - - + + + - - + + + + + + - - - - - + + + + + + - @@ -743,6 +737,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -793,15 +808,31 @@ - + - + + + + + + + + + + + + + + + + + @@ -816,18 +847,19 @@ - - + + - + + - + - + diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php index 7234018..a3bfc43 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 2020-04-16 17:05:54. + * Generated on 2020-04-23 10:42:35. * * @author Barry vd. Heuvel * @see https://github.com/barryvdh/laravel-ide-helper diff --git a/_ide_helper.php b/_ide_helper.php index 287984a..e33edb2 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 6.18.5 on 2020-04-16 17:05:52. + * Generated for Laravel 6.18.5 on 2020-04-23 10:42:32. * * 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 20ce48e..d0e2c01 100644 --- a/_ide_helper_models.php +++ b/_ide_helper_models.php @@ -456,6 +456,8 @@ namespace App\Models{ * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereOriginStartDate($value) * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BookingFile[] $booking_files * @property-read int|null $booking_files_count + * @property float|null $price_balance + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking wherePriceBalance($value) */ class Booking extends \Eloquent {} } @@ -3272,6 +3274,7 @@ namespace App\Models{ * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingFile whereOriginalName($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingFile whereSize($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingFile whereUpdatedAt($value) + * @mixin \Eloquent */ class BookingFile extends \Eloquent {} } diff --git a/app/Http/Controllers/Admin/ReportController.php b/app/Http/Controllers/Admin/ReportController.php index b59c371..9a2b6cc 100755 --- a/app/Http/Controllers/Admin/ReportController.php +++ b/app/Http/Controllers/Admin/ReportController.php @@ -43,7 +43,7 @@ class ReportController extends Controller private function prozessBookingSearch() { - $query = Booking::with( 'customer', 'lead', 'service_provider_entries', 'service_provider_entries.service_provider'); + $query = Booking::with( 'customer', 'lead', 'service_provider_entries', 'service_provider_entries.service_provider')->select('booking.*'); if(Request::get('filter_travel_date_from') != ""){ $travel_date_from = Carbon::parse(Request::get('filter_travel_date_from'))->format("Y-m-d"); @@ -74,6 +74,9 @@ class ReportController extends Controller ->with('price_total_sum', function() use ($query) { return Util::_number_format($query->sum('price')); }) + ->with('price_total_total_sum', function() use ($query) { + return Util::_number_format($query->sum('price_total')); + }) ->with('proceed_total_sum', function() use ($query) { if($query->count() > 200){ return 'max 200 '; @@ -81,7 +84,7 @@ class ReportController extends Controller $all = $query->get(); $proceeds = 0; foreach ($all as $v){ - $proceeds += $v->proceedsRaw(); + $proceeds += $v->proceeds(true); } return Util::_number_format($proceeds); }) @@ -116,8 +119,7 @@ class ReportController extends Controller return $ret === "" ? "-" : $ret; }) ->addColumn('lead.status_id', function (Booking $booking) { - //umbuchen - if($booking->lead->status_id){ + if($booking->lead && $booking->lead->status_id){ $color = $booking->lead->status->color; $icon = ""; if($booking->lead->status_id == 14 && $booking->lead->is_rebook){ @@ -166,6 +168,7 @@ class ReportController extends Controller 'BuchungsID', 'Status', 'MyJack Nr.', + 'Organisation', 'Reisepreis', 'Erlös', 'Kunde', @@ -182,6 +185,7 @@ class ReportController extends Controller 'abgeschlossen', ); $total_price = 0; + $total_price_total = 0; $total_proceeds = 0; $total_amount_final = 0; @@ -191,14 +195,16 @@ class ReportController extends Controller foreach ($export->service_provider_entries as $service_provider_entry){ if($new){ $total_price += $export->getPriceRaw(); - $total_proceeds += $export->proceedsRaw(); + $total_price_total += $export->getPriceTotalRaw(); + $total_proceeds += $export->proceeds(true); } $total_amount_final += $service_provider_entry->getAmountFinalEurRaw(); $columns[] = array( 'BuchungsID' => $new ? $export->id : "", 'Status' => $new ? $export->lead->status->name : "", 'MyJack Nr.' => $new ? $export->merlin_order_number : "", - 'Reisepreis' => $new ? $export->price : "", + 'Organisation' => $new ? $export->price : "", + 'Reisepreis' => $new ? $export->price_total : "", 'Erlös' => $new ? $export->proceeds() : "", 'Kunde' => $new ? $export->customer->fullName() : "", 'Reisedatum' => $new ? $export->getStartDateFormat() : "", @@ -222,7 +228,8 @@ class ReportController extends Controller 'BuchungsID' => $export->id, 'Status' => $export->lead->status->name, 'MyJack Nr.' => $export->merlin_order_number, - 'Reisepreis' => $export->price, + 'Organisation' => $export->price, + 'Reisepreis' => $export->price_total, 'Erlös' => $export->proceeds(), 'Kunde' => $export->customer->fullName(), 'Reisedatum' => $export->getStartDateFormat(), @@ -244,7 +251,8 @@ class ReportController extends Controller 'BuchungsID' => "Total", 'Status' => "", 'MyJack Nr.' => "", - 'Reisepreis' => Util::_number_format($total_price), + 'Organisation' => Util::_number_format($total_price), + 'Reisepreis' => Util::_number_format($total_price_total), 'Erlös' => Util::_number_format($total_proceeds), 'Kunde' => "", 'Reisedatum' => "", @@ -266,7 +274,7 @@ class ReportController extends Controller private function prozessProvidersSearch(){ - $query = ServiceProviderEntry::with('booking', 'service_provider', 'booking.customer'); + $query = ServiceProviderEntry::with('booking', 'service_provider', 'booking.customer')->select('service_provider_entry.*'); if(Request::get('filter_is_cleared') != ""){ $query->where('is_cleared', '=', Request::get('filter_is_cleared')); } @@ -299,11 +307,24 @@ class ReportController extends Controller if($query->count() > 200){ return 'max 200 '; } + $all = $query->get(); + $price = 0; + $isset = []; + foreach ($all as $v){ + $price += in_array($v->booking->lead_id, $isset) ? 0 : $v->booking->getPriceRaw(); + $isset[] = $v->booking->lead_id; + } + return Util::_number_format($price); + }) + ->with('price_total_total_sum', function() use ($query) { + if($query->count() > 200){ + return 'max 200 '; + } $all = $query->get(); $price = 0; $isset = []; foreach ($all as $v){ - $price += in_array($v->booking->lead_id, $isset) ? 0 : $v->booking->getPriceRaw(); + $price += in_array($v->booking->lead_id, $isset) ? 0 : $v->booking->getPriceTotalRaw(); $isset[] = $v->booking->lead_id; } return Util::_number_format($price); @@ -316,14 +337,14 @@ class ReportController extends Controller $proceeds = 0; $isset = []; foreach ($all as $v){ - $proceeds += in_array($v->booking->lead_id, $isset) ? 0 : $v->booking->proceedsRaw(); + $proceeds += in_array($v->booking->lead_id, $isset) ? 0 : $v->booking->proceeds(true); $isset[] = $v->booking->lead_id; } return Util::_number_format($proceeds); /*$all = $query->get(); $proceeds = 0; foreach ($all as $v){ - $proceeds += $v->proceedsRaw(); + $proceeds += $v->proceeds(true); } return Util::_number_format($proceeds);*/ }) @@ -384,6 +405,7 @@ class ReportController extends Controller 'CRM Nr', 'Kunde', 'Reisedatum', + 'Organisation', 'Gesamtreisepreis', 'Reiseland', 'Reiseprogramm', @@ -397,13 +419,15 @@ class ReportController extends Controller ); $isset = []; $total_price = 0; + $total_price_total = 0; $total_amount_final = 0; $total_proceeds = 0; foreach($exports as $export) { $new = in_array($export->booking->lead_id, $isset) ? false : true; if($new){ $total_price += $export->booking->getPriceRaw(); - $total_proceeds += $export->booking->proceedsRaw(); + $total_price_total += $export->booking->getPriceTotalRaw(); + $total_proceeds += $export->booking->proceeds(true); } $total_amount_final += $export->getAmountFinalEurRaw(); $columns[] = array( @@ -412,7 +436,8 @@ class ReportController extends Controller 'CRM Nr' => $new ? $export->booking->lead_id : "", 'Kunde' => $new ? $export->booking->customer->name : "", 'Reisedatum' => $new ? $export->booking->getStartDateFormat() : "", - 'Gesamtreisepreis' => $new ? $export->booking->price : "", + 'Organisation' => $new ? $export->booking->price : "", + 'Gesamtreisepreis' => $new ? $export->booking->price_total : "", 'Reiseland' => $new ? $export->booking->travel_country->name : "", 'Reiseprogramm' => $new ? $export->booking->travel_agenda->name : "", 'Reiseteilnehmer' => $new ? $export->booking->pax : "", @@ -431,7 +456,8 @@ class ReportController extends Controller 'CRM Nr' => "", 'Kunde' =>"", 'Reisedatum' => "", - 'Gesamtreisepreis' => Util::_number_format($total_price), + 'Organisation' => Util::_number_format($total_price), + 'Gesamtreisepreis' => Util::_number_format($total_price_total), 'Reiseland' => "", 'Reiseprogramm' => "", 'Reiseteilnehmer' => "", @@ -466,7 +492,7 @@ class ReportController extends Controller foreach($exports as $export) { $new = in_array($export->booking->lead_id, $isset) ? false : true; if($new) { - $payments_total += $export->booking->getServiceProviderPaymentsTotalRaw(); + $payments_total += $export->booking->getServiceProviderPaymentsTotal(true); } $total_amount_final += $export->getAmountFinalEurRaw(); $columns[] = array( diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index bdcb310..2a672d4 100755 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -203,7 +203,6 @@ class BookingController extends Controller $ret = CustomerMailRepository::loadModal($data); } - if($data['action'] === "modal-upload-booking-file") { $ret = view("booking.upload_modal", compact('data'))->render(); } diff --git a/app/Http/Controllers/CMS/CMSContentCountryController.php b/app/Http/Controllers/CMS/CMSContentCountryController.php deleted file mode 100755 index 9c79464..0000000 --- a/app/Http/Controllers/CMS/CMSContentCountryController.php +++ /dev/null @@ -1,86 +0,0 @@ -middleware('admin'); - - } - - public function index($step = false) - { - $data = [ - 'travel_countries' => TravelCountry::all(), - ]; - return view('cms.content.country.index', $data); - } - - public function detail($id, $step = false) - { - $model = TravelCountry::findOrFail($id); - $id = $model->id; - - $data = [ - 'model' => $model, - 'id' => $id, - 'step' => $step, - 'travel_nationalities' => TravelNationality::where('active', true)->get(), - ]; - return view('cms.content.country.detail', $data); - } - - - - public function store($id) - { - - $data = Request::all(); - if(isset($data['contact_emails'])){ - $data['contact_emails'] = explode('#', str_replace(array("\r\n", "\r", "\n"),"#",$data['contact_emails'])); - }else{ - $data['contact_emails'] = null; - } - if(!isset($data['contact_lands'])){ - $data['contact_lands'] = null; - } - $model = TravelCountry::findOrFail($id); - $model->fill($data); - $model->save(); - - //travel_nationality_requirement - if (isset($data['travel_nationality_requirement'])) { - foreach ($data['travel_nationality_requirement'] as $travel_nationality_id => $text) { - $model->setNationalityRequirement($travel_nationality_id, $text); - } - } - - //TODO for this time - if ($data['action'] == 'contact') { - //we need an update in the old CRM v1 system DB - $tc = \App\Models\Sym\TravelCountry::findOrFail($model->crm_id); - $tc->fill($data); - $tc->save(); - } - \Session()->flash('alert-save', '1'); - return redirect(route('cms_content_country_detail', [$model->id, $data['action']])); - } - -} diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index a9ad289..0d06912 100755 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -62,7 +62,7 @@ class CustomerController extends Controller public function getCustomers() { - $query = Customer::with('salutation'); + $query = Customer::with('salutation')->select('customer.*'); return \DataTables::eloquent($query) ->addColumn('action_edit', function (Customer $customer) { diff --git a/app/Http/Controllers/CustomerMailController.php b/app/Http/Controllers/CustomerMailController.php index 15c00e0..5747072 100755 --- a/app/Http/Controllers/CustomerMailController.php +++ b/app/Http/Controllers/CustomerMailController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers; use App\Models\Customer; use App\Models\CustomerFile; use App\Models\CustomerMail; +use App\Models\EmailTemplate; use App\Repositories\CustomerMailRepository; use App\Repositories\CustomerFileRepository; use App\Services\Util; @@ -136,7 +137,7 @@ class CustomerMailController extends Controller public function getCustomerMails() { - $query = CustomerMail::with('booking')->with('customer'); + $query = CustomerMail::with('booking')->with('customer')->select('customer_mails.*'); return \DataTables::eloquent($query) ->addColumn('action_edit', function (CustomerMail $customer_mail) { @@ -183,6 +184,37 @@ class CustomerMailController extends Controller ->make(true); } + public function getEmailTemplates() + { + $query = EmailTemplate::where('active', '=', true); + + return \DataTables::eloquent($query) + ->addColumn('action', function (EmailTemplate $emailTemplate) { + return ''; + }) + ->orderColumn('id', 'id $1') + ->orderColumn('subject', 'subject $1') + ->orderColumn('message', 'message $1') + ->filterColumn('id', function($query, $keyword) { + if($keyword != ""){ + $query->where('id', 'LIKE', '%'.$keyword.'%'); + } + }) + ->filterColumn('subject', function($query, $keyword) { + if($keyword != ""){ + $query->where('subject', 'LIKE', '%'.$keyword.'%'); + $query->OrWhere('message', 'LIKE', '%'.$keyword.'%'); + + } + }) + ->rawColumns(['action']) + ->make(true); + } + + + public function uploadAttachment($id){ $fileRepo = new CustomerFileRepository(new CustomerFile()); @@ -212,6 +244,20 @@ class CustomerMailController extends Controller $customer_mail->save(); $status = 'success'; } + if($data['action'] === 'load_email_template'){ + $email_template = EmailTemplate::find($data['id']); + $ret = $email_template->message; + $data['subject'] = $email_template->subject; + $status = 'success'; + } + if($data['action'] === 'delete_mail_attachment'){ + $customer_file = CustomerFile::find($data['id']); + $fileRepo = new CustomerFileRepository($customer_file); + $fileRepo->_set('disk', 'customer'); + $ret = $fileRepo->delete(); + $status = 'success'; + } + if($data['action'] === 'add_attachment'){ $arrContextOptions=array( "ssl"=>array( @@ -219,10 +265,7 @@ class CustomerMailController extends Controller "verify_peer_name"=>false, ), ); - $contents = file_get_contents($data['target'], false, stream_context_create($arrContextOptions)); - - $mine = Util::getMimeFromHeader($http_response_header); $extension = Util::getExtensionFromMime($mine); $fileRepo = new CustomerFileRepository(new CustomerFile()); @@ -234,7 +277,6 @@ class CustomerMailController extends Controller $fileRepo->_set('originalName', $data['name']); $fileRepo->_set('mine', $mine); $fileRepo->_set('extension', $extension); - return $fileRepo->storeFile($contents); } } @@ -246,7 +288,6 @@ class CustomerMailController extends Controller if (!Request::get('booking_id')) { return false; } - $query = CustomerMail::where('booking_id', '=', Request::get('booking_id')); if (Request::get('customer_mail_dir') == 11) { //draft $query->where('draft', '=', true); diff --git a/app/Http/Controllers/LeadController.php b/app/Http/Controllers/LeadController.php index f5808d1..444ecfd 100755 --- a/app/Http/Controllers/LeadController.php +++ b/app/Http/Controllers/LeadController.php @@ -62,7 +62,7 @@ class LeadController extends Controller public function getLeads() { - $query = Lead::with('customer')->with('sf_guard_user')->with('status'); + $query = Lead::with('customer')->with('sf_guard_user')->with('status')->select('lead.*'); return \DataTables::eloquent($query) ->addColumn('action_edit', function (Lead $lead) { diff --git a/app/Http/Controllers/RequestController.php b/app/Http/Controllers/RequestController.php index e5a5865..1cf3944 100755 --- a/app/Http/Controllers/RequestController.php +++ b/app/Http/Controllers/RequestController.php @@ -79,16 +79,17 @@ class RequestController extends Controller */ private function getSearchRequests(){ - $query = Booking::with('lead')->with('customer_mails')->where('lead_id', '!=', NULL); + $query = Booking::with('lead')->with('customer')->with('customer_mails')->select('booking.*')->where('lead_id', '!=', NULL); if(Request::get('full_firstname_search') != ""){ - $query->where('participant_firstname', 'LIKE', '%'.Request::get('full_firstname_search').'%'); - } - + $query->whereHas('customer', function ($q) { + $q->where('firstname', 'LIKE', '%'.Request::get('full_firstname_search').'%'); + }); } if(Request::get('full_lastname_search') != ""){ - $query->where('participant_name', 'LIKE', '%'.Request::get('full_lastname_search').'%'); + $query->whereHas('customer', function ($q) { + $q->where('name', 'LIKE', '%'.Request::get('full_lastname_search').'%'); + }); } - if(Request::get('travel_option_country_id') != ""){ $country_ids = TravelCountry::where('contact_lands', 'LIKE', '%"'.Request::get('travel_option_country_id').'"%')->get()->pluck('id'); $country_ids[] = Request::get('travel_option_country_id'); @@ -261,12 +262,12 @@ class RequestController extends Controller ->addColumn('lead_id', function (Booking $booking) { return ''.$booking->lead_id.''; }) - ->addColumn('participant_firstname', function (Booking $booking) { + /*->addColumn('participant_firstname', function (Booking $booking) { return ''.$booking->participant_firstname.''; }) ->addColumn('participant_name', function (Booking $booking) { return ''.$booking->participant_name.''; - }) + })*/ ->addColumn('id', function (Booking $booking) { return ''.$booking->id.''; }) diff --git a/app/Http/Controllers/Settings/AirlineController.php b/app/Http/Controllers/Settings/AirlineController.php index 2b13734..de94c03 100755 --- a/app/Http/Controllers/Settings/AirlineController.php +++ b/app/Http/Controllers/Settings/AirlineController.php @@ -6,6 +6,7 @@ use App\Http\Controllers\Controller; use App\Models\Airline; use App\Models\Booking; +use App\Services\Util; use Request; class AirlineController extends Controller @@ -28,11 +29,10 @@ class AirlineController extends Controller public function update(){ $data = Request::all(); - if(isset($data['contact_emails'])){ - $data['contact_emails'] = explode('#', str_replace(array("\r\n", "\r", "\n"),"#",$data['contact_emails'])); - }else{ - $data['contact_emails'] = null; - } + + + $data['contact_emails'] = isset($data['contact_emails']) ? Util::_explodeLines($data['contact_emails']) : null; + if($data['id'] === "new"){ $model = Airline::create($data); }else{ diff --git a/app/Http/Controllers/Settings/EmailTemplateController.php b/app/Http/Controllers/Settings/EmailTemplateController.php new file mode 100755 index 0000000..15392b9 --- /dev/null +++ b/app/Http/Controllers/Settings/EmailTemplateController.php @@ -0,0 +1,75 @@ +middleware('admin'); + } + + + public function index($step = false) + { + $data = [ + 'email_template' => EmailTemplate::all(), + ]; + return view('settings.email_template.index', $data); + } + + public function load(){ + $data = Request::all(); + $ret = ""; + if(Request::ajax()) { + + if($data['action'] === "modal-email-template") { + if($data['id'] === 'new'){ + $value = new EmailTemplate(); + $value->id = 0; + $value->active = 1; + + }else{ + $value = EmailTemplate::find($data['id']); + + } + $ret = view("settings.email_template.modal", compact('value'))->render(); + } + } + return response()->json(['response' => $data, 'html'=>$ret]); + } + + public function update(){ + + $data = Request::all(); + $data['active'] = isset($data['active']) ? true : false; + + if($data['id'] === "new" || $data['id'] == 0){ + $model = EmailTemplate::create($data); + }else{ + $model = EmailTemplate::find($data['id']); + $model->fill($data); + $model->save(); + } + + \Session()->flash('alert-save', '1'); + return redirect(route('admin_settings_email_template')); + } + + public function delete($id){ + + $model = EmailTemplate::findOrFail($id); + $model->delete(); + \Session()->flash('alert-success', 'Eintrag gelöscht'); + return redirect()->back(); + + } + +} + + diff --git a/app/Http/Controllers/Settings/InsuranceController.php b/app/Http/Controllers/Settings/InsuranceController.php new file mode 100755 index 0000000..6fe168b --- /dev/null +++ b/app/Http/Controllers/Settings/InsuranceController.php @@ -0,0 +1,55 @@ +middleware('admin'); + } + + public function index($step = false) + { + $data = [ + 'insurance' => Insurance::all(), + ]; + return view('settings.insurance.index', $data); + } + + + public function update(){ + + $data = Request::all(); + $data['contact_emails'] = isset($data['contact_emails']) ? Util::_explodeLines($data['contact_emails']) : null; + $data['active'] = isset($data['active']) ? true : false; + + if($data['id'] === "new"){ + $model = Insurance::create($data); + }else{ + $model = Insurance::find($data['id']); + $model->fill($data); + $model->save(); + } + + \Session()->flash('alert-save', '1'); + return redirect(route('admin_settings_insurance')); + } + + public function delete($id){ + $model = Insurance::findOrFail($id); + $model->delete(); + \Session()->flash('alert-success', 'Eintrag gelöscht'); + return redirect()->back(); + + } + +} + + diff --git a/app/Http/Controllers/Settings/ServiceProviderController.php b/app/Http/Controllers/Settings/ServiceProviderController.php new file mode 100755 index 0000000..350060f --- /dev/null +++ b/app/Http/Controllers/Settings/ServiceProviderController.php @@ -0,0 +1,57 @@ +middleware('admin'); + } + + public function index($step = false) + { + $data = [ + 'service_provider' => ServiceProvider::all(), + ]; + return view('settings.service_provider.index', $data); + } + + + public function update(){ + + $data = Request::all(); + $data['contact_emails'] = isset($data['contact_emails']) ? Util::_explodeLines($data['contact_emails']) : null; + $data['active'] = isset($data['active']) ? true : false; + + if($data['id'] === "new"){ + $model = ServiceProvider::create($data); + }else{ + $model = ServiceProvider::find($data['id']); + $model->fill($data); + $model->save(); + } + + \Session()->flash('alert-save', '1'); + return redirect(route('admin_settings_service_provider')); + } + + public function delete($id){ + + abort(404, 'Noch keine Funktion'); + $model = ServiceProvider::findOrFail($id); + $model->delete(); + \Session()->flash('alert-success', 'Eintrag gelöscht'); + return redirect()->back(); + + } + +} + + diff --git a/app/Http/Controllers/Settings/TravelCompanyController.php b/app/Http/Controllers/Settings/TravelCompanyController.php new file mode 100755 index 0000000..856514a --- /dev/null +++ b/app/Http/Controllers/Settings/TravelCompanyController.php @@ -0,0 +1,58 @@ +middleware('admin'); + } + + public function index($step = false) + { + $data = [ + 'travel_company' => TravelCompany::all(), + ]; + return view('settings.travel_company.index', $data); + } + + + public function update(){ + + $data = Request::all(); + $data['contact_emails'] = isset($data['contact_emails']) ? Util::_explodeLines($data['contact_emails']) : null; + $data['active'] = isset($data['active']) ? true : false; + $data['is_allowed_edit_commission'] = isset($data['is_allowed_edit_commission']) ? true : false; + $data['is_inhouse'] = isset($data['is_inhouse']) ? true : false; + if($data['id'] === "new"){ + $model = TravelCompany::create($data); + }else{ + $model = TravelCompany::find($data['id']); + $model->fill($data); + $model->save(); + } + + \Session()->flash('alert-save', '1'); + return redirect(route('admin_settings_travel_company')); + } + + public function delete($id){ + + abort(404, 'Noch keine Funktion'); + $model = TravelCompany::findOrFail($id); + $model->delete(); + \Session()->flash('alert-success', 'Eintrag gelöscht'); + return redirect()->back(); + + } + +} + + diff --git a/app/Http/Controllers/Settings/TravelCountryController.php b/app/Http/Controllers/Settings/TravelCountryController.php index 4012fef..fee0bd8 100755 --- a/app/Http/Controllers/Settings/TravelCountryController.php +++ b/app/Http/Controllers/Settings/TravelCountryController.php @@ -6,13 +6,21 @@ use App\Http\Controllers\Controller; use App\Models\TravelCountry; use App\Models\TravelNationality; +use App\Services\Util; use Request; class TravelCountryController extends Controller { + + + /* + * Create a new controller instance. + * + * @return void + */ public function __construct() { - $this->middleware('admin'); + $this->middleware('admin'); } @@ -24,9 +32,9 @@ class TravelCountryController extends Controller return view('settings.travel_country.index', $data); } - public function detail($id) + public function detail($id, $step = false) { - if($id == "new") { + if($id === "new") { $model = new TravelCountry(); $id = 'new'; $model->active_backend = 1; @@ -34,9 +42,11 @@ class TravelCountryController extends Controller $model = TravelCountry::findOrFail($id); $id = $model->id; } + $data = [ 'model' => $model, 'id' => $id, + 'step' => $step, 'travel_nationalities' => TravelNationality::where('active', true)->get(), ]; return view('settings.travel_country.detail', $data); @@ -44,45 +54,53 @@ class TravelCountryController extends Controller - public function store(){ + public function update($id) + { - $data = Request::all(); - $data['is_customer_country'] = isset($data['is_customer_country']) ? true : false; + $data = Request::all(); + $data['contact_emails'] = isset($data['contact_emails']) ? Util::_explodeLines($data['contact_emails']) : null; + if(!isset($data['contact_lands'])){ + $data['contact_lands'] = null; + } + /* + * $data['is_customer_country'] = isset($data['is_customer_country']) ? true : false; $data['active_frontend'] = isset($data['active_frontend']) ? true : false; $data['active_backend'] = isset($data['active_backend']) ? true : false; + */ + if($id === "new"){ + $data['crm_id'] = 0; + $model = TravelCountry::create($data); + }else{ + $model = TravelCountry::find($id); + $model->fill($data); + $model->save(); + } - if($data['id'] == "new"){ - $data['crm_id'] = 0; - $model = TravelCountry::create($data); - }else{ - $model = TravelCountry::find($data['id']); - $model->fill($data); - $model->save(); - } + //travel_nationality_requirement + if (isset($data['travel_nationality_requirement'])) { + foreach ($data['travel_nationality_requirement'] as $travel_nationality_id => $text) { + $model->setNationalityRequirement($travel_nationality_id, $text); + } + } - //travel_nationality_requirement - if(isset($data['travel_nationality_requirement'])){ - foreach ($data['travel_nationality_requirement'] as $travel_nationality_id => $text){ - $model->setNationalityRequirement($travel_nationality_id, $text); - } - } + //TODO for this time + if ($data['action'] === 'contact') { + //we need an update in the old CRM v1 system DB + $tc = \App\Models\Sym\TravelCountry::findOrFail($model->crm_id); + if(!$tc){ + $tc = \App\Models\Sym\TravelCountry::create($data); + $model->crm_id = $tc->id; + $model->save(); + }else{ + $tc->fill($data); + $tc->save(); + } - //TODO for this time - //we need an update in the old CRM v1 system DB - $tc = \App\Models\Sym\TravelCountry::find($model->crm_id); - if(!$tc){ - $tc = \App\Models\Sym\TravelCountry::create($data); - $model->crm_id = $tc->id; - $model->save(); - }else{ - $tc->fill($data); - $tc->save(); - } + } + \Session()->flash('alert-save', '1'); + return redirect(route('admin_settings_travel_country_detail', [$model->id])); + } - \Session()->flash('alert-save', '1'); - return redirect(route('admin_settings_travel_country_detail', [$model->id])); - - } public function delete($id){ $model = TravelCountry::findOrFail($id); @@ -100,7 +118,6 @@ class TravelCountryController extends Controller \Session()->flash('alert-success', 'Eintrag gelöscht'); return redirect()->back(); } - } diff --git a/app/Http/Controllers/Settings/TravelNationalityController.php b/app/Http/Controllers/Settings/TravelNationalityController.php index f126047..bb63e32 100755 --- a/app/Http/Controllers/Settings/TravelNationalityController.php +++ b/app/Http/Controllers/Settings/TravelNationalityController.php @@ -28,7 +28,7 @@ class TravelNationalityController extends Controller public function update(){ $data = Request::all(); - if($data['id'] == "new"){ + if($data['id'] === "new"){ $model = TravelNationality::create([ 'name' => $data['name'], 'active' => isset($data['active']) ? true : false, diff --git a/app/Models/Airline.php b/app/Models/Airline.php index 4f0fd54..06953bb 100644 --- a/app/Models/Airline.php +++ b/app/Models/Airline.php @@ -47,10 +47,4 @@ class Airline extends Model protected $casts = ['contact_emails' => 'array']; - public function getContactEmailsStr($glue=PHP_EOL){ - if($this->contact_emails){ - return implode($glue, $this->contact_emails); - } - return ""; - } } diff --git a/app/Models/Booking.php b/app/Models/Booking.php index bda2ce9..1cf78b5 100644 --- a/app/Models/Booking.php +++ b/app/Models/Booking.php @@ -6,6 +6,7 @@ namespace App\Models; +use App\Services\Util; use Carbon\Carbon; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; @@ -160,6 +161,8 @@ use Illuminate\Database\Eloquent\Model; * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereOriginStartDate($value) * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BookingFile[] $booking_files * @property-read int|null $booking_files_count + * @property float|null $price_balance + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking wherePriceBalance($value) */ class Booking extends Model { @@ -236,7 +239,9 @@ class Booking extends Model 'travel_company_id', 'travel_documents', 'price', + 'price_canceled', 'price_total', + 'price_balance', 'deposit_total', 'final_payment', 'final_payment_date', @@ -317,36 +322,6 @@ class Booking extends Model 2 => 'success', ]; - /* - * - *
    -
  • - relatedExists('Application')): ?> -
  • - - relatedExists('Confirmation')): ?> -
  • - - relatedExists('Invoice')): ?> -
  • - - relatedExists('Storno')): ?> -
  • - - relatedExists('TravelInsurance')): ?> -
  • - - relatedExists('InsuranceCertificate')): ?> -
  • - - relatedExists('Voucher')): ?> -
  • - - relatedExists('Coupon')): ?> -
  • - - - */ /*public function branch() { @@ -535,15 +510,69 @@ class Booking extends Model public function getPriceAttribute() { - // 2 = decimal places | '.' = decimal seperator | ',' = thousand seperator - return number_format(($this->attributes['price']), 2, ',', '.'); + return Util::_number_format($this->attributes['price']); } - public function getPriceRaw() { return $this->attributes['price']; } + public function getPriceCanceledAttribute() + { + return Util::_number_format($this->attributes['price_canceled']); + } + public function getPriceCanceledRaw() + { + return $this->attributes['price_canceled']; + } + + public function getPriceTotalAttribute() + { + return Util::_number_format($this->attributes['price_total']); + } + public function getPriceTotalRaw() + { + return $this->attributes['price_total']; + } + + public function getCanceledAttribute() + { + return Util::_number_format($this->attributes['canceled']); + } + public function getCanceledRaw() + { + return $this->attributes['canceled']; + } + + + + public function getPriceBalanceAttribute() + { + return Util::_number_format($this->attributes['price_balance']); + } + public function getPriceBalanceRaw() + { + return $this->attributes['price_balance']; + } + + public function getDepositTotalAttribute() + { + return Util::_number_format($this->attributes['deposit_total']); + } + public function getDepositTotalRaw() + { + return $this->attributes['deposit_total']; + } + + public function getFinalPaymentAttribute() + { + return Util::_number_format($this->attributes['final_payment']); + } + public function getFinalPaymentRaw() + { + return $this->attributes['final_payment']; + } + public function findBeforeDraftItemRelation($reid) { $before = false; @@ -585,56 +614,48 @@ class Booking extends Model return Carbon::parse($this->attributes['booking_date'])->format(\Util::formatDateDB()); } - //erlös #getRevenueFactor - public function proceedsRaw(){ - $total = 0; - foreach ($this->service_provider_entries as $entry) - { - $total += $entry->amount / $entry->factor; - } - return $this->attributes['price'] - $total; + public function getFinalPaymentDateFormat(){ + if(!$this->attributes['final_payment_date']){ return ""; } + return Carbon::parse($this->attributes['final_payment_date'])->format(\Util::formatDateDB()); + } + public function isCanceled(){ + return ($this->attributes['canceled'] > 0); } //erlös #getRevenueFactor - public function proceeds(){ - $proceeds = $this->attributes['price'] - // - $this->getServiceTotal() - // - $this->getServiceFee() - - $this->getServiceProviderEntriesAmountFactorTotal(); - - return number_format(($proceeds), 2, ',', '.'); + public function proceeds($raw = false){ + $proceeds = $this->attributes['price'] - $this->attributes['price_balance'] - $this->getServiceProviderPaymentsFactorTotal(true); + return $raw ? $proceeds : Util::_number_format($proceeds); } - public function getServiceProviderEntriesAmountFactorTotal() + public function getServiceTotal($raw = false) { $total = 0; - foreach ($this->service_provider_entries as $entry) - { + foreach ($this->booking_service_items as $booking_service_item){ + $total += $booking_service_item->getServicePriceRaw(); + } + return $raw ? $total : Util::_number_format($total); + } + + + public function getServiceProviderPaymentsFactorTotal($raw = false) + { + $total = 0; + foreach ($this->service_provider_entries as $entry){ $total += $entry->amount / $entry->factor; } - return $total; + return $raw ? $total : Util::_number_format($total); } - public function getServiceProviderPaymentsTotalRaw() + public function getServiceProviderPaymentsTotal($raw = false) { $total = 0; - foreach ($this->service_provider_entries as $entry) - { + foreach ($this->service_provider_entries as $entry){ $total += $entry->amount; } - return $total; - } - - public function getServiceProviderPaymentsTotal() - { - $total = 0; - foreach ($this->service_provider_entries as $entry) - { - $total += $entry->amount; - } - return number_format(($total), 2, ',', '.'); + return $raw ? $total : Util::_number_format($total); } public function getKontoNumber(){ diff --git a/app/Models/BookingServiceItem.php b/app/Models/BookingServiceItem.php index 4198a4b..c6aab4d 100644 --- a/app/Models/BookingServiceItem.php +++ b/app/Models/BookingServiceItem.php @@ -6,6 +6,7 @@ namespace App\Models; +use App\Services\Util; use Carbon\Carbon; use Illuminate\Database\Eloquent\Model; @@ -81,4 +82,14 @@ class BookingServiceItem extends Model { return $this->belongsTo(TravelCompany::class); } + + + public function getServicePriceAttribute() + { + return Util::_number_format($this->attributes['service_price']); + } + public function getServicePriceRaw() + { + return $this->attributes['service_price']; + } } diff --git a/app/Models/EmailTemplate.php b/app/Models/EmailTemplate.php new file mode 100644 index 0000000..0f0dd44 --- /dev/null +++ b/app/Models/EmailTemplate.php @@ -0,0 +1,39 @@ + 'bool' + ]; + + protected $fillable = [ + 'subject', + 'message', + 'active' + ]; +} diff --git a/app/Models/Insurance.php b/app/Models/Insurance.php new file mode 100644 index 0000000..a6aac50 --- /dev/null +++ b/app/Models/Insurance.php @@ -0,0 +1,42 @@ + 'bool', + 'contact_emails' => 'array' + + ]; + + protected $fillable = [ + 'name', + 'contact_emails', + 'active' + ]; +} diff --git a/app/Models/ServiceProvider.php b/app/Models/ServiceProvider.php index c94d246..b66fcd6 100644 --- a/app/Models/ServiceProvider.php +++ b/app/Models/ServiceProvider.php @@ -33,14 +33,23 @@ class ServiceProvider extends Model protected $table = 'service_provider'; public $timestamps = false; + public static $types = [ + 'payment' => 'payment', + 'discount' => 'discount', + ]; + protected $casts = [ - 'dollar' => 'bool' - ]; + 'dollar' => 'bool', + 'active' => 'bool', + 'contact_emails' => 'array' + ]; protected $fillable = [ 'name', 'dollar', - 'type' + 'type', + 'contact_emails', + 'active' ]; public function service_provider_entries() diff --git a/app/Models/TravelCompany.php b/app/Models/TravelCompany.php index ddf8b69..97e2dcb 100644 --- a/app/Models/TravelCompany.php +++ b/app/Models/TravelCompany.php @@ -6,6 +6,7 @@ namespace App\Models; +use App\Services\Util; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; @@ -44,15 +45,19 @@ class TravelCompany extends Model protected $casts = [ 'percentage' => 'float', 'is_allowed_edit_commission' => 'bool', - 'is_inhouse' => 'bool' - ]; + 'is_inhouse' => 'bool', + 'active' => 'bool', + 'contact_emails' => 'array' + ]; protected $fillable = [ 'name', 'percentage', 'is_allowed_edit_commission', - 'is_inhouse' - ]; + 'is_inhouse', + 'contact_emails', + 'active' + ]; public function bookings() { @@ -63,4 +68,19 @@ class TravelCompany extends Model { return $this->hasMany(BookingServiceItem::class); } + + public function setPercentageAttribute($value) + { + $this->attributes['percentage'] = Util::_clean_float($value); + } + + public function getPercentageAttribute() + { + return Util::_number_format($this->attributes['percentage']); + } + + public function getPercentageRaw() + { + return isset($this->attributes['percentage']) ? $this->attributes['percentage'] : 0; + } } diff --git a/app/Models/TravelCountry.php b/app/Models/TravelCountry.php index 71ae778..9a72f4b 100644 --- a/app/Models/TravelCountry.php +++ b/app/Models/TravelCountry.php @@ -118,13 +118,6 @@ class TravelCountry extends Model } } - public function getContactEmailsStr($glue=PHP_EOL){ - if(isset($this->contact_emails)){ - return implode($glue, $this->contact_emails); - } - return ""; - } - public function getContactLandsArray(){ $ret = []; if($this->contact_lands){ diff --git a/app/Repositories/CustomerMailRepository.php b/app/Repositories/CustomerMailRepository.php index 4af0bf8..0359057 100644 --- a/app/Repositories/CustomerMailRepository.php +++ b/app/Repositories/CustomerMailRepository.php @@ -9,6 +9,7 @@ use App\Models\Booking; use App\Models\CMSContent; use App\Models\CustomerFile; use App\Models\CustomerMail; +use App\Services\Placeholder; use App\Services\Util; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Facades\Mail; @@ -54,6 +55,7 @@ class CustomerMailRepository extends BaseRepository { foreach ($customer_files as $file) { $file->customer_id = $booking->customer_id; $file->customer_mail_id = $customer_mail->id; + $file->identifier = 'mail'; $file->save(); } @@ -86,6 +88,7 @@ class CustomerMailRepository extends BaseRepository { foreach ($customer_files as $file) { $file->customer_id = $booking->customer_id; $file->customer_mail_id = $customer_mail->id; + $file->identifier = 'mail'; $file->save(); } } @@ -170,26 +173,8 @@ class CustomerMailRepository extends BaseRepository { } private function prepareContent($booking, $content){ - - $first_name = $booking->customer->firstname; - $last_name = $booking->customer->name; - $title = $booking->customer->title; - - $country = $booking->travel_country_id ? $booking->travel_country->name : "-"; - $program = $booking->travelagenda_id ? $booking->travel_agenda->name : "-"; - $salutation = $booking->customer->salutation->name; - $start_date = $booking->getStartDateFormat(); - $end_date = $booking->getEndDateFormat(); - $booking_date = $booking->getBookingDateFormat(); - $airline = $booking->airline ? $booking->airline->name_full : '-'; - - $dear = $booking->customer->salutation_id == 1 ? 'geehrter' : 'geehrte'; - $search = ['#geehrte/r#', '#Anrede#', '#Titel#', '#Vorname#', '#Nachname#', '#Reiseland#', '#Programm#', '#Anreisedatum#', '#Abreisedatum#', '#Buchungsdatum#', '#Airline#']; - $replace = [$dear, $salutation, $title, $first_name, $last_name, $country, $program, $start_date, $end_date, $booking_date, $airline]; - $content = str_replace($search, $replace, $content); - + $content = Placeholder::replaceBooking($booking, $content); return $content; - } private static function prepareContactMails($value){ @@ -236,6 +221,7 @@ class CustomerMailRepository extends BaseRepository { $value->recipient = ""; $value->cc = ""; $value->bcc = ""; + $value->lead_title_id = ""; /*Ansicht*/ if ($data['action'] === "show-customer-mail") { if (isset($data['customer_mail_id']) && $customer_mail = CustomerMail::find($data['customer_mail_id'])) { @@ -255,6 +241,8 @@ class CustomerMailRepository extends BaseRepository { $value->id = $customer_mail->booking_id; $value->booking = $booking; $value->show = 'single'; + $value->lead_title_id = " - (".$value->booking->lead_id.")"; + $tmp = []; $tmp['email'] = $customer_mail->email ? $customer_mail->email : ""; @@ -288,21 +276,21 @@ class CustomerMailRepository extends BaseRepository { if ($data['action'] === "new-customer-mail") { $value->id = ""; $value->draft = false; - $lead_id = "-"; + $value->lead_title_id = "-"; //singel if (isset($data['booking_id']) && $booking = Booking::find($data['booking_id'])) { $value->id = $data['booking_id']; $value->booking = $booking; $value->show = 'single'; $value->draft = true; - $lead_id = " - (".$value->booking->lead_id.")"; + $value->lead_title_id = " - (".$value->booking->lead_id.")"; }else{ //multi $value->show = 'multi'; } $value->customers = $data['customers']; - $value->subject = $lead_id ; + $value->subject = $value->lead_title_id; $value->message = CMSContent::getContentBySlug('mailvorlage'); $value->s_placeholder = "Betreff der E-Mail"; $value->m_placeholder = "Nachricht der E-Mail"; @@ -333,6 +321,7 @@ class CustomerMailRepository extends BaseRepository { $value->booking = $booking; $value->message = ""; $value->subject = ""; + $value->lead_title_id = " - (".$value->booking->lead_id.")"; $value->s_placeholder = "Betreff des Kunden"; $value->m_placeholder = "Nachricht des Kunden"; if(isset($data['customer_mail_id']) && $customer_mail = CustomerMail::find($data['customer_mail_id'])){ diff --git a/app/Repositories/FileRepository.php b/app/Repositories/FileRepository.php index 153be94..8bbb7b1 100644 --- a/app/Repositories/FileRepository.php +++ b/app/Repositories/FileRepository.php @@ -100,6 +100,16 @@ class FileRepository extends BaseRepository { ], 200); } + public function delete(){ + if($this->model){ + if(Storage::disk($this->disk)->exists( $this->model->dir.$this->model->filename )){ + Storage::disk($this->disk)->delete($this->model->dir.$this->model->filename); + } + $this->model->delete(); + return true; + } + return false; + } private function makeFilename(){ $originalNameWithoutExt = substr($this->originalName, 0, strlen($this->originalName) - strlen($this->extension) - 1); $this->filename = Util::sanitize($originalNameWithoutExt, true, false, true); diff --git a/app/Services/HTMLHelper.php b/app/Services/HTMLHelper.php index 83eabf1..c997b3d 100644 --- a/app/Services/HTMLHelper.php +++ b/app/Services/HTMLHelper.php @@ -112,6 +112,10 @@ class HTMLHelper } + public static function getActiveIcon($active){ + return $active ? '' : ''; + } + public static function getRolesOptions($id = 0){ $ret = ""; foreach (self::$roles as $role_id => $value){ diff --git a/app/Services/Placeholder.php b/app/Services/Placeholder.php new file mode 100644 index 0000000..7901bfe --- /dev/null +++ b/app/Services/Placeholder.php @@ -0,0 +1,68 @@ + '#geehrte/r#', + 'salutation' => '#Anrede#', + 'title' => '#Titel#', + 'first_name' => '#Vorname#', + 'last_name' => '#Nachname#', + 'country' => '#Reiseland#', + 'program' => '#Programm#', + 'start_date' => '#Anreisedatum#', + 'end_date' => '#Abreisedatum#', + 'booking_date' => '#Buchungsdatum#', + 'airline' => '#Airline#' + ]; + + public static function getBookingQuill(){ + $ret = ""; + foreach (self::$booking as $key => $value) { + $value = str_replace('#', '', $value); + $ret .= "{id: '".$value."', label: '".$value."'},"."\n"; + } + return $ret; + } + public static function getBookingOptions(){ + $ret = ""; + foreach (self::$booking as $key => $value) { + $value = str_replace('#', '', $value); + $ret .= ''."\n"; + } + return $ret; + } + + public static function replaceBooking(Booking $booking, $content) + { + $dear = $booking->customer->salutation_id == 1 ? 'geehrter' : 'geehrte'; + $first_name = $booking->customer->firstname; + $last_name = $booking->customer->name; + $title = $booking->customer->title; + $country = $booking->travel_country_id ? $booking->travel_country->name : "-"; + $program = $booking->travelagenda_id ? $booking->travel_agenda->name : "-"; + $salutation = $booking->customer->salutation->name; + $start_date = $booking->getStartDateFormat(); + $end_date = $booking->getEndDateFormat(); + $booking_date = $booking->getBookingDateFormat(); + $airline = $booking->airline ? $booking->airline->name_full : '-'; + $search = []; + $replace = []; + + foreach (self::$booking as $key => $value) { + $search[] = $value; + $replace[] = ${$key}; + } + $content = str_replace($search, $replace, $content); + $content = preg_replace('/(.*?)<\/placeholder>/', '$1', $content); + $content = preg_replace('/(.*?)<\/span>/', '$1', $content); + return $content; + } + + + +} \ No newline at end of file diff --git a/app/Services/Util.php b/app/Services/Util.php index e355d28..f865752 100644 --- a/app/Services/Util.php +++ b/app/Services/Util.php @@ -64,13 +64,6 @@ class Util } return ""; } - - public function getContactEmailsStr($glue=PHP_EOL){ - if(isset($this->contact_emails)){ - return implode($glue, $this->contact_emails); - } - return ""; - } public static function _clean_float($value){ $groups = explode(".", preg_replace("/[^0-9.-]/", "", str_replace(',', '.', $value))); diff --git a/config/permissions.php b/config/permissions.php index a5c361f..ec3986a 100755 --- a/config/permissions.php +++ b/config/permissions.php @@ -28,21 +28,27 @@ return [ 'cms-cn' => ['name' => 'ADMIN CMS > Inhalte' , 'color' => 'secondary'], 'cms-cn-in' => ['name' => 'ADMIN CMS > Inhalte > Infos' , 'color' => 'secondary'], 'cms-cn-al' => ['name' => 'ADMIN CMS > Inhalte > Inhalte' , 'color' => 'secondary'], - 'cms-cn-co' => ['name' => 'ADMIN CMS > Inhalte > Länder' , 'color' => 'secondary'], 'cms-cn-au' => ['name' => 'ADMIN CMS > Inhalte > Autor' , 'color' => 'secondary'], ], 2 => [ 'sua-st' => ['name' => 'SUPERADMIN > Einstellungen' , 'color' => 'superadmin'], - 'sua-st-tp' => ['name' => 'SUPERADMIN > Einstellungen > Reisprogramme' , 'color' => 'superadmin'], - 'sua-st-tc' => ['name' => 'SUPERADMIN > Einstellungen > Reiseländer' , 'color' => 'superadmin'], - 'sua-st-tn' => ['name' => 'SUPERADMIN > Einstellungen > Nationalitäten' , 'color' => 'superadmin'], - 'sua-st-bs' => ['name' => 'SUPERADMIN > Einstellungen > Reisestatus' , 'color' => 'superadmin'], - 'sua-st-ke' => ['name' => 'SUPERADMIN > Einstellungen > Keywords' , 'color' => 'superadmin'], 'sua-st-al' => ['name' => 'SUPERADMIN > Einstellungen > Airline' , 'color' => 'superadmin'], + 'sua-st-et' => ['name' => 'SUPERADMIN > Einstellungen > E-Mail Vorlagen' , 'color' => 'superadmin'], + 'sua-st-ke' => ['name' => 'SUPERADMIN > Einstellungen > Keywords' , 'color' => 'superadmin'], + 'sua-st-sp' => ['name' => 'SUPERADMIN > Einstellungen > Leistungsträger' , 'color' => 'superadmin'], + 'sua-st-tn' => ['name' => 'SUPERADMIN > Einstellungen > Nationalitäten' , 'color' => 'superadmin'], + 'sua-st-co' => ['name' => 'SUPERADMIN > Einstellungen > Reiseländer' , 'color' => 'superadmin'], + 'sua-st-tp' => ['name' => 'SUPERADMIN > Einstellungen > Reisprogramme' , 'color' => 'superadmin'], + 'sua-st-bs' => ['name' => 'SUPERADMIN > Einstellungen > Reisestatus' , 'color' => 'superadmin'], + 'sua-st-tc' => ['name' => 'SUPERADMIN > Einstellungen > Veranstalter' , 'color' => 'superadmin'], + 'sua-st-in' => ['name' => 'SUPERADMIN > Einstellungen > Versicherungen' , 'color' => 'superadmin'], 'sua-re' => ['name' => 'SUPERADMIN > Export' , 'color' => 'superadmin'], 'sua-re-bo' => ['name' => 'SUPERADMIN > Export > Buchungen' , 'color' => 'superadmin'], 'sua-re-pp' => ['name' => 'SUPERADMIN > Export > Leistungsträger' , 'color' => 'superadmin'], 'sua-ur-rt' => ['name' => 'SUPERADMIN > User Rechte' , 'color' => 'danger'], + + 'cms-cn-co' => ['name' => 'ADMIN CMS > Inhalte > Länder' , 'color' => 'secondary'], + ], ], 'roles' => [ diff --git a/database/migrations/2018_10_29_202123_create_booking_table.php b/database/migrations/2018_10_29_202123_create_booking_table.php index b434022..f2e750f 100644 --- a/database/migrations/2018_10_29_202123_create_booking_table.php +++ b/database/migrations/2018_10_29_202123_create_booking_table.php @@ -49,6 +49,7 @@ class CreateBookingTable extends Migration $table->decimal('price', 10, 2)->nullable(); $table->decimal('price_canceled', 10, 2)->nullable(); $table->decimal('price_total', 10, 2)->nullable(); + $table->decimal('price_balance', 10, 2)->nullable(); $table->decimal('deposit_total', 10, 2)->nullable(); $table->decimal('final_payment', 10, 2)->nullable(); $table->date('final_payment_date')->nullable(); diff --git a/database/migrations/2020_01_29_154619_create_travel_company_table.php b/database/migrations/2020_01_29_154619_create_travel_company_table.php index 6a6e6ee..20a02e4 100644 --- a/database/migrations/2020_01_29_154619_create_travel_company_table.php +++ b/database/migrations/2020_01_29_154619_create_travel_company_table.php @@ -23,11 +23,10 @@ class CreateTravelCompanyTable extends Migration $table->decimal('percentage', 6, 2)->nullable(); $table->tinyInteger('is_allowed_edit_commission')->nullable()->default(0); $table->tinyInteger('is_inhouse')->nullable()->default(0); + $table->text('contact_emails')->nullable(); + $table->boolean('active')->default(true); }); - - - } /** diff --git a/database/migrations/2020_02_04_160054_create_service_provider_table.php b/database/migrations/2020_02_04_160054_create_service_provider_table.php index e9d3c90..ab3012f 100644 --- a/database/migrations/2020_02_04_160054_create_service_provider_table.php +++ b/database/migrations/2020_02_04_160054_create_service_provider_table.php @@ -22,6 +22,8 @@ class CreateServiceProviderTable extends Migration $table->string('name', 255); $table->unsignedTinyInteger('dollar')->nullable()->default(0); $table->string('type', 255)->nullable(); + $table->text('contact_emails')->nullable(); + $table->boolean('active')->default(true); $table->index('type', 'service_provider_type_idx'); diff --git a/database/migrations/2020_04_23_144804_create_insurances_table.php b/database/migrations/2020_04_23_144804_create_insurances_table.php new file mode 100644 index 0000000..bbeb4f0 --- /dev/null +++ b/database/migrations/2020_04_23_144804_create_insurances_table.php @@ -0,0 +1,35 @@ +bigIncrements('id'); + $table->string('name', 255); + $table->text('contact_emails')->nullable(); + $table->boolean('active')->default(true); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('insurances'); + } +} diff --git a/database/migrations/2020_04_23_144838_create_email_templates_table.php b/database/migrations/2020_04_23_144838_create_email_templates_table.php new file mode 100644 index 0000000..0fb5a66 --- /dev/null +++ b/database/migrations/2020_04_23_144838_create_email_templates_table.php @@ -0,0 +1,34 @@ +bigIncrements('id'); + $table->string('subject', 255); + $table->text('message')->nullable(); + $table->boolean('active')->default(true); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('email_templates'); + } +} diff --git a/public/css/application.css b/public/css/application.css index c5c28b3..aa06248 100644 --- a/public/css/application.css +++ b/public/css/application.css @@ -385,6 +385,21 @@ figcaption { border-left:1px solid #768394 } + +.btn-outline-next { + border-color: #8897AA; + background: transparent; + color: #8897AA; +} + +.btn-outline-next:hover { + border-color: transparent; + background: #8897AA; + color: #fff; +} + + + .badge-md { font-size: 0.95em; } @@ -444,3 +459,14 @@ div.dropzone.dz-drag-hover { border-style: dashed; } +.ql-picker.ql-placeholder { + width: 102px; +} + +.ql-picker.ql-placeholder > span.ql-picker-label::before { + content: 'Platzhalter'; +} + +.ql-picker.ql-placeholder > span.ql-picker-options > span.ql-picker-item::before { + content: attr(data-label); +} diff --git a/public/js/custom.js b/public/js/custom.js index 3edfda5..8a61b9e 100644 --- a/public/js/custom.js +++ b/public/js/custom.js @@ -196,11 +196,13 @@ function ajax_object_action(event, object, callback) { event.preventDefault(); var data = {}; $.each(object.data(), function(index, value){ - data[index] = value; + if(typeof value !== 'object'){ + data[index] = value; + } }); var url = data['url']; - //console.log(data); - //console.log(url); + console.log(data); + console.log(url); $.ajax({ url: url, data: data, diff --git a/resources/views/admin/report/bookings.blade.php b/resources/views/admin/report/bookings.blade.php index 0bd287a..216accf 100755 --- a/resources/views/admin/report/bookings.blade.php +++ b/resources/views/admin/report/bookings.blade.php @@ -65,6 +65,7 @@ BuchungsID {{__('Status')}} {{__('MyJack Nr.')}} + {{__('Organisation')}} {{__('Reisepreis')}} {{__('Erlös')}} {{__('Kunde')}} @@ -79,6 +80,7 @@ Total 0 + 0 0 @@ -111,6 +113,7 @@ { data: 'lead.status_id', name: 'lead.status_id', orderable: false, searchable: false }, { data: 'merlin_order_number', name: 'merlin_order_number' }, { data: 'price', name: 'price' }, + { data: 'price_total', name: 'price_total' }, { data: 'proceeds', name: 'proceeds' }, { data: 'customer.fullName', name: 'customer.fullName' }, { data: 'start_date', name: 'start_date' }, @@ -127,6 +130,7 @@ }, drawCallback: function (settings) { $('#price_total_sum').html(settings.json.price_total_sum); + $('#price_total_total_sum').html(settings.json.price_total_total_sum); $('#proceed_total_sum').html(settings.json.proceed_total_sum); } }); diff --git a/resources/views/admin/report/service_providers.blade.php b/resources/views/admin/report/service_providers.blade.php index 62600c1..dc1271c 100755 --- a/resources/views/admin/report/service_providers.blade.php +++ b/resources/views/admin/report/service_providers.blade.php @@ -61,6 +61,7 @@ BuchungsID {{__('Reiseveranstalter')}} {{__('MyJack Nr.')}} + {{__('Organisation')}} {{__('Reisepreis')}} {{__('Erlös')}} {{__('Kunde')}} @@ -74,6 +75,7 @@ Total 0 + 0 0 @@ -109,6 +111,7 @@ { data: 'service_provider.name', name: 'service_provider.name' }, { data: 'booking.merlin_order_number', name: 'booking.merlin_order_number' }, { data: 'booking.price', name: 'booking.price' }, + { data: 'booking.price_total', name: 'booking.price_total' }, { data: 'booking.proceeds', name: 'booking.proceeds' }, { data: 'booking.customer.fullName', name: 'booking.customer.fullName' }, { data: 'booking.start_date', name: 'booking.start_date' }, @@ -124,6 +127,7 @@ }, drawCallback: function (settings) { $('#price_total_sum').html(settings.json.price_total_sum); + $('#price_total_total_sum').html(settings.json.price_total_total_sum); $('#proceed_total_sum').html(settings.json.proceed_total_sum); } }); diff --git a/resources/views/booking/_detail_mails.blade.php b/resources/views/booking/_detail_mails.blade.php index 4e17be2..5cbc961 100755 --- a/resources/views/booking/_detail_mails.blade.php +++ b/resources/views/booking/_detail_mails.blade.php @@ -111,7 +111,6 @@ - @@ -120,7 +119,6 @@ - diff --git a/resources/views/booking/_detail_price.blade.php b/resources/views/booking/_detail_price.blade.php index 0d6fbef..b2649e6 100755 --- a/resources/views/booking/_detail_price.blade.php +++ b/resources/views/booking/_detail_price.blade.php @@ -4,15 +4,123 @@
    -
    - -
    -
    - + +
    +
    + +
    +
    + +
    + {{ Form::text('price', $booking->price, array('placeholder'=>__('Gesamtpreis'), 'class'=>'form-control', 'id'=>'price', 'readonly')) }} +
    +
    + +
    + +
    +
    + +
    + {{ Form::text('service_total', $booking->getServiceTotal(), array('placeholder'=>__('Gesamtpreis Vermittlung'), 'class'=>'form-control', 'id'=>'service_total', 'readonly')) }} +
    +
    + @if($booking->isCanceled() > 0) +
    + +
    +
    + +
    + {{ Form::text('price_canceled', $booking->price_canceled, array('placeholder'=>__('Storno Betrag'), 'class'=>'form-control', 'id'=>'price_canceled', 'readonly')) }} +
    +
    +
    + +
    +
    + +
    + {{ Form::text('price_balance', $booking->price_balance, array('placeholder'=>__('Restbetrag'), 'class'=>'form-control', 'id'=>'price_balance', 'readonly')) }} +
    +
    + @else +
    + +
    +
    + +
    + {{ Form::text('price_total', $booking->price_total, array('placeholder'=>__('Gesamtpreis Reise'), 'class'=>'form-control', 'id'=>'price_total', 'readonly')) }} +
    +
    + @endif +
    + +
    +
    + +
    +
    + +
    + {{ Form::text('price', $booking->getServiceProviderPaymentsFactorTotal(), array('placeholder'=>__('Gesamtpreis Leistungsträger'), 'class'=>'form-control', 'id'=>'price', 'readonly')) }} +
    +
    + +
    + +
    +
    + +
    + {{ Form::text('proceeds', $booking->proceeds(), array('placeholder'=>__('Erlös'), 'class'=>'form-control', 'id'=>'proceeds', 'readonly')) }} +
    +
    + + @if($booking->isCanceled() > 0) +
    + +
    +
    + +
    + {{ Form::text('canceled', $booking->canceled, array('placeholder'=>__('Storno in %'), 'class'=>'form-control', 'id'=>'canceled', 'readonly')) }} +
    +
    + @endif +
    + +
    +
    + +
    +
    + +
    + {{ Form::text('deposit_total', $booking->deposit_total, array('placeholder'=>__('Anzahlung'), 'class'=>'form-control', 'id'=>'deposit_total', 'readonly')) }} +
    +
    +
    + +
    +
    + +
    + {{ Form::text('final_payment', $booking->final_payment, array('placeholder'=>__('Restzahlung'), 'class'=>'form-control', 'id'=>'final_payment', 'readonly')) }} +
    +
    +
    + +
    +
    + +
    + {{ Form::text('final_payment_date', $booking->getFinalPaymentDateFormat(), array('placeholder'=>__('Restzahlung bis'), 'class'=>'form-control', 'id'=>'final_payment_date', 'readonly')) }}
    - {{ Form::text('price', $booking->price, array('placeholder'=>__('Gesamtpreis'), 'class'=>'form-control', 'id'=>'price', 'readonly')) }}
    +
    \ No newline at end of file diff --git a/resources/views/booking/detail.blade.php b/resources/views/booking/detail.blade.php index 977b65e..f7523c0 100755 --- a/resources/views/booking/detail.blade.php +++ b/resources/views/booking/detail.blade.php @@ -40,7 +40,7 @@

    @@ -260,11 +260,11 @@ "drawCallback": function( settings ) { $('#datatables-customer-mails [rel="tooltip"]').tooltip({trigger: "hover"}); $('#datatables-customer-mails .customer-mail-ajax-action').on('click', function (event) { - ajax_object_action(event, $(this), callback_ajax_data_table); + ajax_object_action(event, $(this), callback_customer_mails_data_table); }); } }); - function callback_ajax_data_table(data) { + function callback_customer_mails_data_table(data) { if(data.status === 'success'){ oTable.draw(); } diff --git a/resources/views/cms/content/country/detail.blade.php b/resources/views/cms/content/country/detail.blade.php deleted file mode 100755 index 051424b..0000000 --- a/resources/views/cms/content/country/detail.blade.php +++ /dev/null @@ -1,210 +0,0 @@ -@extends('layouts.layout-2') - -@section('content') - - {!! Form::open(['url' => route('cms_content_country_store', [$id]), 'class' => 'form-horizontal']) !!} - -

    - Reiseland Inhalte {{ $model->name }} - -

    - - - - - {!! Form::close() !!} - - - - - -@endsection \ No newline at end of file diff --git a/resources/views/customer/mail/modal-new-booking-files.blade.php b/resources/views/customer/mail/modal-new-booking-files.blade.php index 41a62ba..18bf012 100644 --- a/resources/views/customer/mail/modal-new-booking-files.blade.php +++ b/resources/views/customer/mail/modal-new-booking-files.blade.php @@ -26,7 +26,7 @@
    - - + @endforeach diff --git a/resources/views/settings/travel_company/index.blade.php b/resources/views/settings/travel_company/index.blade.php new file mode 100755 index 0000000..ef88342 --- /dev/null +++ b/resources/views/settings/travel_company/index.blade.php @@ -0,0 +1,145 @@ +@extends('layouts.layout-2') + +@section('content') +

    + Reiseveranstalter +

    + +
    + +
    +
    {{__('Betreff')}} {{__('Datum')}} {{__('#')}}
    {{\App\Services\Util::_format_date($booking_application->updated_at, 'date')}} - @@ -51,7 +51,7 @@ {{\App\Services\Util::_format_date($booking_confirmation->updated_at, 'date')}} - @@ -74,7 +74,7 @@ {{\App\Services\Util::_format_date($booking_storno->updated_at, 'date')}} - @@ -99,7 +99,7 @@ {{\App\Services\Util::_format_date($coupon->issue_date, 'date')}} - @@ -122,7 +122,7 @@ {{\App\Services\Util::_format_date($booking_voucher->updated_at, 'date')}} - @@ -145,7 +145,7 @@ {{\App\Services\Util::_format_date($insurance_certificate->updated_at, 'date')}} - diff --git a/resources/views/customer/mail/modal-new-mail.blade.php b/resources/views/customer/mail/modal-new-mail.blade.php index 891275a..806e009 100644 --- a/resources/views/customer/mail/modal-new-mail.blade.php +++ b/resources/views/customer/mail/modal-new-mail.blade.php @@ -120,6 +120,7 @@
    + {{ Form::hidden('lead_title_id', $value->lead_title_id, array('id'=>'lead_title_id')) }}
    {{ Form::text('subject', $value->subject, array('placeholder'=>$value->s_placeholder, 'id'=>'subject', 'class'=>'form-control', 'required')) }} @@ -129,7 +130,9 @@
    @if($value->show === 'single' || $value->show === 'multi') -
    Vorlage unter: CMS->Inhalte->Allgemein Slug:mailvorlage
    + @if(Auth::user()->isPermission('sua-st-et')) + + @endif @endif
    @@ -156,12 +159,38 @@ + + +
    {!! $value->message !!}
    {{ Form::textarea('message', $value->message, array('placeholder'=>$value->m_placeholder, 'id'=>'message-editor-fallback', 'class'=>'form-control d-none', 'rows'=>15)) }}
    - @if(isset($value->customers)) -

    Platzhalter: #geehrte/r# #Anrede# #Titel# #Vorname# #Nachname# #Reiseland# #Programm# #Anreisedatum# #Abreisedatum# #Buchungsdatum# #Airline#

    + @if($value->show === 'single' || $value->show === 'multi') +
    +
    + +
    +
    +
    +
    + + + + + + + + + + +
    #{{__('Betreff')}} 
    +
    +
    +
    +
    @endif @if($value->show === 'single' || $value->show === 'reply')
    @@ -199,7 +228,6 @@ @if($value->show === 'single' && isset($value->booking)) @endif -
    Datei Anhänge
    @if($value->show === 'single' && isset($value->booking)) @@ -220,7 +248,7 @@
    {{$customer_file->formatBytes()}}
    Vorschau   - {{-- entfernen --}} + löschen
    @@ -260,7 +288,7 @@
    @@ -286,10 +314,9 @@ ///'storage/file/{id}/{disk} template.find('.mail-att-show').attr('href', response.file_url); - template.find('.mail-att-delete').on('click', function () { + template.find('.mail-att-remove').on('click', function () { $(this).parents('.message-attachment').remove(); }); - $('#preview-mail-attachment').append(template); } @@ -314,10 +341,16 @@ $('#message-editor,#message-editor-toolbar').remove(); $('#message-editor-fallback').removeClass('d-none'); } else { + Quill.register('modules/placeholder', PlaceholderModule.default(Quill)) //$('#message-editor-fallback').remove(); var quill = new Quill('#message-editor', { modules: { - toolbar: '#message-editor-toolbar' + toolbar: '#message-editor-toolbar', + placeholder: { + placeholders: [ + {!! \App\Services\Placeholder::getBookingQuill() !!} + ] + } }, placeholder: '{{$value->m_placeholder}}', theme: 'snow' @@ -350,6 +383,60 @@ $( "#customer-mail-form" ).submit(); }); + $("#preview-mail-attachment .mail-att-delete").click(function(event) { + _self = $(this); + if(!confirm('Angang wirklick löschen?')){ + event.preventDefault(); + return; + } + ajax_object_action(event, $(this), function (data) { + console.log(data); + if(data.status === 'success'){ + _self.parents('.message-attachment').remove(); + } + }); + + + }); + + + + var emailTempplateTable = $('#datatables-email-templates').DataTable({ + "processing": true, + "serverSide": true, + "searching": true, + "autoWidth": false, + ajax: { + url: '{!! route( 'email_template_data_table' ) !!}', + }, + "columns": [ + { data: 'id', width: '8%', searchable: true }, + { data: 'subject', name: 'subject', width: '', searchable: true }, + { data: 'action', width: '8%', orderable: false, searchable: false}, + ], + "bLengthChange": false, + "iDisplayLength": 10, + "orderSequence": ["desc", "asc"], + "order": [[ 0, "desc" ]], + "language": { + "url": "/js/German.json" + }, + "drawCallback": function( settings ) { + $('#datatables-email-templates [rel="tooltip"]').tooltip({trigger: "hover"}); + $('#datatables-email-templates .email-template-action').on('click', function (event) { + ajax_object_action(event, $(this), callback_email_template_data_table); + }); + } + }); + function callback_email_template_data_table(data) { + if(data.status === 'success'){ + $('input#subject').val(data.response.subject + $('input#lead_title_id').val()); + $("input#message-editor-fallback").val(data.html); + $('#message-editor .ql-editor').html(data.html) + $('#collapseModalEmailTemplate').collapse('hide'); + } + } + Dropzone.autoDiscover = false; $("#uploadAttachmentFile").dropzone({ uploadMultiple: false, diff --git a/resources/views/layouts/application.blade.php b/resources/views/layouts/application.blade.php index 1774b68..5443e7d 100755 --- a/resources/views/layouts/application.blade.php +++ b/resources/views/layouts/application.blade.php @@ -68,7 +68,7 @@ @yield('styles') - + @@ -102,7 +102,6 @@ @yield('layout-content') - @include('iq.content.assets.modals') @@ -144,6 +143,7 @@ + @if(isset($lfm_helper)) diff --git a/resources/views/layouts/includes/layout-sidenav.blade.php b/resources/views/layouts/includes/layout-sidenav.blade.php index 09d5ddc..63fe989 100755 --- a/resources/views/layouts/includes/layout-sidenav.blade.php +++ b/resources/views/layouts/includes/layout-sidenav.blade.php @@ -143,7 +143,7 @@ @if(Auth::user()->isPermission('cms-tg'))
  • - +
    Reiseführer
      @@ -172,7 +172,6 @@ @endif @if(Auth::user()->isPermission('cms-cn')) -
    • @@ -189,11 +188,6 @@
      Allgemein
    • @endif - @if(Auth::user()->isPermission('cms-cn-co')) -
    • -
      Reiseländer
      -
    • - @endif @if(Auth::user()->isPermission('cms-cn-au'))
    • Autoren
      @@ -215,35 +209,54 @@
      Einstellungen
      diff --git a/resources/views/request/index.blade.php b/resources/views/request/index.blade.php index 536523e..6b2f446 100755 --- a/resources/views/request/index.blade.php +++ b/resources/views/request/index.blade.php @@ -6,7 +6,6 @@
      -
      @@ -257,8 +256,8 @@ "columns": [ { data: 'action_lead_edit', orderable: false, searchable: false}, { data: 'lead_id', name: 'lead_id' }, - { data: 'participant_firstname', name: 'participant_firstname' }, - { data: 'participant_name', name: 'participant_name' }, + { data: 'customer.firstname', name: 'customer.firstname' }, + { data: 'customer.name', name: 'customer.name' }, { data: 'action_booking_edit', orderable: false, searchable: false}, { data: 'id', name: 'id' }, { data: 'travel_country_id', name: 'travel_country_id', orderable: false }, diff --git a/resources/views/settings/_travel_country/detail.blade.php b/resources/views/settings/_travel_country/detail.blade.php new file mode 100755 index 0000000..fe47006 --- /dev/null +++ b/resources/views/settings/_travel_country/detail.blade.php @@ -0,0 +1,116 @@ +@extends('layouts.layout-2') + +@section('content') + + {!! Form::open(['url' => route('admin_settings_travel_country_detail', [$id]), 'class' => 'form-horizontal']) !!} + +

      + Reiseland @if($id == "new") anlegen @else {{"(ID: ".$id.")"}} verwalten @endif +
      +   + {{ __('back') }} +
      +

      +
      + + + + + +
      +
      +
      +
      + + {{ Form::text('name', $model->name, array('placeholder'=>__('Name'), 'class'=>'form-control', 'id'=>'name', 'required'=>true)) }} +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      +
      +
      + + {{ Form::text('slug', $model->slug, array('placeholder'=>__('Slug'), 'class'=>'form-control', 'id'=>'slug')) }} +
      +
      + +
      active_frontend) style="display: none;" @endif> +
      + +

      Inhalte für Seite

      +
      +
      + + {{ Form::textarea('html_information', $model->html_information, ['class' => 'form-control summernote-small']) }} +
      +
      +
      +
      +
      + + {{ Form::text('text_before', $model->text_before, ['class' => 'form-control', 'maxlength'=>'255']) }} +
      +
      + + {{ Form::text('text_after', $model->text_after, ['class' => 'form-control', 'maxlength'=>'255']) }} +
      +
      +
      + +
      Einreisebestimmungen
      + @foreach($travel_nationalities as $travel_nationality) +
      +
      + + {{ Form::textarea('travel_nationality_requirement['.$travel_nationality->id.']', $model->getNationalityRequirement($travel_nationality->id), ['class' => 'form-control summernote-small', 'id'=>'travel_nationality_requirement_'.$travel_nationality->id]) }} +
      +
      + @endforeach +
      + + + +
      +
      + +
      +   + {{ __('back') }} +
      + + {!! Form::close() !!} + + + + + +@endsection \ No newline at end of file diff --git a/resources/views/cms/content/country/index.blade.php b/resources/views/settings/_travel_country/index.blade.php similarity index 75% rename from resources/views/cms/content/country/index.blade.php rename to resources/views/settings/_travel_country/index.blade.php index 0a384ed..8f434d4 100755 --- a/resources/views/cms/content/country/index.blade.php +++ b/resources/views/settings/_travel_country/index.blade.php @@ -3,26 +3,11 @@ @section('content')

      - {{ __('Inhalte') }} {{ __('Reiseländer') }} + {{ __('Reiseländer') }} zurück ins v2 CMS zurück ins v1 CRM -

      - @if ($errors->any()) -
      -
      -
      -
        - @foreach ($errors->all() as $error) -
      • {{ $error }}
      • - @endforeach -
      -
      -
      -
      - @endif -
      @@ -30,29 +15,23 @@ - - + + @foreach($travel_countries as $value) - - - - + + + + @endforeach
        {{__('Name')}}{{__('Bezug')}}{{__('E-Mail(s)')}}{{__('Slug')}} {{__('Seite')}} {{__('CRM')}} {{__('Kunden')}}#
      - + {{ $value->name }} - {!! implode("
      ", $value->getContactLandsArray()) !!} -
      - {!! $value->getContactEmailsStr("
      ") !!} -
      {{ $value->name }}{{ $value->slug }} @if($value->active_frontend) @@ -74,11 +53,17 @@ @endif + +
      - +
      +
      +@endsection \ No newline at end of file diff --git a/resources/views/settings/email_template/modal.blade.php b/resources/views/settings/email_template/modal.blade.php new file mode 100755 index 0000000..cb89ef7 --- /dev/null +++ b/resources/views/settings/email_template/modal.blade.php @@ -0,0 +1,95 @@ +{!! Form::open([ 'url' => route('admin_settings_email_template_update'), 'method' => 'post', 'class' => 'modal-content' ]) !!} +{{ Form::hidden('id', $value->id) }} + + + +{!! Form::close() !!} + + + + diff --git a/resources/views/settings/insurance/index.blade.php b/resources/views/settings/insurance/index.blade.php new file mode 100755 index 0000000..32a64a2 --- /dev/null +++ b/resources/views/settings/insurance/index.blade.php @@ -0,0 +1,112 @@ +@extends('layouts.layout-2') + +@section('content') +

      + Versicherungen +

      + +
      + +
      + + + + + + + + + + + + @foreach($insurance as $value) + + + + + + + + @endforeach + +
       {{__('Name')}}{{__('E-Mail(s)')}}{{__('sichtbar')}}
      + + {{ $value->name }}{!! \App\Services\Util::_implodeLines($value->contact_emails, "
      ") !!}
      {!! \App\Services\HTMLHelper::getActiveIcon($value->active) !!}
      +
      + +
      +
      + + + + + +
      + + +@endsection \ No newline at end of file diff --git a/resources/views/settings/keywords/index.blade.php b/resources/views/settings/keywords/index.blade.php index 1d99ee7..e3e8fea 100755 --- a/resources/views/settings/keywords/index.blade.php +++ b/resources/views/settings/keywords/index.blade.php @@ -41,9 +41,8 @@
      diff --git a/resources/views/settings/service_provider/index.blade.php b/resources/views/settings/service_provider/index.blade.php new file mode 100755 index 0000000..fbe4248 --- /dev/null +++ b/resources/views/settings/service_provider/index.blade.php @@ -0,0 +1,123 @@ +@extends('layouts.layout-2') + +@section('content') +

      + Leistungsträger +

      + +
      + +
      + + + + + + + + + + + + + @foreach($service_provider as $value) + + + + + + + + + @endforeach + +
       {{__('Name')}}{{__('E-Mail(s)')}}{{__('Type')}}{{__('sichtbar')}}
      + + {{ $value->name }}{!! \App\Services\Util::_implodeLines($value->contact_emails, "
      ") !!}
      {{$value->type}}{!! \App\Services\HTMLHelper::getActiveIcon($value->active) !!}
      +
      + +
      +
      + + + + + +
      + + +@endsection \ No newline at end of file diff --git a/resources/views/settings/travel_agenda/index.blade.php b/resources/views/settings/travel_agenda/index.blade.php index 1f3ca11..46d34a0 100755 --- a/resources/views/settings/travel_agenda/index.blade.php +++ b/resources/views/settings/travel_agenda/index.blade.php @@ -33,14 +33,7 @@
  • {{ $value->name }} {{ $value->travel_country->name }} - @if($value->active) - - @else - - @endif - {!! \App\Services\HTMLHelper::getActiveIcon($value->active) !!}
    + + + + + + + + + + + + + + @foreach($travel_company as $value) + + + + + + + + + + + + @endforeach + +
     {{__('Name')}}{{__('E-Mail(s)')}}{{__('Prozentsatz für Provision')}}{{__('Provision änderbar')}}{{__('In-House')}}{{__('sichtbar')}}
    + + {{ $value->name }}{!! \App\Services\Util::_implodeLines($value->contact_emails, "
    ") !!}
    {{$value->percentage}}{!! \App\Services\HTMLHelper::getActiveIcon($value->is_allowed_edit_commission) !!}{!! \App\Services\HTMLHelper::getActiveIcon($value->is_inhouse) !!}{!! \App\Services\HTMLHelper::getActiveIcon($value->active) !!}
    +
    + +
    + + + + + + + + + +@endsection \ No newline at end of file diff --git a/resources/views/settings/travel_country/detail.blade.php b/resources/views/settings/travel_country/detail.blade.php index fe47006..fbcd5e7 100755 --- a/resources/views/settings/travel_country/detail.blade.php +++ b/resources/views/settings/travel_country/detail.blade.php @@ -2,89 +2,184 @@ @section('content') - {!! Form::open(['url' => route('admin_settings_travel_country_detail', [$id]), 'class' => 'form-horizontal']) !!} + {!! Form::open(['url' => route('admin_settings_travel_country_update', [$id]), 'class' => 'form-horizontal']) !!}

    - Reiseland @if($id == "new") anlegen @else {{"(ID: ".$id.")"}} verwalten @endif + Reiseland Inhalte {{ $model->name }}
    -   {{ __('back') }}

    -
    +