Store Customer, Store Booking details
This commit is contained in:
parent
b362b93bca
commit
6706d28f51
33 changed files with 1048 additions and 257 deletions
|
|
@ -69,6 +69,12 @@ class BookingController extends Controller
|
|||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('booking_detail', [$booking->id])."#collapseBookingNotice");
|
||||
}
|
||||
|
||||
if($data['action'] === 'save_lead_status'){
|
||||
$booking = $this->bookingRepo->updateLeadStatus($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('booking_detail', [$booking->id])."#collapseBookingLead");
|
||||
}
|
||||
|
||||
if($data['action'] === 'update_booking'){
|
||||
$booking = $this->bookingRepo->updateBooking($id, $data);
|
||||
|
|
@ -76,15 +82,35 @@ class BookingController extends Controller
|
|||
return redirect(route('booking_detail', [$booking->id])."#collapseBookingBooking");
|
||||
}
|
||||
|
||||
if($data['action'] === 'update_booking_services'){
|
||||
$booking = $this->bookingRepo->updateBookingServices($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('booking_detail', [$booking->id])."#collapseBookingServices");
|
||||
}
|
||||
|
||||
if($data['action'] === 'update_booking_number'){
|
||||
$booking = $this->bookingRepo->updateBookingNumber($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('booking_detail', [$booking->id])."#collapseBookingMyJack");
|
||||
}
|
||||
|
||||
if($data['action'] === 'update_booking_price'){
|
||||
$booking = $this->bookingRepo->updateBookingPrice($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('booking_detail', [$booking->id])."#collapseBookingPrice");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if($id === "new") {
|
||||
$booking = new Booking();
|
||||
}else{
|
||||
$booking = Booking::findOrFail($id);
|
||||
}
|
||||
|
||||
$booking->merlin_order_number = $data['merlin_order_number'];
|
||||
$booking->save();
|
||||
|
||||
// $booking->merlin_order_number = $data['merlin_order_number'];
|
||||
// $booking->save();
|
||||
$i = 1;
|
||||
|
||||
if($data['action'] === 'addItemUp'){
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ use Request;
|
|||
class CustomerController extends Controller
|
||||
{
|
||||
|
||||
protected $customerRepo;
|
||||
protected $custRepo;
|
||||
|
||||
public function __construct(CustomerRepository $customerRepo)
|
||||
public function __construct(CustomerRepository $custRepo)
|
||||
{
|
||||
$this->middleware('admin');
|
||||
$this->customerRepo = $customerRepo;
|
||||
$this->custRepo = $custRepo;
|
||||
}
|
||||
|
||||
public function index($step = false)
|
||||
|
|
@ -46,12 +46,14 @@ class CustomerController extends Controller
|
|||
|
||||
public function store($id)
|
||||
{
|
||||
$data = Request::all();
|
||||
|
||||
if($data['action'] === 'saveCustomer'){
|
||||
$customer = $this->custRepo->updateCustomer($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('customer_detail', [$id]).'#collapseCustomerDetail');
|
||||
}
|
||||
return back();
|
||||
/* $data = Request::all();
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('lead_detail', [$lead->id]));*/
|
||||
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class CustomerFewoMailController extends Controller
|
|||
$this->customerMailRepo = $customerMailRepo;
|
||||
}
|
||||
|
||||
public function index()
|
||||
/* public function index()
|
||||
{
|
||||
$data = [
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ class CustomerFewoMailController extends Controller
|
|||
];
|
||||
return view('customer.mail.detail', $data);
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
public function store($id, $action=false)
|
||||
{
|
||||
|
|
@ -137,55 +137,6 @@ class CustomerFewoMailController extends Controller
|
|||
return back();
|
||||
}
|
||||
|
||||
/*public function getCustomerFewoMails()
|
||||
{
|
||||
$query = CustomerFewoMail::with('booking')->with('customer')->select('customer_mails.*');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (CustomerFewoMail $customer_mail) {
|
||||
return '<a href="'.route('customer_mail_detail', [$customer_mail->id]).'" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('id', function (CustomerFewoMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->id.'" href="'.route('customer_mail_detail', [$customer_mail->id]).'" data-id="'.$customer_mail->id.'">'.$customer_mail->id.'</a>';
|
||||
})
|
||||
->addColumn('booking', function (CustomerFewoMail $customer_mail) {
|
||||
$out = $customer_mail->booking->travel_country_id ? $customer_mail->booking->travel_country->name." | " : "- | ";
|
||||
$out .= $customer_mail->booking->travelagenda_id ? $customer_mail->booking->travel_agenda->name."" : "-";
|
||||
return $out;
|
||||
})
|
||||
->addColumn('travel_user_booking_fewo_id', function (CustomerFewoMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->travel_user_booking_fewo_id.'" href="'.route('booking_detail', [$customer_mail->travel_user_booking_fewo_id]).'">'.$customer_mail->travel_user_booking_fewo_id.'</a>';
|
||||
})
|
||||
->addColumn('customer_id', function (CustomerFewoMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->customer_id.'" href="'.route('customer_detail', [$customer_mail->customer_id]).'">'.$customer_mail->customer_id.'</a>';
|
||||
})
|
||||
->addColumn('send', function (CustomerFewoMail $customer_mail) {
|
||||
return $customer_mail->send ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('travel_user_booking_fewo_id', 'travel_user_booking_fewo_id $1')
|
||||
->orderColumn('customer_id', 'customer_id $1')
|
||||
->orderColumn('send', 'send $1')
|
||||
|
||||
->filterColumn('id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('customer_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('customer_id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('travel_user_booking_fewo_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('travel_user_booking_fewo_id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->rawColumns(['action_edit', 'send', 'customer_id', 'travel_user_booking_fewo_id', 'id'])
|
||||
->make(true);
|
||||
}*/
|
||||
|
||||
public function getEmailTemplates()
|
||||
{
|
||||
$query = EmailTemplate::with('email_template_dir')->select('email_templates.*')->where('active', '=', true);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class CustomerMailController extends Controller
|
|||
$this->customerMailRepo = $customerMailRepo;
|
||||
}
|
||||
|
||||
public function index()
|
||||
/*public function index()
|
||||
{
|
||||
$data = [
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ class CustomerMailController extends Controller
|
|||
];
|
||||
return view('customer.mail.detail', $data);
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
public function store($id, $action=false)
|
||||
{
|
||||
|
|
@ -156,62 +156,6 @@ class CustomerMailController extends Controller
|
|||
return back();
|
||||
}
|
||||
|
||||
public function getCustomerMails()
|
||||
{
|
||||
$query = CustomerMail::with('booking')->with('customer')->select('customer_mails.*');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (CustomerMail $customer_mail) {
|
||||
return '<a href="'.route('customer_mail_detail', [$customer_mail->id]).'" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('id', function (CustomerMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->id.'" href="'.route('customer_mail_detail', [$customer_mail->id]).'" data-id="'.$customer_mail->id.'">'.$customer_mail->id.'</a>';
|
||||
})
|
||||
->addColumn('booking', function (CustomerMail $customer_mail) {
|
||||
$out = $customer_mail->booking->travel_country_id ? $customer_mail->booking->travel_country->name." | " : "- | ";
|
||||
$out .= $customer_mail->booking->travelagenda_id ? $customer_mail->booking->travel_agenda->name."" : "-";
|
||||
return $out;
|
||||
})
|
||||
->addColumn('booking_id', function (CustomerMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->booking_id.'" href="'.route('booking_detail', [$customer_mail->booking_id]).'">'.$customer_mail->booking_id.'</a>';
|
||||
})
|
||||
->addColumn('customer_id', function (CustomerMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->customer_id.'" href="'.route('customer_detail', [$customer_mail->customer_id]).'">'.$customer_mail->customer_id.'</a>';
|
||||
})
|
||||
->addColumn('send', function (CustomerMail $customer_mail) {
|
||||
return $customer_mail->send ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
})
|
||||
->addColumn('date', function (CustomerMail $customer_mail) {
|
||||
if($customer_mail->send){
|
||||
return '<span class="badge badge-success" style="background-color: #94ae59"><i class="fa fa-check-circle"></i> '.$customer_mail->sent_at.'</span>';
|
||||
}
|
||||
return '<span class="badge badge-default"><i class="fa fa-times-circle"></i> '.$customer_mail->sent_at.'</span>';
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('booking_id', 'booking_id $1')
|
||||
->orderColumn('customer_id', 'customer_id $1')
|
||||
->orderColumn('send', 'send $1')
|
||||
->orderColumn('date', 'sent_at $1')
|
||||
|
||||
->filterColumn('id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('customer_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('customer_id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('booking_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('booking_id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->rawColumns(['action_edit', 'send', 'date', 'customer_id', 'booking_id', 'id'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function getEmailTemplates()
|
||||
{
|
||||
$query = EmailTemplate::with('email_template_dir')->select('email_templates.*')->where('active', '=', true);
|
||||
|
|
|
|||
|
|
@ -31,34 +31,6 @@ class LeadMailController extends Controller
|
|||
$this->leadMailRepo = $leadMailRepo;
|
||||
}
|
||||
|
||||
/*public function index()
|
||||
{
|
||||
$data = [
|
||||
|
||||
];
|
||||
return view('customer.mail.index', $data);
|
||||
}
|
||||
|
||||
public function detail($id)
|
||||
{
|
||||
if($id === "new") {
|
||||
$lead_mail = new LeadMail();
|
||||
$id = 'new';
|
||||
|
||||
}else{
|
||||
$lead_mail = LeadMail::findOrFail($id);
|
||||
$id = $lead_mail->id;
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'lead_mail' => $lead_mail,
|
||||
'id' => $id,
|
||||
'back' => URL::previous(),
|
||||
];
|
||||
return view('customer.mail.detail', $data);
|
||||
|
||||
}*/
|
||||
|
||||
public function store($id, $action=false)
|
||||
{
|
||||
|
|
|
|||
170
app/Http/Controllers/MailController.php
Normal file
170
app/Http/Controllers/MailController.php
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
|
||||
use Carbon;
|
||||
use Request;
|
||||
use Response;
|
||||
use App\Models\LeadMail;
|
||||
use App\Models\CustomerMail;
|
||||
use App\Models\CustomerFewoMail;
|
||||
|
||||
class MailController extends Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('admin');
|
||||
}
|
||||
|
||||
public function leads()
|
||||
{
|
||||
$data = [
|
||||
];
|
||||
return view('mails.lead', $data);
|
||||
}
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
$data = [
|
||||
];
|
||||
return view('mails.booking', $data);
|
||||
}
|
||||
|
||||
public function bookingFewos()
|
||||
{
|
||||
$data = [
|
||||
];
|
||||
return view('mails.booking_fewo', $data);
|
||||
}
|
||||
|
||||
|
||||
public function leadDatatable()
|
||||
{
|
||||
$query = LeadMail::with('lead')->with('customer')->select('lead_mails.*');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (LeadMail $lead_mail) {
|
||||
return '<a href="'.route('lead_detail', [$lead_mail->lead_id]).'#collapseLeadMails" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('lead_id', function (LeadMail $lead_mail) {
|
||||
return '<a data-order="'.$lead_mail->lead_id.'" href="'.route('lead_detail', [$lead_mail->lead_id]).'#collapseLeadMails">'.$lead_mail->lead_id.'</a>';
|
||||
})
|
||||
->addColumn('send', function (LeadMail $lead_mail) {
|
||||
return $lead_mail->send ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
})
|
||||
->addColumn('date', function (LeadMail $lead_mail) {
|
||||
if($lead_mail->send){
|
||||
return '<span class="badge badge-success" style="background-color: #94ae59"><i class="fa fa-check-circle"></i> '.$lead_mail->sent_at.'</span>';
|
||||
}
|
||||
return '<span class="badge badge-default"><i class="fa fa-times-circle"></i> '.$lead_mail->sent_at.'</span>';
|
||||
})
|
||||
->orderColumn('lead_id', 'lead_id $1')
|
||||
->orderColumn('send', 'send $1')
|
||||
->orderColumn('date', 'sent_at $1')
|
||||
|
||||
->filterColumn('id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('lead_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('lead_id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->rawColumns(['action_edit', 'send', 'date', 'lead_id'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function bookingDatatable()
|
||||
{
|
||||
$query = CustomerMail::with('booking')->with('customer')->select('customer_mails.*');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (CustomerMail $customer_mail) {
|
||||
return '<a href="'.route('booking_detail', [$customer_mail->booking_id]).'#collapseBookingMails" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('booking', function (CustomerMail $customer_mail) {
|
||||
$out = $customer_mail->booking->travel_country_id ? $customer_mail->booking->travel_country->name." | " : "- | ";
|
||||
$out .= $customer_mail->booking->travelagenda_id ? $customer_mail->booking->travel_agenda->name."" : "-";
|
||||
return $out;
|
||||
})
|
||||
->addColumn('booking_id', function (CustomerMail $customer_mail) {
|
||||
return '<a data-order="'.$customer_mail->booking_id.'" href="'.route('booking_detail', [$customer_mail->booking_id]).'#collapseBookingMails">'.$customer_mail->booking_id.'</a>';
|
||||
})
|
||||
->addColumn('send', function (CustomerMail $customer_mail) {
|
||||
return $customer_mail->send ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
})
|
||||
->addColumn('date', function (CustomerMail $customer_mail) {
|
||||
if($customer_mail->send){
|
||||
return '<span class="badge badge-success" style="background-color: #94ae59"><i class="fa fa-check-circle"></i> '.$customer_mail->sent_at.'</span>';
|
||||
}
|
||||
return '<span class="badge badge-default"><i class="fa fa-times-circle"></i> '.$customer_mail->sent_at.'</span>';
|
||||
})
|
||||
->orderColumn('booking_id', 'booking_id $1')
|
||||
->orderColumn('send', 'send $1')
|
||||
->orderColumn('date', 'sent_at $1')
|
||||
|
||||
->filterColumn('id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('booking_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('booking_id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->rawColumns(['action_edit', 'send', 'date', 'booking_id'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function bookingFewoDatatable()
|
||||
{
|
||||
$query = CustomerFewoMail::with('booking')->with('customer')->select('customer_fewo_mails.*');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (CustomerFewoMail $customer_fewo_mail) {
|
||||
return '<a href="'.route('travel_user_booking_fewo_detail', [$customer_fewo_mail->travel_user_booking_fewo_id]).'#collapseBookingMails" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('booking', function (CustomerFewoMail $customer_fewo_mail) {
|
||||
$out = ($customer_fewo_mail->booking && $customer_fewo_mail->booking->fewo_lodging) ? $customer_fewo_mail->booking->fewo_lodging->name : "-";
|
||||
return $out;
|
||||
})
|
||||
->addColumn('booking_id', function (CustomerFewoMail $customer_fewo_mail) {
|
||||
return '<a data-order="'.$customer_fewo_mail->travel_user_booking_fewo_id.'" href="'.route('travel_user_booking_fewo_detail', [$customer_fewo_mail->travel_user_booking_fewo_id]).'#collapseBookingMails">'.$customer_fewo_mail->travel_user_booking_fewo_id.'</a>';
|
||||
})
|
||||
->addColumn('send', function (CustomerFewoMail $customer_fewo_mail) {
|
||||
return $customer_fewo_mail->send ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
|
||||
})
|
||||
->addColumn('date', function (CustomerFewoMail $customer_fewo_mail) {
|
||||
if($customer_fewo_mail->send){
|
||||
return '<span class="badge badge-success" style="background-color: #94ae59"><i class="fa fa-check-circle"></i> '.$customer_fewo_mail->sent_at.'</span>';
|
||||
}
|
||||
return '<span class="badge badge-default"><i class="fa fa-times-circle"></i> '.$customer_fewo_mail->sent_at.'</span>';
|
||||
})
|
||||
->orderColumn('booking_id', 'booking_id $1')
|
||||
->orderColumn('send', 'send $1')
|
||||
->orderColumn('date', 'sent_at $1')
|
||||
|
||||
->filterColumn('id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->filterColumn('booking_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('booking_id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->rawColumns(['action_edit', 'send', 'date', 'booking_id'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -331,7 +331,15 @@ class TravelUserBookingFewoController extends Controller
|
|||
});
|
||||
}
|
||||
})
|
||||
->rawColumns(['action_edit', 'travel_user', 'is_calendar', 'is_mail', 'booking_fewo_notice', 'action_delete'])
|
||||
->addColumn('last_fewo_email', function (TravelUserBookingFewo $travel_user_booking_fewo) {
|
||||
//umbuchen
|
||||
if($travel_user_booking_fewo->customer_fewo_mails->count()){
|
||||
$fewo_mail = $travel_user_booking_fewo->customer_fewo_mail_last;
|
||||
return '<a data-order="'.$fewo_mail->getSentAtRaw().'" href="'.route('travel_user_booking_fewo_detail', [$travel_user_booking_fewo->id]).'#collapseLeadMails" data-order="'.$fewo_mail->sent_at.'"><span class="badge '.($fewo_mail->is_answer ? 'badge-default' : 'badge-secondary').'">'.$fewo_mail->sent_at.'</span></a>';
|
||||
}
|
||||
return '<span data-order="">-</span>';
|
||||
})
|
||||
->rawColumns(['action_edit', 'travel_user', 'is_calendar', 'is_mail', 'booking_fewo_notice', 'last_fewo_email', 'action_delete'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,15 +143,15 @@ class Customer extends Model
|
|||
}
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
return $this->hasMany(Booking::class, 'customer_id');
|
||||
}
|
||||
public function coupons()
|
||||
{
|
||||
return $this->hasMany(Coupon::class);
|
||||
return $this->hasMany(Coupon::class, 'customer_id');
|
||||
}
|
||||
public function leads()
|
||||
{
|
||||
return $this->hasMany(Lead::class);
|
||||
return $this->hasMany(Lead::class, 'customer_id');
|
||||
}
|
||||
|
||||
public function getSalutation(){
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ class CustomerFewoMail extends Model
|
|||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(TravelUserBookingFewo::class);
|
||||
return $this->belongsTo(TravelUserBookingFewo::class, 'travel_user_booking_fewo_id');
|
||||
}
|
||||
|
||||
public function travel_user()
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@
|
|||
namespace App\Repositories;
|
||||
|
||||
|
||||
use Auth;
|
||||
use App\Models\Lead;
|
||||
use App\Services\Util;
|
||||
use App\Models\Booking;
|
||||
use App\Models\BookingNotice;
|
||||
use Auth;
|
||||
use App\Models\BookingCompanyService;
|
||||
use App\Models\BookingCountryService;
|
||||
use App\Models\BookingProviderService;
|
||||
|
|
@ -46,11 +48,37 @@ class BookingRepository extends BaseRepository {
|
|||
return $this->model;
|
||||
}
|
||||
|
||||
public function updateLeadStatus($id, $data){
|
||||
|
||||
$this->model = Booking::findOrFail($id);
|
||||
|
||||
if(isset($data['lead'])){
|
||||
$lead = $this->model->lead;
|
||||
if($lead->id != $data['lead']['id']){
|
||||
abort(500);
|
||||
}
|
||||
$lead->status_id = $data['lead']['status_id'];
|
||||
$lead->is_rebook = isset($data['lead']['is_rebook']) ? true : false;
|
||||
$lead->is_closed = isset($data['lead']['is_closed']) ? true : false;
|
||||
$lead->save();
|
||||
}
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
public function updateBooking($id, $data){
|
||||
|
||||
$this->model = Booking::findOrFail($id);
|
||||
|
||||
$fill = [
|
||||
'sf_guard_user_id' => $data['sf_guard_user_id'],
|
||||
'booking_date' => $data['booking_date'] ? _reformat_date($data['booking_date']) : null,
|
||||
'travel_number' => $data['travel_number'],
|
||||
'travel_country_id' => $data['travel_country_id'] ? $data['travel_country_id'] : null,
|
||||
'travelagenda_id' => $data['travelagenda_id'] ? $data['travelagenda_id'] : null,
|
||||
'travel_category_id' => $data['travel_category_id'] ? $data['travel_category_id'] : null,
|
||||
'start_date' => $data['start_date'] ? _reformat_date($data['start_date']) : null,
|
||||
'end_date' => $data['end_date'] ? _reformat_date($data['end_date']) : null,
|
||||
'title' => $data['title'],
|
||||
'paying_out' => $data['paying_out'],
|
||||
'paying_out_status' => $data['paying_out_status'],
|
||||
'airline_id' => $data['airline_id'],
|
||||
|
|
@ -63,11 +91,17 @@ class BookingRepository extends BaseRepository {
|
|||
'filekey' => $data['filekey'],
|
||||
'is_rail_fly' => isset($data['is_rail_fly']) ? true : false,
|
||||
'notice' => $data['notice'],
|
||||
'ev_number' => $data['ev_number'],
|
||||
'merlin_order_number' => $data['merlin_order_number'],
|
||||
];
|
||||
|
||||
$this->model->fill($fill);
|
||||
$this->model->save();
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
public function updateBookingServices($id, $data){
|
||||
|
||||
$this->model = Booking::findOrFail($id);
|
||||
if(isset($data['country_service'])){
|
||||
$this->updateCountryService($data['country_service']);
|
||||
}
|
||||
|
|
@ -79,11 +113,38 @@ class BookingRepository extends BaseRepository {
|
|||
if(isset($data['company_service'])){
|
||||
$this->updateCompanyService($data['company_service']);
|
||||
}
|
||||
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
public function updateCountryService($country_services){
|
||||
public function updateBookingNumber($id, $data){
|
||||
|
||||
$this->model = Booking::findOrFail($id);
|
||||
$fill = [
|
||||
'ev_number' => $data['ev_number'],
|
||||
'merlin_order_number' => $data['merlin_order_number'],
|
||||
];
|
||||
$this->model->fill($fill);
|
||||
$this->model->save();
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
public function updateBookingPrice($id, $data){
|
||||
|
||||
$this->model = Booking::findOrFail($id);
|
||||
$fill = [
|
||||
'deposit_total' => $data['deposit_total'] ? Util::_clean_float($data['deposit_total']) : 0,
|
||||
'final_payment' => $data['final_payment'] ? Util::_clean_float($data['final_payment']) : 0,
|
||||
'final_payment_date' => $data['final_payment_date'] ? _reformat_date($data['final_payment_date']) : null,
|
||||
];
|
||||
$this->model->fill($fill);
|
||||
$this->model->save();
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function updateCountryService($country_services){
|
||||
foreach ($country_services as $country_service_id=>$val){
|
||||
$booking_country_service = BookingCountryService::where('travel_country_service_id', '=', $country_service_id)
|
||||
->where('booking_id', '=', $this->model->id)->first();
|
||||
|
|
@ -103,7 +164,7 @@ class BookingRepository extends BaseRepository {
|
|||
}
|
||||
}
|
||||
|
||||
public function updateProviderService($provider_service){
|
||||
private function updateProviderService($provider_service){
|
||||
foreach ($provider_service as $provider_service_id=>$val){
|
||||
$booking_provider_service = BookingProviderService::where('service_provider_service_id', '=', $provider_service_id)
|
||||
->where('booking_id', '=', $this->model->id)->first();
|
||||
|
|
@ -123,7 +184,7 @@ class BookingRepository extends BaseRepository {
|
|||
}
|
||||
}
|
||||
|
||||
public function updateCompanyService($company_service){
|
||||
private function updateCompanyService($company_service){
|
||||
foreach ($company_service as $company_service_id=>$val){
|
||||
$booking_company_service = BookingCompanyService::where('travel_company_service_id', '=', $company_service_id)
|
||||
->where('booking_id', '=', $this->model->id)->first();
|
||||
|
|
|
|||
|
|
@ -16,27 +16,13 @@ class CustomerRepository extends BaseRepository {
|
|||
|
||||
public function updateCustomer($id, $data)
|
||||
{
|
||||
|
||||
$this->model = Customer::findOrFail($id);
|
||||
$fill = [
|
||||
'salutation_id' => $data['salutation_id'],
|
||||
'name' => $data['name'],
|
||||
'firstname' => $data['firstname'],
|
||||
'street' => $data['street'],
|
||||
'zip' => $data['zip'],
|
||||
'city' => $data['city'],
|
||||
'email' => $data['email'],
|
||||
'phone' => $data['phone'],
|
||||
'phonemobile' => $data['phonemobile'],
|
||||
'country_id' => $data['country_id'],
|
||||
];
|
||||
$this->model->fill($fill);
|
||||
$this->model->fill($data);
|
||||
$this->model->save();
|
||||
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
|
||||
public function updateCustomerFromLead($id, $data){
|
||||
|
||||
$lead = Lead::findOrFail($id);
|
||||
|
|
|
|||
46
app/Services/Model.php
Normal file
46
app/Services/Model.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Status;
|
||||
use App\Models\SfGuardUser;
|
||||
use App\Models\Sym\TravelCountry as SymTravelCountry;
|
||||
use App\Models\TravelAgenda;
|
||||
use App\Models\TravelCountry;
|
||||
use App\Models\TravelCategory;
|
||||
|
||||
class Model
|
||||
{
|
||||
|
||||
public static function getSfGuardUserArray(){
|
||||
return SfGuardUser::where('is_active', 1)->get()->pluck('fullname', 'id');
|
||||
}
|
||||
|
||||
public static function getTravelCountryArray($emtpy = false){
|
||||
$TravelCountry = TravelCountry::where('active_backend', 1)->orderBy('name')->get()->pluck('name', 'id');
|
||||
return $emtpy ? $TravelCountry->prepend('-', 0) : $TravelCountry;
|
||||
|
||||
}
|
||||
|
||||
public static function getTravelCategoryArray($emtpy = false){
|
||||
$TravelCategory = TravelCategory::orderBy('name')->get()->pluck('name', 'id');
|
||||
return $emtpy ? $TravelCategory->prepend('-', 0) : $TravelCategory;
|
||||
|
||||
}
|
||||
|
||||
public static function getTravelAgendaArray($emtpy = false){
|
||||
$TravelAgenda = TravelAgenda::orderBy('name')->get()->pluck('name', 'id');
|
||||
return $emtpy ? $TravelAgenda->prepend('-', 0) : $TravelAgenda;
|
||||
}
|
||||
|
||||
public static function getSymTravelCountryArray($emtpy = false){
|
||||
$TravelAgenda = SymTravelCountry::orderBy('name')->get()->pluck('name', 'id');
|
||||
return $emtpy ? $TravelAgenda->prepend('-', 0) : $TravelAgenda;
|
||||
}
|
||||
|
||||
public static function getStatusArray($emtpy = false){
|
||||
$Status = Status::orderBy('name')->get()->pluck('name', 'id');
|
||||
return $emtpy ? $Status->prepend('-', 0) : $Status;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -15,10 +15,13 @@ return [
|
|||
'crm-bo-bo' => ['name' => 'ADMIN CRM > Buchungen > Buchungen' , 'color' => 'admin'],
|
||||
'crm-bo-le' => ['name' => 'ADMIN CRM > Buchungen > Anfragen' , 'color' => 'admin'],
|
||||
'crm-bo-cu' => ['name' => 'ADMIN CRM > Buchungen > Kunden' , 'color' => 'admin'],
|
||||
'crm-bo-ma' => ['name' => 'ADMIN CRM > Buchungen > Kunden Mails' , 'color' => 'admin'],
|
||||
'crm-cm' => ['name' => 'ADMIN CRM > Kundenverwaltung' , 'color' => 'admin'],
|
||||
'crm-cm-cf' => ['name' => 'ADMIN CRM > Kundenverwaltung > Kunden (FeWo)' , 'color' => 'admin'],
|
||||
'crm-cm-bf' => ['name' => 'ADMIN CRM > Kundenverwaltung > Buchungen (FeWo)' , 'color' => 'admin'],
|
||||
'crm-mail' => ['name' => 'ADMIN CRM > E-Mails' , 'color' => 'admin'],
|
||||
'crm-mail-le' => ['name' => 'ADMIN CRM > E-Mails > Anfragen' , 'color' => 'admin'],
|
||||
'crm-mail-bo' => ['name' => 'ADMIN CRM > E-Mails > Buchungen' , 'color' => 'admin'],
|
||||
'crm-mail-bf' => ['name' => 'ADMIN CRM > E-Mails > Buchungen (Fewo)' , 'color' => 'admin'],
|
||||
'crm-old-cm' => ['name' => 'ADMIN CRM altes System > Kundenverwaltung' , 'color' => 'info'],
|
||||
'cms' => ['name' => 'ADMIN CMS' , 'color' => 'secondary'],
|
||||
'cms-iq-assets' => ['name' => 'ADMIN CMS > Medien' , 'color' => 'secondary'],
|
||||
|
|
|
|||
|
|
@ -5,41 +5,59 @@
|
|||
<div class="collapse" id="collapseBookingBooking">
|
||||
|
||||
<div class="card-body row">
|
||||
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="sf_guard_user_id">{{ __('Sachbearbeiter') }}</label>
|
||||
{{ Form::text('sf_guard_user_id', $booking->sf_guard_user->first_name." ".$booking->sf_guard_user->last_name, array('placeholder'=>__('Sachbearbeiter'), 'class'=>'form-control', 'id'=>'sf_guard_user_id', 'readonly')) }}
|
||||
<label for="sf_guard_user_id" class="form-label">{{ __('Sachbearbeiter') }}*</label>
|
||||
{{ Form::select('sf_guard_user_id', \App\Services\Model::getSfGuardUserArray() , $booking->sf_guard_user_id, array('class'=>'custom-select', 'id'=>'sf_guard_user_id', 'required'=>true)) }}
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="booking_date">{{ __('Buchungsdatum') }}</label>
|
||||
{{ Form::text('booking_date', _format_date($booking->booking_date), array('placeholder'=>__('Buchungsdatum'), 'class'=>'form-control', 'id'=>'booking_date', 'readonly')) }}
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="travel_country_id">{{ __('Reiseland') }}</label>
|
||||
{{ Form::text('travel_country_id', $booking->travel_country ? $booking->travel_country->name : '', array('placeholder'=>__('Reiseland'), 'class'=>'form-control', 'id'=>'travel_country_id', 'readonly')) }}
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar-alt"></i></span>
|
||||
</div>
|
||||
{{ Form::text('booking_date', _format_date($booking->booking_date), array('placeholder'=>__('Buchungsdatum'), 'class'=>'form-control datepicker-base', 'id'=>'booking_date')) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="travel_number">{{ __('Reisenummer') }}</label>
|
||||
{{ Form::text('travel_number', $booking->travel_number, array('placeholder'=>__('Reisenummer'), 'class'=>'form-control', 'id'=>'travel_number', 'readonly')) }}
|
||||
{{ Form::text('travel_number', $booking->travel_number, array('placeholder'=>__('Reisenummer'), 'class'=>'form-control', 'id'=>'travel_number')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label for="travel_country_id" class="form-label">{{ __('Reiseland') }}</label>
|
||||
{{ Form::select('travel_country_id', \App\Services\Model::getSymTravelCountryArray(true) , $booking->travel_country_id, array('class'=>'custom-select', 'id'=>'travel_country_id')) }}
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="travelagenda_id">{{ __('Reiseprogramm') }}</label>
|
||||
{{ Form::text('travelagenda_id', $booking->travel_agenda ? $booking->travel_agenda->name : '', array('placeholder'=>__('Reiseprogramm'), 'class'=>'form-control', 'id'=>'travelagenda_id', 'readonly')) }}
|
||||
{{ Form::select('travelagenda_id', \App\Services\Model::getTravelAgendaArray(true) , $booking->travelagenda_id, array('class'=>'custom-select', 'id'=>'travelagenda_id')) }}
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="travel_category_id">{{ __('Reiseart') }}</label>
|
||||
{{ Form::text('travel_category_id', $booking->travel_category ? $booking->travel_category->name : '', array('placeholder'=>__('Reiseart'), 'class'=>'form-control', 'id'=>'travel_category_id', 'readonly')) }}
|
||||
{{ Form::select('travel_category_id', \App\Services\Model::getTravelCategoryArray(true) , $booking->travel_category_id, array('class'=>'custom-select', 'id'=>'travel_category_id')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="start_date">{{ __('Aufenthalt vom') }}</label>
|
||||
{{ Form::text('start_date', _format_date($booking->start_date), array('placeholder'=>__('Aufenthalt vom'), 'class'=>'form-control', 'id'=>'start_date', 'readonly')) }}
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar-alt"></i></span>
|
||||
</div>
|
||||
{{ Form::text('start_date', _format_date($booking->start_date), array('placeholder'=>__('Aufenthalt vom'), 'class'=>'form-control datepicker-base', 'id'=>'start_date')) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="end_date">{{ __('Aufenthalt bis') }}</label>
|
||||
{{ Form::text('end_date', _format_date($booking->end_date), array('placeholder'=>__('Aufenthalt bis'), 'class'=>'form-control', 'id'=>'end_date', 'readonly')) }}
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar-alt"></i></span>
|
||||
</div>
|
||||
{{ Form::text('end_date', _format_date($booking->end_date), array('placeholder'=>__('Aufenthalt bis'), 'class'=>'form-control datepicker-base', 'id'=>'end_date')) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="title">{{ __('Reisetitel') }}</label>
|
||||
{{ Form::text('title', $booking->title, array('placeholder'=>__('Reisetitel'), 'class'=>'form-control', 'id'=>'title', 'readonly')) }}
|
||||
{{ Form::text('title', $booking->title, array('placeholder'=>__('Reisetitel'), 'class'=>'form-control', 'id'=>'title')) }}
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
|
|
@ -60,7 +78,12 @@
|
|||
</div>
|
||||
<div class="form-group col-sm-6 col-md-3">
|
||||
<label class="form-label" for="refund_date">{{ __('Refund Datum') }}</label>
|
||||
{{ Form::text('refund_date', _format_date($booking->refund_date), array('placeholder'=>__('Refund Datum'), 'class'=>'form-control datepicker-base', 'id'=>'refund_date')) }}
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar-alt"></i></span>
|
||||
</div>
|
||||
{{ Form::text('refund_date', _format_date($booking->refund_date), array('placeholder'=>__('Refund Datum'), 'class'=>'form-control datepicker-base', 'id'=>'refund_date')) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-3">
|
||||
<label class="form-label" for="xx_tkt">{{ __('XX TKT') }}</label>
|
||||
|
|
@ -68,7 +91,12 @@
|
|||
</div>
|
||||
<div class="form-group col-sm-6 col-md-3">
|
||||
<label class="form-label" for="xx_tkt_date">{{ __('XX TKT Datum') }}</label>
|
||||
{{ Form::text('xx_tkt_date', _format_date($booking->xx_tkt_date), array('placeholder'=>__('XX TKT Datum'), 'class'=>'form-control datepicker-base', 'id'=>'xx_tkt_date')) }}
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar-alt"></i></span>
|
||||
</div>
|
||||
{{ Form::text('xx_tkt_date', _format_date($booking->xx_tkt_date), array('placeholder'=>__('XX TKT Datum'), 'class'=>'form-control datepicker-base', 'id'=>'xx_tkt_date')) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-3">
|
||||
<label class="form-label" for="hold">{{ __('Hold') }}</label>
|
||||
|
|
@ -91,7 +119,12 @@
|
|||
</div>
|
||||
<div class="form-group col-sm-6 col-md-3">
|
||||
<label class="form-label" for="lawyer_date">{{ __('Anwaltsfrist') }}</label>
|
||||
{{ Form::text('lawyer_date', _format_date($booking->lawyer_date), array('placeholder'=>__('Anwaltsfrist'), 'class'=>'form-control datepicker-base', 'id'=>'lawyer_date')) }}
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar-alt"></i></span>
|
||||
</div>
|
||||
{{ Form::text('lawyer_date', _format_date($booking->lawyer_date), array('placeholder'=>__('Anwaltsfrist'), 'class'=>'form-control datepicker-base', 'id'=>'lawyer_date')) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-12 col-md-12">
|
||||
|
|
|
|||
|
|
@ -15,11 +15,14 @@
|
|||
{{ Form::text('lead[id]', $booking->lead->id, array('placeholder'=>__('Anfrage ID'), 'class'=>'form-control', 'id'=>'lead_id', 'readonly')) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="form-label" for="lead_status_id">{{ __('Status') }}</label>
|
||||
{{ Form::text('lead[status_id]', $booking->lead->status ? $booking->lead->status->name : '', array('placeholder'=>__('Status'), 'class'=>'form-control', 'id'=>'lead_status_id', 'readonly')) }}
|
||||
|
||||
<div class="form-group col-sm-6 col-md-6">
|
||||
<label class="form-label" for="lead_status_id">{{ __('Status ändern') }} </label>
|
||||
{{ Form::select('lead[status_id]', \App\Models\Lead::getStatusArray() , $booking->lead->status_id, array('class'=>'custom-select')) }}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="custom-control custom-checkbox mt-2">
|
||||
{!! Form::checkbox('lead[is_rebook]', 1, $booking->lead->is_rebook, ['class'=>'custom-control-input', 'readonly']) !!}
|
||||
|
|
@ -33,6 +36,13 @@
|
|||
<span class="custom-control-label">{{__('Vorgang abgeschlossen')}}</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<div class="text-left mt-2">
|
||||
<button type="submit" name="action" value="save_lead_status" class="btn btn-sm btn-secondary">Änderungen speichern</button>
|
||||
<a href="{{route('leads')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,20 +3,28 @@
|
|||
<strong style="line-height: 1.6em">MyJack</strong>
|
||||
</h6>
|
||||
<div class="collapse" id="collapseBookingMyJack">
|
||||
|
||||
<div class="card-body row">
|
||||
<div class="form-group col-sm-4">
|
||||
<label class="form-label" for="merlin_order_number">{{ __('MyJack Nr.') }}</label>
|
||||
{{ Form::text('merlin_order_number', $booking->merlin_order_number, array('placeholder'=>__('MyJack Nr.'), 'class'=>'form-control', 'id'=>'merlin_order_number')) }}
|
||||
</div>
|
||||
<div class="form-group col-sm-4">
|
||||
<label class="form-label" for="ev_number">{{ __('EV Nummer') }}</label>
|
||||
{{ Form::text('ev_number', $booking->ev_number, array('placeholder'=>__('EV Nummer'), 'class'=>'form-control', 'id'=>'ev_number', 'readonly')) }}
|
||||
{{ Form::select('ev_number', ['E01'=>'E01', 'E02'=>'E02', 'E03'=>'E03', 'E04'=>'E04'] , $booking->ev_number, array('class'=>'custom-select', 'id'=>'ev_number' )) }}
|
||||
</div>
|
||||
<div class="form-group col-sm-4">
|
||||
<label class="form-label" for="booking_konto">{{ __('Konto') }}</label>
|
||||
{{ Form::text('booking_konto', 4011, array('placeholder'=>__('Konto'), 'class'=>'form-control', 'id'=>'booking_konto', 'readonly')) }}
|
||||
</div>
|
||||
<div class="form-group col-sm-4">
|
||||
<label class="form-label" for="merlin_order_number">{{ __('MyJack Nr.') }}</label>
|
||||
{{ Form::text('merlin_order_number', $booking->merlin_order_number, array('placeholder'=>__('MyJack Nr.'), 'class'=>'form-control', 'id'=>'merlin_order_number', 'readonly')) }}
|
||||
{{ Form::text('booking_konto', $booking->getKontoNumber(), array('placeholder'=>__('Konto'), 'class'=>'form-control', 'id'=>'booking_konto')) }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
<div class="text-left mt-3">
|
||||
<button type="submit" name="action" value="update_booking_number" class="btn btn-sm btn-secondary">{{ __('save changes') }}</button>
|
||||
<a href="{{route('bookings')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">€</span>
|
||||
</div>
|
||||
{{ Form::text('deposit_total', $booking->deposit_total, array('placeholder'=>__('Anzahlung'), 'class'=>'form-control', 'id'=>'deposit_total', 'readonly')) }}
|
||||
{{ Form::text('deposit_total', $booking->deposit_total, array('placeholder'=>__('Anzahlung'), 'class'=>'form-control', 'id'=>'deposit_total')) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
@ -107,20 +107,29 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">€</span>
|
||||
</div>
|
||||
{{ Form::text('final_payment', $booking->final_payment, array('placeholder'=>__('Restzahlung'), 'class'=>'form-control', 'id'=>'final_payment', 'readonly')) }}
|
||||
{{ Form::text('final_payment', $booking->final_payment, array('placeholder'=>__('Restzahlung'), 'class'=>'form-control', 'id'=>'final_payment')) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="final_payment_date">{{ __('Restzahlung bis') }}</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">€</span>
|
||||
<span class="input-group-text"><i class="fa fa-calendar-alt"></i></span>
|
||||
</div>
|
||||
{{ Form::text('final_payment_date', $booking->getFinalPaymentDateFormat(), array('placeholder'=>__('Restzahlung bis'), 'class'=>'form-control', 'id'=>'final_payment_date', 'readonly')) }}
|
||||
{{ Form::text('final_payment_date', $booking->getFinalPaymentDateFormat(), array('placeholder'=>__('Restzahlung bis'), 'class'=>'form-control datepicker-base', 'id'=>'final_payment_date')) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
<div class="text-left mt-3">
|
||||
<button type="submit" name="action" value="update_booking_price" class="btn btn-sm btn-secondary">{{ __('save changes') }}</button>
|
||||
<a href="{{route('bookings')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
<div class="col-12">
|
||||
<hr>
|
||||
<div class="text-left mt-3">
|
||||
<button type="submit" name="action" value="update_booking" class="btn btn-sm btn-secondary">{{ __('save changes') }}</button>
|
||||
<button type="submit" name="action" value="update_booking_services" class="btn btn-sm btn-secondary">{{ __('save changes') }}</button>
|
||||
<a href="{{route('bookings')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
{!! Form::open(['url' => route('booking_detail', [$id]), 'class' => 'form-horizontal', 'id'=>'lead-form-validation']) !!}
|
||||
{!! Form::open(['url' => route('booking_detail', [$id]), 'class' => 'form-horizontal', 'id'=>'booking-form-validation']) !!}
|
||||
|
||||
<input type="hidden" name="id" id="id" value="{{$id}}">
|
||||
|
||||
|
|
|
|||
171
resources/views/customer/_detail_booking.blade.php
Normal file
171
resources/views/customer/_detail_booking.blade.php
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
<div class="card mb-2 border-primary">
|
||||
<h6 class="card-header bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseCustomerBooking" aria-expanded="false" aria-controls="collapseCustomerBooking">
|
||||
<strong style="line-height: 1.6em">Anfragen
|
||||
<span class="badge badge-secondary">{{ $customer->leads->count()}} </span> |
|
||||
</strong>
|
||||
|
||||
<strong style="line-height: 1.6em">Buchung
|
||||
<span class="badge badge-secondary">{{ $customer->bookings->count()}} </span> |
|
||||
</strong>
|
||||
|
||||
<strong style="line-height: 1.6em">Gutscheine
|
||||
<span class="badge badge-secondary">{{ $customer->coupons->count()}} </span>
|
||||
</strong>
|
||||
</h6>
|
||||
|
||||
<div class="collapse" id="collapseCustomerBooking">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="max-width: 60px;">AnfrageID</th>
|
||||
<th>{{__('Sachbearbeiter')}}</th>
|
||||
<th>{{__('Status')}}</th>
|
||||
<th>{{__('Anfrage-Datum')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($customer->leads)
|
||||
@foreach ($customer->leads as $lead)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ route('lead_detail', [$lead->id]) }}" class="btn icon-btn btn-sm btn-primary">
|
||||
<span class="fa fa-edit"></span>
|
||||
</a>
|
||||
{{ $lead->id }}
|
||||
</td>
|
||||
<td>
|
||||
@if($lead->sf_guard_user_id && $lead->sf_guard_user)
|
||||
{{ $lead->sf_guard_user->first_name }} {{ $lead->sf_guard_user->last_name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{!! $lead->getStatusBadge() !!}
|
||||
</td>
|
||||
<td>
|
||||
{{ _format_date($lead->request_date) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<hr class="mt-3 mb-3">
|
||||
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="max-width: 60px;">BuchnungsID</th>
|
||||
<th>{{__('Reiseland')}}</th>
|
||||
<th>{{__('Programm')}}</th>
|
||||
<th>{{__('Anreise')}}</th>
|
||||
<th>{{__('Abreise')}}</th>
|
||||
<th>{{__('Sachbearbeiter')}}</th>
|
||||
<th>{{__('Status')}}</th>
|
||||
<th>{{__('Datum')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($customer->bookings)
|
||||
@foreach ($customer->bookings as $booking)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ route('booking_detail', [$booking->id]) }}" class="btn icon-btn btn-sm btn-primary">
|
||||
<span class="fa fa-edit"></span>
|
||||
</a>
|
||||
{{ $booking->id }}
|
||||
</td>
|
||||
<td>
|
||||
@if($booking->travel_country_id && $booking->travel_country)
|
||||
{{ $booking->travel_country->name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($booking->travelagenda_id && $booking->travel_agenda)
|
||||
{{ $booking->travel_agenda->name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ _format_date($booking->start_date) }}</td>
|
||||
<td>{{ _format_date($booking->end_date) }}</td>
|
||||
<td>
|
||||
@if($booking->sf_guard_user_id && $booking->sf_guard_user)
|
||||
{{ $booking->sf_guard_user->first_name }} {{ $booking->sf_guard_user->last_name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($booking->lead)
|
||||
{!! $booking->lead->getStatusBadge($booking) !!}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ _format_date($booking->booking_date) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<hr class="mt-3 mb-3">
|
||||
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{__('Gutschein')}}</th>
|
||||
<th>{{__('Wert')}}</th>
|
||||
<th>{{__('Ausstellungsdatum')}}</th>
|
||||
<th>{{__('Gültig bis')}}</th>
|
||||
<th>{{__('Eingelöst')}}</th>
|
||||
<th>{{__('#')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($customer->coupons)
|
||||
@foreach ($customer->coupons as $coupon)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ route('customer_file_show', ['coupon', $coupon->id]) }}" target="_blank" class="badge badge-md badge-warning">
|
||||
<i class="fa fa-file-pdf mr-1"></i> Gutschein {{$coupon->number}}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ \App\Services\Util::_number_format($coupon->value)}} €
|
||||
</td>
|
||||
<td>
|
||||
{{\App\Services\Util::_format_date($coupon->issue_date, 'date')}}
|
||||
</td>
|
||||
<td>
|
||||
{{\App\Services\Util::_format_date($coupon->valid_date, 'date')}}
|
||||
</td>
|
||||
<td>
|
||||
@if($coupon->is_redeemed)
|
||||
<i class="fa fa-check-circle text-success"></i> {{\App\Services\Util::_format_date($coupon->redeem_date, 'date')}}
|
||||
@else
|
||||
<i class="fa fa-times-circle text-danger"></i>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="{{ route('customer_file_show', ['coupon', $coupon->id, true]) }}" class="btn btn-xs btn-default"
|
||||
title="Download" data-placement="left" rel="tooltip">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
77
resources/views/customer/_detail_customer.blade.php
Normal file
77
resources/views/customer/_detail_customer.blade.php
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<div class="card mb-2 border-primary">
|
||||
<h6 class="card-header bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseCustomerDetail" aria-expanded="false" aria-controls="collapseCustomerDetail">
|
||||
<strong style="line-height: 1.6em">Kunde</strong>
|
||||
</h6>
|
||||
<div class="collapse" id="collapseCustomerDetail">
|
||||
<div class="card-body">
|
||||
@if($customer->count())
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="form-label" for="customer_id">{{ __('Kunden ID') }}</label>
|
||||
{{ Form::text('customer_id', $customer->id, array('placeholder'=>__('Kunden ID'), 'class'=>'form-control', 'id'=>'customer_id', 'readonly')) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
<label for="salutation_id" class="form-label">{{ __('Anrede') }}*</label>
|
||||
{{ Form::select('salutation_id', \App\Models\Customer::$salutationType , $customer->salutation_id, array('class'=>'custom-select', 'required'=>true)) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-4">
|
||||
<label class="form-label" for="firstname">{{ __('Vorname') }}*</label>
|
||||
{{ Form::text('firstname', $customer->firstname, array('placeholder'=>__('Vorname'), 'class'=>'form-control', 'id'=>'firstname', 'required'=>true)) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-5">
|
||||
<label class="form-label" for="name">{{ __('Nachname') }}*</label>
|
||||
{{ Form::text('name', $customer->name, array('placeholder'=>__('Nachname'), 'class'=>'form-control', 'id'=>'name', 'required'=>true)) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-12">
|
||||
<label class="form-label" for="street">{{ __('Straße') }}</label>
|
||||
{{ Form::text('street', $customer->street, array('placeholder'=>__('Straße'), 'class'=>'form-control', 'id'=>'street')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
<label class="form-label" for="zip">{{ __('PLZ') }}</label>
|
||||
{{ Form::text('zip', $customer->zip, array('placeholder'=>__('PLZ'), 'class'=>'form-control', 'id'=>'zip')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-4">
|
||||
<label class="form-label" for="city">{{ __('Stadt') }}</label>
|
||||
{{ Form::text('city', $customer->city, array('placeholder'=>__('Stadt'), 'class'=>'form-control', 'id'=>'city')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-5">
|
||||
<label class="form-label" for="country_id">{{ __('Land') }}*</label>
|
||||
{{ Form::select('country_id', \App\Models\Customer::getCustomerCountriesArray() , $customer->country_id, array('class'=>'custom-select', 'required'=>true)) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="form-label" for="phone">{{ __('Telefon') }}</label>
|
||||
{{ Form::text('phone', $customer->phone, array('placeholder'=>__('Telefon'), 'class'=>'form-control', 'id'=>'phone')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="form-label" for="phonemobile">{{ __('Telefon Mobil') }}</label>
|
||||
{{ Form::text('phonemobile', $customer->phonemobile, array('placeholder'=>__('Telefon Mobil'), 'class'=>'form-control', 'id'=>'phonemobile')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-12">
|
||||
<label class="form-label" for="email">{{ __('E-Mail') }}*</label>
|
||||
{{ Form::text('email', $customer->email, array('placeholder'=>__('E-Mail'), 'class'=>'form-control', 'id'=>'email', 'required'=>true)) }}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<div class="text-left mt-2">
|
||||
<button type="submit" name="action" value="saveCustomer" class="btn btn-sm btn-secondary">Änderungen speichern</button>
|
||||
<a href="{{route('customers')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4,12 +4,6 @@
|
|||
|
||||
<style>
|
||||
body {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.btn-xs {
|
||||
line-height: 1.3em;
|
||||
|
|
@ -32,40 +26,104 @@
|
|||
.input-group-text {
|
||||
padding: 0.438rem 0.475rem;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="float-right mt-3">
|
||||
<a href="{{route('customers')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
||||
<a href="{{ make_old_url('/index.php/customer/'.$customer->id.'/edit') }}" class="btn btn-sm btn-default float-right">{{ __('zurück ins CRM v2') }}</a>
|
||||
</div>
|
||||
|
||||
<h4 class="font-weight-bold py-3 mb-1">
|
||||
Kunden verwalten
|
||||
</h4>
|
||||
|
||||
{!! Form::open(['url' => route('customer_detail', [$id]), 'class' => 'form-horizontal', 'id'=>'lead-form-validation']) !!}
|
||||
<ul class="nav nav-sm nav-tabs nav-justified tabs-alt mb-3" id="top-nav-quick-jump">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseCustomerDetail">
|
||||
Kunde
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseCustomerBooking">
|
||||
Anfrage / Buchung
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
{!! Form::open(['url' => route('customer_detail', [$id]), 'class' => 'form-horizontal', 'id'=>'customer-form-validation']) !!}
|
||||
<input type="hidden" name="id" id="id" value="{{$id}}">
|
||||
|
||||
<!-- Kunde -->
|
||||
@include('customer._detail_customer')
|
||||
|
||||
<!-- draft -->
|
||||
<div class="card mb-2">
|
||||
<div class="card-body row">
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="form-label" for="customer_id">{{ __('Nr.') }}*</label>
|
||||
{{ Form::text('id', $customer->id, array('placeholder'=>__('Nr.'), 'class'=>'form-control', 'id'=>'customer_id', 'readonly')) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="text-left mt-3">
|
||||
<button type="submit" name="action" value="saveAll" class="btn btn-submit">{{ __('save changes') }}</button>
|
||||
<a href="{{route('customers')}}" class="btn btn-default">{{ __('zur Übersicht') }}</a>
|
||||
<a href="{{ make_old_url('/index.php/customer/'.$customer->id.'/edit') }}" class="btn btn-default float-right">{{ __('zurück ins CRM v2') }}</a>
|
||||
@if($id !== "new" && $customer)
|
||||
@include('customer._detail_booking')
|
||||
@endif
|
||||
|
||||
<div class="float-right mt-3">
|
||||
<a href="{{route('customers')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
||||
<a href="{{ make_old_url('/index.php/customer/'.$customer->id.'/edit') }}" class="btn btn-sm btn-default float-right">{{ __('zurück ins CRM v2') }}</a>
|
||||
</div>
|
||||
|
||||
{!! Form::close() !!}
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
var collapseHashValue = null;
|
||||
$('[rel="tooltip"]').tooltip({trigger: "hover"});
|
||||
|
||||
$('#top-nav-quick-jump .nav-link').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$('#top-nav-quick-jump .nav-link').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
var collapse_id = $(this).data('collapse');
|
||||
//console.log(collapse_id);
|
||||
$(collapse_id).collapse('show');
|
||||
// animate
|
||||
$('html, body').animate({
|
||||
scrollTop: $(collapse_id).parent('.card').offset().top
|
||||
}, 300, function(){
|
||||
// when done, add hash to url
|
||||
// (default click behaviour)
|
||||
window.location.hash = collapse_id;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".collapse").on('shown.bs.collapse', function (){
|
||||
if(collapseHashValue){
|
||||
$('a[data-collapse="#'+collapseHashValue+'"]').click();
|
||||
collapseHashValue = null;
|
||||
}
|
||||
CookiesAddJSONValue('customer_collapse', $(this).attr('id'));
|
||||
window.location.hash = "#"+$(this).attr('id');
|
||||
|
||||
});
|
||||
|
||||
$(".collapse").on('hidden.bs.collapse', function (){
|
||||
CookiesRemoveJSONValue('customer_collapse', $(this).attr('id'));
|
||||
});
|
||||
|
||||
function init_site(){
|
||||
if(window.location.hash){
|
||||
value = $(window.location.hash).attr('id');
|
||||
if(value){
|
||||
collapseHashValue = value;
|
||||
CookiesAddJSONValue('customer_collapse', value);
|
||||
}
|
||||
}
|
||||
var customer_collapses = Cookies.get('customer_collapse');
|
||||
if (customer_collapses != null)
|
||||
{
|
||||
customer_collapses = JSON.parse(customer_collapses);
|
||||
for (var customer_collapse in customer_collapses){
|
||||
$("#"+customer_collapses[customer_collapse]).collapse("show");
|
||||
}
|
||||
}
|
||||
}
|
||||
init_site();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -51,14 +51,16 @@
|
|||
<ul class="sidenav-menu">
|
||||
@if(Auth::user()->isPermission('crm-bo-re'))
|
||||
<li class="sidenav-item{{ Request::is('requests') ? ' active' : '' }}">
|
||||
<a href="{{ route('requests') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-search"></i><div>Übersicht</div></a>
|
||||
<a href="{{ route('requests') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-search"></i><div>Buchungen</div></a>
|
||||
</li>
|
||||
@endif
|
||||
@if(Auth::user()->isPermission('crm-bo-bo'))
|
||||
{{--
|
||||
@if(Auth::user()->isPermission('crm-bo-bo'))
|
||||
<li class="sidenav-item{{ Request::is(['bookings', 'booking/*']) ? ' active' : '' }}">
|
||||
<a href="{{ route('bookings') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-bed"></i><div>Buchungen</div></a>
|
||||
</li>
|
||||
@endif
|
||||
--}}
|
||||
@if(Auth::user()->isPermission('crm-bo-le'))
|
||||
<li class="sidenav-item{{ Request::is(['leads', 'lead/*']) ? ' active' : '' }}">
|
||||
<a href="{{ route('leads') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-contact"></i><div>Anfragen</div></a>
|
||||
|
|
@ -69,11 +71,6 @@
|
|||
<a href="{{ route('customers') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-people"></i><div>Kunden</div></a>
|
||||
</li>
|
||||
@endif
|
||||
@if(Auth::user()->isPermission('crm-bo-ma'))
|
||||
<li class="sidenav-item{{ Request::is(['customer_mails', 'customer_mail/*']) ? ' active' : '' }}">
|
||||
<a href="{{ route('customer_mails') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-mail"></i><div>Kunden Mails</div></a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
|
|
@ -97,6 +94,32 @@
|
|||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->isPermission('crm-mail'))
|
||||
<li class="sidenav-item{{ Request::is(['mail/leads', 'mail/bookings', 'mail/booking_fewos']) ? ' open' : '' }}">
|
||||
<a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
|
||||
<i class="sidenav-icon ion ion-ios-mail"></i>
|
||||
<div>E-Mails</div>
|
||||
</a>
|
||||
<ul class="sidenav-menu">
|
||||
@if(Auth::user()->isPermission('crm-mail-le'))
|
||||
<li class="sidenav-item{{ Request::is(['mail/leads', 'mail/lead/*']) ? ' active' : '' }}">
|
||||
<a href="{{ route('mail_leads') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-people"></i><div>Anfragen </div></a>
|
||||
</li>
|
||||
@endif
|
||||
@if(Auth::user()->isPermission('crm-mail-bo'))
|
||||
<li class="sidenav-item{{ Request::is(['mail/bookings', 'mail/booking/*']) ? ' active' : '' }}">
|
||||
<a href="{{ route('mail_bookings') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-bed"></i><div>Buchungen</div></a>
|
||||
</li>
|
||||
@endif
|
||||
@if(Auth::user()->isPermission('crm-mail-bf'))
|
||||
<li class="sidenav-item{{ Request::is(['mail/booking_fewos', 'mail/booking_fewo/*']) ? ' active' : '' }}">
|
||||
<a href="{{ route('mail_booking_fewos') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-home"></i><div>Buchungen (FeWo)</div></a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
@endif
|
||||
@if(Auth::user()->isPermission('crm-old-cm'))
|
||||
<li class="sidenav-divider mb-1"></li>
|
||||
|
|
|
|||
71
resources/views/lead/_detail_booking.blade.php
Normal file
71
resources/views/lead/_detail_booking.blade.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<div class="card mb-2 border-primary">
|
||||
<h6 class="card-header bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseLeadBooking" aria-expanded="false" aria-controls="collapseLeadBooking">
|
||||
<strong style="line-height: 1.6em">Buchung
|
||||
<span class="badge badge-secondary">{{ $lead->bookings->count()}} </span>
|
||||
</strong>
|
||||
</h6>
|
||||
<div class="collapse" id="collapseLeadBooking">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12"><hr></div>
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="max-width: 60px;">BuchnungsID</th>
|
||||
<th>{{__('Reiseland')}}</th>
|
||||
<th>{{__('Programm')}}</th>
|
||||
<th>{{__('Anreise')}}</th>
|
||||
<th>{{__('Abreise')}}</th>
|
||||
<th>{{__('Sachbearbeiter')}}</th>
|
||||
<th>{{__('Status')}}</th>
|
||||
<th>{{__('Datum')}}</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($lead->bookings)
|
||||
@foreach ($lead->bookings as $booking)
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<a href="{{ route('booking_detail', [$booking->id]) }}" class="btn icon-btn btn-sm btn-primary">
|
||||
<span class="fa fa-edit"></span>
|
||||
</a>
|
||||
{{ $booking->id }}
|
||||
</th>
|
||||
<td>
|
||||
@if($booking->travel_country_id && $booking->travel_country)
|
||||
{{ $booking->travel_country->name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($booking->travelagenda_id && $booking->travel_agenda)
|
||||
{{ $booking->travel_agenda->name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ _format_date($booking->start_date) }}</td>
|
||||
<td>{{ _format_date($booking->end_date) }}</td>
|
||||
<td>
|
||||
@if($booking->sf_guard_user_id && $booking->sf_guard_user)
|
||||
{{ $booking->sf_guard_user->first_name }} {{ $booking->sf_guard_user->last_name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($booking->lead)
|
||||
{!! $booking->lead->getStatusBadge($booking) !!}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ _format_date($booking->booking_date) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label for="sf_guard_user_id" class="form-label">{{ __('Sachbearbeiter') }}*</label>
|
||||
{{ Form::select('sf_guard_user_id', \App\Models\Lead::getSfGuardUserArray() , $lead->sf_guard_user_id, array('class'=>'custom-select', 'required'=>true)) }}
|
||||
{{ Form::select('sf_guard_user_id', \App\Services\Model::getSfGuardUserArray() , $lead->sf_guard_user_id, array('class'=>'custom-select', 'required'=>true)) }}
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="request_date">{{ __('Anfragedatum') }}*</label>
|
||||
|
|
@ -45,17 +45,17 @@
|
|||
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label for="travelcountry_id" class="form-label">{{ __('Reiseland') }}*</label>
|
||||
{{ Form::select('travelcountry_id', \App\Models\Lead::getTravelCountryArray(true) , $lead->travelcountry_id, array('class'=>'custom-select')) }}
|
||||
{{ Form::select('travelcountry_id', \App\Services\Model::getTravelCountryArray(true) , $lead->travelcountry_id, array('class'=>'custom-select')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="travelagenda_id">{{ __('Reiseprogramm') }}</label>
|
||||
{{ Form::select('travelagenda_id', \App\Models\Lead::getTravelAgendaArray(true) , $lead->travelagenda_id, array('class'=>'custom-select')) }}
|
||||
{{ Form::select('travelagenda_id', \App\Services\Model::getTravelAgendaArray(true) , $lead->travelagenda_id, array('class'=>'custom-select')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-6 col-md-4">
|
||||
<label class="form-label" for="travelcategory_id">{{ __('Reiseart') }}</label>
|
||||
{{ Form::select('travelcategory_id', \App\Models\Lead::getTravelCategoryArray(true) , $lead->travelcategory_id, array('class'=>'custom-select')) }}
|
||||
{{ Form::select('travelcategory_id', \App\Services\Model::getTravelCategoryArray(true) , $lead->travelcategory_id, array('class'=>'custom-select')) }}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
<h6 class="card-header bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseLeadMails" aria-expanded="false" aria-controls="collapseLeadMails">
|
||||
<strong style="line-height: 1.6em">E-Mails</strong>
|
||||
<span class="badge badge-secondary">{{$lead->lead_mails->count()}}</span>
|
||||
|
||||
</h6>
|
||||
<div class="collapse" id="collapseLeadMails">
|
||||
<div class="container-fluid d-flex align-items-stretch flex-grow-1 p-0">
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@
|
|||
<div class="collapse" id="collapseLeadStatus">
|
||||
<div class="card-body">
|
||||
@if($lead->count())
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
|
|
|
|||
|
|
@ -57,7 +57,11 @@
|
|||
Status
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseLeadBooking">
|
||||
Buchung
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseLeadMails">
|
||||
E-Mails
|
||||
|
|
@ -86,12 +90,13 @@
|
|||
@include('lead._detail_status')
|
||||
{!! Form::close() !!}
|
||||
|
||||
@if($id !== "new")
|
||||
@if($id !== "new" && $lead)
|
||||
@include('lead._detail_booking')
|
||||
@include('lead._detail_mails')
|
||||
@include('lead._detail_files')
|
||||
@include('lead._detail_notice')
|
||||
@endif
|
||||
|
||||
@include('lead._detail_notice')
|
||||
|
||||
<div class="float-right mt-3">
|
||||
<a href="{{route('leads')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
|
||||
|
|
|
|||
52
resources/views/mails/booking.blade.php
Normal file
52
resources/views/mails/booking.blade.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
@extends('layouts.layout-2')
|
||||
@section('content')
|
||||
<h4 class="font-weight-bold py-3 mb-4">
|
||||
{{ __('E-Mails Buchungen') }}
|
||||
</h4>
|
||||
<div class="card">
|
||||
<div class="card-datatable table-responsive">
|
||||
<table class="datatables-mails table table-striped table-bordered">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="max-width: 60px;"> </th>
|
||||
<th>{{__('BuchungID')}}</th>
|
||||
<th>{{__('Vorname')}}</th>
|
||||
<th>{{__('Nachname')}}</th>
|
||||
<th>{{__('E-Mail')}}</th>
|
||||
<th>{{__('Betreff')}}</th>
|
||||
<th>{{__('Buchung')}}</th>
|
||||
<th>{{__('gesendet')}}</th>
|
||||
<th>{{__('Datum')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$('.datatables-mails').dataTable({
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
"ajax": '{!! route('mail_booking_datatable') !!}',
|
||||
"order": [[ 8, "desc" ]],
|
||||
"columns": [
|
||||
{ data: 'action_edit', orderable: false, searchable: false},
|
||||
{ data: 'booking_id', name: 'booking_id' },
|
||||
{ data: 'customer.firstname', name: 'customer.firstname' },
|
||||
{ data: 'customer.name', name: 'customer.name' },
|
||||
{ data: 'email', name: 'email' },
|
||||
{ data: 'subject', name: 'subject' },
|
||||
{ data: 'booking', name: 'booking', searchable: false },
|
||||
{ data: 'send', name: 'send', searchable: false },
|
||||
{ data: 'date', name: 'date' },
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 100,
|
||||
"language": {
|
||||
"url": "/js/German.json"
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
52
resources/views/mails/booking_fewo.blade.php
Normal file
52
resources/views/mails/booking_fewo.blade.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
@extends('layouts.layout-2')
|
||||
@section('content')
|
||||
<h4 class="font-weight-bold py-3 mb-4">
|
||||
{{ __('E-Mails Buchungen FeWo') }}
|
||||
</h4>
|
||||
<div class="card">
|
||||
<div class="card-datatable table-responsive">
|
||||
<table class="datatables-mails table table-striped table-bordered">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="max-width: 60px;"> </th>
|
||||
<th>{{__('BuchnungID')}}</th>
|
||||
<th>{{__('Vorname')}}</th>
|
||||
<th>{{__('Nachname')}}</th>
|
||||
<th>{{__('E-Mail')}}</th>
|
||||
<th>{{__('Betreff')}}</th>
|
||||
<th>{{__('Buchung')}}</th>
|
||||
<th>{{__('gesendet')}}</th>
|
||||
<th>{{__('Datum')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$('.datatables-mails').dataTable({
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
"ajax": '{!! route('mail_booking_fewo_datatable') !!}',
|
||||
"order": [[ 8, "desc" ]],
|
||||
"columns": [
|
||||
{ data: 'action_edit', orderable: false, searchable: false},
|
||||
{ data: 'booking_id', name: 'booking_id' },
|
||||
{ data: 'customer.first_name', name: 'customer.first_name' },
|
||||
{ data: 'customer.last_name', last_name: 'customer.name' },
|
||||
{ data: 'email', name: 'email' },
|
||||
{ data: 'subject', name: 'subject' },
|
||||
{ data: 'booking', name: 'booking' },
|
||||
{ data: 'send', name: 'send', searchable: false },
|
||||
{ data: 'date', name: 'date' },
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 100,
|
||||
"language": {
|
||||
"url": "/js/German.json"
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
50
resources/views/mails/lead.blade.php
Normal file
50
resources/views/mails/lead.blade.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
@extends('layouts.layout-2')
|
||||
@section('content')
|
||||
<h4 class="font-weight-bold py-3 mb-4">
|
||||
{{ __('E-Mails Buchungen') }}
|
||||
</h4>
|
||||
<div class="card">
|
||||
<div class="card-datatable table-responsive">
|
||||
<table class="datatables-mails table table-striped table-bordered">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="max-width: 60px;"> </th>
|
||||
<th>{{__('AnfrageID')}}</th>
|
||||
<th>{{__('Vorname')}}</th>
|
||||
<th>{{__('Nachname')}}</th>
|
||||
<th>{{__('E-Mail')}}</th>
|
||||
<th>{{__('Betreff')}}</th>
|
||||
<th>{{__('gesendet')}}</th>
|
||||
<th>{{__('Datum')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$('.datatables-mails').dataTable({
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
"ajax": '{!! route('mail_lead_datatable') !!}',
|
||||
"order": [[ 7, "desc" ]],
|
||||
"columns": [
|
||||
{ data: 'action_edit', orderable: false, searchable: false},
|
||||
{ data: 'lead_id', name: 'lead_id' },
|
||||
{ data: 'customer.firstname', name: 'customer.firstname' },
|
||||
{ data: 'customer.name', name: 'customer.name' },
|
||||
{ data: 'email', name: 'email' },
|
||||
{ data: 'subject', name: 'subject' },
|
||||
{ data: 'send', name: 'send', searchable: false },
|
||||
{ data: 'date', name: 'date' },
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 100,
|
||||
"language": {
|
||||
"url": "/js/German.json"
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
|
@ -54,6 +54,7 @@
|
|||
<th>{{__('Mails')}}</th>
|
||||
<th>{{__('N.')}}</th>
|
||||
<th>{{__('Kanal')}}</th>
|
||||
<th>{{__('E-Mail')}}</th>
|
||||
<th>{{__('Datum')}}</th>
|
||||
<th>{{__('R.-Nr.')}}</th>
|
||||
<th style="max-width: 60px;">{{__('delete')}}</th>
|
||||
|
|
@ -90,6 +91,7 @@
|
|||
{ data: 'is_mail', name: 'is_mail', orderable: false },
|
||||
{ data: 'booking_fewo_notice', name: 'booking_fewo_notice', orderable: false },
|
||||
{ data: 'travel_booking_fewo_channel.name', name: 'travel_booking_fewo_channel.name' },
|
||||
{ data: 'last_fewo_email', name: 'last_fewo_email' },
|
||||
{ data: 'booking_date', name: 'booking_date' },
|
||||
{ data: 'invoice_number', name: 'invoice_number' },
|
||||
{ data: 'action_delete', orderable: false, searchable: false},
|
||||
|
|
|
|||
|
|
@ -110,6 +110,10 @@ Route::group(['middleware' => ['admin']], function()
|
|||
Route::get('/email_template/data/table', 'CustomerMailController@getEmailTemplates')->name('email_template_data_table');
|
||||
Route::get('/customer_mail/delete/{id}', 'CustomerMailController@delete')->name('customer_mail_delete');
|
||||
Route::post('customer_mail/ajax', 'CustomerMailController@ajax')->name('customer_mail_ajax');
|
||||
Route::get('/customer_mail/delete/{id}', 'CustomerMailController@delete')->name('customer_mail_delete');
|
||||
|
||||
Route::get('/customer_mail/detail/{id}', 'CustomerMailController@detail')->name('customer_mail_detail');
|
||||
Route::post('/customer_mail/detail/{id}/{action?}', 'CustomerMailController@store')->name('customer_mail_detail');
|
||||
|
||||
Route::post('/customer_fewo_mail/upload/attachment/{id}', 'CustomerFewoMailController@uploadAttachment')->name('customer_fewo_mail_upload_attachment');
|
||||
Route::post('/customer_fewo_mail/send/mail', 'CustomerFewoMailController@sendMail')->name('customer_fewo_mail_send_mail');
|
||||
|
|
@ -190,6 +194,7 @@ Route::group(['middleware' => ['admin']], function()
|
|||
Route::post('/booking/action/{action}/{id?}', 'BookingController@action')->name('booking_action');
|
||||
Route::get('/booking/delete/{id}/{del?}', 'BookingController@delete')->name('booking_delete');
|
||||
|
||||
|
||||
});
|
||||
Route::group(['middleware' => ['auth.permission:crm-bo-le']], function() {
|
||||
//Buchungen > Leads
|
||||
|
|
@ -210,14 +215,15 @@ Route::group(['middleware' => ['admin']], function()
|
|||
Route::post('/customer/detail/{id}', 'CustomerController@store')->name('customer_detail');
|
||||
Route::get('/customer/delete/{id}', 'CustomerController@delete')->name('customer_delete');
|
||||
});
|
||||
Route::group(['middleware' => ['auth.permission:crm-bo-ma']], function() {
|
||||
//Buchungen > Kunden
|
||||
Route::get('data/table/customer_mails', 'CustomerMailController@getCustomerMails')->name('data_table_customer_mails');
|
||||
Route::get('/customer_mails', 'CustomerMailController@index')->name('customer_mails');
|
||||
Route::get('/customer_mail/detail/{id}', 'CustomerMailController@detail')->name('customer_mail_detail');
|
||||
Route::post('/customer_mail/detail/{id}/{action?}', 'CustomerMailController@store')->name('customer_mail_detail');
|
||||
Route::get('/customer_mail/delete/{id}', 'CustomerMailController@delete')->name('customer_mail_delete');
|
||||
Route::group(['middleware' => ['auth.permission:crm-mail']], function() {
|
||||
//Emails > Anfragen / Buchungen / Fewo
|
||||
Route::get('/mail/leads', 'MailController@leads')->name('mail_leads');
|
||||
Route::get('/mail/bookings', 'MailController@bookings')->name('mail_bookings');
|
||||
Route::get('/mail/booking_fewos', 'MailController@bookingFewos')->name('mail_booking_fewos');
|
||||
|
||||
Route::get('/mail/lead/datatable', 'MailController@leadDatatable')->name('mail_lead_datatable');
|
||||
Route::get('/mail/booking/datatable', 'MailController@bookingDatatable')->name('mail_booking_datatable');
|
||||
Route::get('/mail/booking_fewo/datatable', 'MailController@bookingFewoDatatable')->name('mail_booking_fewo_datatable');
|
||||
});
|
||||
Route::group(['middleware' => ['auth.permission:crm-cm-cf']], function() {
|
||||
//Kundenverwaltung > Kunden (FeWo)
|
||||
|
|
@ -237,7 +243,6 @@ Route::group(['middleware' => ['admin']], function()
|
|||
Route::post('/travel_user_booking_fewo/modal/load', 'TravelUserBookingFewoController@loadModal')->name('travel_user_booking_fewo_modal_load');
|
||||
Route::post('travel_user_booking_fewo/ajax/requests', 'TravelUserBookingFewoController@getAjaxRequests')->name('travel_user_booking_fewo_ajax_requests');
|
||||
|
||||
|
||||
});
|
||||
Route::group(['middleware' => ['auth.permission:cms-cn-in']], function() {
|
||||
//CMS Infos
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue