Просмотр исходного кода

Add void PDF graphic; add ability to mark certain parts of the test as void

Alan Lam 2 лет назад
Родитель
Сommit
db6b41b497

+ 8 - 0
controllers/test_verify_form.php

@@ -128,8 +128,16 @@ if($submit) {
 		}
 
 		$test->void = (int) HTTP::value("void", "int");
+		$test->void_primary = (int) HTTP::value("void_primary", "int");
+		$test->void_secondary = (int) HTTP::value("void_secondary", "int");
 		$test->void_notes = HTTP::value("void_notes", "trim");
 
+		if($test->void || $test->void_primary || $test->void_secondary) {
+			if(!$test->void_notes) {
+				throw new RuntimeException(__("Void notes are required if any part of the test was void."));
+			}
+		}
+
 		// Accept test as completed
 		if($accept) {
 			$test->status = Test::STATUS_COMPLETED;

+ 12 - 0
db/migrations/20240603090013_add_void_fields_to_test_table.php

@@ -0,0 +1,12 @@
+<?php
+
+use Phinx\Migration\AbstractMigration;
+
+class AddVoidFieldsToTestTable extends AbstractMigration {
+	public function change() {
+		$this->table("test")
+			->addColumn("void_primary", "boolean", ["signed" => false, "default" => "0", "after" => "void"])
+			->addColumn("void_secondary", "boolean", ["signed" => false, "default" => "0", "after" => "void_primary"])
+			->update();
+	}
+}

+ 2 - 0
engine/template.php

@@ -49,6 +49,8 @@ class Template extends Model {
 	 */
 	public function exportTestsCSV(string $processing_file, array $tests = []): void {
 
+		$template = $this;
+
 		// Get customer
 		$customer = $this->getCustomer();
 		$year_cycle_constraint = $customer->getYearCycleConstraint(TIMEZONE);

+ 11 - 2
engine/test.php

@@ -36,6 +36,8 @@ use Mpdf\Mpdf;
  * @property int $pass
  * @property int $retest
  * @property int $void
+ * @property int $void_primary
+ * @property int $void_secondary
  * @property string $void_notes
  * @property string $dts_created
  * @property string $dts_updated
@@ -58,7 +60,10 @@ class Test extends Model {
 		"additional_notes",
 		"dts_due", "dts_start", "dts_end", "dts_tester_invoice_generated", "dts_tester_invoice_paid",
 		"verifier_id", "verifier_notes",
-		"pass", "retest", "void", "void_notes",
+		"pass", "retest",
+		"void", "void_notes",
+		"void_primary",
+		"void_secondary",
 		"dts_created", "dts_updated",
 		"dts_assigned", "dts_rejected", "dts_verified"
 	];
@@ -588,7 +593,7 @@ class Test extends Model {
 	 * @return string Pending, Pass or Fail
 	 */
 	public function getPassText(): string {
-		if($this->isVoid()) return __("Void");
+		if($this->isVoid() || $this->isPrimaryVoid()) return __("Void");
 		if($this->pass === null) return __("Pending");
 		return $this->pass ? __("Pass") : __("Fail");
 	}
@@ -820,6 +825,10 @@ class Test extends Model {
 		return (bool) $this->void;
 	}
 
+	public function isPrimaryVoid(): bool {
+		return (bool) $this->void_primary;
+	}
+
 	public function getStatus(): int {
 		return $this->status;
 	}

+ 1 - 0
json/age_verification_greene_king.json

@@ -1,4 +1,5 @@
 {
+	"hasAlcohol": true,
 	"reports": {
 		"categories": [
 			"Gaming",

+ 21 - 4
template_processing/age_verification/project_csv.php

@@ -7,16 +7,22 @@
  * @var Template $template
  */
 
+$config = $template->getConfiguration();
+
 $field_names = [
 	"Project ID", "Project Name",
 	"Template Name",
-	"Test ID", "Test Status", "Test Void", "Test Result",
+	"Test ID", "Test Status", "Test Void", "Gaming Void", "Alcohol Void", "Test Result",
 	"Location Name", "Legal Entity", "Address", "Email", "Phone", "Region", "Internal ID", "Area Manager",
 	"Tester Age", "Tester Gender", "Travel Costs",
 
 	"Date", "Start Time", "End Time", "Duration",
 ];
 
+if($config->hasAlcohol ?? false) {
+	array_splice($field_names, 6, 0, ["Gaming Void", "Alcohol Void"]);
+}
+
 foreach($fields as $field) {
 	$field_names[] = $field->label;
 }
@@ -41,6 +47,15 @@ foreach($tests as $test) {
 	$gender = "";
 	$travel_costs = "";
 
+	if($test->isVoid()) {
+		$gaming_void = "Y";
+		$alcohol_void = "Y";
+	}
+	else {
+		$gaming_void = $test->void_primary ? "Y" : "N";
+		$alcohol_void = $test->void_secondary ? "Y" : "N";
+	}
+
 	$output = [];
 	$output[] = $project->id;
 	$output[] = $project->name;
@@ -49,6 +64,11 @@ foreach($tests as $test) {
 	$output[] = $test->getStatusText();
 	$output[] = $test->isVoid() ? "Y" : "N";
 
+	if($config->hasAlcohol ?? false) {
+		$output[] = $gaming_void;
+		$output[] = $alcohol_void;
+	}
+
 	if(!is_null($test->pass)) {
 
 		$result = $test->pass ? "Pass" : "Fail";
@@ -71,7 +91,6 @@ foreach($tests as $test) {
 		}
 	}
 
-
 	$output[] = $result;
 	$output[] = $location->name;
 	$output[] = $location->legal_entity_name;
@@ -103,5 +122,3 @@ foreach($tests as $test) {
 
 	fputcsv($handle, $output);
 }
-
-?>

+ 20 - 0
template_processing/age_verification/project_customer_csv.php

@@ -1,12 +1,15 @@
 <?php /** @noinspection PhpUnhandledExceptionInspection */
 
 /**
+ * @var Template $template
  * @var object[] $fields
  * @var resource $handle
  * @var Test[] $tests
  * @var Constraint $year_cycle_constraint
  */
 
+$config = $template->getConfiguration();
+
 $field_names = [
 	"Test Result", "Test Void",
 	"Location Name", "Address", "Region", "Internal ID", "Area Manager",
@@ -15,6 +18,10 @@ $field_names = [
 	"All-Time Test Count", "Current Year Period Test Count"
 ];
 
+if($config->hasAlcohol ?? false) {
+	array_splice($field_names, 2, ["Gaming Void", "Alcohol Void"]);
+}
+
 foreach($fields as $field) {
 	$customer_export = $field->customerExport ?? true;
 	if(!$customer_export) {
@@ -70,8 +77,21 @@ foreach($tests as $test) {
 		}
 	}
 
+	if($test->isVoid()) {
+		$gaming_void = "Y";
+		$alcohol_void = "Y";
+	}
+	else {
+		$gaming_void = $test->void_primary ? "Y" : "N";
+		$alcohol_void = $test->void_secondary ? "Y" : "N";
+	}
+
 	$output[] = $result;
 	$output[] = $test->isVoid() ? "Y" : "N";
+	if($config->hasAlcohol ?? false) {
+		$output[] = $gaming_void;
+		$output[] = $alcohol_void;
+	}
 	$output[] = $location->name;
 	$output[] = $location->getDisplayAddress();
 	$output[] = $location->region;

+ 71 - 70
template_processing/age_verification_greene_king/reports_process_test.php

@@ -24,7 +24,6 @@
  * @return void
  */
 $increment_periodic_pass_fail = static function($value, $pass, $prefix) use (&$data, $key) {
-
 	if($pass) {
 		$field = $prefix . "PassCounts";
 	}
@@ -45,87 +44,89 @@ $increment_periodic_pass_fail = static function($value, $pass, $prefix) use (&$d
 	$data[$key]->$field[$index]++;
 };
 
-$stage_key = "stage" . $test->challenge_stage . "Count";
-$data[$key]->$stage_key++;
-$total_data->{$stage_key}++;
-
-$line_of_sight = $test_values->play_machine_line_of_sight ?? null;
-$eye_contact = $test->challenger_eye_contact ?? null;
-$pass = (bool) $test->pass;
-
-if($test->pass) {
-	$data[$key]->passCount++;
-	$total_data->passCount++;
-	if($region) $region_data[$region][$key]->passCount++;
-	if($area_manager) $area_manager_data[$area_manager][$key]->passCount++;
-	if($brand) $brand_data[$brand][$key]->passCount++;
-	if($operations_manager) $operations_manager_data[$operations_manager][$key]->passCount++;
-}
-else {
-	$data[$key]->failCount++;
-	$total_data->failCount++;
-	if($region) $region_data[$region][$key]->failCount++;
-	if($area_manager) $area_manager_data[$area_manager][$key]->failCount++;
-	if($brand) $brand_data[$brand][$key]->failCount++;
-	if($operations_manager) $operations_manager_data[$operations_manager][$key]->failCount++;
-}
+if(!$test->void_primary) {
+	$stage_key = "stage" . $test->challenge_stage . "Count";
+	$data[$key]->$stage_key++;
+	$total_data->{$stage_key}++;
+
+	$line_of_sight = $test_values->play_machine_line_of_sight ?? null;
+	$eye_contact = $test->challenger_eye_contact ?? null;
+	$pass = (bool) $test->pass;
+
+	if($test->pass) {
+		$data[$key]->passCount++;
+		$total_data->passCount++;
+		if($region) $region_data[$region][$key]->passCount++;
+		if($area_manager) $area_manager_data[$area_manager][$key]->passCount++;
+		if($brand) $brand_data[$brand][$key]->passCount++;
+		if($operations_manager) $operations_manager_data[$operations_manager][$key]->passCount++;
+	}
+	else {
+		$data[$key]->failCount++;
+		$total_data->failCount++;
+		if($region) $region_data[$region][$key]->failCount++;
+		if($area_manager) $area_manager_data[$area_manager][$key]->failCount++;
+		if($brand) $brand_data[$brand][$key]->failCount++;
+		if($operations_manager) $operations_manager_data[$operations_manager][$key]->failCount++;
+	}
 
-$pass_key = $pass ? "pass" : "fail";
-$data[$key]->combinedCounts[$pass_key]++;
-$total_data->combinedCounts[$pass_key]++;
+	$pass_key = $pass ? "pass" : "fail";
+	$data[$key]->combinedCounts[$pass_key]++;
+	$total_data->combinedCounts[$pass_key]++;
 
-$increment_periodic_pass_fail($eye_contact, $pass, "eyeContact");
-$increment_periodic_pass_fail($line_of_sight, $pass, "lineOfSight");
+	$increment_periodic_pass_fail($eye_contact, $pass, "eyeContact");
+	$increment_periodic_pass_fail($line_of_sight, $pass, "lineOfSight");
 
-if($test->challenger_gender === "M") {
-	$data[$key]->maleChallengerCount++;
-	$total_data->maleChallengerCount++;
-}
-else if($test->challenger_gender === "F") {
-	$data[$key]->femaleChallengerCount++;
-	$total_data->femaleChallengerCount++;
-}
-else {
-	$data[$key]->unspecifiedChallengerCount++;
-	$total_data->unspecifiedChallengerCount++;
-}
+	if($test->challenger_gender === "M") {
+		$data[$key]->maleChallengerCount++;
+		$total_data->maleChallengerCount++;
+	}
+	else if($test->challenger_gender === "F") {
+		$data[$key]->femaleChallengerCount++;
+		$total_data->femaleChallengerCount++;
+	}
+	else {
+		$data[$key]->unspecifiedChallengerCount++;
+		$total_data->unspecifiedChallengerCount++;
+	}
 
-// Eye Contact
-if(is_null($test->challenger_eye_contact)) {
-	++$data[$key]->eyeContactCounts[2];
-}
-else if($test->challenger_eye_contact) {
-	++$data[$key]->eyeContactCounts[0];
-}
-else {
-	++$data[$key]->eyeContactCounts[1];
-}
+	// Eye Contact
+	if($test->challenger_eye_contact === null) {
+		++$data[$key]->eyeContactCounts[2];
+	}
+	else if($test->challenger_eye_contact) {
+		++$data[$key]->eyeContactCounts[0];
+	}
+	else {
+		++$data[$key]->eyeContactCounts[1];
+	}
 
-// Genders Comparison
-$gender_prefix = "";
-switch($test->challenger_gender) {
-	case "M": $gender_prefix = "male"; break;
-	case "F": $gender_prefix = "female"; break;
-	default:  $gender_prefix = "unknown"; break;
-}
+	// Genders Comparison
+	$gender_prefix = "";
+	switch($test->challenger_gender) {
+		case "M": $gender_prefix = "male"; break;
+		case "F": $gender_prefix = "female"; break;
+		default:  $gender_prefix = "unknown"; break;
+	}
 
-$gender_prefix .= "Challenge";
+	$gender_prefix .= "Challenge";
 
-if($gender_prefix !== "unknownChallenge") {
-	switch($tester->gender) {
-		case "M": $gender_prefix .= "Male"; break;
-		case "F": $gender_prefix .= "Female"; break;
-		default: $gender_prefix = "unknownChallenge"; break;
+	if($gender_prefix !== "unknownChallenge") {
+		switch($tester->gender) {
+			case "M": $gender_prefix .= "Male"; break;
+			case "F": $gender_prefix .= "Female"; break;
+			default: $gender_prefix = "unknownChallenge"; break;
+		}
 	}
-}
 
-$data[$key]->{$gender_prefix . "Count"}++;
-$data[$key]->{$gender_prefix . "Stages"}[$test->challenge_stage - 1]++;
-if($test->pass) $data[$key]->{$gender_prefix . "PassCount"}++;
+	$data[$key]->{$gender_prefix . "Count"}++;
+	$data[$key]->{$gender_prefix . "Stages"}[$test->challenge_stage - 1]++;
+	if($test->pass) $data[$key]->{$gender_prefix . "PassCount"}++;
+}
 
 // Alcohol Pass/Fail
 
-if($test->challenge_stage === 5) {
+if($test->challenge_stage === 5 || $test->void_primary) {
 	$av = (bool) ($test_values->bar_age_verification ?? false);
 	$av_key = $av ? "pass" : "fail";
 	$data[$key]->barAgeVerificationCounts[$av_key]++;

+ 157 - 112
template_processing/age_verification_greene_king/test_pdf.php

@@ -23,8 +23,22 @@ $display_year_cycle = $customer->getDisplayYearCycle();
 
 $alcohol_purchased = $values["alcohol_purchased"] ?? "";
 
-$pass_image = $test->pass ? "pass.png" : "fail.png";
-$alcohol_pass_image = empty($alcohol_purchased) ? "pass.png" : "fail.png";
+$gaming_void = ($test->void_primary || $test->void);
+$alcohol_void = ($test->void_secondary || $test->void);
+
+if($gaming_void) {
+	$pass_image = "void.png";
+}
+else {
+	$pass_image = $test->pass ? "pass.png" : "fail.png";
+}
+
+if($alcohol_void) {
+	$alcohol_pass_image = "void.png";
+}
+else {
+	$alcohol_pass_image = empty($alcohol_purchased) ? "pass.png" : "fail.png";
+}
 
 // Bar Receipt
 $receipt_path_pattern = $test->getDirectory() . "/bar_receipt.*";
@@ -47,9 +61,9 @@ $render_field_value = static function($field, $value): void {
 	<?php
 };
 
-if($test->pass) {
+if($test->pass && !$gaming_void) {
 	?>
-	<h3 class="section">Test Result</h3>
+	<h3 class="section">Gaming Machine Test Result</h3>
 
 	<div align="center" style="margin: auto; width: 75%;">
 		<img src="/img/<?=htmlspecialchars($pass_image)?>" alt="" />
@@ -75,11 +89,8 @@ else {
 	<br />
 	<?php
 }
-
 ?>
 
-
-
 <div style="float: left; width: 49.25%; position: relative;">
 	<h3 class="section"><?=htmlspecialchars($location_text)?></h3>
 
@@ -102,8 +113,6 @@ else {
 		</div>
 	</div>
 
-
-
 	<section>
 		<h3 class="section">Tester</h3>
 
@@ -117,11 +126,9 @@ else {
 			<?=htmlspecialchars($test->attire)?>
 		</div>
 	</section>
-
 </div>
 
 <div style="float: right; width: 49.25%">
-
 	<section>
 		<h3 class="section">House Information</h3>
 
@@ -134,8 +141,6 @@ else {
 		$render_field_value("Density", $location->machine_count);
 		?>
 	</section>
-
-
 </div>
 
 <div style="clear: both;"></div>
@@ -167,14 +172,17 @@ else {
 
 	<div style="clear: both;"></div><br />
 
-
 	<div class="subheader">
 		<strong>ID Request</strong>
 	</div>
 
 	<?php
-
-	$pass_colour = $test->pass ? "green" : "red";
+	if($gaming_void) {
+		$pass_colour = "orange";
+	}
+	else {
+		$pass_colour = $test->pass ? "green" : "red";
+	}
 
 	switch($test->challenge_stage) {
 		case 1:
@@ -199,40 +207,47 @@ else {
 		</div>
 	</div>
 
-	<div>
-		<div class="field">ID Stage:</div>
-		<div class="value" style="color: <?=$challenge_colour?>">
-			<strong><?=htmlspecialchars($test->challenge_stage . " - " . $test->getChallengeStageText())?></strong>
+	<?php
+	if(!$gaming_void) {
+		?>
+		<div>
+			<div class="field">ID Stage:</div>
+			<div class="value" style="color: <?=$challenge_colour?>">
+				<strong><?=htmlspecialchars($test->challenge_stage . " - " . $test->getChallengeStageText())?></strong>
+			</div>
 		</div>
-	</div>
 
-	<div class="bl">
-		<div class="field">Eye Contact:</div>
-		<div class="value"><?=($test->challenger_eye_contact ? "Yes" : "No")?></div>
-	</div>
+		<div class="bl">
+			<div class="field">Eye Contact:</div>
+			<div class="value"><?=($test->challenger_eye_contact ? "Yes" : "No")?></div>
+		</div>
 
-	<div>
-		<strong>Description:</strong><br />
-		<?=TestPDF::getValueHtml($test->challenge_description)?>
-	</div>
+		<div>
+			<strong>Description:</strong><br />
+			<?=TestPDF::getValueHtml($test->challenge_description)?>
+		</div>
 
-	<br />
+		<br />
 
-	<section>
-		<div class="subheader">
-			<strong>Staff</strong>
-		</div>
+		<section>
+			<div class="subheader">
+				<strong>Staff</strong>
+			</div>
 
-		<div class="bl">
-			<div class="field">Name:</div>
-			<div class="value"><?=TestPDF::getValueHtml($test->challenger_name)?></div>
-		</div>
+			<div class="bl">
+				<div class="field">Name:</div>
+				<div class="value"><?=TestPDF::getValueHtml($test->challenger_name)?></div>
+			</div>
 
-		<strong>Description:</strong><br />
-		<?=TestPDF::getValueHtml($test->challenger_description)?><br />
+			<strong>Description:</strong><br />
+			<?=TestPDF::getValueHtml($test->challenger_description)?><br />
+
+			<br />
+		</section>
+		<?php
+	}
+	?>
 
-		<br />
-	</section>
 
 </div>
 <!-- Page 1 / Alcohol Test -->
@@ -251,6 +266,16 @@ else {
 		$alcohol_purchased = $values["alcohol_purchased"] ?? "";
 		$bar_expenditure = ($values["bar_expenditure"] ?? "") ?: 0;
 		$bar_purchase_item = ($values["bar_purchase_item"] ?? "");
+
+		if($alcohol_void) {
+			$alcohol_pass_colour = "orange";
+			$alcohol_pass_text = "Void";
+		}
+		else {
+			$alcohol_pass_colour = $alcohol_purchased ? "red" : "green";
+			$alcohol_pass_text = $alcohol_purchased ? "Fail" : "Pass";
+		}
+
 		?>
 
 		<div class="subheader">
@@ -258,30 +283,44 @@ else {
 		</div>
 
 		<div class="wide-field-names">
+
 			<div class="bl">
 				<div class="field">Arrival:</div>
 				<div class="value"><?=TestPDF::getValueHtml($bar_time)?></div>
 			</div>
 
 			<div class="bl">
-				<div class="field">Asked For ID:</div>
-				<div class="value"><?=TestPDF::getBooleanHtml($bar_age_verification)?></div>
-			</div>
-
-			<div class="bl">
-				<div class="field">Alcohol Purchased:</div>
-				<div class="value"><?=TestPDF::getBooleanHtml($alcohol_purchased)?></div>
-			</div>
-
-			<div class="bl">
-				<div class="field">Drink Purchased:</div>
-				<div class="value"><?=TestPDF::getValueHtml($bar_purchase_item)?></div>
+				<div class="field">Result:</div>
+				<div class="value" style="color: <?=$alcohol_pass_colour?>">
+					<strong><?=htmlspecialchars($alcohol_pass_text)?></strong>
+				</div>
 			</div>
 
-			<div class="bl">
-				<div class="field">Bar Spend:</div>
-				<div class="value">£<?=number_format($bar_expenditure, 2)?></div>
-			</div>
+			<?php
+			if(!$alcohol_void) {
+				?>
+				<div class="bl">
+					<div class="field">Asked For ID:</div>
+					<div class="value"><?=TestPDF::getBooleanHtml($bar_age_verification)?></div>
+				</div>
+
+				<div class="bl">
+					<div class="field">Alcohol Purchased:</div>
+					<div class="value"><?=TestPDF::getBooleanHtml($alcohol_purchased)?></div>
+				</div>
+
+				<div class="bl">
+					<div class="field">Drink Purchased:</div>
+					<div class="value"><?=TestPDF::getValueHtml($bar_purchase_item)?></div>
+				</div>
+
+				<div class="bl">
+					<div class="field">Bar Spend:</div>
+					<div class="value">£<?=number_format($bar_expenditure, 2)?></div>
+				</div>
+				<?php
+			}
+			?>
 		</div>
 
 		<br />
@@ -307,72 +346,78 @@ else {
 
 <!-- Page 2 / Machine Test -->
 <div style="float: left; width: 49.25%">
-	<div class="subheader">
-		<strong>Play Details</strong>
-	</div>
-	<div class="wide-field-names">
-		<div class="bl">
-			<div class="field">Machine Played:</div>
-			<div class="value"><?=TestPDF::getValueHtml($values["play_machine"] ?? "")?></div>
-		</div>
 
-		<div class="bl">
-			<div class="field">Machine Position:</div>
-			<div class="value"><?=TestPDF::getValueHtml($values["play_machine_position"] ?? "")?></div>
-		</div>
-
-		<?php
-		$play_jackpot = $values["play_jackpot"] ?? "";
-		if(!empty($play_jackpot)) {
-			$play_jackpot = "£" . number_format($play_jackpot, 2);
-		}
+	<?php
+	if(!$gaming_void) {
 		?>
-
-		<div class="bl">
-			<div class="field">Jackpot Value:</div>
-			<div class="value"><?=TestPDF::getValueHtml($play_jackpot)?></div>
+		<div class="subheader">
+			<strong>Play Details</strong>
 		</div>
+		<div class="wide-field-names">
+			<div class="bl">
+				<div class="field">Machine Played:</div>
+				<div class="value"><?=TestPDF::getValueHtml($values["play_machine"] ?? "")?></div>
+			</div>
 
-		<?php
-		$play_machine_stake = $values["play_machine_stake"] ?? "";
-		if(!empty($play_machine_stake)) {
-			$play_machine_stake = "£" . number_format($play_machine_stake, 2);
-		}
-		?>
+			<div class="bl">
+				<div class="field">Machine Position:</div>
+				<div class="value"><?=TestPDF::getValueHtml($values["play_machine_position"] ?? "")?></div>
+			</div>
 
-		<div class="bl">
-			<div class="field">Stake Played:</div>
-			<div class="value"><?=TestPDF::getValueHtml($play_machine_stake)?></div>
-		</div>
+			<?php
+			$play_jackpot = $values["play_jackpot"] ?? "";
+			if(!empty($play_jackpot)) {
+				$play_jackpot = "£" . number_format($play_jackpot, 2);
+			}
+			?>
 
-		<div class="bl">
-			<div class="field">Minutes Played:</div>
-			<div class="value"><?=TestPDF::getValueHtml($values["play_minutes"] ?? "")?></div>
-		</div>
+			<div class="bl">
+				<div class="field">Jackpot Value:</div>
+				<div class="value"><?=TestPDF::getValueHtml($play_jackpot)?></div>
+			</div>
 
-		<?php
-		$play_spent = $values["play_spent"] ?? "";
-		if(!empty($play_spent)) $play_spent = "£" . number_format($play_spent, 2);
-		?>
+			<?php
+			$play_machine_stake = $values["play_machine_stake"] ?? "";
+			if(!empty($play_machine_stake)) {
+				$play_machine_stake = "£" . number_format($play_machine_stake, 2);
+			}
+			?>
 
-		<div>
-			<div class="field">Amount Spent:</div>
-			<div class="value"><?=TestPDF::getValueHtml($play_spent)?></div>
-		</div>
-	</div>
+			<div class="bl">
+				<div class="field">Stake Played:</div>
+				<div class="value"><?=TestPDF::getValueHtml($play_machine_stake)?></div>
+			</div>
 
-	<section>
-		<h3 class="subheader">ID Stage Reference</h3>
+			<div class="bl">
+				<div class="field">Minutes Played:</div>
+				<div class="value"><?=TestPDF::getValueHtml($values["play_minutes"] ?? "")?></div>
+			</div>
 
-		<div>
-			<div style="color: green;">1: Challenge on entry</div>
-			<div style="color: green;">2: Challenge while browsing</div>
-			<div style="color: orange;">3: Challenge during play</div>
-			<div style="color: red;">4: Challenge after play</div>
-			<div style="color: red;">5: No challenge</div>
+			<?php
+			$play_spent = $values["play_spent"] ?? "";
+			if(!empty($play_spent)) $play_spent = "£" . number_format($play_spent, 2);
+			?>
+
+			<div>
+				<div class="field">Amount Spent:</div>
+				<div class="value"><?=TestPDF::getValueHtml($play_spent)?></div>
+			</div>
 		</div>
-	</section>
 
+		<section>
+			<h3 class="subheader">ID Stage Reference</h3>
+
+			<div>
+				<div style="color: green;">1: Challenge on entry</div>
+				<div style="color: green;">2: Challenge while browsing</div>
+				<div style="color: orange;">3: Challenge during play</div>
+				<div style="color: red;">4: Challenge after play</div>
+				<div style="color: red;">5: No challenge</div>
+			</div>
+		</section>
+		<?php
+	}
+	?>
 </div>
 <!-- Page 2 / Alcohol Test -->
 <div style="float: right; width: 49.25%">

+ 25 - 2
views/test_verify_form.php

@@ -16,6 +16,7 @@
 
 use Carbon\CarbonImmutable;
 
+$config = $template->getConfiguration();
 $values = $test->getValues(true);
 
 $get_test_details = static function(Test $test) use ($project, $location): array {
@@ -205,20 +206,42 @@ function render_card_list_group($details) {
 						}
 					}
 
+					?>
+						<hr/>
+
+					<h3><?=htmlspecialchars(__("Void"))?></h3>
+					<?php
+
 					Form::renderField((object) [
 						"type" => "checkbox",
 						"name" => "void",
 						"value" => $test->void,
-						"label" => __("Void"),
+						"label" => __("Void - All Tests / Venue Closed"),
 					]);
 
+					if($config->hasAlcohol ?? false) {
+						Form::renderField((object) [
+							"type" => "checkbox",
+							"name" => "void_primary",
+							"value" => $test->void_primary,
+							"label" => __("Void - Gaming Test"),
+						]);
+
+						Form::renderField((object) [
+							"type" => "checkbox",
+							"name" => "void_secondary",
+							"value" => $test->void_secondary,
+							"label" => __("Void - Alcohol Test"),
+						]);
+					}
+
 					Form::renderField((object) [
 						"type" => "textarea",
 						"name" => "void_notes",
 						"label" => __("Void Notes"),
 						"value" => $test->void_notes,
 						"maxLength" => 65535,
-						"helpText" => __("You must fill in this field if Void is checked."),
+						"helpText" => __("You must fill in this field if any part of the test was void."),
 					]);
 
 					?>