Bläddra i källkod

Fix call to member function on null

Alan Lam 1 år sedan
förälder
incheckning
0ecb10bfa7

+ 3 - 1
template_processing/age_verification_greene_king/project_account_csv.php

@@ -34,12 +34,14 @@ foreach($tests as $test) {
 	$bar_cost = bcadd($values["bar_expenditure"] ?? "0.00", 0, 2);
 	$bar_cost = bcadd($values["bar_expenditure"] ?? "0.00", 0, 2);
 	$test_and_bar_cost = bcadd($test_cost, $bar_cost, 2);
 	$test_and_bar_cost = bcadd($test_cost, $bar_cost, 2);
 
 
+	$dt_start = $test->getDateTimeStart();
+
 	$output = [];
 	$output = [];
 	$output[] = $location->internal_id;
 	$output[] = $location->internal_id;
 	$output[] = $location->name;
 	$output[] = $location->name;
 	$output[] = $location->brand;
 	$output[] = $location->brand;
 	$output[] = $template->name;
 	$output[] = $template->name;
-	$output[] = $test->getDateTimeStart()->format("d/m/Y");
+	$output[] = $dt_start ? $dt_start->format("d/m/Y") : "";
 	$output[] = $test->id;
 	$output[] = $test->id;
 	$output[] = $test_cost;
 	$output[] = $test_cost;
 	$output[] = $bar_cost;
 	$output[] = $bar_cost;