* Fertigstellung Buchungsformular (#1321) (SternTours-CRM-API-Anbindung, Mailversand, Validierung, Dynamische Preisberechnung, Persistierung von Buchungsinformationen)
* Fehler bei der Preisberechnung behoben * Farbschema geändert (Kevin Adametz) git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3289 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
dde3b91724
commit
3a28866cd2
36 changed files with 2200 additions and 268 deletions
|
|
@ -89,12 +89,12 @@ final class TravelDate
|
|||
}
|
||||
$this->start = $start;
|
||||
$this->index = $index;
|
||||
$this->flightPeriod = $flightPeriod;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->start = $travelPeriod->getStartDate();
|
||||
}
|
||||
$this->flightPeriod = $flightPeriod;
|
||||
$this->travelProgram = $travelPeriod->getProgram();
|
||||
$this->key = $key;
|
||||
$this->travelPeriod = $travelPeriod;
|
||||
|
|
@ -187,6 +187,24 @@ final class TravelDate
|
|||
return $this->departures;
|
||||
}
|
||||
|
||||
public function getFlightPrice()
|
||||
{
|
||||
if ($this->travelProgram->getIsMediated())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
$flightPrice = null;
|
||||
if ($this->flightPeriod !== null)
|
||||
{
|
||||
$flightPrice = $this->flightPeriod->getPrice();
|
||||
}
|
||||
if ($flightPrice === null)
|
||||
{
|
||||
$flightPrice = $this->travelProgram->getDefaultFlightPrice();
|
||||
}
|
||||
return $flightPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TravelPeriodPrice[]|\Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
|
|
@ -195,31 +213,21 @@ final class TravelDate
|
|||
if (!$this->calculatedEffectivePrices)
|
||||
{
|
||||
$this->calculatedEffectivePrices = true;
|
||||
$flightPrice = $this->getFlightPrice();
|
||||
if ($this->travelProgram->getIsMediated())
|
||||
{
|
||||
$profitMargin = 1;
|
||||
$flightPrice = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$profitMargin = $this->travelProgram->getProfitMargin() / 100 + 1;
|
||||
$flightPrice = null;
|
||||
if ($this->flightPeriod !== null)
|
||||
{
|
||||
$flightPrice = $this->flightPeriod->getPrice();
|
||||
}
|
||||
if ($flightPrice === null)
|
||||
{
|
||||
$flightPrice = $this->travelProgram->getDefaultFlightPrice();
|
||||
}
|
||||
}
|
||||
$currencyFactor = $this->travelProgram->getNettoPricesInEuro() ? 1 : $this->currencyFactor;
|
||||
foreach ($this->travelPeriod->getPrices() as $price)
|
||||
{
|
||||
$price->setEffectivePrice(round(($flightPrice + $price->getPrice() * $currencyFactor) * $profitMargin));
|
||||
$price->setEffectiveDiscountPrice(
|
||||
round(($flightPrice + $price->getDiscountPrice() * $currencyFactor) * $profitMargin));
|
||||
//$price->setEffectiveDiscountPrice($pr)
|
||||
$price->setEffectiveComfortPrice(round($price->getPriceComfort() * $currencyFactor * $profitMargin));
|
||||
$price->setEffectiveChildPrice(round($price->getPriceChildren() * $currencyFactor * $profitMargin));
|
||||
}
|
||||
}
|
||||
return $this->travelPeriod->getPrices();
|
||||
|
|
@ -255,6 +263,14 @@ final class TravelDate
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TravelProgram
|
||||
*/
|
||||
public function getTravelProgram(): TravelProgram
|
||||
{
|
||||
return $this->travelProgram;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TravelPeriod
|
||||
* @internal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue