deposit percent in programm for caluclate price
git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3465 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
3cb28e108b
commit
ee98d2faa3
2 changed files with 41 additions and 4 deletions
|
|
@ -103,7 +103,7 @@ class BookingController extends Controller
|
||||||
}
|
}
|
||||||
$htmlSummary = [];
|
$htmlSummary = [];
|
||||||
$bookingPriceInfo = [];
|
$bookingPriceInfo = [];
|
||||||
$totalPrice = $this->calculatePrice($travelDate, $bookingRequest, $travelProgram->getCategory()->getId(), $htmlSummary, $bookingPriceInfo);
|
$totalPrice = $this->calculatePrice($travelDate, $bookingRequest, $travelProgram->getCategory()->getId(), $travelProgram->getDepositPercent(), $htmlSummary, $bookingPriceInfo);
|
||||||
|
|
||||||
if ($action == '/buchen')
|
if ($action == '/buchen')
|
||||||
{
|
{
|
||||||
|
|
@ -252,7 +252,7 @@ class BookingController extends Controller
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function calculatePrice(TravelDate $travelDate, BookingRequest $bookingRequest, $categoryId, &$outHtmlSummary = null, &$outPriceInfo = null)
|
public function calculatePrice(TravelDate $travelDate, BookingRequest $bookingRequest, $categoryId, $depositPercent = null, &$outHtmlSummary = null, &$outPriceInfo = null)
|
||||||
{
|
{
|
||||||
$ret = 0;
|
$ret = 0;
|
||||||
$insuranceAssessmentBasis = 0;
|
$insuranceAssessmentBasis = 0;
|
||||||
|
|
@ -713,14 +713,17 @@ class BookingController extends Controller
|
||||||
$outPriceInfo['flight_price'] = 0;
|
$outPriceInfo['flight_price'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($depositPercent === null) {
|
||||||
|
$depositPercent = 20;
|
||||||
|
}
|
||||||
//Aeqypten (20% from price)
|
//Aeqypten (20% from price)
|
||||||
if($categoryId == 1){
|
if($categoryId == 1){
|
||||||
$deposit = ($outPriceInfo['total'] / 100 * 20);
|
$deposit = ($outPriceInfo['total'] / 100 * $depositPercent);
|
||||||
$outPriceInfo['deposit_total'] = $deposit;
|
$outPriceInfo['deposit_total'] = $deposit;
|
||||||
$outPriceInfo['final_payment'] = ($outPriceInfo['total'] - $outPriceInfo['deposit_total']);
|
$outPriceInfo['final_payment'] = ($outPriceInfo['total'] - $outPriceInfo['deposit_total']);
|
||||||
}else{
|
}else{
|
||||||
//all 100% vom Flugpreis und 20% von der Landleistung.
|
//all 100% vom Flugpreis und 20% von der Landleistung.
|
||||||
$deposit = (($outPriceInfo['total'] - $outPriceInfo['flight_price']) / 100 * 20);
|
$deposit = (($outPriceInfo['total'] - $outPriceInfo['flight_price']) / 100 * $depositPercent);
|
||||||
$outPriceInfo['deposit_total'] = ($deposit + $outPriceInfo['flight_price']);
|
$outPriceInfo['deposit_total'] = ($deposit + $outPriceInfo['flight_price']);
|
||||||
$outPriceInfo['final_payment'] = ($outPriceInfo['total'] - $outPriceInfo['deposit_total']);
|
$outPriceInfo['final_payment'] = ($outPriceInfo['total'] - $outPriceInfo['deposit_total']);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,14 @@ class TravelProgram
|
||||||
*/
|
*/
|
||||||
private $travelAgenda;
|
private $travelAgenda;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var integer
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="deposit_percent", type="integer", nullable=true)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private $depositPercent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*
|
*
|
||||||
|
|
@ -1057,6 +1065,32 @@ class TravelProgram
|
||||||
return $this->travelAgenda;
|
return $this->travelAgenda;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set travelAgenda
|
||||||
|
*
|
||||||
|
* @param integer $depositPercent
|
||||||
|
*
|
||||||
|
* @return TravelProgram
|
||||||
|
*/
|
||||||
|
public function setDepositPercent($depositPercent)
|
||||||
|
{
|
||||||
|
$this->depositPercent = $depositPercent;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get depositPercent
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function getDepositPercent()
|
||||||
|
{
|
||||||
|
return $this->depositPercent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set nettoPricesInEuro
|
* Set nettoPricesInEuro
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue