feat: correct determination of inquiry status and conditional voucher field display
This commit is contained in:
@@ -893,10 +893,12 @@ class BookingDataProcessor
|
||||
}
|
||||
}
|
||||
|
||||
// Add promotional voucher as aktionscode (allowed for inquiry bookings)
|
||||
$promotionalCode = $this->getPromoVoucherCodeForParticipant($participant);
|
||||
if (null !== $promotionalCode) {
|
||||
$participantData['aktionscode'] = $promotionalCode;
|
||||
// Add promotional voucher as aktionscode (excluded from inquiry bookings)
|
||||
if (false === $isInquiryBooking) {
|
||||
$promotionalCode = $this->getPromoVoucherCodeForParticipant($participant);
|
||||
if (null !== $promotionalCode) {
|
||||
$participantData['aktionscode'] = $promotionalCode;
|
||||
}
|
||||
}
|
||||
|
||||
// Add goodwill voucher as participant-level einloesecode
|
||||
@@ -926,15 +928,16 @@ class BookingDataProcessor
|
||||
$this->addServicesFromMap($payload, 'versicherungen', 'versicherung', '@idversicherung', $insuranceMap);
|
||||
|
||||
// Add purchase vouchers (regular purchase vouchers, excluding goodwill vouchers)
|
||||
// Purchase vouchers are allowed for both inquiry and final bookings
|
||||
// Goodwill vouchers are handled separately and excluded from inquiry bookings
|
||||
$purchaseVouchers = $this->collectPurchaseVouchers($bookingDto);
|
||||
if (false === empty($purchaseVouchers)) {
|
||||
$payload['gutscheine']['gutschein'] = [];
|
||||
foreach ($purchaseVouchers as $code) {
|
||||
$payload['gutscheine']['gutschein'][] = [
|
||||
'@einloesecode' => $code,
|
||||
];
|
||||
// All vouchers (purchase, promotional, goodwill) are excluded from inquiry bookings
|
||||
if (false === $isInquiryBooking) {
|
||||
$purchaseVouchers = $this->collectPurchaseVouchers($bookingDto);
|
||||
if (false === empty($purchaseVouchers)) {
|
||||
$payload['gutscheine']['gutschein'] = [];
|
||||
foreach ($purchaseVouchers as $code) {
|
||||
$payload['gutscheine']['gutschein'][] = [
|
||||
'@einloesecode' => $code,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user