Fewo PDF Hinweise, Generator, Anhang Mail

This commit is contained in:
Kevin Adametz 2020-06-29 12:23:21 +02:00
parent a3bef8d1aa
commit 730832c8e1
31 changed files with 1786 additions and 147 deletions

View file

@ -21,14 +21,13 @@ use Request;
class TravelUserBookingFewoController extends Controller
{
protected $userBookingFewoRepo;
// protected $identifier_fewo;
public function __construct(TravelUserBookingFewoRepository $userBookingFewoRepo)
{
$this->middleware('admin');
$this->userBookingFewoRepo = $userBookingFewoRepo;
// $this->identifier_fewo = 'fewo-pdf-';
}
public function index($step = false)
@ -59,6 +58,11 @@ class TravelUserBookingFewoController extends Controller
$id = $travel_user_booking_fewo->id;
$replace_info_text['fewo_user_anrede'] = $travel_user_booking_fewo->getUserSalutation();
$replace_info_text['fewo_adresse'] = $travel_user_booking_fewo->getNameAddressLocation(", ");
/* if($travel_user_booking_fewo->fewo_lodging){
$this->identifier_fewo = $this->identifier_fewo.Util::sanitize($travel_user_booking_fewo->fewo_lodging->single_name);
}*/
}
if(!$travel_user_booking_fewo->info_mail_text) {
$travel_user_booking_fewo->info_mail_text = CMSContent::getContentBySlug('pdf-vorlage-anreiseinfo-fewo');
@ -78,10 +82,10 @@ class TravelUserBookingFewoController extends Controller
public function store($id)
{
$data = Request::all();
if($data['action'] == 'saveAll'){
if($data['action'] === 'saveAll'){
return $this->userBookingFewoRepo->update($id, $data);
}
if($data['action'] == 'createInvoice'){
if($data['action'] === 'createInvoice'){
if(!TravelUserBookingFewo::find($id)){
\Session()->flash('alert-error', __('Buchung nicht gefunden.'));
return back()->withRequest(Request::all());
@ -97,7 +101,7 @@ class TravelUserBookingFewoController extends Controller
}
}
if($data['action'] == 'createTravelInfo'){
if($data['action'] === 'createTravelInfo'){
if(!TravelUserBookingFewo::find($id)){
\Session()->flash('alert-error', __('Buchung nicht gefunden.'));
return back()->withRequest(Request::all());
@ -114,7 +118,7 @@ class TravelUserBookingFewoController extends Controller
}
}
if($data['action'] == 'sendMailtoUser') {
if($data['action'] === 'sendMailtoUser') {
$travel_user_booking_fewo = TravelUserBookingFewo::findOrFail($id);
if($travel_user_booking_fewo->travel_user_id && $travel_user_booking_fewo->travel_user->email){
$mail_bbc = config('mail.mail_bbc');
@ -128,7 +132,7 @@ class TravelUserBookingFewoController extends Controller
}
}
if($data['action'] == 'sendInfosMailtoUser') {
if($data['action'] === 'sendInfosMailtoUser') {
$travel_user_booking_fewo = TravelUserBookingFewo::findOrFail($id);
if($travel_user_booking_fewo->travel_user_id && $travel_user_booking_fewo->travel_user->email){
$mail_bbc = config('mail.mail_bbc');
@ -142,7 +146,7 @@ class TravelUserBookingFewoController extends Controller
}
}
if($data['action'] == 'sendMailtoService') {
if($data['action'] === 'sendMailtoService') {
$travel_user_booking_fewo = TravelUserBookingFewo::findOrFail($id);
if($travel_user_booking_fewo){
$mail_bbc = config('mail.mail_bbc');
@ -160,7 +164,7 @@ class TravelUserBookingFewoController extends Controller
}
}
if($data['action'] == 'sendMailtoEmployee') {
if($data['action'] === 'sendMailtoEmployee') {
$travel_user_booking_fewo = TravelUserBookingFewo::findOrFail($id);
if($travel_user_booking_fewo){
$mails = explode(",", Request::get('send_mail_employee_mail'));
@ -220,7 +224,6 @@ class TravelUserBookingFewoController extends Controller
public function getTravelUserBookingFewos()
{
$query = $this->prozessTravelUserBookingFewosSearch();
return \DataTables::eloquent($query)