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 = [];
|
||||
$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')
|
||||
{
|
||||
|
|
@ -252,7 +252,7 @@ class BookingController extends Controller
|
|||
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;
|
||||
$insuranceAssessmentBasis = 0;
|
||||
|
|
@ -713,14 +713,17 @@ class BookingController extends Controller
|
|||
$outPriceInfo['flight_price'] = 0;
|
||||
}
|
||||
|
||||
if($depositPercent === null) {
|
||||
$depositPercent = 20;
|
||||
}
|
||||
//Aeqypten (20% from price)
|
||||
if($categoryId == 1){
|
||||
$deposit = ($outPriceInfo['total'] / 100 * 20);
|
||||
$deposit = ($outPriceInfo['total'] / 100 * $depositPercent);
|
||||
$outPriceInfo['deposit_total'] = $deposit;
|
||||
$outPriceInfo['final_payment'] = ($outPriceInfo['total'] - $outPriceInfo['deposit_total']);
|
||||
}else{
|
||||
//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['final_payment'] = ($outPriceInfo['total'] - $outPriceInfo['deposit_total']);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue