* Update GeoService.php
Replace double name usage with more valuable info
* Update GeoService.php
Changed `GS` with `Spd` 'cause it may be IAS or GS according to the phase of the flight.
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
* SimBrief OFP Edit
Changes aim to have ability of editing generated SimBrief Flight Plans and re-downloading.
* Move url to config
* Blade update and $uri change
* Update simbrief_form.blade.php
Used `$flight->id` along with `$user->ident` to have a more unique static id value. No details given for that fields uniqueness requirements, this will be ok I think though.
Also we are passing user's simbrief userid with api to find the flight plan, both combined, no chance to get another users plan and/or any other plan of same user.
* Update SimBriefController.php
Move `static_id` to controller
* Update simbrief_form.blade.php
Read `static_id` from controller
* StyleFix
* Update phpvms.php
* Update SimBriefService.php
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
* Discord notifications for events #433
* Style fixes
* Check for blank webhook urls and disable
* Cleanup items after review
* Changes and fixes
* Style fixes
* Don't load env for testing
* Fix status text
* Refactor saving fields/fares so events get the latest data
* Cleanup
* Style fixes
* Block Aircraft with SimBrief
Changes aim to have the ability to block an aircraft's usage if it is used to generate a SimBrief OFP.
Unused/Expired briefings will be deleted by cron like before but will now be checked by HourlyCron, so admins can define more precise restrictions for them (and the blockage period of their aircraft)
Owner of the SimBrief OFP will be able to start a flight with acars using that particular aircraft, but pilots will get an Aircraft Not Available error (similar to Aircraft State check)
To prevent SimBrief OFP packs being marked as expired/unused, during pirep prefile, pirep_id will be saved to SimBrief model along with flight_id.
And when a flight is finished (pirep file), flight_id will be removed from SimBrief model as before. Only pirep_id will remain and aircraft will be available for another OFP generation.
* Update PirepController
In case a pirep is being saved/submitted with manual entry (but the va is using simbrief effectively) same logic should be applied during save/submit button selection.
Save will act like a pirep prefile , Submit will be pirep file.
* Manual Pirep Checks
Manual pireps, prefiled from a generated simbrief should be checked too. Also pirep.show blade's submit button should provide the same simbrief checks.
* Update PirepService.php
* Change settings and move sb cron to hourly
* StyleFix (SimBriefService)
* Another StyleFix (SimBriefService)
* Update SimBriefController
Removed null check of pirep_id for aircraft list generation to prevent live flights' aircraft being listed for another ofp generation.
( Active acars flights will have both flight_id and pirep_id at simbrief table)
* Update PirepService.php
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
* Fix removeExpiredEntires()
* Fix SimBriefTest
No need to add `'pirep_id' => ''` , just let it be `null` (like the core code does) and no need to convert Carbon to DateTimeString.
* Handle Route and Level fields too during import.
* Also removed the check for `visible => true` from `firstorNew` 'cause va admin may be importing to update not visible flights too.
(by default all new flights are visible, so no affect on new flights)
Closes#1201
* Fix Advanced Fuel Calculations
Current code works fine with a fresh submitted pirep but when a re-calculation is needed, fuel amount will not be correct if the aircraft was flown later on.
Commit provides fix for such re-calculation scenarios.
* StyleFix for the Comment Line !
* Check Aircraft Availability before Prefile
Check if the aircraft is available for flight (State : Parked / On Ground). If not throw new exception AircraftNotAvailable
* Add Exception
AircraftNotAvailable exception, used by PirepService during prefile checks.
* Add defaults for 100LL and MOGAS prices
Add missing defaults for 100LL and MOGAS Fuel prices.
* Calculate Fuel Cost according to Fuel Type
Calculate pirep fuel costs according to aircraft (subfleet) fuel type, use JetA as fail safe default.
* Fix for Failing AwardTest
At least attempting to fix
* Fix fuel types logic
* Style
* Invert the logic
Co-authored-by: Nabeel Shahzad <nabeel@nabeel.sh>
* Remove "Remove bid on accept" setting and remove bids after PIREP was filed
fixes#1039
* Add migration to remove setting from database
* fix migration naming and remove obsolete code
Co-authored-by: Andreas Palm <ap@ewsp.de>
* when importing flights, set subfleet name only if subfleet has been created, do not update existing subfleets
* add tests for flights import regarding subfleets
Co-authored-by: Andreas Palm <ap@ewsp.de>
* Fix For GH Costs.
PR aims to fix the problem where Airport GH cost is not defined but recored to db as 0.00 or 0 (default value for airports table)
In such cases settings/default apt gh cost will be used.
* Updated logic for JetA1 cost check
* Remove default costs being used during import
* Add boolean field "disable activity checks" to role, check for this field inside PilotLeave-Check, add tests
* fix checkbox on form
* CS fixes
* CS fixes again :-)
Co-authored-by: Andreas Palm <ap@ewsp.de>
* Fix for Fuel and Ground Handling Costs
PR aims to fix issue #1048 and implements the feature request #1049
If no fuel cost is defined for departure airport, settings / airport fuel price will be used.
If no ground handling cost is defined for airports, settings / airport ground handling cost will be used.
Ground handling prices of both departure and arrival airport will be used for calculations.
* Resolve conflict with latest dev
PR will still fail checks due to double ground handling fares and will work on it to have two records at transactions for dep/arr
* Remove Double GH Costs / Fix The Bug Only
Removed double GH costs for now, pr aims only fixing the current issue (general settings not being read for fuel and ground handling costs)
* Add departure and arrival airports to ground handling
* Style fix
* Fix tests
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
Co-authored-by: Nabeel Shahzad <nabeel@nabeel.sh>
* Refactoring simbrief fares and aircraft
* Hide user full name/email
* Sort PIREP fields desc; fix cargo counts
* Change the sorting
* Extra logs
* Fix tests
* Return fare information through the API
* Style fixes
* Test fix
* Another test fix
* More fixes
* Set aircraft and fares in prefile
* Formatting