This commit is contained in:
Kevin Adametz 2022-06-15 18:05:16 +02:00
parent 34a3d2196b
commit 93d1bea8e3
45 changed files with 1601 additions and 573 deletions

View file

@ -66,6 +66,7 @@ use Illuminate\Database\Eloquent\Collection;
* @property Collection|BookingInvoice[] $booking_invoices
* @property Collection|BookingServiceItem[] $booking_service_items
* @property Collection|BookingVoucher[] $booking_vouchers
* @property Collection|BookingVoucherAgency[] $booking_voucher_agencys
* @property Collection|Coupon[] $coupons
* @property Collection|InsuranceCertificate[] $insurance_certificates
* @property Collection|Participant[] $participants
@ -155,6 +156,7 @@ use Illuminate\Database\Eloquent\Collection;
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BookingStorno[] $booking_stornos
* @property-read int|null $booking_stornos_count
* @property-read int|null $booking_vouchers_count
* @property-read int|null $booking_voucher_agencys_count
* @property-read int|null $travel_insurances_count
* @property string|null $origin_start_date
* @property \Illuminate\Support\Carbon|null $lawyer_date
@ -496,6 +498,11 @@ class Booking extends Model
return $this->hasMany(BookingVoucher::class);
}
public function booking_voucher_agencys()
{
return $this->hasMany(BookingVoucherAgency::class);
}
public function travel_insurances()
{
return $this->hasMany(TravelInsurance::class);

View file

@ -0,0 +1,49 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class BookingVoucherAgency
*
* @property int $id
* @property int $booking_id
* @property boolean $binary_data
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Booking $booking
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucherAgency newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucherAgency newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucherAgency query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucherAgency whereBinaryData($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucherAgency whereBookingId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucherAgency whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucherAgency whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucherAgency whereUpdatedAt($value)
* @mixin \Eloquent
*/
class BookingVoucherAgency extends Model
{
protected $table = 'booking_voucher_agency';
protected $casts = [
'booking_id' => 'int',
];
protected $fillable = [
'booking_id',
'binary_data'
];
public function booking()
{
return $this->belongsTo(Booking::class);
}
}

View file

@ -0,0 +1,78 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class TravelInsurance
*
* @property int $id
* @property int $booking_id
* @property string $policy_number
* @property string $ak
* @property string $an
* @property string $akt
* @property float $premium
* @property string $request_data
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Booking $booking
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereAk($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereAkt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereAn($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereBookingId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance wherePolicyNumber($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance wherePremium($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereRequestData($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereUpdatedAt($value)
* @mixin \Eloquent
*/
class TravelArrivalPoint extends Model
{
protected $connection = 'mysql_stern';
protected $table = 'travel_arrival_point';
public $timestamps = false;
protected $casts = [
'travel_country_id' => 'int',
];
protected $fillable = [
'name',
'travel_country_id',
'active'
];
public function travel_programs()
{
return $this->hasMany(TravelProgram::class, 'travel_arrival_point_id');
}
//on crm
/* public function travel_country_crm()
{
return $this->belongsTo('App\Models\Sym\TravelCountry', 'travel_country_id', 'crm_id');
}
*/
//on stern DB relaunch
public function travel_country()
{
return $this->belongsTo('App\Models\TravelCountry', 'travel_country_id', 'id');
}
}

View file

@ -34,7 +34,8 @@ class TravelCategory extends Model
public $timestamps = false;
protected $fillable = [
'name'
'name',
'active'
];
public function bookings()
@ -46,4 +47,9 @@ class TravelCategory extends Model
{
return $this->hasMany(Lead::class, 'travelcategory_id');
}
public function travel_programs()
{
return $this->hasMany(TravelProgram::class, 'travel_category');
}
}

View file

@ -0,0 +1,60 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class TravelInsurance
*
* @property int $id
* @property int $booking_id
* @property string $policy_number
* @property string $ak
* @property string $an
* @property string $akt
* @property float $premium
* @property string $request_data
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Booking $booking
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereAk($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereAkt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereAn($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereBookingId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance wherePolicyNumber($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance wherePremium($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereRequestData($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereUpdatedAt($value)
* @mixin \Eloquent
*/
class TravelGerneralNote extends Model
{
protected $connection = 'mysql_stern';
protected $table = 'travel_general_notes';
public $timestamps = false;
protected $fillable = [
'name',
'text',
// 'active'
];
public function travel_programs()
{
return $this->hasMany(TravelProgram::class, 'generalnote');
}
}

View file

@ -163,6 +163,12 @@ class TravelProgram extends Model
1 => 'Vermittlung'
];
public static $programDiscountTypes = [
0 => '€',
1 => '%'
];
public static $travelCategoryTypes = [
1 => 'Ägypten-Reise',
2 => 'Israel-Reise',
@ -172,9 +178,9 @@ class TravelProgram extends Model
public function travel_arrival_point()
{
return $this->belongsTo(TravelArrivalPoint::class);
return $this->belongsTo(TravelArrivalPoint::class, 'travel_arrival_point_id');
}
//default 1 sterntours
public function travel_organizer()
{
return $this->belongsTo(TravelOrganizer::class, 'organizer');

View file

@ -690,7 +690,7 @@ class TravelUserBookingFewo extends Model
$salutation = __('Dear Sir')." ".$this->travel_user->last_name;
}
if($this->travel_user->salutation_id == 2){
$salutation = __('Dear Sir')." ".$this->travel_user->last_name;
$salutation = __('Dear Mrs')." ".$this->travel_user->last_name;
}
if($this->travel_user->salutation_id == 4){
$salutation = __('Dear customer')." ".$this->travel_user->last_name;