Commit Graph

369 Commits

Author SHA1 Message Date
Nabeel S
564f9ec06e
Add ability to launch acars for flight/bid #1272 (#1273)
* Add ability to launch acars for flight/bid #1272

* Check for module active/inactive status

* Just some formatting
2021-08-06 14:53:04 -04:00
Nabeel S
95e1df619e
Trap exception/check for module existing on disk #1211 (#1271)
* Trap exception/check for module existing on disk #1211

* Style fixes
2021-08-06 13:30:24 -04:00
Nabeel S
88a8ffe48a
Check for blank values on import and omit them (#1266)
* Check for blank values on import and omit them

* Add paused status to the pirep changed
2021-07-22 15:56:03 -04:00
B.Fatih KOZ
6304f3cab4
Fix PirepService (#1261)
`$fv['name']` should be used instead of `$fv->name` due to the nature of source data.

Fixes #1260
2021-07-16 13:24:31 -04:00
Nabeel Shahzad
2af72d137d Have emails go into the logs by default, make note to users to change that #1259 2021-07-12 17:18:28 -04:00
Nabeel S
35359b8646
Create endpoint to load bid by ID (#1248)
* Create endpoint to load bid by ID

* Fix endpoint
2021-06-17 19:42:56 -04:00
B.Fatih KOZ
90344fb6e6
Simbrief Edit & Download Latest OFP (#1228)
* 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>
2021-06-09 11:38:14 -04:00
Nabeel Shahzad
dead1cfd0f Style fixes 2021-06-08 17:49:42 -04:00
Nabeel Shahzad
544462f420 Fix environment mapping 2021-06-08 17:46:15 -04:00
Nabeel S
96d33c11c8
Fix data not showing up for live map (#1223)
* Fix data not showing up for live map

* StyleCI fixes
2021-06-04 16:57:27 -04:00
Nabeel S
9b2e466b7e
Discord notifications for PIREP and News events #433 (#1215)
* 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
2021-06-04 10:51:59 -04:00
B.Fatih KOZ
17447c6903
Block aircraft with Simbrief (#1213)
* 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>
2021-06-03 16:17:16 -04:00
Nabeel Shahzad
97f095e4e9 Set default env name to "production" and debug to false 2021-05-29 18:13:36 -04:00
Nabeel Shahzad
a9e5554dea Trap migration error for modules if they don't exist 2021-05-27 16:14:13 -04:00
B.Fatih KOZ
5b10dca868
Fix SimBriefService (#1209)
* 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.
2021-05-27 09:27:38 -04:00
B.Fatih KOZ
68a6ed24cb
Fix Flight Importer (#1202)
* 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
2021-05-24 15:19:06 -04:00
Nabeel S
7d8a34645e
Add --force flag to migrations (#1203) 2021-05-24 10:58:10 -04:00
B.Fatih KOZ
30be7c245c
Fix Advanced Fuel Calculations (#1190)
* 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 !
2021-05-19 19:01:33 -04:00
B.Fatih KOZ
594d0eb222
Check Aircraft Availability (#1177)
* 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.
2021-05-13 15:26:53 -04:00
Nabeel S
6e6ba85080
Fix for duplicated/wrong expenses being applied #915 (#1173)
* Fix for duplicated/wrong expenses being applied #915

* Style fixes
2021-05-06 12:42:56 -04:00
B.Fatih KOZ
d2272e32a6
100LL and MOGAS Fuel Cost (#1172)
* 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>
2021-05-06 08:16:33 -04:00
Nabeel S
b6c0946795
Delete users without PIREPS; pilot leave fix (#1171)
* Delete users without PIREPS; pilot leave fix

* Style fixes
2021-05-05 09:56:28 -04:00
Nabeel S
fe0ef60b6c
Block refiling of PIREPs (#1167)
* Block refiling of PIREPs

* Style fixes

* Package updates
2021-05-03 10:00:10 -04:00
Nabeel Shahzad
ec6cb42bfd User guard for null 2021-04-23 13:47:54 -04:00
Nabeel S
14d0e99a37
Delete the user in a GDPR compatible way (#1151)
* Delete the user in a GDPR compatible way

* Block user from calls

* Style fix
2021-04-23 10:33:13 -04:00
Nabeel Shahzad
2545328233 Fix APP_URL being called SITE_URL 2021-04-20 23:28:57 -04:00
Nabeel S
bfddb2c84d
Make sure all dates are in UTC (#1139) 2021-04-13 09:25:38 -04:00
Nabeel Shahzad
9cb0a0cf36 Change the default driver to use mail 2021-04-11 12:36:37 -04:00
Nabeel Shahzad
498d5bfaf0 Slugify cache prefix and quote it in the env 2021-04-10 21:13:34 -04:00
Nabeel Shahzad
2202c5b479 Change default env to prod for fresh install 2021-04-10 18:00:03 -04:00
Nabeel S
ac64a5db75
Migrate all configs into the env.php file #1075 (#1128)
* Migrate all configs into the env.php file #1075

* Style fixes

* Fix config names in CreateConfig

* Fix installer/installer error messages
2021-04-10 17:19:45 -04:00
exciler
50e8f2e52b
Fetch timezone on airport lookup (#1103)
Co-authored-by: Andreas Palm <ap@ewsp.de>
2021-03-29 17:10:00 -04:00
Nabeel S
96fff0248d
Save airport timezone (#1112)
* Fix airport timezone lookup

* Save timezone to the airport when importing
2021-03-29 15:49:34 -04:00
Nabeel S
9c4aced837
Move the prefile event and add a new error exception (#1111)
* Move the prefile event and add a new error exception

* Remove extra import

* Add empty handler for testing

* Fix styling

* Fix styleci
2021-03-29 14:53:35 -04:00
exciler
d4c301a36c
Remove remove_bid_after_accept setting (#1100)
* 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>
2021-03-27 08:33:21 -04:00
exciler
be6332936f
When importing flights, set subfleet name only if subfleet has been created (#1095)
* 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>
2021-03-23 08:50:19 -04:00
Nabeel Shahzad
61ee4254fc Style fix 2021-03-20 17:41:07 -04:00
Nabeel Shahzad
f9f0ee826d Fill the flight subfleets even if there's a simbrief 2021-03-20 17:28:54 -04:00
Nabeel S
1287766a46
Fix aircraft retrieval for Simbrief (#1089)
* Fix full aircraft retrieval for simbriefs

* F off StyleCI
2021-03-19 18:25:19 -04:00
B.Fatih KOZ
bbd02bf5c7
Fix For GH Costs (#1088)
* 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
2021-03-19 16:42:36 -04:00
exciler
9bb192b97f
Add disable activity check option on certain roles #1078 (#1087)
* 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>
2021-03-19 13:09:29 -04:00
B.Fatih KOZ
7072428218
Fix Finance Memo (Ground Handling) (#1083)
PR fixes issue #1082
2021-03-18 20:04:13 -04:00
B.Fatih KOZ
1d83b85d8b
Fix for Fuel and Ground Handling Costs (#1050)
* 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>
2021-03-18 11:32:40 -04:00
Nabeel S
950c7788be
Restrict Simbrief to user who generated it (#1064)
* Restrict simbrief to user

* Style fixes

* Add tests

* Style fix
2021-03-06 13:49:42 -05:00
Nabeel S
922e754c9e
Check for valid reference object in recurring finance (#1056) 2021-03-02 16:19:54 -05:00
Nabeel S
936cd2efd3
Implement PIREP deletion #1014 (#1055)
* Implement PIREP deletion #1014

* Style fixes

* Add delete button to PIREP listing page

* Remove extra import
2021-03-02 15:43:34 -05:00
Nabeel S
e22d6d5996
Refactoring Simbrief fares and aircraft (#1054)
* 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
2021-03-02 12:29:04 -05:00
B.Fatih KOZ
efcb7e8895
Fix Advanced Fuel Calculations (#1053)
Due to an error on the settings check advanced fuel calculations was not working and defaulting to fuel used always.
2021-03-01 15:03:27 -05:00
B.Fatih KOZ
4fe323a763
Advanced Fuel Calculations (#1044)
* Advanced Fuel Calculations

PR aims to have realistic fuel debit calculations as in the real ops. When enabled, remaining fuel amounts from previous flight will be reduced from block fuel and airline will only pay for uplifted fuel amount.

If onboard fuel is enough for the flight or exceeds the required amount no fuel debit will be issued.

If this is the first flight of the aircraft or the tanks are dry, full block fuel will be treated as uplifted.

Disabled / uses current default (fuel_used will be debited)

Aircraft table also will hold the fuel_onboard value (not needed for calculations, just saving for displaying purposes)

* Style Fix

* Another Style Fix

Love StyleCi

* Fix Settings

Moved new setting under other pirep settings

* Fix Setting Check

* Fix EOF settings.yml

* Fix Settings
2021-02-24 12:22:52 -05:00
Nabeel Shahzad
a4c431d39f Set missing value from default 2021-02-23 11:25:06 -05:00