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.
This commit is contained in:
B.Fatih KOZ
2021-03-01 23:03:27 +03:00
committed by GitHub
parent 43fbe9e943
commit efcb7e8895

View File

@@ -152,7 +152,7 @@ class PirepFinanceService extends Service
public function payFuelCosts(Pirep $pirep): void
{
$ap = $pirep->dpt_airport;
if (setting('pirep.advanced_fuel', false)) {
if (setting('pireps.advanced_fuel', false)) {
$ac = $pirep->aircraft;
// Reading second row by skip(1) to reach the previous accepted pirep. Current pirep is at the first row
$prev_flight = Pirep::where('aircraft_id', $ac->id)->where('state', 2)->where('status', 'ONB')->orderby('submitted_at', 'desc')->skip(1)->first();