Lead create Booking
This commit is contained in:
parent
3df0e93c2c
commit
34a3d2196b
18 changed files with 462 additions and 160 deletions
|
|
@ -274,13 +274,13 @@ class TravelUserBookingFewo extends Model
|
|||
}
|
||||
|
||||
|
||||
public function getPersonsAttribute($value)
|
||||
public function getPersonsAttribute()
|
||||
{
|
||||
$this->attributes['persons'] = $this->adults + $this->children;
|
||||
return $this->attributes['persons'];
|
||||
}
|
||||
|
||||
public function setPersonsAttribute( $value ) {
|
||||
public function setPersonsAttribute($value) {
|
||||
|
||||
$this->attributes['persons'] = $this->adults + $this->children;
|
||||
|
||||
|
|
@ -321,10 +321,9 @@ class TravelUserBookingFewo extends Model
|
|||
return $ret;
|
||||
}
|
||||
|
||||
public function getBookingDateAttribute($value)
|
||||
public function getBookingDateAttribute()
|
||||
{
|
||||
if(!$value){ return ""; }
|
||||
return Carbon::parse($value)->format(Util::formatDateDB());
|
||||
return isset($this->attributes['booking_date']) ? Carbon::parse($this->attributes['booking_date'])->format(Util::formatDateDB()) : NULL;
|
||||
}
|
||||
|
||||
public function setBookingDateAttribute( $value ) {
|
||||
|
|
@ -332,10 +331,9 @@ class TravelUserBookingFewo extends Model
|
|||
}
|
||||
|
||||
//from_date
|
||||
public function getFromDateAttribute($value)
|
||||
public function getFromDateAttribute()
|
||||
{
|
||||
if(!$value){ return ""; }
|
||||
return Carbon::parse($value)->format(Util::formatDateDB());
|
||||
return isset($this->attributes['from_date']) ? Carbon::parse($this->attributes['from_date'])->format(Util::formatDateDB()) : NULL;
|
||||
}
|
||||
public function setFromDateAttribute( $value ) {
|
||||
$this->attributes['from_date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL;
|
||||
|
|
@ -346,10 +344,9 @@ class TravelUserBookingFewo extends Model
|
|||
}
|
||||
|
||||
//to_date
|
||||
public function getToDateAttribute($value)
|
||||
public function getToDateAttribute()
|
||||
{
|
||||
if(!$value){ return ""; }
|
||||
return Carbon::parse($value)->format(Util::formatDateDB());
|
||||
return isset($this->attributes['to_date']) ? Carbon::parse($this->attributes['to_date'])->format(Util::formatDateDB()) : NULL;
|
||||
}
|
||||
public function setToDateAttribute( $value ) {
|
||||
$this->attributes['to_date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL;
|
||||
|
|
@ -367,8 +364,7 @@ class TravelUserBookingFewo extends Model
|
|||
|
||||
public function getPriceTravelAttribute($value)
|
||||
{
|
||||
if(!$value){ return 0; }
|
||||
return number_format(($this->attributes['price_travel']), 2, ',', '.');
|
||||
return isset($this->attributes['price_travel']) ? number_format(($this->attributes['price_travel']), 2, ',', '.') : 0;
|
||||
}
|
||||
|
||||
public function getPriceTravelRaw()
|
||||
|
|
@ -399,8 +395,7 @@ class TravelUserBookingFewo extends Model
|
|||
}
|
||||
public function getPriceBalanceAttribute($value)
|
||||
{
|
||||
if(!$value){ return 0; }
|
||||
return number_format(($this->attributes['price_balance']), 2, ',', '.');
|
||||
return isset($this->attributes['price_balance']) ? number_format(($this->attributes['price_balance']), 2, ',', '.') : 0;
|
||||
}
|
||||
public function getPriceBalanceRaw()
|
||||
{
|
||||
|
|
@ -415,10 +410,10 @@ class TravelUserBookingFewo extends Model
|
|||
}
|
||||
public function getPriceTravelTotalAttribute($value)
|
||||
{
|
||||
if(!$value){
|
||||
if(!isset($this->attributes['price_travel_total']) || $this->attributes['price_travel_total'] == 0){
|
||||
$this->attributes['price_travel_total'] = $this->getPriceTravelRaw() + $this->getPriceBalanceRaw() + $this->getPriceExtraRaw();
|
||||
}
|
||||
return number_format(($this->attributes['price_travel_total']), 2, ',', '.');
|
||||
}
|
||||
return isset($this->attributes['price_travel_total']) ? number_format(($this->attributes['price_travel_total']), 2, ',', '.') : 0;
|
||||
}
|
||||
public function getPriceTravelTotalRaw()
|
||||
{
|
||||
|
|
@ -436,8 +431,7 @@ class TravelUserBookingFewo extends Model
|
|||
|
||||
public function getPriceDepositAttribute($value)
|
||||
{
|
||||
if(!$value){ return 0; }
|
||||
return number_format(($this->attributes['price_deposit']), 2, ',', '.');
|
||||
return isset($this->attributes['price_deposit']) ? number_format(($this->attributes['price_deposit']), 2, ',', '.') : 0;
|
||||
}
|
||||
|
||||
public function getPriceDepositRaw()
|
||||
|
|
@ -453,8 +447,7 @@ class TravelUserBookingFewo extends Model
|
|||
|
||||
public function getPriceServiceAttribute($value)
|
||||
{
|
||||
if(!$value){ return 0; }
|
||||
return number_format(($this->attributes['price_service']), 2, ',', '.');
|
||||
return isset($this->attributes['price_service']) ? number_format(($this->attributes['price_service']), 2, ',', '.') : 0;
|
||||
}
|
||||
|
||||
public function getPriceServiceRaw()
|
||||
|
|
@ -471,8 +464,7 @@ class TravelUserBookingFewo extends Model
|
|||
|
||||
public function getPriceTotalAttribute($value)
|
||||
{
|
||||
if(!$value){ return 0; }
|
||||
return number_format(($this->attributes['price_total']), 2, ',', '.');
|
||||
return isset($this->attributes['price_total']) ? number_format(($this->attributes['price_total']), 2, ',', '.') : 0;
|
||||
}
|
||||
|
||||
public function getPriceTotalRaw()
|
||||
|
|
@ -696,8 +688,12 @@ class TravelUserBookingFewo extends Model
|
|||
if($this->travel_user){
|
||||
if($this->travel_user->salutation_id == 1){
|
||||
$salutation = __('Dear Sir')." ".$this->travel_user->last_name;
|
||||
}else{
|
||||
$salutation = __('Dear Mrs')." ".$this->travel_user->last_name;
|
||||
}
|
||||
if($this->travel_user->salutation_id == 2){
|
||||
$salutation = __('Dear Sir')." ".$this->travel_user->last_name;
|
||||
}
|
||||
if($this->travel_user->salutation_id == 4){
|
||||
$salutation = __('Dear customer')." ".$this->travel_user->last_name;
|
||||
}
|
||||
}
|
||||
return $salutation;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue