Lead create Booking

This commit is contained in:
Kevin Adametz 2022-04-14 13:22:03 +02:00
parent 3df0e93c2c
commit 34a3d2196b
18 changed files with 462 additions and 160 deletions

View file

@ -75,7 +75,9 @@ class HTMLHelper
private static $salutation = [
1 => 'Herr',
2 => 'Frau',
3 => 'Firma',
3 => 'Divers/keine Anrede',
4 => 'Firma',
];

View file

@ -74,7 +74,7 @@ class Model
}
public static function getSalutationArray($emtpy = false){
$Salutation = Salutation::orderBy('name')->get()->pluck('name', 'id');
$Salutation = Salutation::orderBy('id')->get()->pluck('name', 'id');
return $emtpy ? $Salutation->prepend('-', 0) : $Salutation;
}

View file

@ -147,13 +147,13 @@ class Placeholder
public static function replaceBooking(Booking $booking, $content)
{
$dear = $booking->customer->salutation_id == 1 ? 'geehrter' : 'geehrte';
$dear = $booking->customer->getSalutationDear();
$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 = isset($booking->customer->salutation) ? $booking->customer->salutation->name : '-';
$salutation = isset($booking->customer->salutation) ? $booking->customer->getSalutationName() : '-';
$filekey = $booking->filekey;
$flight_info = "";
@ -174,7 +174,7 @@ class Placeholder
$myjack_nr = $booking->merlin_order_number;
$participants = "Teilnehmer:<br>";
$participants = "Teilnehmer:in<br>";
//first
if($booking->participant_firstname){
$participants .= $booking->participant_salutation_id ? \App\Services\Model::getSalutationById($booking->participant_salutation_id)." " : '';
@ -209,12 +209,12 @@ class Placeholder
public static function replaceBookingFewo(TravelUserBookingFewo $booking_fewo, $content)
{
$dear = $booking_fewo->travel_user->salutation_id == 1 ? 'geehrter' : 'geehrte';
$dear = $booking_fewo->travel_user->getSalutationDear();
$first_name = $booking_fewo->travel_user->first_name;
$last_name = $booking_fewo->travel_user->last_name;
$title = $booking_fewo->travel_user->title;
$program = $booking_fewo->fewo_lodging_id ? $booking_fewo->fewo_lodging->name : "-";
$salutation = $booking_fewo->travel_user->salutation_id == 1 ? 'Herr' : 'Frau';
$salutation = $booking_fewo->travel_user->getSalutationName();
$start_date = $booking_fewo->from_date;
$end_date = $booking_fewo->to_date;
$booking_date = $booking_fewo->booking_date;
@ -232,19 +232,19 @@ class Placeholder
public static function replaceLead(Lead $lead, $content)
{
$dear = $lead->customer->salutation_id == 1 ? 'geehrter' : 'geehrte';
$dear = $lead->customer->getSalutationDear();
$first_name = $lead->customer->firstname;
$last_name = $lead->customer->name;
$title = $lead->customer->title;
$country = $lead->travelcountry_id ? $lead->travel_country->name : "-";
$program = $lead->travelagenda_id ? $lead->travel_agenda->name : "-";
$salutation = $lead->customer->salutation_id == 1 ? 'Herr' : 'Frau';
$salutation = $lead->customer->getSalutationName();
$start_date = $lead->travelperiod_start ? _format_date($lead->travelperiod_start) : '-';
$end_date = $lead->travelperiod_end ? _format_date($lead->travelperiod_end) : '-';
$booking_date = $lead->request_date ? _format_date($lead->request_date) : '-';
$participants = "";
if($lead->lead_participants->count()){
$participants = "Teilnehmer:<br>";
$participants = "Teilnehmer:in<br>";
foreach($lead->lead_participants as $participant){
$participants .= $participant->salutation ? $participant->salutation->name." " : '';
$participants .= $participant->participant_firstname." ".$participant->participant_name;