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

Add support for saving test travel costs

Alan Lam 8 лет назад
Родитель
Сommit
194a6fb014
2 измененных файлов с 4 добавлено и 1 удалено
  1. 3 0
      controllers/test_invoice.php
  2. 1 1
      engine/test.php

+ 3 - 0
controllers/test_invoice.php

@@ -20,6 +20,9 @@ $travel_cost = (float) http::value("travel_cost", "float");
 
 $invoice_total = $fee + $play_spent + $travel_cost;
 
+$test->test_travel_cost = $travel_cost;
+$test->commit();
+
 $address = $tester->getInvoiceAddress();
 if(!$address) throw new Exception("Invoice address not found. Please set an address as the invoice address then try again.");
 if(!$tester->hasValidPaymentMethod()) throw new Exception("No valid payment method found. Please go to the Settings page and make sure all respective fields are filled in and then try again.");

+ 1 - 1
engine/test.php

@@ -4,7 +4,7 @@ class Test extends Model {
 
 	protected static $table = "test";
 	protected static $id_field = "id";
-	protected static $fillable_fields = ["project_id", "location_id", "tester_id", "status", "test_fee", "test_time", "shop_left", "shop_right", "attire", "challenge_stage", "challenge_description", "challenger_name", "challenger_description", "challenger_gender", "challenger_eye_contact", "additional_notes", "dts_due", "dts_start", "dts_end", "verifier_id", "verifier_notes", "pass", "dts_created", "dts_updated", "dts_assigned", "dts_verified"];
+	protected static $fillable_fields = ["project_id", "location_id", "tester_id", "status", "test_fee", "test_time", "test_travel_cost", "shop_left", "shop_right", "attire", "challenge_stage", "challenge_description", "challenger_name", "challenger_description", "challenger_gender", "challenger_eye_contact", "additional_notes", "dts_due", "dts_start", "dts_end", "verifier_id", "verifier_notes", "pass", "dts_created", "dts_updated", "dts_assigned", "dts_verified"];
 
 	const TEST_FIELDS = ["shop_left", "shop_right", "attire", "challenge_stage", "challenge_description", "challenger_name", "challenger_description", "challenger_gender", "challenger_eye_contact", "additional_notes"];