소스 검색

Add play costs column to test table

Alan Lam 3 년 전
부모
커밋
37aba535f1
3개의 변경된 파일과 20개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      engine/template.php
  2. 8 0
      engine/test.php
  3. 11 0
      views/test_list.php

+ 1 - 1
engine/template.php

@@ -166,7 +166,7 @@ class Template extends Model {
 	}
 
 	/**
-	 * @param array $values
+	 * @param array $values Values as associative array
 	 * @return float
 	 * @throws Exception
 	 */

+ 8 - 0
engine/test.php

@@ -878,4 +878,12 @@ class Test extends Model {
 		return nl2br(htmlspecialchars($this->verifier_notes));
 	}
 
+	/**
+	 * @return float
+	 * @throws Exception
+	 */
+	public function getTesterInvoiceCosts(): float {
+		return $this->getProject()->getTemplate()->getTesterInvoiceCosts($this->getValues(true));
+	}
+
 }

+ 11 - 0
views/test_list.php

@@ -284,6 +284,7 @@ foreach($projects as $project) {
 							<th>Due Date</th>
 							<th>Test Date</th>
 							<th>T. Costs</th>
+							<th>P. Costs</th>
 							<th>Status</th>
 							<th>Result</th>
 							<th></th>
@@ -396,6 +397,16 @@ foreach($projects as $project) {
 									}
 									?>
 								</td>
+								<td class="text-right align-middle">
+									<?php
+									$tester_invoice_costs = $test->getTesterInvoiceCosts();
+									if($tester_invoice_costs > 0) {
+										?>
+										£<?=number_format($tester_invoice_costs, 2)?>
+										<?php
+									}
+									?>
+								</td>
 								<td class="text-center align-middle">
 									<span class="badge badge-<?=$test->getStatusClass()?>"><?=$test->getStatusText()?></span>
 								</td>