diff --git a/Layout/default/Preorder/export.csv.php b/Layout/default/Preorder/export.csv.php index fdb05bc92..509819ac4 100644 --- a/Layout/default/Preorder/export.csv.php +++ b/Layout/default/Preorder/export.csv.php @@ -12,6 +12,7 @@ if(!$no_filename) { $status_flags_header = []; foreach(PreorderStatusflagModel::getAll() as $sflag) { $status_flags_header[$sflag->code] = $sflag->code; + $status_flags_header[$sflag->code . " Datum"] = $sflag->code . " Datum"; } ?> @@ -35,6 +36,16 @@ while($data = mysqli_fetch_object($res)): $statusflags = []; foreach($preorder->statusflags as $sflag) { $statusflags[$sflag->code] = $sflag->value->value ? 1 : 0; + if($sflag->value->value) { + $historyEntry = PreorderHistoryModel::getFirst([ + "preorder_id" => $preorder->id, + "key" => "preorderstatusflag-".$sflag->id."-value", + "new_value" => 1 + ]); + $statusflags[$sflag->code . " Datum"] = ($historyEntry) ? date("Y-m-d H:i:s", $historyEntry->create) : ""; + } else { + $statusflags[$sflag->code . " Datum"] = ""; + } } $discounts = [];