Lead create Booking
This commit is contained in:
parent
3df0e93c2c
commit
34a3d2196b
18 changed files with 462 additions and 160 deletions
|
|
@ -29,13 +29,14 @@ class BookingController extends Controller
|
|||
{
|
||||
|
||||
$request = \Request::all();
|
||||
if($request['key'] !== $this->successKey){
|
||||
if(!isset($request['key']) || $request['key'] !== $this->successKey){
|
||||
return response()->json(['error' => "key"], 401);
|
||||
}
|
||||
$travel_booking = TravelBooking::find($request['travel_booking_id']);
|
||||
|
||||
// $travel_booking = TravelBooking::find(2458);
|
||||
if(!$travel_booking){
|
||||
//# vor testing
|
||||
//$travel_booking = TravelBooking::find(2922);
|
||||
if(!isset($travel_booking) || !$travel_booking){
|
||||
return response()->json(['error' => 'no-booking-found'], $this->successStatus);
|
||||
}
|
||||
|
||||
|
|
@ -81,8 +82,6 @@ class BookingController extends Controller
|
|||
'new_drafts' => $travel_booking->drafts === null ? 0 : 1,
|
||||
'sf_guard_user_id' => 15,
|
||||
'branch_id' => 4,
|
||||
'travel_country_id' => isset($travel_booking->selected_travel['travel_country_id'][0]) ? $travel_booking->selected_travel['travel_country_id'][0] : null,
|
||||
'travel_category_id' => isset($travel_booking->selected_travel['travel_category_id']) ? $travel_booking->selected_travel['travel_category_id'] : null,
|
||||
'pax' => $travel_booking->selected_adults,
|
||||
'title' => isset($travel_booking->selected_travel['travel_title']) ? $travel_booking->selected_travel['travel_title'] : "",
|
||||
'comfort' => $comfort,
|
||||
|
|
@ -100,13 +99,15 @@ class BookingController extends Controller
|
|||
'participant_birthdate' => null,
|
||||
'participant_salutation_id' => null,
|
||||
'nationality_id' => null,
|
||||
'travel_company_id' => null,
|
||||
'price' => $travel_booking->price,
|
||||
'price_total' => $travel_booking->price_total,
|
||||
'deposit_total' => $travel_booking->deposit_total,
|
||||
'final_payment' => $travel_booking->final_payment,
|
||||
'final_payment_date' => $travel_booking->final_payment_date->format('Y-m-d'),
|
||||
'travel_country_id' => isset($travel_booking->selected_travel['travel_country_id'][0]) ? $travel_booking->selected_travel['travel_country_id'][0] : null,
|
||||
'travel_category_id' => isset($travel_booking->selected_travel['travel_category_id']) ? $travel_booking->selected_travel['travel_category_id'] : null,
|
||||
'travelagenda_id' => isset($travel_booking->selected_travel['travelagenda_id']) ? $travel_booking->selected_travel['travelagenda_id'] : null,
|
||||
'travel_company_id' => isset($travel_booking->selected_travel['travel_company_id']) ? $travel_booking->selected_travel['travel_company_id'] : 4,
|
||||
];
|
||||
|
||||
//createBooking
|
||||
|
|
|
|||
|
|
@ -60,6 +60,11 @@ class LeadController extends Controller
|
|||
{
|
||||
$data = Request::all();
|
||||
|
||||
if($data['action'] === 'createBooking'){
|
||||
$lead = $this->leadRepo->createBooking($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('lead_detail', [$id]).'#collapseLeadBooking');
|
||||
}
|
||||
if($data['action'] === 'saveCustomer'){
|
||||
$customer = $this->custRepo->updateCustomerFromLead($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class ServiceProviderController extends Controller
|
|||
$model = new ServiceProvider();
|
||||
$id = 'new';
|
||||
$model->active = 1;
|
||||
$model->id = 0;
|
||||
}else{
|
||||
$model = ServiceProvider::findOrFail($id);
|
||||
$id = $model->id;
|
||||
|
|
@ -49,7 +50,6 @@ class ServiceProviderController extends Controller
|
|||
public function update($id){
|
||||
|
||||
$data = Request::all();
|
||||
|
||||
if(isset($data['update-action'])){
|
||||
if($data['update-action'] === 'save-service-provider-service'){
|
||||
$data['active'] = true;//isset($data['active']) ? true : false;
|
||||
|
|
@ -70,7 +70,6 @@ class ServiceProviderController extends Controller
|
|||
|
||||
|
||||
$data['contact_emails'] = isset($data['contact_emails']) ? Util::_explodeLines($data['contact_emails']) : null;
|
||||
|
||||
if($id === "new"){
|
||||
$model = ServiceProvider::create($data);
|
||||
}else{
|
||||
|
|
@ -87,8 +86,17 @@ class ServiceProviderController extends Controller
|
|||
public function delete($id, $del="service_provider"){
|
||||
|
||||
if($del === 'service_provider') {
|
||||
abort(404, 'Noch keine Funktion');
|
||||
//abort(403, 'Noch keine Funktion');
|
||||
$model = ServiceProvider::findOrFail($id);
|
||||
if($model->service_provider_entries->count() > 0){
|
||||
\Session()->flash('alert-error', 'Der Leistungträger kann nicht gelöscht werden, dieser hat Einträge');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
if($model->service_provider_services->count() > 0){
|
||||
\Session()->flash('alert-error', 'Der Leistungträger kann nicht gelöscht werden, dieser hat Einträge Service');
|
||||
return redirect()->back();
|
||||
}
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect()->back();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue