Anzahlungen / Restzahlungen

Restzahlung, wenn kleiner als 4 Wochen, dann sofort

git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3427 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
adametz 2018-07-04 14:48:49 +00:00
parent 35aeb88f09
commit 7e8a53bace
3 changed files with 12 additions and 2 deletions

View file

@ -27,7 +27,7 @@
<td class="st-position-price-col">
<span class="st-final-price">{{ booking_price_info.final_payment|number_format(2) }} €</span>
</td>
<td class="st-position-name-col">Restzahlung (bis zum {{ booking_price_info.final_payment_date}})</td>
<td class="st-position-name-col">Restzahlung ({{ booking_price_info.final_payment_date_str}})</td>
</tr>

View file

@ -227,6 +227,7 @@ class BookingController extends Controller
$outPriceInfo['departure_extra'] = 0;
$outPriceInfo['flight_price'] = 0;
$outPriceInfo['final_payment_date'] = $travelDate->getFinalPaymentDate();
$outPriceInfo['final_payment_date_str'] = $travelDate->getFinalPaymentDateStr();
}
if($bookingRequest->getDeparture() != null)

View file

@ -165,11 +165,20 @@ final class TravelDate
{
$pDate = strtotime('-4 week', $this->getStart()->getTimestamp());
if($pDate <= time()){
$pDate = strtotime('+1 day', $this->getStart()->getTimestamp());
$pDate = time();
}
return date('d.m.Y',$pDate);
}
public function getFinalPaymentDateStr()
{
$pDate = strtotime('-4 week', $this->getStart()->getTimestamp());
if($pDate <= time()){
return "ist sofort fällig";
}
return "bis zum ".date('d.m.Y',$pDate);
}
/**
* @return \DateTime