@@ -22,20 +22,22 @@ $factory->define(App\Models\Flight::class, function (Faker $faker) {
|
|||||||
'alt_airport_id' => function () {
|
'alt_airport_id' => function () {
|
||||||
return factory(App\Models\Airport::class)->create()->id;
|
return factory(App\Models\Airport::class)->create()->id;
|
||||||
},
|
},
|
||||||
'distance' => $faker->numberBetween(1, 1000),
|
'distance' => $faker->numberBetween(1, 1000),
|
||||||
'route' => null,
|
'route' => null,
|
||||||
'level' => 0,
|
'level' => 0,
|
||||||
'dpt_time' => $faker->time(),
|
'dpt_time' => $faker->time(),
|
||||||
'arr_time' => $faker->time(),
|
'arr_time' => $faker->time(),
|
||||||
'flight_time' => $faker->numberBetween(60, 360),
|
'flight_time' => $faker->numberBetween(60, 360),
|
||||||
'has_bid' => false,
|
'load_factor' => $faker->randomElement([15, 20, 50, 90, 100]),
|
||||||
'active' => true,
|
'load_factor_variance' => $faker->randomElement([15, 20, 50, 90, 100]),
|
||||||
'visible' => true,
|
'has_bid' => false,
|
||||||
'days' => 0,
|
'active' => true,
|
||||||
'start_date' => null,
|
'visible' => true,
|
||||||
'end_date' => null,
|
'days' => 0,
|
||||||
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
'start_date' => null,
|
||||||
'updated_at' => static function (array $flight) {
|
'end_date' => null,
|
||||||
|
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
||||||
|
'updated_at' => static function (array $flight) {
|
||||||
return $flight['created_at'];
|
return $flight['created_at'];
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class FlightsAddLoadFactor extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Add a `load_factor` and `load_factor_variance` columns to the expenses table
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('flights', function (Blueprint $table) {
|
||||||
|
$table->decimal('load_factor', 5, 2)
|
||||||
|
->nullable()
|
||||||
|
->after('flight_type');
|
||||||
|
|
||||||
|
$table->decimal('load_factor_variance', 5, 2)
|
||||||
|
->nullable()
|
||||||
|
->after('load_factor');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('flights', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('load_factor');
|
||||||
|
$table->dropColumn('load_factor_variance');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -124,7 +124,16 @@ airports:
|
|||||||
lat: 25.2528
|
lat: 25.2528
|
||||||
lon: 55.3644
|
lon: 55.3644
|
||||||
ground_handling_cost: 50
|
ground_handling_cost: 50
|
||||||
|
- id: OMAA
|
||||||
|
iata: AUH
|
||||||
|
icao: OMAA
|
||||||
|
name: Abu Dhabi International Airport
|
||||||
|
location: Abu Dhabi
|
||||||
|
country:
|
||||||
|
timezone: Asia/Dubai
|
||||||
|
lat: 24.433
|
||||||
|
lon: 54.6511
|
||||||
|
ground_handling_cost: 50
|
||||||
#
|
#
|
||||||
aircraft:
|
aircraft:
|
||||||
- id: 1
|
- id: 1
|
||||||
@@ -283,6 +292,7 @@ flights:
|
|||||||
arr_time: 11PM EST
|
arr_time: 11PM EST
|
||||||
flight_time: 240
|
flight_time: 240
|
||||||
flight_type: J
|
flight_type: J
|
||||||
|
load_factor: 100
|
||||||
created_at: NOW
|
created_at: NOW
|
||||||
updated_at: NOW
|
updated_at: NOW
|
||||||
- id: flightid_3
|
- id: flightid_3
|
||||||
@@ -294,6 +304,7 @@ flights:
|
|||||||
arr_airport_id: KJFK
|
arr_airport_id: KJFK
|
||||||
flight_time: 480
|
flight_time: 480
|
||||||
flight_type: J
|
flight_type: J
|
||||||
|
load_factor: 63
|
||||||
dpt_time: 9AM CST
|
dpt_time: 9AM CST
|
||||||
arr_time: 1030AM CST
|
arr_time: 1030AM CST
|
||||||
route: PITZZ4 MNURE WLEEE4
|
route: PITZZ4 MNURE WLEEE4
|
||||||
@@ -308,6 +319,37 @@ flights:
|
|||||||
arr_airport_id: MWCR
|
arr_airport_id: MWCR
|
||||||
flight_time: 70
|
flight_time: 70
|
||||||
flight_type: 'J'
|
flight_type: 'J'
|
||||||
|
load_factor: 80
|
||||||
|
dpt_time: '0800'
|
||||||
|
arr_time: '0900'
|
||||||
|
route: 'MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3'
|
||||||
|
created_at: NOW
|
||||||
|
updated_at: NOW
|
||||||
|
- id: flightid_5
|
||||||
|
airline_id: 1
|
||||||
|
flight_number: 112
|
||||||
|
route_code:
|
||||||
|
route_leg:
|
||||||
|
dpt_airport_id: OMAA
|
||||||
|
arr_airport_id: OMDB
|
||||||
|
flight_time: 30
|
||||||
|
flight_type: 'J'
|
||||||
|
load_factor:
|
||||||
|
dpt_time: '0800'
|
||||||
|
arr_time: '0900'
|
||||||
|
route: 'MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3'
|
||||||
|
created_at: NOW
|
||||||
|
updated_at: NOW
|
||||||
|
- id: flightid_6
|
||||||
|
airline_id: 1
|
||||||
|
flight_number: 113
|
||||||
|
route_code:
|
||||||
|
route_leg:
|
||||||
|
dpt_airport_id: OMDB
|
||||||
|
arr_airport_id: OMAA
|
||||||
|
flight_time: 30
|
||||||
|
flight_type: 'J'
|
||||||
|
load_factor: 100
|
||||||
dpt_time: '0800'
|
dpt_time: '0800'
|
||||||
arr_time: '0900'
|
arr_time: '0900'
|
||||||
route: 'MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3'
|
route: 'MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3'
|
||||||
@@ -467,12 +509,8 @@ pirep_fares:
|
|||||||
|
|
||||||
pirep_fields:
|
pirep_fields:
|
||||||
- id: 1
|
- id: 1
|
||||||
name: departure terminal
|
name: Cost Index
|
||||||
slug: departure-terminal
|
slug: cost-index
|
||||||
required: 1
|
|
||||||
- id: 2
|
|
||||||
name: arrival terminal
|
|
||||||
slug: arrival-terminal
|
|
||||||
required: 0
|
required: 0
|
||||||
|
|
||||||
pirep_field_values:
|
pirep_field_values:
|
||||||
|
|||||||
@@ -138,6 +138,20 @@
|
|||||||
options: ''
|
options: ''
|
||||||
type: int
|
type: int
|
||||||
description: 'Number of hours to expire bids after'
|
description: 'Number of hours to expire bids after'
|
||||||
|
- key: flights.default_load_factor
|
||||||
|
name: 'Load Factor'
|
||||||
|
group: flights
|
||||||
|
value: 82
|
||||||
|
options: ''
|
||||||
|
type: number
|
||||||
|
description: 'The default load factor for a flight, as a percent'
|
||||||
|
- key: flights.load_factor_variance
|
||||||
|
name: 'Load Factor Variance'
|
||||||
|
group: flights
|
||||||
|
value: 5
|
||||||
|
options: ''
|
||||||
|
type: number
|
||||||
|
description: 'How much the load factor can vary per-flight'
|
||||||
- key: pireps.duplicate_check_time
|
- key: pireps.duplicate_check_time
|
||||||
name: 'PIREP duplicate time check'
|
name: 'PIREP duplicate time check'
|
||||||
group: pireps
|
group: pireps
|
||||||
|
|||||||
@@ -5,12 +5,13 @@ namespace App\Http\Resources;
|
|||||||
use App\Support\Units\Distance;
|
use App\Support\Units\Distance;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin \App\Models\Flight
|
||||||
|
*/
|
||||||
class Flight extends Response
|
class Flight extends Response
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Set the fields on the flight object
|
* Set the fields on the flight object
|
||||||
*
|
|
||||||
* @mixin \App\Models\Flight
|
|
||||||
*/
|
*/
|
||||||
private function setFields()
|
private function setFields()
|
||||||
{
|
{
|
||||||
@@ -42,6 +43,14 @@ class Flight extends Response
|
|||||||
|
|
||||||
$res['ident'] = $this->ident;
|
$res['ident'] = $this->ident;
|
||||||
|
|
||||||
|
if (empty($res['load_factor'])) {
|
||||||
|
$res['load_factor'] = setting('flights.default_load_factor');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($res['load_factor_variance'])) {
|
||||||
|
$res['load_factor_variance'] = setting('flights.load_factor_variance');
|
||||||
|
}
|
||||||
|
|
||||||
$distance = new Distance($res['distance'], config('phpvms.internal_units.distance'));
|
$distance = new Distance($res['distance'], config('phpvms.internal_units.distance'));
|
||||||
$res['distance'] = $distance->getResponseUnits();
|
$res['distance'] = $distance->getResponseUnits();
|
||||||
|
|
||||||
|
|||||||
+26
-18
@@ -26,6 +26,8 @@ use Illuminate\Support\Collection;
|
|||||||
* @property int flight_time
|
* @property int flight_time
|
||||||
* @property string route
|
* @property string route
|
||||||
* @property int level
|
* @property int level
|
||||||
|
* @property float load_factor
|
||||||
|
* @property float load_factor_variance
|
||||||
* @property Airport dpt_airport
|
* @property Airport dpt_airport
|
||||||
* @property Airport arr_airport
|
* @property Airport arr_airport
|
||||||
* @property Airport alt_airport
|
* @property Airport alt_airport
|
||||||
@@ -65,6 +67,8 @@ class Flight extends Model
|
|||||||
'distance',
|
'distance',
|
||||||
'flight_time',
|
'flight_time',
|
||||||
'flight_type',
|
'flight_type',
|
||||||
|
'load_factor',
|
||||||
|
'load_factor_variance',
|
||||||
'route',
|
'route',
|
||||||
'notes',
|
'notes',
|
||||||
'start_date',
|
'start_date',
|
||||||
@@ -75,27 +79,31 @@ class Flight extends Model
|
|||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'flight_number' => 'integer',
|
'flight_number' => 'integer',
|
||||||
'days' => 'integer',
|
'days' => 'integer',
|
||||||
'level' => 'integer',
|
'level' => 'integer',
|
||||||
'distance' => 'float',
|
'distance' => 'float',
|
||||||
'flight_time' => 'integer',
|
'flight_time' => 'integer',
|
||||||
'start_date' => 'date',
|
'start_date' => 'date',
|
||||||
'end_date' => 'date',
|
'end_date' => 'date',
|
||||||
'has_bid' => 'boolean',
|
'load_factor' => 'double',
|
||||||
'route_leg' => 'integer',
|
'load_factor_variance' => 'double',
|
||||||
'active' => 'boolean',
|
'has_bid' => 'boolean',
|
||||||
'visible' => 'boolean',
|
'route_leg' => 'integer',
|
||||||
|
'active' => 'boolean',
|
||||||
|
'visible' => 'boolean',
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $rules = [
|
public static $rules = [
|
||||||
'airline_id' => 'required|exists:airlines,id',
|
'airline_id' => 'required|exists:airlines,id',
|
||||||
'flight_number' => 'required',
|
'flight_number' => 'required',
|
||||||
'route_code' => 'nullable',
|
'route_code' => 'nullable',
|
||||||
'route_leg' => 'nullable',
|
'route_leg' => 'nullable',
|
||||||
'dpt_airport_id' => 'required|exists:airports,id',
|
'dpt_airport_id' => 'required|exists:airports,id',
|
||||||
'arr_airport_id' => 'required|exists:airports,id',
|
'arr_airport_id' => 'required|exists:airports,id',
|
||||||
'level' => 'nullable',
|
'load_factor' => 'nullable|numeric',
|
||||||
|
'load_factor_variance' => 'nullable|numeric',
|
||||||
|
'level' => 'nullable',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class ExpenseImporter extends ImportExport
|
|||||||
'name' => 'required',
|
'name' => 'required',
|
||||||
'amount' => 'required|numeric',
|
'amount' => 'required|numeric',
|
||||||
'type' => 'required',
|
'type' => 'required',
|
||||||
|
'flight_type' => 'nullable',
|
||||||
'charge_to_user' => 'nullable|boolean',
|
'charge_to_user' => 'nullable|boolean',
|
||||||
'multiplier' => 'nullable|numeric',
|
'multiplier' => 'nullable|numeric',
|
||||||
'active' => 'nullable|boolean',
|
'active' => 'nullable|boolean',
|
||||||
|
|||||||
@@ -25,26 +25,28 @@ class FlightImporter extends ImportExport
|
|||||||
* Should match the database fields, for the most part
|
* Should match the database fields, for the most part
|
||||||
*/
|
*/
|
||||||
public static $columns = [
|
public static $columns = [
|
||||||
'airline' => 'required',
|
'airline' => 'required',
|
||||||
'flight_number' => 'required',
|
'flight_number' => 'required',
|
||||||
'route_code' => 'nullable',
|
'route_code' => 'nullable',
|
||||||
'route_leg' => 'nullable',
|
'route_leg' => 'nullable',
|
||||||
'dpt_airport' => 'required',
|
'dpt_airport' => 'required',
|
||||||
'arr_airport' => 'required',
|
'arr_airport' => 'required',
|
||||||
'alt_airport' => 'nullable',
|
'alt_airport' => 'nullable',
|
||||||
'days' => 'nullable',
|
'days' => 'nullable',
|
||||||
'dpt_time' => 'nullable',
|
'dpt_time' => 'nullable',
|
||||||
'arr_time' => 'nullable',
|
'arr_time' => 'nullable',
|
||||||
'level' => 'nullable|integer',
|
'level' => 'nullable|integer',
|
||||||
'distance' => 'nullable|numeric',
|
'distance' => 'nullable|numeric',
|
||||||
'flight_time' => 'required|integer',
|
'flight_time' => 'required|integer',
|
||||||
'flight_type' => 'required|alpha',
|
'flight_type' => 'required|alpha',
|
||||||
'route' => 'nullable',
|
'load_factor' => 'nullable',
|
||||||
'notes' => 'nullable',
|
'load_factor_variance' => 'nullable',
|
||||||
'active' => 'nullable|boolean',
|
'route' => 'nullable',
|
||||||
'subfleets' => 'nullable',
|
'notes' => 'nullable',
|
||||||
'fares' => 'nullable',
|
'active' => 'nullable|boolean',
|
||||||
'fields' => 'nullable',
|
'subfleets' => 'nullable',
|
||||||
|
'fares' => 'nullable',
|
||||||
|
'fields' => 'nullable',
|
||||||
];
|
];
|
||||||
|
|
||||||
private $airportSvc;
|
private $airportSvc;
|
||||||
|
|||||||
@@ -307,3 +307,17 @@ if (!function_exists('_fmt')) {
|
|||||||
return $line;
|
return $line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('docs_link')) {
|
||||||
|
/**
|
||||||
|
* Return a link to the docs
|
||||||
|
*
|
||||||
|
* @param string $key Key from phpvms.config.docs
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function docs_link($key)
|
||||||
|
{
|
||||||
|
return config('phpvms.docs.root').config('phpvms.docs.'.$key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+6
-1
@@ -109,6 +109,11 @@ return [
|
|||||||
* The links to various docs on the documentation site
|
* The links to various docs on the documentation site
|
||||||
*/
|
*/
|
||||||
'docs' => [
|
'docs' => [
|
||||||
'cron' => 'http://docs.phpvms.net/configuration/cron',
|
'root' => 'http://docs.phpvms.net',
|
||||||
|
'cron' => '/configuration/cron',
|
||||||
|
'finances' => '/concepts/finances',
|
||||||
|
'importing_legacy' => '/setup/importing-from-v2-v5',
|
||||||
|
'load_factor' => '/operations/flights#load-factor',
|
||||||
|
'subfleets' => '/concepts/basics#subfleets-and-aircraft',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<li>The first user's password (admin) will be "admin". Please change it after logging in</li>
|
<li>The first user's password (admin) will be "admin". Please change it after logging in</li>
|
||||||
<li>User passwords will be reset and they will need to use "Forgot Password" to reset it</li>
|
<li>User passwords will be reset and they will need to use "Forgot Password" to reset it</li>
|
||||||
<li>If you have more than 1000 PIREPs or flights, it's best to use the command-line importer!
|
<li>If you have more than 1000 PIREPs or flights, it's best to use the command-line importer!
|
||||||
<a href="http://docs.phpvms.net/setup/importing-from-v2-v5" target="_blank">Click here</a> to
|
<a href="{{ docs_link('importing_legacy') }}" target="_blank">Click here</a> to
|
||||||
see the documentation of how to use it.
|
see the documentation of how to use it.
|
||||||
</li>
|
</li>
|
||||||
<li><strong>THIS WILL WIPE OUT YOUR EXISTING DATA</strong> - this is required to make sure that things like
|
<li><strong>THIS WILL WIPE OUT YOUR EXISTING DATA</strong> - this is required to make sure that things like
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
], 'config');
|
], 'config');
|
||||||
|
|
||||||
$this->mergeConfigFrom(
|
$this->mergeConfigFrom(
|
||||||
__DIR__.'/../Config/config.php', 'vacentral'
|
__DIR__.'/../Config/config.php',
|
||||||
|
'vacentral'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<div class="alert alert-danger" role="alert">
|
<div class="alert alert-danger" role="alert">
|
||||||
There was a problem running the cron; make sure it's setup and check logs at
|
There was a problem running the cron; make sure it's setup and check logs at
|
||||||
<span class="text-monospace bg-gradient-dark">storage/logs/cron.log</span>.
|
<span class="text-monospace bg-gradient-dark">storage/logs/cron.log</span>.
|
||||||
<a href="{{ config('phpvms.docs.cron') }}" target="_blank">See the docs</a>
|
<a href="{{ docs_link('cron') }}" target="_blank">See the docs</a>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
the values used come from the subfleet of the aircraft that the flight is
|
the values used come from the subfleet of the aircraft that the flight is
|
||||||
filed with. Only assign the fares you want to override. They can be set as
|
filed with. Only assign the fares you want to override. They can be set as
|
||||||
a monetary amount, or a percentage.
|
a monetary amount, or a percentage.
|
||||||
<a href="http://docs.phpvms.net/concepts/finances"
|
<a href="{{ docs_link('finances') }}" target="_blank">Read documentation about finances</a>.
|
||||||
target="_blank">Read documentation about finances</a>.
|
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
<p class="text-danger">{{ $errors->first('value') }}</p>
|
<p class="text-danger">{{ $errors->first('value') }}</p>
|
||||||
|
|||||||
@@ -99,25 +99,28 @@
|
|||||||
{{-- NEXT ROW --}}
|
{{-- NEXT ROW --}}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group col-sm-3">
|
<div class="form-group col-sm-4">
|
||||||
{{ Form::label('dpt_time', 'Departure Time:') }}
|
{{ Form::label('load_factor', 'Load Factor:') }}
|
||||||
{{ Form::text('dpt_time', null, ['class' => 'form-control']) }}
|
{{ Form::text('load_factor', null, ['class' => 'form-control']) }}
|
||||||
<p class="text-danger">{{ $errors->first('dpt_time') }}</p>
|
<p class="text-danger">{{ $errors->first('load_factor') }}</p>
|
||||||
|
@component('admin.components.info')
|
||||||
|
Value between 1 and 100. See
|
||||||
|
<a href="{{ docs_link('load_factor') }}" target="_blank">docs</a>.
|
||||||
|
Leave blank to use the default value.
|
||||||
|
@endcomponent
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-sm-3">
|
<div class="form-group col-sm-4">
|
||||||
{{ Form::label('arr_time', 'Arrival Time:') }}
|
{{ Form::label('load_factor_variance', 'Load Factor Variance:') }}
|
||||||
{{ Form::text('arr_time', null, ['class' => 'form-control']) }}
|
{{ Form::text('load_factor_variance', null, ['class' => 'form-control']) }}
|
||||||
<p class="text-danger">{{ $errors->first('arr_time') }}</p>
|
<p class="text-danger">{{ $errors->first('load_factor_variance') }}</p>
|
||||||
|
@component('admin.components.info')
|
||||||
|
How much the load factor can vary per flight (+ or -). Leave blank to
|
||||||
|
use the default value.
|
||||||
|
@endcomponent
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-sm-3">
|
<div class="form-group col-sm-4">
|
||||||
{{ Form::label('level', 'Flight Level:') }}
|
|
||||||
{{ Form::text('level', null, ['class' => 'form-control']) }}
|
|
||||||
<p class="text-danger">{{ $errors->first('level') }}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group col-sm-3">
|
|
||||||
{{ Form::label('distance', 'Distance:') }} <span class="description small">in nautical miles</span>
|
{{ Form::label('distance', 'Distance:') }} <span class="description small">in nautical miles</span>
|
||||||
<a href="#" class="airport_distance_lookup">Calculate</a>
|
<a href="#" class="airport_distance_lookup">Calculate</a>
|
||||||
{{ Form::text('distance', null, ['id' => 'distance', 'class' => 'form-control']) }}
|
{{ Form::text('distance', null, ['id' => 'distance', 'class' => 'form-control']) }}
|
||||||
@@ -185,6 +188,20 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-sm-4">
|
||||||
|
{{ Form::label('dpt_time', 'Departure Time:') }}
|
||||||
|
{{ Form::text('dpt_time', null, ['class' => 'form-control']) }}
|
||||||
|
<p class="text-danger">{{ $errors->first('dpt_time') }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-sm-4">
|
||||||
|
{{ Form::label('arr_time', 'Arrival Time:') }}
|
||||||
|
{{ Form::text('arr_time', null, ['class' => 'form-control']) }}
|
||||||
|
<p class="text-danger">{{ $errors->first('arr_time') }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -206,6 +223,14 @@
|
|||||||
<p class="text-danger">{{ $errors->first('route') }}</p>
|
<p class="text-danger">{{ $errors->first('route') }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-container-body row">
|
||||||
|
<div class="form-group col-sm-4">
|
||||||
|
{{ Form::label('level', 'Flight Level:') }}
|
||||||
|
{{ Form::text('level', null, ['class' => 'form-control']) }}
|
||||||
|
<p class="text-danger">{{ $errors->first('level') }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<div class="alert alert-danger" role="alert">
|
<div class="alert alert-danger" role="alert">
|
||||||
There was a problem running the cron; make sure it's setup and check logs at
|
There was a problem running the cron; make sure it's setup and check logs at
|
||||||
<span class="text-monospace bg-gradient-dark">storage/logs/cron.log</span>.
|
<span class="text-monospace bg-gradient-dark">storage/logs/cron.log</span>.
|
||||||
<a href="{{ config('phpvms.docs.cron') }}" target="_blank">See the docs</a>
|
<a href="{{ docs_link('cron') }}" target="_blank">See the docs</a>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,10 +5,7 @@
|
|||||||
group aircraft together by feature, so 737s with winglets might have a type of
|
group aircraft together by feature, so 737s with winglets might have a type of
|
||||||
"B.738-WL". You can create as many as you want, you need at least one, though.
|
"B.738-WL". You can create as many as you want, you need at least one, though.
|
||||||
|
|
||||||
Read more about subfleets <a
|
Read more about subfleets <a href="{{ docs_link('finances') }}" target="_new">here</a>.
|
||||||
href="http://docs.phpvms.net/concepts/basics#subfleets-and-aircraft"
|
|
||||||
target="_new">here</a>.
|
|
||||||
|
|
||||||
@endcomponent
|
@endcomponent
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -435,7 +435,9 @@ class FinanceTest extends TestCase
|
|||||||
// Change to a percentage
|
// Change to a percentage
|
||||||
$manual_pay_rate = '50%';
|
$manual_pay_rate = '50%';
|
||||||
$manual_pay_adjusted = Math::addPercent(
|
$manual_pay_adjusted = Math::addPercent(
|
||||||
$rank->manual_base_pay_rate, $manual_pay_rate);
|
$rank->manual_base_pay_rate,
|
||||||
|
$manual_pay_rate
|
||||||
|
);
|
||||||
|
|
||||||
$this->fleetSvc->addSubfleetToRank($subfleet['subfleet'], $rank, [
|
$this->fleetSvc->addSubfleetToRank($subfleet['subfleet'], $rank, [
|
||||||
'manual_pay' => $manual_pay_rate,
|
'manual_pay' => $manual_pay_rate,
|
||||||
|
|||||||
+18
-5
@@ -27,15 +27,18 @@ class FlightTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* Add a single flight
|
* Add a single flight
|
||||||
*
|
*
|
||||||
* @param $user
|
* @param $user
|
||||||
|
* @param array $flight_properties
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function addFlight($user)
|
public function addFlight($user, $flight_properties = [])
|
||||||
{
|
{
|
||||||
$flight = factory(App\Models\Flight::class)->create([
|
$opts = array_merge([
|
||||||
'airline_id' => $user->airline_id,
|
'airline_id' => $user->airline_id,
|
||||||
]);
|
], $flight_properties);
|
||||||
|
|
||||||
|
$flight = factory(App\Models\Flight::class)->create($opts);
|
||||||
|
|
||||||
$flight->subfleets()->syncWithoutDetaching([
|
$flight->subfleets()->syncWithoutDetaching([
|
||||||
factory(App\Models\Subfleet::class)->create([
|
factory(App\Models\Subfleet::class)->create([
|
||||||
@@ -119,7 +122,10 @@ class FlightTest extends TestCase
|
|||||||
public function testGetFlight()
|
public function testGetFlight()
|
||||||
{
|
{
|
||||||
$this->user = factory(App\Models\User::class)->create();
|
$this->user = factory(App\Models\User::class)->create();
|
||||||
$flight = $this->addFlight($this->user);
|
$flight = $this->addFlight($this->user, [
|
||||||
|
'load_factor' => '',
|
||||||
|
'load_factor_variance' => '',
|
||||||
|
]);
|
||||||
|
|
||||||
$req = $this->get('/api/flights/'.$flight->id);
|
$req = $this->get('/api/flights/'.$flight->id);
|
||||||
$req->assertStatus(200);
|
$req->assertStatus(200);
|
||||||
@@ -128,6 +134,7 @@ class FlightTest extends TestCase
|
|||||||
$this->assertEquals($flight->id, $body['id']);
|
$this->assertEquals($flight->id, $body['id']);
|
||||||
$this->assertEquals($flight->dpt_airport_id, $body['dpt_airport_id']);
|
$this->assertEquals($flight->dpt_airport_id, $body['dpt_airport_id']);
|
||||||
$this->assertEquals($flight->arr_airport_id, $body['arr_airport_id']);
|
$this->assertEquals($flight->arr_airport_id, $body['arr_airport_id']);
|
||||||
|
$this->assertEquals(setting('flights.default_load_factor'), $body['load_factor']);
|
||||||
|
|
||||||
// Distance conversion
|
// Distance conversion
|
||||||
$this->assertHasKeys($body['distance'], ['mi', 'nmi', 'km']);
|
$this->assertHasKeys($body['distance'], ['mi', 'nmi', 'km']);
|
||||||
@@ -167,6 +174,12 @@ class FlightTest extends TestCase
|
|||||||
$flight->route = $route_text;
|
$flight->route = $route_text;
|
||||||
$flight->save();
|
$flight->save();
|
||||||
|
|
||||||
|
$req = $this->get('/api/flights/'.$flight->id);
|
||||||
|
$req->assertStatus(200);
|
||||||
|
|
||||||
|
$body = $req->json()['data'];
|
||||||
|
$this->assertEquals($flight->load_factor, $body['load_factor']);
|
||||||
|
|
||||||
$res = $this->get('/api/flights/'.$flight->id.'/route');
|
$res = $this->get('/api/flights/'.$flight->id.'/route');
|
||||||
$res->assertStatus(200);
|
$res->assertStatus(200);
|
||||||
$body = $res->json();
|
$body = $res->json();
|
||||||
|
|||||||
+4
-2
@@ -27,7 +27,8 @@ class MetarTest extends TestCase
|
|||||||
private function mockXmlResponse($filename)
|
private function mockXmlResponse($filename)
|
||||||
{
|
{
|
||||||
$mock = new MockHandler([
|
$mock = new MockHandler([
|
||||||
new Response(200,
|
new Response(
|
||||||
|
200,
|
||||||
[
|
[
|
||||||
'Content-Type' => 'text/xml',
|
'Content-Type' => 'text/xml',
|
||||||
],
|
],
|
||||||
@@ -85,7 +86,8 @@ class MetarTest extends TestCase
|
|||||||
$this->assertCount(4, $parsed['clouds']);
|
$this->assertCount(4, $parsed['clouds']);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'A few at 1676 meters; scattered at 2896 meters; broken sky at 3353 meters; broken sky at 7010 meters',
|
'A few at 1676 meters; scattered at 2896 meters; broken sky at 3353 meters; broken sky at 7010 meters',
|
||||||
$parsed['clouds_report']);
|
$parsed['clouds_report']
|
||||||
|
);
|
||||||
$this->assertEquals(1676.4, $parsed['cloud_height']['m']);
|
$this->assertEquals(1676.4, $parsed['cloud_height']['m']);
|
||||||
$this->assertEquals(false, $parsed['cavok']);
|
$this->assertEquals(false, $parsed['cavok']);
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -135,7 +135,8 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||||||
public function mockGuzzleClient($mockFile): void
|
public function mockGuzzleClient($mockFile): void
|
||||||
{
|
{
|
||||||
$mock = new MockHandler([
|
$mock = new MockHandler([
|
||||||
new Response(200,
|
new Response(
|
||||||
|
200,
|
||||||
[
|
[
|
||||||
'Content-Type' => 'application/json; charset=utf-8',
|
'Content-Type' => 'application/json; charset=utf-8',
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
airline,name,amount,type,charge_to_user,multiplier,active,ref_model,ref_model_id
|
airline,name,amount,type,flight_type,charge_to_user,multiplier,active,ref_model,ref_model_id
|
||||||
,"Per-Flight (no muliplier)",100,F,0,0,1,,
|
,"Per-Flight (no muliplier)",100,F,,0,0,1,,
|
||||||
,"Per-Flight (multiplier)",100,F,0,1,1,,
|
,"Per-Flight (multiplier)",100,F,,0,1,1,,
|
||||||
VMS,"Per-Flight (multiplier, on airline)",200,F,0,1,1,,
|
VMS,"Per-Flight (multiplier, on airline)",200,F,,0,1,1,,
|
||||||
,"A daily fee",800,D,0,0,1,,
|
,"A daily fee",800,D,,0,0,1,,
|
||||||
,"A monthly fee",5000,M,0,0,1,,
|
,"A monthly fee",5000,M,,0,0,1,,
|
||||||
,Catering,1000,F,0,0,1,Subfleet,744-3X-RB211
|
,Catering,1000,F,J,0,0,1,Subfleet,744-3X-RB211
|
||||||
,"Catering Staff",1000,D,0,0,1,Subfleet,744-3X-RB211
|
,"Catering Staff",1000,D,J,0,0,1,Subfleet,744-3X-RB211
|
||||||
,Maintenance,1000,D,0,0,1,App\Models\Aircraft,001Z
|
,Maintenance,1000,D,F,0,0,1,App\Models\Aircraft,001Z
|
||||||
|
|||||||
|
@@ -1,11 +1,11 @@
|
|||||||
airline,name,amount,type,charge_to_user,multiplier,active,ref_model,ref_model_id
|
airline,name,amount,type,flight_type,charge_to_user,multiplier,active,ref_model,ref_model_id
|
||||||
,"Per-Flight (no muliplier)",100,F,0,0,1,,
|
,"Per-Flight (no muliplier)",100,F,,0,0,1,,
|
||||||
,"Per-Flight (multiplier)",100,F,0,1,1,,
|
,"Per-Flight (multiplier)",100,F,,0,1,1,,
|
||||||
VMS,"Per-Flight (multiplier, on airline)",200,F,0,1,1,,
|
VMS,"Per-Flight (multiplier, on airline)",200,F,,0,1,1,,
|
||||||
,"A daily fee",800,D,0,0,1,,
|
,"A daily fee",800,D,,0,0,1,,
|
||||||
,"A monthly fee",5000,M,0,0,1,,
|
,"A monthly fee",5000,M,,0,0,1,,
|
||||||
,Catering,1000,F,0,0,1,Subfleet,744-3X-RB211
|
,Catering,1000,F,,0,0,1,Subfleet,744-3X-RB211
|
||||||
,"Catering Staff",1000,D,0,0,1,Subfleet,744-3X-RB211
|
,"Catering Staff",1000,D,,0,0,1,Subfleet,744-3X-RB211
|
||||||
,Maintenance,1000,D,0,0,1,App\Models\Aircraft,001Z
|
,Maintenance,1000,D,,0,0,1,App\Models\Aircraft,001Z
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
@@ -1,4 +1,4 @@
|
|||||||
airline,flight_number,route_code,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,route,notes,active,subfleets,fares,fields
|
airline,flight_number,route_code,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,load_factor, load_factor_variance,route,notes,active,subfleets,fares,fields
|
||||||
VMS,1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
|
VMS,1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,85,0, ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
|
||||||
" ",1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
|
" ",1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,100,10, ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
|
||||||
VMS,113,,,KJFK,KAUS,KDFW,15,0810 EST,1035 CST,350,,207,J,,"Empty distance",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=C41;Arrival Gate=2
|
VMS,113,,,KJFK,KAUS,KDFW,15,0810 EST,1035 CST,350,,207,J,70,2,,"Empty distance",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=C41;Arrival Gate=2
|
||||||
|
|||||||
|
@@ -1,2 +1,2 @@
|
|||||||
airline,flight_number,route_code,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,route,notes,active,subfleets,fares,fields
|
airline,flight_number,route_code,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,load_factor, load_factor_variance,route,notes,active,subfleets,fares,fields
|
||||||
VMS,1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,
|
VMS,1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,,,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,
|
||||||
|
|||||||
|
Reference in New Issue
Block a user