| ... | ... |
@@ -96,6 +96,18 @@ class CheckInCompletedListener implements EventSubscriberInterface |
| 96 | 96 |
$filesystem->mkdir($exportDir, 0755); |
| 97 | 97 |
} |
| 98 | 98 |
|
| 99 |
+ // Get slot data |
|
| 100 |
+ $slotModel = $reservationModel->getRelated('pid');
|
|
| 101 |
+ |
|
| 102 |
+ if (null === $slotModel) {
|
|
| 103 |
+ $this->logger->log( |
|
| 104 |
+ LogLevel::ERROR, |
|
| 105 |
+ sprintf('Could not find slot with ID: %s', $reservationModel->pid),
|
|
| 106 |
+ ['contao' => new ContaoContext(__METHOD__, 'CHECK_IN_CSV_EXPORT')] |
|
| 107 |
+ ); |
|
| 108 |
+ return; |
|
| 109 |
+ } |
|
| 110 |
+ |
|
| 99 | 111 |
// Get member data |
| 100 | 112 |
$memberId = $reservationData['uid']; |
| 101 | 113 |
$memberModel = MemberModel::findById($memberId); |
| ... | ... |
@@ -136,8 +148,9 @@ class CheckInCompletedListener implements EventSubscriberInterface |
| 136 | 148 |
} |
| 137 | 149 |
} |
| 138 | 150 |
|
| 139 |
- // Format check-in date |
|
| 151 |
+ // Format dates |
|
| 140 | 152 |
$checkInDate = date('d.m.Y', $reservationData['checked_in_on']);
|
| 153 |
+ $slotDate = date('d.m.Y', $slotModel->time);
|
|
| 141 | 154 |
|
| 142 | 155 |
// Get sorten (grape varieties and harvest types) |
| 143 | 156 |
$sortenData = []; |
| ... | ... |
@@ -255,7 +268,7 @@ class CheckInCompletedListener implements EventSubscriberInterface |
| 255 | 268 |
$leseartTitle, // leseart title |
| 256 | 269 |
$ernteart, // ernteart (H for handlese, V for vollernter) |
| 257 | 270 |
$behaelterNumber, // behaelter number |
| 258 |
- $checkInDate, // check-in date |
|
| 271 |
+ $slotDate, // slot date |
|
| 259 | 272 |
// $reservationData['behaelter'] // behaelter amount for the whole checked-in booking |
| 260 | 273 |
]; |
| 261 | 274 |
} |