01 2020
This commit is contained in:
parent
bed91c4f4a
commit
c8948338bb
122 changed files with 7911 additions and 1639 deletions
88
app/Models/Arrangement.php
Normal file
88
app/Models/Arrangement.php
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Arrangement
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $template_id
|
||||
* @property Carbon $state
|
||||
* @property Carbon $begin
|
||||
* @property Carbon $end
|
||||
* @property string $type_s
|
||||
* @property string $data_s
|
||||
* @property int $view_position
|
||||
* @property int $booking_id
|
||||
* @property int $type_id
|
||||
* @property bool $in_pdf
|
||||
* @property Booking $booking
|
||||
* @property ArrangementTemplate $arrangement_template
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereBegin($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereDataS($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereEnd($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereInPdf($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereState($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereTemplateId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereTypeId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereTypeS($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereViewPosition($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Arrangement extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'arrangement';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'template_id' => 'int',
|
||||
'view_position' => 'int',
|
||||
'booking_id' => 'int',
|
||||
'type_id' => 'int',
|
||||
'in_pdf' => 'bool'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'state',
|
||||
'begin',
|
||||
'end'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'template_id',
|
||||
'state',
|
||||
'begin',
|
||||
'end',
|
||||
'type_s',
|
||||
'data_s',
|
||||
'view_position',
|
||||
'booking_id',
|
||||
'type_id',
|
||||
'in_pdf'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
|
||||
public function arrangement_template()
|
||||
{
|
||||
return $this->belongsTo(ArrangementTemplate::class, 'template_id');
|
||||
}
|
||||
}
|
||||
42
app/Models/ArrangementTemplate.php
Normal file
42
app/Models/ArrangementTemplate.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ArrangementTemplate
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $title
|
||||
* @property Collection|Arrangement[] $arrangements
|
||||
* @package App\Models
|
||||
* @property-read int|null $arrangements_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementTemplate newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementTemplate newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementTemplate query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementTemplate whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementTemplate whereTitle($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class ArrangementTemplate extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'arrangement_template';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'title'
|
||||
];
|
||||
|
||||
public function arrangements()
|
||||
{
|
||||
return $this->hasMany(Arrangement::class, 'template_id');
|
||||
}
|
||||
}
|
||||
92
app/Models/ArrangementType.php
Normal file
92
app/Models/ArrangementType.php
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ArrangementType
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property int $notify_rel_days
|
||||
* @property int $arrangement_type_id
|
||||
* @property bool $is_unique
|
||||
* @property int $notify_rel_field_key
|
||||
* @property ArrangementType $arrangement_type
|
||||
* @property Booking $booking
|
||||
* @property DraftItem $draft_item
|
||||
* @property DraftType $draft_type
|
||||
* @property Collection|ArrangementType[] $arrangement_types
|
||||
* @property Collection|InquiryType[] $inquiry_types
|
||||
* @package App\Models
|
||||
* @property-read int|null $arrangement_types_count
|
||||
* @property-read int|null $inquiry_types_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementType newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementType newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementType query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementType whereArrangementTypeId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementType whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementType whereIsUnique($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementType whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementType whereNotifyRelDays($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ArrangementType whereNotifyRelFieldKey($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class ArrangementType extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'arrangement_type';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'notify_rel_days' => 'int',
|
||||
'arrangement_type_id' => 'int',
|
||||
'is_unique' => 'bool',
|
||||
'notify_rel_field_key' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'notify_rel_days',
|
||||
'arrangement_type_id',
|
||||
'is_unique',
|
||||
'notify_rel_field_key'
|
||||
];
|
||||
|
||||
public function arrangement_type()
|
||||
{
|
||||
return $this->belongsTo(ArrangementType::class);
|
||||
}
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
|
||||
public function draft_item()
|
||||
{
|
||||
return $this->belongsTo(DraftItem::class);
|
||||
}
|
||||
|
||||
public function draft_type()
|
||||
{
|
||||
return $this->belongsTo(DraftType::class);
|
||||
}
|
||||
|
||||
public function arrangement_types()
|
||||
{
|
||||
return $this->hasMany(ArrangementType::class);
|
||||
}
|
||||
|
||||
public function inquiry_types()
|
||||
{
|
||||
return $this->hasMany(InquiryType::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,53 +1,85 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\Booking
|
||||
* Class Booking
|
||||
*
|
||||
* @property int $id
|
||||
* @property string|null $booking_date
|
||||
* @property Carbon $booking_date
|
||||
* @property int $customer_id
|
||||
* @property int|null $lead_id
|
||||
* @property int|null $new_drafts
|
||||
* @property int $lead_id
|
||||
* @property bool $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
|
||||
* @property float $service_fee
|
||||
* @property int $travel_country_id
|
||||
* @property int $travel_category_id
|
||||
* @property int $pax
|
||||
* @property int $coupon_id
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property string $title
|
||||
* @property Carbon $start_date
|
||||
* @property Carbon $end_date
|
||||
* @property int $website_id
|
||||
* @property string $travel_number
|
||||
* @property string $participant_name
|
||||
* @property string $participant_firstname
|
||||
* @property Carbon $participant_birthdate
|
||||
* @property int $participant_salutation_id
|
||||
* @property string $ev_number
|
||||
* @property string $merlin_knr
|
||||
* @property string $merlin_order_number
|
||||
* @property int $travel_company_id
|
||||
* @property bool $travel_documents
|
||||
* @property float $price
|
||||
* @property float $price_total
|
||||
* @property float $deposit_total
|
||||
* @property float $final_payment
|
||||
* @property Carbon $final_payment_date
|
||||
* @property int $travelagenda_id
|
||||
* @property Branch $branch
|
||||
* @property Coupon $coupon
|
||||
* @property Customer $customer
|
||||
* @property Lead $lead
|
||||
* @property SfGuardUser $sf_guard_user
|
||||
* @property TravelCategory $travel_category
|
||||
* @property TravelCompany $travel_company
|
||||
* @property TravelCountry $travel_country
|
||||
* @property TravelAgenda $travel_agenda
|
||||
* @property Collection|Arrangement[] $arrangements
|
||||
* @property Collection|ArrangementType[] $arrangement_types
|
||||
* @property Collection|BookingApplication[] $booking_applications
|
||||
* @property Collection|BookingConfirmation[] $booking_confirmations
|
||||
* @property Collection|BookingDraftItem[] $booking_draft_items
|
||||
* @property Collection|BookingInvoice[] $booking_invoices
|
||||
* @property Collection|BookingServiceItem[] $booking_service_items
|
||||
* @property Collection|BookingVoucher[] $booking_vouchers
|
||||
* @property Collection|Coupon[] $coupons
|
||||
* @property Collection|InsuranceCertificate[] $insurance_certificates
|
||||
* @property Collection|Participant[] $participants
|
||||
* @property Collection|ServiceProviderEntry[] $service_provider_entries
|
||||
* @property Collection|TravelInsurance[] $travel_insurances
|
||||
* @package App\Models
|
||||
* @property-read int|null $arrangement_types_count
|
||||
* @property-read int|null $arrangements_count
|
||||
* @property-read int|null $booking_draft_items_count
|
||||
* @property-read int|null $booking_service_items_count
|
||||
* @property-read int|null $coupons_count
|
||||
* @property-read int|null $insurance_certificates_count
|
||||
* @property-read int|null $participants_count
|
||||
* @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()
|
||||
* @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)
|
||||
|
|
@ -83,11 +115,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @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
|
||||
* @property-read int|null $service_provider_entries_count
|
||||
*/
|
||||
class Booking extends Model
|
||||
{
|
||||
|
|
@ -95,40 +123,185 @@ class Booking extends Model
|
|||
|
||||
protected $table = 'booking';
|
||||
|
||||
/*protected $fillable = [
|
||||
'pos',
|
||||
];*/
|
||||
protected $casts = [
|
||||
'customer_id' => 'int',
|
||||
'lead_id' => 'int',
|
||||
'new_drafts' => 'bool',
|
||||
'sf_guard_user_id' => 'int',
|
||||
'branch_id' => 'int',
|
||||
'service_fee' => 'float',
|
||||
'travel_country_id' => 'int',
|
||||
'travel_category_id' => 'int',
|
||||
'pax' => 'int',
|
||||
'coupon_id' => 'int',
|
||||
'website_id' => 'int',
|
||||
'participant_salutation_id' => 'int',
|
||||
'travel_company_id' => 'int',
|
||||
'travel_documents' => 'bool',
|
||||
'price' => 'float',
|
||||
'price_total' => 'float',
|
||||
'deposit_total' => 'float',
|
||||
'final_payment' => 'float',
|
||||
'travelagenda_id' => 'int'
|
||||
];
|
||||
|
||||
public function booking_draft_items()
|
||||
{
|
||||
return $this->hasMany('App\Models\BookingDraftItem', 'booking_id', 'id')->orderBy('pos', 'ASC');
|
||||
}
|
||||
protected $dates = [
|
||||
'booking_date',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'participant_birthdate',
|
||||
'final_payment_date'
|
||||
];
|
||||
|
||||
//on crm
|
||||
public function travel_agenda()
|
||||
protected $fillable = [
|
||||
'booking_date',
|
||||
'customer_id',
|
||||
'lead_id',
|
||||
'new_drafts',
|
||||
'sf_guard_user_id',
|
||||
'branch_id',
|
||||
'service_fee',
|
||||
'travel_country_id',
|
||||
'travel_category_id',
|
||||
'pax',
|
||||
'coupon_id',
|
||||
'title',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'website_id',
|
||||
'travel_number',
|
||||
'participant_name',
|
||||
'participant_firstname',
|
||||
'participant_birthdate',
|
||||
'participant_salutation_id',
|
||||
'ev_number',
|
||||
'merlin_knr',
|
||||
'merlin_order_number',
|
||||
'travel_company_id',
|
||||
'travel_documents',
|
||||
'price',
|
||||
'price_total',
|
||||
'deposit_total',
|
||||
'final_payment',
|
||||
'final_payment_date',
|
||||
'travelagenda_id'
|
||||
];
|
||||
|
||||
/*public function branch()
|
||||
{
|
||||
return $this->belongsTo(Branch::class);
|
||||
}*/
|
||||
|
||||
public function coupon()
|
||||
{
|
||||
return $this->belongsTo(Coupon::class);
|
||||
}
|
||||
|
||||
public function customer()
|
||||
{
|
||||
return $this->belongsTo(Customer::class);
|
||||
}
|
||||
|
||||
public function lead()
|
||||
{
|
||||
return $this->belongsTo(Lead::class);
|
||||
}
|
||||
|
||||
public function sf_guard_user()
|
||||
{
|
||||
return $this->belongsTo(SfGuardUser::class);
|
||||
}
|
||||
|
||||
public function travel_category()
|
||||
{
|
||||
return $this->belongsTo(TravelCategory::class);
|
||||
}
|
||||
|
||||
public function travel_company()
|
||||
{
|
||||
return $this->belongsTo(TravelCompany::class);
|
||||
}
|
||||
|
||||
/* public function travel_country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\TravelAgenda', 'travelagenda_id', 'id');
|
||||
}
|
||||
return $this->belongsTo(TravelCountry::class, 'travel_country_id', 'crm_id');
|
||||
}*/
|
||||
|
||||
|
||||
public function travel_country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\TravelCountry', 'travel_country_id', 'crm_id');
|
||||
return $this->belongsTo(\App\Models\Sym\TravelCountry::class, 'travel_country_id', 'id');
|
||||
}
|
||||
|
||||
public function lead()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Lead', 'lead_id', 'id');
|
||||
}
|
||||
public function travel_agenda()
|
||||
{
|
||||
return $this->belongsTo(TravelAgenda::class, 'travelagenda_id');
|
||||
}
|
||||
|
||||
public function sf_guard_user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\SfGuardUser', 'sf_guard_user_id', 'id');
|
||||
}
|
||||
public function arrangements()
|
||||
{
|
||||
return $this->hasMany(Arrangement::class);
|
||||
}
|
||||
|
||||
public function arrangements()
|
||||
{
|
||||
return $this->hasMany('App\Models\Sym\Arrangement', 'booking_id', 'id')->orderBy('view_position', 'DESC');
|
||||
}
|
||||
public function arrangement_types()
|
||||
{
|
||||
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()
|
||||
{
|
||||
return $this->hasMany(Coupon::class);
|
||||
}
|
||||
|
||||
public function insurance_certificates()
|
||||
{
|
||||
return $this->hasMany(InsuranceCertificate::class);
|
||||
}
|
||||
|
||||
public function participants()
|
||||
{
|
||||
return $this->hasMany(Participant::class);
|
||||
}
|
||||
|
||||
public function service_provider_entries()
|
||||
{
|
||||
return $this->hasMany(ServiceProviderEntry::class);
|
||||
}
|
||||
/*
|
||||
public function travel_insurances()
|
||||
{
|
||||
return $this->hasMany(TravelInsurance::class);
|
||||
}*/
|
||||
|
||||
|
||||
public function calculate_price_total()
|
||||
|
|
@ -152,7 +325,7 @@ class Booking extends Model
|
|||
}
|
||||
$total_adult += $prices['adult'];
|
||||
$total_children += $prices['children'];
|
||||
}
|
||||
}
|
||||
|
||||
if($travel_draft_item){
|
||||
$travel_draft_item->setPriceAdultRaw($travel_price_adult);
|
||||
|
|
@ -171,6 +344,11 @@ class Booking extends Model
|
|||
return number_format(($this->attributes['price']), 2, ',', '.');
|
||||
}
|
||||
|
||||
public function getPriceRaw()
|
||||
{
|
||||
return $this->attributes['price'];
|
||||
}
|
||||
|
||||
public function findBeforeDraftItemRelation($reid)
|
||||
{
|
||||
$before = false;
|
||||
|
|
@ -207,4 +385,56 @@ class Booking extends Model
|
|||
return Carbon::parse($this->attributes['end_date'])->format(\Util::formatDateDB());
|
||||
}
|
||||
|
||||
|
||||
//erlös #getRevenueFactor
|
||||
public function proceeds(){
|
||||
$proceeds = $this->attributes['price']
|
||||
// - $this->getServiceTotal()
|
||||
// - $this->getServiceFee()
|
||||
- $this->getServiceProviderEntriesAmountFactorTotal();
|
||||
|
||||
return number_format(($proceeds), 2, ',', '.');
|
||||
|
||||
}
|
||||
|
||||
public function getServiceProviderEntriesAmountFactorTotal()
|
||||
{
|
||||
$total = 0;
|
||||
foreach ($this->service_provider_entries as $entry)
|
||||
{
|
||||
$total += $entry->amount / $entry->factor;
|
||||
}
|
||||
return $total;
|
||||
}
|
||||
|
||||
public function getServiceProviderPaymentsTotal()
|
||||
{
|
||||
$total = 0;
|
||||
foreach ($this->service_provider_entries as $entry)
|
||||
{
|
||||
$total += $entry->amount;
|
||||
}
|
||||
return number_format(($total), 2, ',', '.');
|
||||
}
|
||||
|
||||
public function getKontoNumber(){
|
||||
|
||||
switch ($this->ev_number){
|
||||
case 'E01':
|
||||
return '4011';
|
||||
break;
|
||||
case 'E02':
|
||||
return '4012';
|
||||
break;
|
||||
case 'E03':
|
||||
return '4013';
|
||||
break;
|
||||
case 'E04':
|
||||
return '4014';
|
||||
break;
|
||||
|
||||
}
|
||||
return $this->ev_number;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
84
app/Models/BookingServiceItem.php
Normal file
84
app/Models/BookingServiceItem.php
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BookingServiceItem
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property int $travel_company_id
|
||||
* @property float $service_price
|
||||
* @property float $service_price_refund
|
||||
* @property float $commission
|
||||
* @property Carbon $travel_date
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property string $name
|
||||
* @property bool $is_commission_locked
|
||||
* @property Booking $booking
|
||||
* @property TravelCompany $travel_company
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem whereCommission($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem whereIsCommissionLocked($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem whereServicePrice($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem whereServicePriceRefund($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem whereTravelCompanyId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem whereTravelDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingServiceItem whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class BookingServiceItem extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'booking_service_item';
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'travel_company_id' => 'int',
|
||||
'service_price' => 'float',
|
||||
'service_price_refund' => 'float',
|
||||
'commission' => 'float',
|
||||
'is_commission_locked' => 'bool'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'travel_date'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'booking_id',
|
||||
'travel_company_id',
|
||||
'service_price',
|
||||
'service_price_refund',
|
||||
'commission',
|
||||
'travel_date',
|
||||
'name',
|
||||
'is_commission_locked'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
|
||||
public function travel_company()
|
||||
{
|
||||
return $this->belongsTo(TravelCompany::class);
|
||||
}
|
||||
}
|
||||
92
app/Models/Coupon.php
Normal file
92
app/Models/Coupon.php
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Coupon
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $number
|
||||
* @property int $customer_id
|
||||
* @property int $booking_id
|
||||
* @property float $value
|
||||
* @property Carbon $issue_date
|
||||
* @property Carbon $valid_date
|
||||
* @property bool $is_redeemed
|
||||
* @property Carbon $redeem_date
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Booking $booking
|
||||
* @property Customer $customer
|
||||
* @property Collection|Booking[] $bookings
|
||||
* @package App\Models
|
||||
* @property-read int|null $bookings_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereCustomerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereIsRedeemed($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereIssueDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereNumber($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereRedeemDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereValidDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereValue($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Coupon extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'coupon';
|
||||
|
||||
protected $casts = [
|
||||
'customer_id' => 'int',
|
||||
'booking_id' => 'int',
|
||||
'value' => 'float',
|
||||
'is_redeemed' => 'bool'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'issue_date',
|
||||
'valid_date',
|
||||
'redeem_date'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'number',
|
||||
'customer_id',
|
||||
'booking_id',
|
||||
'value',
|
||||
'issue_date',
|
||||
'valid_date',
|
||||
'is_redeemed',
|
||||
'redeem_date'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
|
||||
public function customer()
|
||||
{
|
||||
return $this->belongsTo(Customer::class);
|
||||
}
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
}
|
||||
42
app/Models/CreditCardType.php
Normal file
42
app/Models/CreditCardType.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class CreditCardType
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property Collection|Customer[] $customers
|
||||
* @package App\Models
|
||||
* @property-read int|null $customers_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CreditCardType newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CreditCardType newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CreditCardType query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CreditCardType whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CreditCardType whereName($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class CreditCardType extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'credit_card_type';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name'
|
||||
];
|
||||
|
||||
public function customers()
|
||||
{
|
||||
return $this->hasMany(Customer::class);
|
||||
}
|
||||
}
|
||||
168
app/Models/Customer.php
Normal file
168
app/Models/Customer.php
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Customer
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $salutation_id
|
||||
* @property string $title
|
||||
* @property string $name
|
||||
* @property string $firstname
|
||||
* @property Carbon $birthdate
|
||||
* @property string $company
|
||||
* @property string $street
|
||||
* @property string $zip
|
||||
* @property string $city
|
||||
* @property string $email
|
||||
* @property string $phone
|
||||
* @property string $phonebusiness
|
||||
* @property string $phonemobile
|
||||
* @property string $fax
|
||||
* @property string $bank
|
||||
* @property string $bank_code
|
||||
* @property string $bank_account_number
|
||||
* @property int $credit_card_type_id
|
||||
* @property string $credit_card_number
|
||||
* @property Carbon $credit_card_expiration_date
|
||||
* @property string $participants_remarks
|
||||
* @property string $miscellaneous_remarks
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property int $country_id
|
||||
* @property TravelCountry $travel_country
|
||||
* @property CreditCardType $credit_card_type
|
||||
* @property Salutation $salutation
|
||||
* @property Collection|Booking[] $bookings
|
||||
* @property Collection|Coupon[] $coupons
|
||||
* @property Collection|Lead[] $leads
|
||||
* @package App\Models
|
||||
* @property-read int|null $bookings_count
|
||||
* @property-read int|null $coupons_count
|
||||
* @property-read int|null $leads_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereBank($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereBankAccountNumber($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereBankCode($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereBirthdate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereCity($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereCompany($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereCountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereCreditCardExpirationDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereCreditCardNumber($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereCreditCardTypeId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereEmail($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereFax($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereFirstname($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereMiscellaneousRemarks($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereParticipantsRemarks($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer wherePhone($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer wherePhonebusiness($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer wherePhonemobile($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereSalutationId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereStreet($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereTitle($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Customer whereZip($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Customer extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'customer';
|
||||
|
||||
protected $casts = [
|
||||
'salutation_id' => 'int',
|
||||
'credit_card_type_id' => 'int',
|
||||
'country_id' => 'int'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'birthdate',
|
||||
'credit_card_expiration_date'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'salutation_id',
|
||||
'title',
|
||||
'name',
|
||||
'firstname',
|
||||
'birthdate',
|
||||
'company',
|
||||
'street',
|
||||
'zip',
|
||||
'city',
|
||||
'email',
|
||||
'phone',
|
||||
'phonebusiness',
|
||||
'phonemobile',
|
||||
'fax',
|
||||
'bank',
|
||||
'bank_code',
|
||||
'bank_account_number',
|
||||
'credit_card_type_id',
|
||||
'credit_card_number',
|
||||
'credit_card_expiration_date',
|
||||
'participants_remarks',
|
||||
'miscellaneous_remarks',
|
||||
'country_id',
|
||||
|
||||
];
|
||||
|
||||
public function travel_country()
|
||||
{
|
||||
return $this->belongsTo(TravelCountry::class, 'country_id');
|
||||
}
|
||||
|
||||
public function credit_card_type()
|
||||
{
|
||||
return $this->belongsTo(CreditCardType::class);
|
||||
}
|
||||
|
||||
public function salutation()
|
||||
{
|
||||
return $this->belongsTo(Salutation::class);
|
||||
}
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
|
||||
public function coupons()
|
||||
{
|
||||
return $this->hasMany(Coupon::class);
|
||||
}
|
||||
|
||||
public function leads()
|
||||
{
|
||||
return $this->hasMany(Lead::class);
|
||||
}
|
||||
|
||||
public function fullName()
|
||||
{
|
||||
if ($this->firstname) {
|
||||
return $this->firstname . ' ' . $this->name;
|
||||
}
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -55,6 +55,8 @@ use Illuminate\Support\Str;
|
|||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\IQContentSite[] $iq_content_sites
|
||||
* @property-read int|null $iq_content_sites_count
|
||||
* @property-read int|null $iq_content_tree_node_childs_count
|
||||
* @property string|null $title
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTreeNode whereTitle($value)
|
||||
*/
|
||||
class IQContentTreeNode extends Model
|
||||
{
|
||||
|
|
@ -68,7 +70,7 @@ class IQContentTreeNode extends Model
|
|||
protected $table = 'i_q_content_tree_nodes';
|
||||
|
||||
protected $fillable = [
|
||||
'tree_id', 'parent_id', 'lvl', 'name', 'identifier', 'description', 'settings', 'pos', 'active',
|
||||
'tree_id', 'parent_id', 'lvl', 'name', 'identifier', 'title', 'description', 'settings', 'pos', 'active',
|
||||
];
|
||||
|
||||
protected $casts = ['settings' => 'array'];
|
||||
|
|
|
|||
42
app/Models/InitialContactType.php
Normal file
42
app/Models/InitialContactType.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class InitialContactType
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property Collection|Lead[] $leads
|
||||
* @package App\Models
|
||||
* @property-read int|null $leads_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InitialContactType newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InitialContactType newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InitialContactType query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InitialContactType whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InitialContactType whereName($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class InitialContactType extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'initial_contact_type';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name'
|
||||
];
|
||||
|
||||
public function leads()
|
||||
{
|
||||
return $this->hasMany(Lead::class, 'initialcontacttype_id');
|
||||
}
|
||||
}
|
||||
90
app/Models/Inquiry.php
Normal file
90
app/Models/Inquiry.php
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Inquiry
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $lead_id
|
||||
* @property int $template_id
|
||||
* @property bool $in_pdf
|
||||
* @property Carbon $begin
|
||||
* @property Carbon $end
|
||||
* @property int $type_id
|
||||
* @property string $type_s
|
||||
* @property string $data_s
|
||||
* @property int $view_position
|
||||
* @property Lead $lead
|
||||
* @property InquiryTemplate $inquiry_template
|
||||
* @property InquiryType $inquiry_type
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry whereBegin($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry whereDataS($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry whereEnd($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry whereInPdf($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry whereLeadId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry whereTemplateId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry whereTypeId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry whereTypeS($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Inquiry whereViewPosition($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Inquiry extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'inquiry';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'lead_id' => 'int',
|
||||
'template_id' => 'int',
|
||||
'in_pdf' => 'bool',
|
||||
'type_id' => 'int',
|
||||
'view_position' => 'int'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'begin',
|
||||
'end'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'lead_id',
|
||||
'template_id',
|
||||
'in_pdf',
|
||||
'begin',
|
||||
'end',
|
||||
'type_id',
|
||||
'type_s',
|
||||
'data_s',
|
||||
'view_position'
|
||||
];
|
||||
|
||||
public function lead()
|
||||
{
|
||||
return $this->belongsTo(Lead::class);
|
||||
}
|
||||
|
||||
public function inquiry_template()
|
||||
{
|
||||
return $this->belongsTo(InquiryTemplate::class, 'template_id');
|
||||
}
|
||||
|
||||
public function inquiry_type()
|
||||
{
|
||||
return $this->belongsTo(InquiryType::class, 'type_id');
|
||||
}
|
||||
}
|
||||
42
app/Models/InquiryTemplate.php
Normal file
42
app/Models/InquiryTemplate.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class InquiryTemplate
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $title
|
||||
* @property Collection|Inquiry[] $inquiries
|
||||
* @package App\Models
|
||||
* @property-read int|null $inquiries_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryTemplate newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryTemplate newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryTemplate query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryTemplate whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryTemplate whereTitle($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class InquiryTemplate extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'inquiry_template';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'title'
|
||||
];
|
||||
|
||||
public function inquiries()
|
||||
{
|
||||
return $this->hasMany(Inquiry::class, 'template_id');
|
||||
}
|
||||
}
|
||||
55
app/Models/InquiryType.php
Normal file
55
app/Models/InquiryType.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class InquiryType
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property int $arrangement_type_id
|
||||
* @property ArrangementType $arrangement_type
|
||||
* @property Collection|Inquiry[] $inquiries
|
||||
* @package App\Models
|
||||
* @property-read int|null $inquiries_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType whereArrangementTypeId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InquiryType whereName($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class InquiryType extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'inquiry_type';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'arrangement_type_id' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'arrangement_type_id'
|
||||
];
|
||||
|
||||
public function arrangement_type()
|
||||
{
|
||||
return $this->belongsTo(ArrangementType::class);
|
||||
}
|
||||
|
||||
public function inquiries()
|
||||
{
|
||||
return $this->hasMany(Inquiry::class, 'type_id');
|
||||
}
|
||||
}
|
||||
62
app/Models/InsuranceCertificate.php
Normal file
62
app/Models/InsuranceCertificate.php
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class InsuranceCertificate
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property int $internal_id
|
||||
* @property string $filename
|
||||
* @property boolean $binary_data
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property string $request_data
|
||||
* @property Booking $booking
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InsuranceCertificate newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InsuranceCertificate newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InsuranceCertificate query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InsuranceCertificate whereBinaryData($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InsuranceCertificate whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InsuranceCertificate whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InsuranceCertificate whereFilename($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InsuranceCertificate whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InsuranceCertificate whereInternalId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InsuranceCertificate whereRequestData($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\InsuranceCertificate whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class InsuranceCertificate extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'insurance_certificate';
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'internal_id' => 'int',
|
||||
'binary_data' => 'boolean'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'booking_id',
|
||||
'internal_id',
|
||||
'filename',
|
||||
'binary_data',
|
||||
'request_data'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,40 +1,68 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\Lead
|
||||
* Class Lead
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $customer_id
|
||||
* @property string $request_date
|
||||
* @property string|null $travelperiod_start
|
||||
* @property string|null $travelperiod_end
|
||||
* @property int|null $travelperiod_length
|
||||
* @property int|null $travelcountry_id
|
||||
* @property int|null $travelagenda_id
|
||||
* @property string|null $remarks
|
||||
* @property Carbon $request_date
|
||||
* @property Carbon $travelperiod_start
|
||||
* @property Carbon $travelperiod_end
|
||||
* @property int $travelperiod_length
|
||||
* @property int $travelcountry_id
|
||||
* @property int $travelagenda_id
|
||||
* @property string $remarks
|
||||
* @property int $sf_guard_user_id
|
||||
* @property int|null $is_closed
|
||||
* @property int|null $initialcontacttype_id
|
||||
* @property int|null $searchengine_id
|
||||
* @property string|null $searchengine_keywords
|
||||
* @property bool $is_closed
|
||||
* @property int $initialcontacttype_id
|
||||
* @property int $searchengine_id
|
||||
* @property string $searchengine_keywords
|
||||
* @property int $status_id
|
||||
* @property string|null $next_due_date
|
||||
* @property int|null $website_id
|
||||
* @property int|null $travelcategory_id
|
||||
* @property \Illuminate\Support\Carbon $created_at
|
||||
* @property \Illuminate\Support\Carbon $updated_at
|
||||
* @property float|null $price
|
||||
* @property int|null $pax
|
||||
* @property string|null $participant_name
|
||||
* @property string|null $participant_firstname
|
||||
* @property string|null $participant_birthdate
|
||||
* @property int|null $participant_salutation_id
|
||||
* @property-read \App\Models\SfGuardUser $sf_guard_user
|
||||
* @property-read \App\Models\Status $status
|
||||
* @property Carbon $next_due_date
|
||||
* @property int $website_id
|
||||
* @property int $travelcategory_id
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property float $price
|
||||
* @property int $pax
|
||||
* @property string $participant_name
|
||||
* @property string $participant_firstname
|
||||
* @property Carbon $participant_birthdate
|
||||
* @property int $participant_salutation_id
|
||||
* @property Customer $customer
|
||||
* @property InitialContactType $initial_contact_type
|
||||
* @property Salutation $salutation
|
||||
* @property Searchengine $searchengine
|
||||
* @property SfGuardUser $sf_guard_user
|
||||
* @property Status $status
|
||||
* @property TravelAgenda $travel_agenda
|
||||
* @property TravelCategory $travel_category
|
||||
* @property TravelCountry $travel_country
|
||||
* @property Website $website
|
||||
* @property Collection|Booking[] $bookings
|
||||
* @property Collection|Inquiry[] $inquiries
|
||||
* @property Collection|LeadParticipant[] $lead_participants
|
||||
* @property Collection|Offer[] $offers
|
||||
* @property Collection|StatusHistory[] $status_histories
|
||||
* @package App\Models
|
||||
* @property-read int|null $bookings_count
|
||||
* @property-read int|null $inquiries_count
|
||||
* @property-read int|null $lead_participants_count
|
||||
* @property-read int|null $offers_count
|
||||
* @property-read int|null $status_histories_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereCustomerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereId($value)
|
||||
|
|
@ -62,9 +90,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereWebsiteId($value)
|
||||
* @mixin \Eloquent
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead query()
|
||||
*/
|
||||
class Lead extends Model
|
||||
{
|
||||
|
|
@ -72,13 +97,146 @@ class Lead extends Model
|
|||
|
||||
protected $table = 'lead';
|
||||
|
||||
public function status()
|
||||
protected $casts = [
|
||||
'customer_id' => 'int',
|
||||
'travelperiod_length' => 'int',
|
||||
'travelcountry_id' => 'int',
|
||||
'travelagenda_id' => 'int',
|
||||
'sf_guard_user_id' => 'int',
|
||||
'is_closed' => 'bool',
|
||||
'initialcontacttype_id' => 'int',
|
||||
'searchengine_id' => 'int',
|
||||
'status_id' => 'int',
|
||||
'website_id' => 'int',
|
||||
'travelcategory_id' => 'int',
|
||||
'price' => 'float',
|
||||
'pax' => 'int',
|
||||
'participant_salutation_id' => 'int'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'request_date',
|
||||
'travelperiod_start',
|
||||
'travelperiod_end',
|
||||
'next_due_date',
|
||||
'participant_birthdate'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'customer_id',
|
||||
'request_date',
|
||||
'travelperiod_start',
|
||||
'travelperiod_end',
|
||||
'travelperiod_length',
|
||||
'travelcountry_id',
|
||||
'travelagenda_id',
|
||||
'remarks',
|
||||
'sf_guard_user_id',
|
||||
'is_closed',
|
||||
'initialcontacttype_id',
|
||||
'searchengine_id',
|
||||
'searchengine_keywords',
|
||||
'status_id',
|
||||
'next_due_date',
|
||||
'website_id',
|
||||
'travelcategory_id',
|
||||
'price',
|
||||
'pax',
|
||||
'participant_name',
|
||||
'participant_firstname',
|
||||
'participant_birthdate',
|
||||
'participant_salutation_id'
|
||||
];
|
||||
|
||||
public function updateNextDueDate($date = false){
|
||||
|
||||
if(!$date){
|
||||
$carbon = Carbon::now();
|
||||
$this->next_due_date = $carbon->modify('+ '.$this->status->handling_days.' days')->format("Y-m-d");
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
public function customer()
|
||||
{
|
||||
return $this->belongsTo(Customer::class);
|
||||
}
|
||||
|
||||
public function initial_contact_type()
|
||||
{
|
||||
return $this->belongsTo(InitialContactType::class, 'initialcontacttype_id');
|
||||
}
|
||||
|
||||
public function salutation()
|
||||
{
|
||||
return $this->belongsTo(Salutation::class, 'participant_salutation_id');
|
||||
}
|
||||
|
||||
public function searchengine()
|
||||
{
|
||||
return $this->belongsTo(Searchengine::class);
|
||||
}
|
||||
|
||||
public function sf_guard_user()
|
||||
{
|
||||
return $this->belongsTo(SfGuardUser::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(Status::class);
|
||||
}
|
||||
|
||||
public function travel_agenda()
|
||||
{
|
||||
return $this->belongsTo(TravelAgenda::class, 'travelagenda_id');
|
||||
}
|
||||
|
||||
public function travel_category()
|
||||
{
|
||||
return $this->belongsTo(TravelCategory::class, 'travelcategory_id');
|
||||
}
|
||||
|
||||
//on crm
|
||||
public function travel_country_crm()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Status', 'status_id', 'id');
|
||||
return $this->belongsTo('App\Models\Sym\TravelCountry', 'travelcountry_id', 'id');
|
||||
}
|
||||
|
||||
public function sf_guard_user()
|
||||
|
||||
//on stern other DB
|
||||
public function travel_country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\SfGuardUser', 'sf_guard_user_id', 'id');
|
||||
return $this->belongsTo('App\Models\TravelCountry', 'travelcountry_id', 'crm_id');
|
||||
}
|
||||
|
||||
|
||||
public function website()
|
||||
{
|
||||
return $this->belongsTo(Website::class);
|
||||
}
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
|
||||
public function inquiries()
|
||||
{
|
||||
return $this->hasMany(Inquiry::class);
|
||||
}
|
||||
|
||||
public function lead_participants()
|
||||
{
|
||||
return $this->hasMany(LeadParticipant::class);
|
||||
}
|
||||
|
||||
public function offers()
|
||||
{
|
||||
return $this->hasMany(Offer::class);
|
||||
}
|
||||
|
||||
public function status_histories()
|
||||
{
|
||||
return $this->hasMany(StatusHistory::class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
68
app/Models/LeadParticipant.php
Normal file
68
app/Models/LeadParticipant.php
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class LeadParticipant
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $lead_id
|
||||
* @property string $participant_name
|
||||
* @property string $participant_firstname
|
||||
* @property Carbon $participant_birthdate
|
||||
* @property int $participant_salutation_id
|
||||
* @property Lead $lead
|
||||
* @property Salutation $salutation
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant whereLeadId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant whereParticipantBirthdate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant whereParticipantFirstname($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant whereParticipantName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant whereParticipantSalutationId($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class LeadParticipant extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'lead_participant';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'lead_id' => 'int',
|
||||
'participant_salutation_id' => 'int'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'participant_birthdate'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'lead_id',
|
||||
'participant_name',
|
||||
'participant_firstname',
|
||||
'participant_birthdate',
|
||||
'participant_salutation_id'
|
||||
];
|
||||
|
||||
public function lead()
|
||||
{
|
||||
return $this->belongsTo(Lead::class);
|
||||
}
|
||||
|
||||
public function salutation()
|
||||
{
|
||||
return $this->belongsTo(Salutation::class, 'participant_salutation_id');
|
||||
}
|
||||
}
|
||||
56
app/Models/Offer.php
Normal file
56
app/Models/Offer.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Offer
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $lead_id
|
||||
* @property float $total
|
||||
* @property boolean $binary_data
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Lead $lead
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Offer newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Offer newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Offer query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Offer whereBinaryData($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Offer whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Offer whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Offer whereLeadId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Offer whereTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Offer whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Offer extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'offer';
|
||||
|
||||
protected $casts = [
|
||||
'lead_id' => 'int',
|
||||
'total' => 'float',
|
||||
'binary_data' => 'boolean'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'lead_id',
|
||||
'total',
|
||||
'binary_data'
|
||||
];
|
||||
|
||||
public function lead()
|
||||
{
|
||||
return $this->belongsTo(Lead::class);
|
||||
}
|
||||
}
|
||||
72
app/Models/Participant.php
Normal file
72
app/Models/Participant.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Participant
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property string $participant_name
|
||||
* @property string $participant_firstname
|
||||
* @property Carbon $participant_birthdate
|
||||
* @property int $participant_salutation_id
|
||||
* @property bool $participant_child
|
||||
* @property Booking $booking
|
||||
* @property Salutation $salutation
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantBirthdate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantChild($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantFirstname($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantSalutationId($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Participant extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'participant';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'participant_salutation_id' => 'int',
|
||||
'participant_child' => 'bool'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'participant_birthdate'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'booking_id',
|
||||
'participant_name',
|
||||
'participant_firstname',
|
||||
'participant_birthdate',
|
||||
'participant_salutation_id',
|
||||
'participant_child'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
|
||||
public function salutation()
|
||||
{
|
||||
return $this->belongsTo(Salutation::class, 'participant_salutation_id');
|
||||
}
|
||||
}
|
||||
63
app/Models/Salutation.php
Normal file
63
app/Models/Salutation.php
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Salutation
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property Collection|Customer[] $customers
|
||||
* @property Collection|Lead[] $leads
|
||||
* @property Collection|LeadParticipant[] $lead_participants
|
||||
* @property Collection|Participant[] $participants
|
||||
* @package App\Models
|
||||
* @property-read int|null $customers_count
|
||||
* @property-read int|null $lead_participants_count
|
||||
* @property-read int|null $leads_count
|
||||
* @property-read int|null $participants_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Salutation newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Salutation newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Salutation query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Salutation whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Salutation whereName($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Salutation extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'salutation';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name'
|
||||
];
|
||||
|
||||
public function customers()
|
||||
{
|
||||
return $this->hasMany(Customer::class);
|
||||
}
|
||||
|
||||
public function leads()
|
||||
{
|
||||
return $this->hasMany(Lead::class, 'participant_salutation_id');
|
||||
}
|
||||
|
||||
public function lead_participants()
|
||||
{
|
||||
return $this->hasMany(LeadParticipant::class, 'participant_salutation_id');
|
||||
}
|
||||
|
||||
public function participants()
|
||||
{
|
||||
return $this->hasMany(Participant::class, 'participant_salutation_id');
|
||||
}
|
||||
}
|
||||
42
app/Models/Searchengine.php
Normal file
42
app/Models/Searchengine.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Searchengine
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property Collection|Lead[] $leads
|
||||
* @package App\Models
|
||||
* @property-read int|null $leads_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Searchengine newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Searchengine newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Searchengine query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Searchengine whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Searchengine whereName($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Searchengine extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'searchengine';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name'
|
||||
];
|
||||
|
||||
public function leads()
|
||||
{
|
||||
return $this->hasMany(Lead::class);
|
||||
}
|
||||
}
|
||||
50
app/Models/ServiceProvider.php
Normal file
50
app/Models/ServiceProvider.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ServiceProvider
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property bool $dollar
|
||||
* @property string $type
|
||||
* @property Collection|ServiceProviderEntry[] $service_provider_entries
|
||||
* @package App\Models
|
||||
* @property-read int|null $service_provider_entries_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider whereDollar($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider whereType($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class ServiceProvider extends Model
|
||||
{
|
||||
protected $table = 'service_provider';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'dollar' => 'bool'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'dollar',
|
||||
'type'
|
||||
];
|
||||
|
||||
public function service_provider_entries()
|
||||
{
|
||||
return $this->hasMany(ServiceProviderEntry::class);
|
||||
}
|
||||
}
|
||||
112
app/Models/ServiceProviderEntry.php
Normal file
112
app/Models/ServiceProviderEntry.php
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ServiceProviderEntry
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property int $service_provider_id
|
||||
* @property float $amount
|
||||
* @property float $amount_eur
|
||||
* @property float $factor
|
||||
* @property Carbon $payment_date
|
||||
* @property string $invoice_number
|
||||
* @property bool $is_cleared
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property string $type
|
||||
* @property Booking $booking
|
||||
* @property ServiceProvider $service_provider
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry whereAmount($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry whereAmountEur($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry whereFactor($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry whereInvoiceNumber($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry whereIsCleared($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry wherePaymentDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry whereServiceProviderId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry whereType($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProviderEntry whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class ServiceProviderEntry extends Model
|
||||
{
|
||||
protected $table = 'service_provider_entry';
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'service_provider_id' => 'int',
|
||||
'amount' => 'float',
|
||||
'amount_eur' => 'float',
|
||||
'factor' => 'float',
|
||||
'is_cleared' => 'bool'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'payment_date'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'booking_id',
|
||||
'service_provider_id',
|
||||
'amount',
|
||||
'amount_eur',
|
||||
'factor',
|
||||
'payment_date',
|
||||
'invoice_number',
|
||||
'is_cleared',
|
||||
'type'
|
||||
];
|
||||
|
||||
private static $counter = 0;
|
||||
private static $bookingIds = array();
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
|
||||
public function service_provider()
|
||||
{
|
||||
return $this->belongsTo(ServiceProvider::class);
|
||||
}
|
||||
|
||||
public function getCounter(){
|
||||
if ($this->booking_id) {
|
||||
if (!in_array($this->booking_id, self::$bookingIds)) {
|
||||
self::$bookingIds[] = $this->booking_id;
|
||||
self::$counter++;
|
||||
}
|
||||
return self::$counter;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAmountFinalEur(){
|
||||
$ret = $this->amount;
|
||||
if($this->amount_eur && $this->amount_eur > 0){
|
||||
$ret = $this->amount_eur;
|
||||
}
|
||||
return number_format($ret, 2, ',', '.');
|
||||
;
|
||||
}
|
||||
|
||||
public function getPaymentDateFormat(){
|
||||
if(!$this->attributes['payment_date']){ return ""; }
|
||||
return Carbon::parse($this->attributes['payment_date'])->format(\Util::formatDateDB());
|
||||
}
|
||||
}
|
||||
81
app/Models/StatusHistory.php
Normal file
81
app/Models/StatusHistory.php
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class StatusHistory
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $status_id
|
||||
* @property int $lead_id
|
||||
* @property int $sf_guard_user_id
|
||||
* @property Carbon $date
|
||||
* @property string $remarks
|
||||
* @property Carbon $target_date
|
||||
* @property Carbon $created_at
|
||||
* @property Lead $lead
|
||||
* @property SfGuardUser $sf_guard_user
|
||||
* @property Status $status
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StatusHistory newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StatusHistory newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StatusHistory query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StatusHistory whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StatusHistory whereDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StatusHistory whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StatusHistory whereLeadId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StatusHistory whereRemarks($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StatusHistory whereSfGuardUserId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StatusHistory whereStatusId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StatusHistory whereTargetDate($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class StatusHistory extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'status_history';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'status_id' => 'int',
|
||||
'lead_id' => 'int',
|
||||
'sf_guard_user_id' => 'int'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'date',
|
||||
'target_date'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'status_id',
|
||||
'lead_id',
|
||||
'sf_guard_user_id',
|
||||
'date',
|
||||
'remarks',
|
||||
'target_date'
|
||||
];
|
||||
|
||||
public function lead()
|
||||
{
|
||||
return $this->belongsTo(Lead::class);
|
||||
}
|
||||
|
||||
public function sf_guard_user()
|
||||
{
|
||||
return $this->belongsTo(SfGuardUser::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(Status::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace App\Models\Sym;
|
||||
|
||||
use App\Models\Booking;
|
||||
use App\Models\Lead;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
|
||||
|
|
@ -62,5 +64,18 @@ class TravelCountry extends Model
|
|||
public $timestamps = false;
|
||||
|
||||
|
||||
/*public function leads()
|
||||
{
|
||||
return $this->hasMany(Lead::class, 'travelcountry_id', 'id');
|
||||
}*/
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class, 'travel_country_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
210
app/Models/Sym/_Booking.php
Normal file
210
app/Models/Sym/_Booking.php
Normal file
|
|
@ -0,0 +1,210 @@
|
|||
<?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());
|
||||
}
|
||||
|
||||
}
|
||||
194
app/Models/TravelBooking.php
Normal file
194
app/Models/TravelBooking.php
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class TravelBooking
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $salutation_id
|
||||
* @property string $first_name
|
||||
* @property string $last_name
|
||||
* @property string $street
|
||||
* @property string $zipcode
|
||||
* @property string $city
|
||||
* @property int $country_id
|
||||
* @property string $fax
|
||||
* @property string $phone
|
||||
* @property string $mobile
|
||||
* @property string $comments
|
||||
* @property string $email
|
||||
* @property Carbon $created
|
||||
* @property Carbon $selected_start_date
|
||||
* @property Carbon $selected_end_date
|
||||
* @property string $program_name
|
||||
* @property string $selected_travel
|
||||
* @property string $selected_departure
|
||||
* @property int $program_id
|
||||
* @property int $period_id
|
||||
* @property string $class
|
||||
* @property int $selected_adults
|
||||
* @property int $selected_childs
|
||||
* @property int $participants_total
|
||||
* @property string $participants
|
||||
* @property string $drafts
|
||||
* @property string $service_items
|
||||
* @property string $arrangements
|
||||
* @property string $rooms
|
||||
* @property float $price
|
||||
* @property float $price_total
|
||||
* @property float $deposit_total
|
||||
* @property float $final_payment
|
||||
* @property Carbon $final_payment_date
|
||||
* @property string $insurance_name
|
||||
* @property string $insurances
|
||||
* @property int $travel_cancellation
|
||||
* @property string $options
|
||||
* @property string $class_options
|
||||
* @property string $extra_category
|
||||
* @property bool $accept_legal_rights
|
||||
* @property string $ip
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereAcceptLegalRights($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereArrangements($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereCity($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereClass($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereClassOptions($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereComments($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereCountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereCreated($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereDepositTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereDrafts($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereEmail($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereExtraCategory($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereFax($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereFinalPayment($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereFinalPaymentDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereFirstName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereInsuranceName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereInsurances($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereIp($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereLastName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereMobile($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereOptions($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereParticipants($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereParticipantsTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking wherePeriodId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking wherePhone($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking wherePrice($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking wherePriceTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereProgramId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereProgramName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereRooms($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereSalutationId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereSelectedAdults($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereSelectedChilds($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereSelectedDeparture($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereSelectedEndDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereSelectedStartDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereSelectedTravel($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereServiceItems($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereStreet($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereTravelCancellation($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereZipcode($value)
|
||||
* @mixin \Eloquent
|
||||
* @property int|null $crm_booking_id
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBooking whereCrmBookingId($value)
|
||||
*/
|
||||
class TravelBooking extends Model
|
||||
{
|
||||
protected $connection = 'mysql_stern';
|
||||
protected $table = 'travel_booking';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'salutation_id' => 'int',
|
||||
'country_id' => 'int',
|
||||
'program_id' => 'int',
|
||||
'period_id' => 'int',
|
||||
'selected_adults' => 'int',
|
||||
'selected_childs' => 'int',
|
||||
'participants_total' => 'int',
|
||||
'price' => 'float',
|
||||
'price_total' => 'float',
|
||||
'deposit_total' => 'float',
|
||||
'final_payment' => 'float',
|
||||
'travel_cancellation' => 'int',
|
||||
'accept_legal_rights' => 'bool',
|
||||
'selected_travel' => 'array',
|
||||
'selected_departure' => 'array',
|
||||
'participants' => 'array',
|
||||
'drafts' => 'array',
|
||||
'service_items' => 'array',
|
||||
'arrangements' => 'array',
|
||||
'rooms' => 'array',
|
||||
'options' => 'array',
|
||||
'class_options' => 'array',
|
||||
'extra_category' => 'array',
|
||||
'insurances' => 'array'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created',
|
||||
'selected_start_date',
|
||||
'selected_end_date',
|
||||
'final_payment_date'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'crm_booking_id',
|
||||
'salutation_id',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'street',
|
||||
'zipcode',
|
||||
'city',
|
||||
'country_id',
|
||||
'fax',
|
||||
'phone',
|
||||
'mobile',
|
||||
'comments',
|
||||
'email',
|
||||
'created',
|
||||
'selected_start_date',
|
||||
'selected_end_date',
|
||||
'program_name',
|
||||
'selected_travel',
|
||||
'selected_departure',
|
||||
'program_id',
|
||||
'period_id',
|
||||
'class',
|
||||
'selected_adults',
|
||||
'selected_childs',
|
||||
'participants_total',
|
||||
'participants',
|
||||
'drafts',
|
||||
'service_items',
|
||||
'arrangements',
|
||||
'rooms',
|
||||
'price',
|
||||
'price_total',
|
||||
'deposit_total',
|
||||
'final_payment',
|
||||
'final_payment_date',
|
||||
'insurance_name',
|
||||
'insurances',
|
||||
'travel_cancellation',
|
||||
'options',
|
||||
'class_options',
|
||||
'extra_category',
|
||||
'accept_legal_rights',
|
||||
'ip'
|
||||
];
|
||||
}
|
||||
49
app/Models/TravelCategory.php
Normal file
49
app/Models/TravelCategory.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class TravelCategory
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property Collection|Booking[] $bookings
|
||||
* @property Collection|Lead[] $leads
|
||||
* @package App\Models
|
||||
* @property-read int|null $bookings_count
|
||||
* @property-read int|null $leads_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory whereName($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class TravelCategory extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'travel_category';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name'
|
||||
];
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
|
||||
public function leads()
|
||||
{
|
||||
return $this->hasMany(Lead::class, 'travelcategory_id');
|
||||
}
|
||||
}
|
||||
64
app/Models/TravelCompany.php
Normal file
64
app/Models/TravelCompany.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class TravelCompany
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property float $percentage
|
||||
* @property bool $is_allowed_edit_commission
|
||||
* @property bool $is_inhouse
|
||||
* @property Collection|Booking[] $bookings
|
||||
* @property Collection|BookingServiceItem[] $booking_service_items
|
||||
* @package App\Models
|
||||
* @property-read int|null $booking_service_items_count
|
||||
* @property-read int|null $bookings_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereIsAllowedEditCommission($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereIsInhouse($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany wherePercentage($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class TravelCompany extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'travel_company';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'percentage' => 'float',
|
||||
'is_allowed_edit_commission' => 'bool',
|
||||
'is_inhouse' => 'bool'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'percentage',
|
||||
'is_allowed_edit_commission',
|
||||
'is_inhouse'
|
||||
];
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
|
||||
public function booking_service_items()
|
||||
{
|
||||
return $this->hasMany(BookingServiceItem::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -211,9 +211,9 @@ class TravelUserBookingFewo extends Model
|
|||
|
||||
public function getCheckedBadgeCalendar(){
|
||||
$back = "";
|
||||
$back .= $this->is_calendar_fewo_direct ? ' <span class="badge badge-pill badge-success"><i class="far fa-check"></i></span>' : ' <span class="badge badge-pill badge-danger"><i class="far fa-times"></i></span>';
|
||||
$back .= $this->is_calendar_hrs ? ' <span class="badge badge-pill badge-success"><i class="far fa-check"></i></span>' : ' <span class="badge badge-pill badge-danger"><i class="far fa-times"></i></span>';
|
||||
$back .= $this->is_calendar_stern_tours ? ' <span class="badge badge-pill badge-success"><i class="far fa-check"></i></span>' : ' <span class="badge badge-pill badge-danger"><i class="far fa-times"></i></span>';
|
||||
$back .= $this->is_calendar_fewo_direct ? ' <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>';
|
||||
$back .= $this->is_calendar_hrs ? ' <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>';
|
||||
$back .= $this->is_calendar_stern_tours ? ' <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>';
|
||||
return $back;
|
||||
}
|
||||
|
||||
|
|
|
|||
42
app/Models/Website.php
Normal file
42
app/Models/Website.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Website
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property Collection|Lead[] $leads
|
||||
* @package App\Models
|
||||
* @property-read int|null $leads_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Website newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Website newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Website query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Website whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Website whereName($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Website extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'website';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name'
|
||||
];
|
||||
|
||||
public function leads()
|
||||
{
|
||||
return $this->hasMany(Lead::class);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue