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

Add "Play Cost" column to GK account CSV

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

+ 4 - 0
template_processing/age_verification_greene_king/project_account_csv.php

@@ -17,6 +17,7 @@ $field_names = [
 	"Date",
 	"Test ID",
 	"Test Cost",
+	"Play Cost",
 ];
 
 fputcsv($handle, $field_names);
@@ -25,6 +26,8 @@ foreach($tests as $test) {
 	$location = $test->getLocation();
 	$project = $test->getProject();
 
+	$values = $test->getValues(true);
+
 	$output = [];
 	$output[] = $location->internal_id;
 	$output[] = $location->name;
@@ -32,6 +35,7 @@ foreach($tests as $test) {
 	$output[] = $test->getDateTimeStart()->format("d/m/Y");
 	$output[] = $test->id;
 	$output[] = $test->getCustomerFee();
+	$output[] = bcadd($values["play_spent"] ?? "0.00", 0, 2);
 
 	fputcsv($handle, $output);
 }