Mail Weiterleitung / verlauf / Notizen Buchnungen
This commit is contained in:
parent
f1a1baa913
commit
644ec93c53
47 changed files with 663 additions and 59 deletions
|
|
@ -524,6 +524,11 @@ class Booking extends Model
|
|||
return $this->belongsTo(TravelNationality::class, 'nationality_id');
|
||||
}
|
||||
|
||||
public function booking_notices()
|
||||
{
|
||||
return $this->hasMany(BookingNotice::class, 'booking_id')->orderBy('created_at', 'DESC');
|
||||
}
|
||||
|
||||
public function hasBookingServicesUnchecked(){
|
||||
$country_services = true;
|
||||
$provider_services = true;
|
||||
|
|
@ -547,14 +552,18 @@ class Booking extends Model
|
|||
return false;
|
||||
}
|
||||
|
||||
public function getPassolutionPDF($create = false){
|
||||
public function getPassolutionPDF($create = false, $resync = false){
|
||||
|
||||
$nats = [];
|
||||
|
||||
if(count($this->passolutionPDFs)){
|
||||
return $this->passolutionPDFs;
|
||||
return $this->passolutionPDFs;
|
||||
}
|
||||
|
||||
if(!$this->travel_country){
|
||||
return $this->passolutionPDFs;
|
||||
}
|
||||
|
||||
$destco = $this->travel_country->destco;
|
||||
if($this->travel_nationality){
|
||||
$nats[$this->travel_nationality->nat] = $this->travel_nationality->nat;
|
||||
|
|
@ -566,6 +575,11 @@ class Booking extends Model
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($nats)){
|
||||
$nats['de'] = 'de';
|
||||
}
|
||||
|
||||
foreach ($nats as $nat){
|
||||
$data = [
|
||||
'nat' => $nat,
|
||||
|
|
@ -573,11 +587,15 @@ class Booking extends Model
|
|||
];
|
||||
|
||||
$passolution = new Passolution($data);
|
||||
$this->passolutionPDFs[] = $passolution->findOrCreatePDF($create);
|
||||
$this->passolutionPDFs[] = $passolution->findOrCreatePDF($create, $resync);
|
||||
}
|
||||
return $this->passolutionPDFs;
|
||||
}
|
||||
|
||||
public function resyncPassolutionPDF(){
|
||||
return $this->getPassolutionPDF(true, true);
|
||||
}
|
||||
|
||||
public function calculate_price_total()
|
||||
{
|
||||
$travel_draft_item = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue