EU Reiserecht - Booking
git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3419 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
8fd6f63403
commit
2360290f06
25 changed files with 1089 additions and 229 deletions
|
|
@ -153,6 +153,24 @@ final class TravelDate
|
|||
return $this->start;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getStartWeekday()
|
||||
{
|
||||
return $this->start->format('w');
|
||||
}
|
||||
|
||||
public function getFinalPaymentDate()
|
||||
{
|
||||
$pDate = strtotime('-4 week', $this->getStart()->getTimestamp());
|
||||
if($pDate <= time()){
|
||||
$pDate = strtotime('+1 day', $this->getStart()->getTimestamp());
|
||||
}
|
||||
return date('d.m.Y',$pDate);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
|
|
@ -221,6 +239,23 @@ final class TravelDate
|
|||
return $flightPrice;
|
||||
}
|
||||
|
||||
|
||||
public function getFlightCalcPrice()
|
||||
{
|
||||
$flightPrice = $this->getFlightPrice();
|
||||
if ($this->travelProgram->getIsMediated())
|
||||
{
|
||||
$profitMargin = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$profitMargin = $this->travelProgram->getProfitMargin() / 100 + 1;
|
||||
}
|
||||
$currencyFactor = $this->travelProgram->getNettoPricesInEuro() ? 1 : $this->currencyFactor;
|
||||
return round(($flightPrice * $currencyFactor) * $profitMargin);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TravelPeriodPrice[]|\Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue