Mail and Booking
This commit is contained in:
parent
62e84637b6
commit
5daea268f7
250 changed files with 5377 additions and 1473 deletions
56
app/Models/Airline.php
Normal file
56
app/Models/Airline.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Airline
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $name_full
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @package App\Models
|
||||
* @property array|null $contact_emails
|
||||
* @property array|null $emails
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereContactEmails($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereEmails($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereNameFull($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Airline extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'airlines';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'name_full',
|
||||
'emails',
|
||||
'contact_emails',
|
||||
];
|
||||
|
||||
protected $casts = ['contact_emails' => 'array'];
|
||||
|
||||
public function getContactEmailsStr($glue=PHP_EOL){
|
||||
if($this->contact_emails){
|
||||
return implode($glue, $this->contact_emails);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Arrangement
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ArrangementTemplate
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ArrangementType
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace App\Models;
|
|||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Booking
|
||||
|
|
@ -116,6 +116,44 @@ use Reliese\Database\Eloquent\Model;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereWebsiteId($value)
|
||||
* @mixin \Eloquent
|
||||
* @property-read int|null $service_provider_entries_count
|
||||
* @property float|null $canceled
|
||||
* @property float|null $price_canceled
|
||||
* @property int|null $paying_out
|
||||
* @property int|null $paying_out_status
|
||||
* @property int|null $airline_id
|
||||
* @property int|null $refund
|
||||
* @property \Illuminate\Support\Carbon|null $refund_date
|
||||
* @property int|null $hold
|
||||
* @property int|null $xx_tkt
|
||||
* @property string|null $xx_tkt_date
|
||||
* @property string|null $filekey
|
||||
* @property-read \App\Models\Airline|null $airline
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\CustomerMail[] $customer_mails
|
||||
* @property-read int|null $customer_mails_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\CustomerMail[] $customer_mails_sent_at
|
||||
* @property-read int|null $customer_mails_sent_at_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereAirlineId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereCanceled($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereFilekey($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereHold($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking wherePayingOut($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking wherePayingOutStatus($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking wherePriceCanceled($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereRefund($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereRefundDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereXxTkt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereXxTktDate($value)
|
||||
* @property int|null $is_rail_fly
|
||||
* @property string|null $notice
|
||||
* @property-read \App\Models\CustomerMail $customer_mail_last
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereIsRailFly($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereNotice($value)
|
||||
* @property-read int|null $booking_applications_count
|
||||
* @property-read int|null $booking_confirmations_count
|
||||
* @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 $travel_insurances_count
|
||||
*/
|
||||
class Booking extends Model
|
||||
{
|
||||
|
|
@ -144,6 +182,8 @@ class Booking extends Model
|
|||
'final_payment' => 'float',
|
||||
'travelagenda_id' => 'int',
|
||||
'paying_out' => 'int',
|
||||
'hold' => 'int',
|
||||
'airline_id' => 'int',
|
||||
'refund' => 'int',
|
||||
'xx_tkt' => 'int',
|
||||
|
||||
|
|
@ -192,6 +232,8 @@ class Booking extends Model
|
|||
'travelagenda_id',
|
||||
'paying_out',
|
||||
'paying_out_status',
|
||||
'airline_id',
|
||||
'hold',
|
||||
'refund',
|
||||
'refund_date',
|
||||
'xx_tkt',
|
||||
|
|
@ -225,7 +267,14 @@ class Booking extends Model
|
|||
2 => 'erledigt',
|
||||
];
|
||||
|
||||
|
||||
public static $customer_mail_dirs = [
|
||||
0 => ['name' => 'Reisender', 'icon'=>'ion-ios-filing'],
|
||||
1 => ['name' => 'Agentur', 'icon'=>'ion-ios-folder-open'],
|
||||
2 => ['name' => 'Flug', 'icon'=>'ion-ios-airplane'],
|
||||
3 => ['name' => 'Versicherung', 'icon'=>'ion-ios-help-buoy'],
|
||||
11 => ['name' => 'Entwürfe', 'icon'=>'ion-md-create'],
|
||||
12 => ['name' => 'Papierkorb', 'icon'=>'ion-md-trash'],
|
||||
];
|
||||
protected $paying_out_colors = [
|
||||
0 => '',
|
||||
1 => 'info',
|
||||
|
|
@ -252,6 +301,38 @@ class Booking extends Model
|
|||
1 => 'danger',
|
||||
2 => 'success',
|
||||
];
|
||||
|
||||
/*
|
||||
*
|
||||
* <ul class="tabscontrol flatlist clearfix" id="tabscontrol">
|
||||
<li class="tab"><a href="#customer" class="active"><?php echo __('Kunde') ?></a></li>
|
||||
<?php if ($booking->relatedExists('Application')): ?>
|
||||
<li class="tab"><a href="#application" class="active"><?php echo __('Reiseanmeldung') ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($booking->relatedExists('Confirmation')): ?>
|
||||
<li class="tab"><a href="#confirmation" class="active"><?php echo __('Reisebestätigung') ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($booking->relatedExists('Invoice')): ?>
|
||||
<li class="tab"><a href="#invoice" class="active"><?php echo __('Rechnung') ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($booking->relatedExists('Storno')): ?>
|
||||
<li class="tab"><a href="#storno" class="active"><?php echo __('Storno') ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($booking->relatedExists('TravelInsurance')): ?>
|
||||
<li class="tab"><a href="#travelinsurance" class="active"><?php echo __('Versicherung') ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($booking->relatedExists('InsuranceCertificate')): ?>
|
||||
<li class="tab"><a href="#insurance" class="active"><?php echo __('Sicherungsschein') ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($booking->relatedExists('Voucher')): ?>
|
||||
<li class="tab"><a href="#voucher" class="active"><?php echo __('Voucher') ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($booking->relatedExists('Coupon')): ?>
|
||||
<li class="tab"><a href="#coupon" class="active"><?php echo __('Gutscheine') ?></a></li>
|
||||
<?php endif; ?>
|
||||
|
||||
*/
|
||||
|
||||
/*public function branch()
|
||||
{
|
||||
return $this->belongsTo(Branch::class);
|
||||
|
|
@ -303,6 +384,11 @@ class Booking extends Model
|
|||
return $this->belongsTo(TravelAgenda::class, 'travelagenda_id');
|
||||
}
|
||||
|
||||
public function airline()
|
||||
{
|
||||
return $this->belongsTo(Airline::class, 'airline_id');
|
||||
}
|
||||
|
||||
public function arrangements()
|
||||
{
|
||||
return $this->hasMany(Arrangement::class);
|
||||
|
|
@ -313,35 +399,18 @@ class Booking extends Model
|
|||
return $this->hasMany(ArrangementType::class);
|
||||
}
|
||||
|
||||
/*public function booking_applications()
|
||||
{
|
||||
return $this->hasMany(BookingApplication::class);
|
||||
}
|
||||
|
||||
public function booking_confirmations()
|
||||
{
|
||||
return $this->hasMany(BookingConfirmation::class);
|
||||
}*/
|
||||
|
||||
public function booking_draft_items()
|
||||
{
|
||||
return $this->hasMany(BookingDraftItem::class)->orderBy('pos', 'ASC');
|
||||
}
|
||||
|
||||
/*public function booking_invoices()
|
||||
{
|
||||
return $this->hasMany(BookingInvoice::class);
|
||||
}*/
|
||||
|
||||
public function booking_service_items()
|
||||
{
|
||||
return $this->hasMany(BookingServiceItem::class);
|
||||
}
|
||||
|
||||
/*public function booking_vouchers()
|
||||
{
|
||||
return $this->hasMany(BookingVoucher::class);
|
||||
}*/
|
||||
|
||||
public function coupons()
|
||||
{
|
||||
|
|
@ -373,11 +442,41 @@ class Booking extends Model
|
|||
{
|
||||
return $this->hasMany(CustomerMail::class, 'booking_id')->orderBy('sent_at', 'ASC');
|
||||
}
|
||||
/*
|
||||
|
||||
public function customer_mail_last()
|
||||
{
|
||||
return $this->hasOne(CustomerMail::class, 'booking_id')->latest();
|
||||
}
|
||||
|
||||
public function booking_applications()
|
||||
{
|
||||
return $this->hasMany(BookingApplication::class);
|
||||
}
|
||||
|
||||
public function booking_confirmations()
|
||||
{
|
||||
return $this->hasMany(BookingConfirmation::class);
|
||||
}
|
||||
|
||||
public function booking_stornos()
|
||||
{
|
||||
return $this->hasMany(BookingStorno::class);
|
||||
}
|
||||
|
||||
/*public function booking_invoices()
|
||||
{
|
||||
return $this->hasMany(BookingInvoice::class);
|
||||
}*/
|
||||
|
||||
public function booking_vouchers()
|
||||
{
|
||||
return $this->hasMany(BookingVoucher::class);
|
||||
}
|
||||
|
||||
public function travel_insurances()
|
||||
{
|
||||
return $this->hasMany(TravelInsurance::class);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
public function calculate_price_total()
|
||||
|
|
@ -461,6 +560,21 @@ class Booking extends Model
|
|||
return Carbon::parse($this->attributes['end_date'])->format(\Util::formatDateDB());
|
||||
}
|
||||
|
||||
public function getBookingDateFormat(){
|
||||
if(!$this->attributes['booking_date']){ return ""; }
|
||||
return Carbon::parse($this->attributes['booking_date'])->format(\Util::formatDateDB());
|
||||
}
|
||||
|
||||
//erlös #getRevenueFactor
|
||||
public function proceedsRaw(){
|
||||
$total = 0;
|
||||
foreach ($this->service_provider_entries as $entry)
|
||||
{
|
||||
$total += $entry->amount / $entry->factor;
|
||||
}
|
||||
return $this->attributes['price'] - $total;
|
||||
|
||||
}
|
||||
|
||||
//erlös #getRevenueFactor
|
||||
public function proceeds(){
|
||||
|
|
@ -483,6 +597,16 @@ class Booking extends Model
|
|||
return $total;
|
||||
}
|
||||
|
||||
public function getServiceProviderPaymentsTotalRaw()
|
||||
{
|
||||
$total = 0;
|
||||
foreach ($this->service_provider_entries as $entry)
|
||||
{
|
||||
$total += $entry->amount;
|
||||
}
|
||||
return $total;
|
||||
}
|
||||
|
||||
public function getServiceProviderPaymentsTotal()
|
||||
{
|
||||
$total = 0;
|
||||
|
|
@ -513,6 +637,16 @@ class Booking extends Model
|
|||
return $this->ev_number;
|
||||
}
|
||||
|
||||
public function getBookingNumber()
|
||||
{
|
||||
if ($this->lead)
|
||||
{
|
||||
return $this->lead->id;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getPayingOutType(){
|
||||
return isset(self::$paying_out_types[$this->paying_out]) ? self::$paying_out_types[$this->paying_out] : '-';
|
||||
}
|
||||
|
|
@ -565,5 +699,14 @@ class Booking extends Model
|
|||
return isset($this->xx_tkt_colors[$this->xx_tkt]) ? $this->xx_tkt_colors[$this->xx_tkt] : '-';
|
||||
}
|
||||
|
||||
public function countCustomerMailsBy($dir, $country=false){
|
||||
|
||||
if($dir === 11){
|
||||
return $this->customer_mails->where('draft', true)->count();
|
||||
}
|
||||
if($country){
|
||||
return $this->customer_mails->where('dir', $dir)->where('travel_country_id', $country)->count();
|
||||
}
|
||||
return $this->customer_mails->where('dir', $dir)->count();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
53
app/Models/BookingApplication.php
Normal file
53
app/Models/BookingApplication.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BookingApplication
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property float $total
|
||||
* @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\BookingApplication newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingApplication newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingApplication query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingApplication whereBinaryData($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingApplication whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingApplication whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingApplication whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingApplication whereTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingApplication whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class BookingApplication extends Model
|
||||
{
|
||||
protected $table = 'booking_application';
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'total' => 'float',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'booking_id',
|
||||
'total',
|
||||
'binary_data'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
}
|
||||
72
app/Models/BookingConfirmation.php
Normal file
72
app/Models/BookingConfirmation.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BookingConfirmation
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property float $total
|
||||
* @property float $deposit
|
||||
* @property float $final_payment
|
||||
* @property Carbon $deposit_payment_date
|
||||
* @property Carbon $final_payment_date
|
||||
* @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\BookingConfirmation newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation whereBinaryData($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation whereDeposit($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation whereDepositPaymentDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation whereFinalPayment($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation whereFinalPaymentDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation whereTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingConfirmation whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class BookingConfirmation extends Model
|
||||
{
|
||||
protected $table = 'booking_confirmation';
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'total' => 'float',
|
||||
'deposit' => 'float',
|
||||
'final_payment' => 'float',
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'deposit_payment_date',
|
||||
'final_payment_date'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'booking_id',
|
||||
'total',
|
||||
'deposit',
|
||||
'final_payment',
|
||||
'deposit_payment_date',
|
||||
'final_payment_date',
|
||||
'binary_data'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -145,9 +145,15 @@ class BookingDraftItem extends Model
|
|||
public function getStartDateAttribute(){
|
||||
return isset($this->attributes['start_date']) ? Carbon::parse($this->attributes['start_date'])->format("d.m.Y") : '';
|
||||
}
|
||||
public function getStartDateRow(){
|
||||
return isset($this->attributes['start_date']) ? Carbon::parse($this->attributes['start_date']) : null;
|
||||
}
|
||||
public function getEndDateAttribute(){
|
||||
return isset($this->attributes['end_date']) ? Carbon::parse($this->attributes['end_date'])->format("d.m.Y") : '';
|
||||
}
|
||||
public function getEndDateRow(){
|
||||
return isset($this->attributes['end_date']) ? Carbon::parse($this->attributes['end_date']) : null;
|
||||
}
|
||||
|
||||
public function setStartDateAttribute($value)
|
||||
{
|
||||
|
|
@ -157,6 +163,10 @@ class BookingDraftItem extends Model
|
|||
$this->attributes['start_date'] = (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
}
|
||||
public function setStartDateRow($value)
|
||||
{
|
||||
$this->attributes['start_date'] = $value;
|
||||
}
|
||||
public function setEndDateAttribute($value){
|
||||
if (!$value) {
|
||||
$this->attributes['end_date'] = null;
|
||||
|
|
@ -164,6 +174,9 @@ class BookingDraftItem extends Model
|
|||
$this->attributes['end_date'] = (new Carbon($value))->format('Y-m-d');
|
||||
}
|
||||
}
|
||||
public function setEndDateRow($value){
|
||||
$this->attributes['end_date'] = $value;
|
||||
}
|
||||
|
||||
//price_adult
|
||||
public function setPriceAdultAttribute($value)
|
||||
|
|
|
|||
72
app/Models/BookingInvoice.php
Normal file
72
app/Models/BookingInvoice.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BookingInvoice
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property float $total
|
||||
* @property float $deposit
|
||||
* @property float $final_payment
|
||||
* @property Carbon $deposit_payment_date
|
||||
* @property Carbon $final_payment_date
|
||||
* @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\BookingInvoice newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice whereBinaryData($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice whereDeposit($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice whereDepositPaymentDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice whereFinalPayment($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice whereFinalPaymentDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice whereTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingInvoice whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class BookingInvoice extends Model
|
||||
{
|
||||
protected $table = 'booking_invoice';
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'total' => 'float',
|
||||
'deposit' => 'float',
|
||||
'final_payment' => 'float',
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'deposit_payment_date',
|
||||
'final_payment_date'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'booking_id',
|
||||
'total',
|
||||
'deposit',
|
||||
'final_payment',
|
||||
'deposit_payment_date',
|
||||
'final_payment_date',
|
||||
'binary_data'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BookingServiceItem
|
||||
|
|
|
|||
68
app/Models/BookingStorno.php
Normal file
68
app/Models/BookingStorno.php
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BookingStorno
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property float $total
|
||||
* @property float $storno
|
||||
* @property Carbon $storno_date
|
||||
* @property boolean $binary_data
|
||||
* @property bool $done
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Booking $booking
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereBinaryData($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereDone($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereStorno($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereStornoDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class BookingStorno extends Model
|
||||
{
|
||||
protected $table = 'booking_storno';
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'total' => 'float',
|
||||
'storno' => 'float',
|
||||
'done' => 'bool'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'storno_date'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'booking_id',
|
||||
'total',
|
||||
'storno',
|
||||
'storno_date',
|
||||
'binary_data',
|
||||
'done'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
}
|
||||
49
app/Models/BookingVoucher.php
Normal file
49
app/Models/BookingVoucher.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BookingVoucher
|
||||
*
|
||||
* @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\BookingVoucher newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucher newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucher query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucher whereBinaryData($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucher whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucher whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucher whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingVoucher whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class BookingVoucher extends Model
|
||||
{
|
||||
protected $table = 'booking_voucher';
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'booking_id',
|
||||
'binary_data'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class CMSAuthor
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace App\Models;
|
|||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Coupon
|
||||
|
|
@ -44,6 +44,8 @@ use Reliese\Database\Eloquent\Model;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereValidDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereValue($value)
|
||||
* @mixin \Eloquent
|
||||
* @property string|null $text
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereText($value)
|
||||
*/
|
||||
class Coupon extends Model
|
||||
{
|
||||
|
|
@ -90,4 +92,9 @@ class Coupon extends Model
|
|||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
|
||||
public function isLegal(){
|
||||
//TODO
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class CreditCardType
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace App\Models;
|
|||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Customer
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class CustomerFile
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $customer_id
|
||||
* @property int $customer_mail_id
|
||||
|
|
@ -24,11 +25,26 @@ use Reliese\Database\Eloquent\Model;
|
|||
* @property int $size
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Customer $customer
|
||||
* @property CustomerMail $customer_mail
|
||||
*
|
||||
* @package App\Models
|
||||
* @property-read \App\User $user
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereCustomerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereCustomerMailId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereDir($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereExt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereFilename($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereIdentifier($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereMine($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereOriginalName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereSize($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFile whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class CustomerFile extends Model
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ namespace App\Models;
|
|||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class CustomerMail
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property int $customer_id
|
||||
|
|
@ -20,8 +20,15 @@ use Reliese\Database\Eloquent\Model;
|
|||
* @property bool $is_answer
|
||||
* @property int $reply_id
|
||||
* @property string $email
|
||||
* @property string $recipient
|
||||
* @property string $cc
|
||||
* @property string $bcc
|
||||
* @property string $subject
|
||||
* @property string $message
|
||||
* @property int $dir
|
||||
* @property int $travel_country_id
|
||||
* @property bool $draft
|
||||
* @property bool $important
|
||||
* @property bool $send
|
||||
* @property bool $fail
|
||||
* @property string $error
|
||||
|
|
@ -30,28 +37,73 @@ use Reliese\Database\Eloquent\Model;
|
|||
* @property Carbon $delivered_at
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Booking $booking
|
||||
* @property Customer $customer
|
||||
* @property CustomerMail $customer_mail
|
||||
* @property TravelCountry $travel_country
|
||||
* @property Lead $lead
|
||||
* @property Collection|CustomerFile[] $customer_files
|
||||
* @property Collection|CustomerMail[] $customer_mails
|
||||
*
|
||||
* @package App\Models
|
||||
* @property-read int|null $customer_files_count
|
||||
* @property-read int|null $customer_mails_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereBcc($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereCc($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereCustomerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereDeliveredAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereDir($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereDraft($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereEmail($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereError($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereFail($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereImportant($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereIsAnswer($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereLeadId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereMessage($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereRecipient($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereReplyId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereScheduledAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereSend($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereSentAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereSubject($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereTravelCountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class CustomerMail extends Model
|
||||
{
|
||||
protected $table = 'customer_mails';
|
||||
|
||||
public $dir_types = [
|
||||
0 => 'Reisender',
|
||||
1 => 'Agentur',
|
||||
2 => 'Flug',
|
||||
3 => 'Versicherung',
|
||||
11 => 'Entwurf',
|
||||
12 => 'Papierkorb',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'customer_id' => 'int',
|
||||
'lead_id' => 'int',
|
||||
'is_answer' => 'bool',
|
||||
'reply_id' => 'int',
|
||||
'dir' => 'int',
|
||||
'travel_country_id' => 'int',
|
||||
'draft' => 'bool',
|
||||
'important' => 'bool',
|
||||
'send' => 'bool',
|
||||
'fail' => 'bool'
|
||||
'fail' => 'bool',
|
||||
'recipient' => 'array',
|
||||
'cc' => 'array',
|
||||
'bcc' => 'array'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
|
|
@ -67,8 +119,15 @@ class CustomerMail extends Model
|
|||
'is_answer',
|
||||
'reply_id',
|
||||
'email',
|
||||
'recipient',
|
||||
'cc',
|
||||
'bcc',
|
||||
'subject',
|
||||
'message',
|
||||
'dir',
|
||||
'travel_country_id',
|
||||
'draft',
|
||||
'important',
|
||||
'send',
|
||||
'fail',
|
||||
'error',
|
||||
|
|
@ -92,6 +151,11 @@ class CustomerMail extends Model
|
|||
return $this->belongsTo(CustomerMail::class, 'reply_id');
|
||||
}
|
||||
|
||||
public function travel_country()
|
||||
{
|
||||
return $this->belongsTo(TravelCountry::class);
|
||||
}
|
||||
|
||||
public function lead()
|
||||
{
|
||||
return $this->belongsTo(Lead::class);
|
||||
|
|
@ -107,6 +171,9 @@ class CustomerMail extends Model
|
|||
return $this->hasMany(CustomerMail::class, 'reply_id');
|
||||
}
|
||||
|
||||
public function getSentAtRaw(){
|
||||
return $this->attributes['sent_at'];
|
||||
}
|
||||
|
||||
public function getSentAtAttribute(){
|
||||
if(!$this->attributes['sent_at']){ return ""; }
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class InitialContactType
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Inquiry
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class InquiryTemplate
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class InquiryType
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class InsuranceCertificate
|
||||
|
|
@ -44,7 +44,6 @@ class InsuranceCertificate extends Model
|
|||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'internal_id' => 'int',
|
||||
'binary_data' => 'boolean'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Keyword
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace App\Models;
|
|||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Lead
|
||||
|
|
@ -91,6 +91,8 @@ use Reliese\Database\Eloquent\Model;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereWebsiteId($value)
|
||||
* @mixin \Eloquent
|
||||
* @property-read \App\Models\Sym\TravelCountry|null $travel_country_crm
|
||||
* @property bool|null $is_rebook
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereIsRebook($value)
|
||||
*/
|
||||
class Lead extends Model
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class LeadParticipant
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Offer
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Participant
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Salutation
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Searchengine
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ServiceProvider
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ServiceProviderEntry
|
||||
|
|
@ -102,7 +102,13 @@ class ServiceProviderEntry extends Model
|
|||
$ret = $this->amount_eur;
|
||||
}
|
||||
return number_format($ret, 2, ',', '.');
|
||||
;
|
||||
}
|
||||
|
||||
public function getAmountFinalEurRaw(){
|
||||
if($this->amount_eur && $this->amount_eur > 0){
|
||||
return $this->amount_eur;
|
||||
}
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
public function getPaymentDateFormat(){
|
||||
|
|
|
|||
|
|
@ -7,20 +7,27 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Status
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property int $handling_days
|
||||
* @property string $color
|
||||
*
|
||||
* @property Collection|Lead[] $leads
|
||||
* @property Collection|StatusHistory[] $status_histories
|
||||
*
|
||||
* @package App\Models
|
||||
* @property-read int|null $leads_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Status newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Status newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Status query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Status whereColor($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Status whereHandlingDays($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Status whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Status whereName($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Status extends Model
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class StatusHistory
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactLands($value)
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Booking[] $bookings
|
||||
* @property-read int|null $bookings_count
|
||||
* @property array|null $contact_emails
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereContactEmails($value)
|
||||
*/
|
||||
class TravelCountry extends Model
|
||||
{
|
||||
|
|
@ -57,15 +59,14 @@ class TravelCountry extends Model
|
|||
'contact_text_3',
|
||||
'contact_text_4',
|
||||
'contact_footer',
|
||||
'contact_emails',
|
||||
|
||||
];
|
||||
|
||||
protected $casts = ['contact_lands' => 'array'];
|
||||
|
||||
protected $casts = ['contact_lands' => 'array', 'contact_emails' => 'array'];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
|
||||
/*public function leads()
|
||||
{
|
||||
return $this->hasMany(Lead::class, 'travelcountry_id', 'id');
|
||||
|
|
@ -76,8 +77,17 @@ class TravelCountry extends Model
|
|||
return $this->hasMany(Booking::class, 'travel_country_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getCountryLands(){
|
||||
$ret = [];
|
||||
if($this->contact_lands){
|
||||
foreach ($this->contact_lands as $travel_country_id){
|
||||
if($travel_country = TravelCountry::find($travel_country_id)){
|
||||
$ret[$travel_country->id] = $travel_country->name;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$ret[$this->id] = $this->name;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,210 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\Booking
|
||||
*
|
||||
* @property int $id
|
||||
* @property string|null $booking_date
|
||||
* @property int $customer_id
|
||||
* @property int|null $lead_id
|
||||
* @property int|null $new_drafts
|
||||
* @property int $sf_guard_user_id
|
||||
* @property int $branch_id
|
||||
* @property float|null $service_fee
|
||||
* @property int|null $travel_country_id
|
||||
* @property int|null $travel_category_id
|
||||
* @property int|null $pax
|
||||
* @property int|null $coupon_id
|
||||
* @property \Illuminate\Support\Carbon $created_at
|
||||
* @property \Illuminate\Support\Carbon $updated_at
|
||||
* @property string|null $title
|
||||
* @property string|null $start_date
|
||||
* @property string|null $end_date
|
||||
* @property int|null $website_id
|
||||
* @property string|null $travel_number
|
||||
* @property string|null $participant_name
|
||||
* @property string|null $participant_firstname
|
||||
* @property string|null $participant_birthdate
|
||||
* @property int|null $participant_salutation_id
|
||||
* @property string|null $ev_number
|
||||
* @property string|null $merlin_knr
|
||||
* @property string|null $merlin_order_number
|
||||
* @property int|null $travel_company_id
|
||||
* @property int|null $travel_documents
|
||||
* @property float|null $price
|
||||
* @property float|null $price_total
|
||||
* @property float|null $deposit_total
|
||||
* @property float|null $final_payment
|
||||
* @property string|null $final_payment_date
|
||||
* @property int|null $travelagenda_id
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Sym\Arrangement[] $arrangements
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BookingDraftItem[] $booking_draft_items
|
||||
* @property-read \App\Models\TravelCountry|null $lead
|
||||
* @property-read \App\Models\SfGuardUser $sf_guard_user
|
||||
* @property-read \App\Models\TravelAgenda|null $travel_agenda
|
||||
* @property-read \App\Models\TravelCountry|null $travel_country
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereBookingDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereBranchId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereCouponId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereCustomerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereDepositTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereEndDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereEvNumber($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereFinalPayment($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereFinalPaymentDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereLeadId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereMerlinKnr($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereMerlinOrderNumber($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereNewDrafts($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereParticipantBirthdate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereParticipantFirstname($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereParticipantName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereParticipantSalutationId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking wherePax($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking wherePrice($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking wherePriceTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereServiceFee($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereSfGuardUserId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereStartDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTitle($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelCategoryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelCompanyId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelCountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelDocuments($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelNumber($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelagendaId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereWebsiteId($value)
|
||||
* @mixin \Eloquent
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking query()
|
||||
* @property-read int|null $arrangements_count
|
||||
* @property-read int|null $booking_draft_items_count
|
||||
*/
|
||||
class _Booking extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'booking';
|
||||
|
||||
/*protected $fillable = [
|
||||
'pos',
|
||||
];*/
|
||||
|
||||
public function booking_draft_items()
|
||||
{
|
||||
return $this->hasMany('App\Models\BookingDraftItem', 'booking_id', 'id')->orderBy('pos', 'ASC');
|
||||
}
|
||||
|
||||
//on crm
|
||||
public function travel_agenda()
|
||||
{
|
||||
return $this->belongsTo('App\Models\TravelAgenda', 'travelagenda_id', 'id');
|
||||
}
|
||||
|
||||
public function travel_country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\TravelCountry', 'travel_country_id', 'crm_id');
|
||||
}
|
||||
|
||||
public function lead()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Lead', 'lead_id', 'id');
|
||||
}
|
||||
|
||||
public function sf_guard_user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\SfGuardUser', 'sf_guard_user_id', 'id');
|
||||
}
|
||||
|
||||
public function arrangements()
|
||||
{
|
||||
return $this->hasMany('App\Models\Sym\Arrangement', 'booking_id', 'id')->orderBy('view_position', 'DESC');
|
||||
}
|
||||
|
||||
|
||||
public function calculate_price_total()
|
||||
{
|
||||
$travel_draft_item = false;
|
||||
$travel_price_adult = 0;
|
||||
$travel_price_children = 0;
|
||||
$total_adult = 0;
|
||||
$total_children = 0;
|
||||
foreach ($this->booking_draft_items as $booking_draft_item) {
|
||||
//24 Rundreise
|
||||
if($booking_draft_item->draft_type_id == 24){
|
||||
$travel_draft_item = $booking_draft_item;
|
||||
continue;
|
||||
}
|
||||
$prices = $booking_draft_item->getItemPrice();
|
||||
//Grundpreis Reise
|
||||
if($booking_draft_item->draft_type_id == 30){
|
||||
$travel_price_adult += $prices['adult'];
|
||||
$travel_price_children += $prices['children'];
|
||||
}
|
||||
$total_adult += $prices['adult'];
|
||||
$total_children += $prices['children'];
|
||||
}
|
||||
|
||||
if($travel_draft_item){
|
||||
$travel_draft_item->setPriceAdultRaw($travel_price_adult);
|
||||
$travel_draft_item->setPriceChildrenRaw($travel_price_children);
|
||||
$travel_draft_item->save();
|
||||
}
|
||||
|
||||
$this->price = $total_adult + $total_children;
|
||||
$this->save();
|
||||
|
||||
}
|
||||
|
||||
public function getPriceAttribute()
|
||||
{
|
||||
// 2 = decimal places | '.' = decimal seperator | ',' = thousand seperator
|
||||
return number_format(($this->attributes['price']), 2, ',', '.');
|
||||
}
|
||||
|
||||
public function findBeforeDraftItemRelation($reid)
|
||||
{
|
||||
$before = false;
|
||||
foreach($this->booking_draft_items as $booking_draft_items) {
|
||||
if ($booking_draft_items->id == $reid) {
|
||||
return $before;
|
||||
}
|
||||
$before = $booking_draft_items;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function findAfterDraftItemRelation($reid)
|
||||
{
|
||||
$next = false;
|
||||
foreach($this->booking_draft_items as $booking_draft_items) {
|
||||
if($next){
|
||||
return $booking_draft_items;
|
||||
}
|
||||
if ($booking_draft_items->id == $reid) {
|
||||
$next = true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getStartDateFormat(){
|
||||
if(!$this->attributes['start_date']){ return ""; }
|
||||
return Carbon::parse($this->attributes['start_date'])->format(\Util::formatDateDB());
|
||||
}
|
||||
|
||||
public function getEndDateFormat(){
|
||||
if(!$this->attributes['end_date']){ return ""; }
|
||||
return Carbon::parse($this->attributes['end_date'])->format(\Util::formatDateDB());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class TravelBooking
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class TravelCategory
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class TravelCompany
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ use Illuminate\Support\Str;
|
|||
* @property array|null $contact_lands
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactLands($value)
|
||||
* @property-read int|null $travel_nationality_requirements_count
|
||||
* @property array|null $contact_emails
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereContactEmails($value)
|
||||
*/
|
||||
class TravelCountry extends Model
|
||||
{
|
||||
|
|
@ -81,13 +83,14 @@ class TravelCountry extends Model
|
|||
'contact_text_4',
|
||||
'contact_footer',
|
||||
'entry_requirements',
|
||||
'contact_emails',
|
||||
'is_customer_country',
|
||||
'active_frontend',
|
||||
'active_backend'
|
||||
|
||||
];
|
||||
|
||||
protected $casts = ['contact_lands' => 'array'];
|
||||
protected $casts = ['contact_lands' => 'array', 'contact_emails' => 'array'];
|
||||
|
||||
|
||||
public $timestamps = false;
|
||||
|
|
@ -115,6 +118,26 @@ class TravelCountry extends Model
|
|||
}
|
||||
}
|
||||
|
||||
public function getContactEmailsStr($glue=PHP_EOL){
|
||||
if(isset($this->contact_emails)){
|
||||
return implode($glue, $this->contact_emails);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function getContactLandsArray(){
|
||||
$ret = [];
|
||||
if($this->contact_lands){
|
||||
foreach ($this->contact_lands as $contact_land_id){
|
||||
$travel_country = TravelCountry::where('crm_id', $contact_land_id)->first();
|
||||
if($travel_country){
|
||||
$ret[] = $travel_country->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function getNationalityRequirement($travel_nationality_id){
|
||||
|
||||
$model = TravelNationalityRequirement::where('travel_country_id', $this->id)->where('travel_nationality_id', $travel_nationality_id)->first();
|
||||
|
|
|
|||
65
app/Models/TravelInsurance.php
Normal file
65
app/Models/TravelInsurance.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?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 TravelInsurance extends Model
|
||||
{
|
||||
protected $table = 'travel_insurance';
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'premium' => 'float'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'booking_id',
|
||||
'policy_number',
|
||||
'ak',
|
||||
'an',
|
||||
'akt',
|
||||
'premium',
|
||||
'request_data'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Website
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue