fix: skip discounts with value 0€
This commit is contained in:
@@ -51,11 +51,14 @@ class AccommodationBookingBreakdownCalculator
|
||||
$discountSum = 0;
|
||||
|
||||
foreach ($buckets as [$label, $percent, $base]) {
|
||||
if (null === $percent) {
|
||||
$amount = self::discountAmount($base, $percent);
|
||||
|
||||
// Nothing to show for a discount of 0 %, or one on a bucket this booking has no
|
||||
// price in — a "– 0,00 €" row only raises questions.
|
||||
if (0 === $amount) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$amount = self::discountAmount($base, $percent);
|
||||
$discountSum += $amount;
|
||||
$discounts[] = ['label' => $label, 'percent' => $percent, 'amount' => $amount];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user