From efcb7e8895eaf425586a90ce73895e22fbce8f8b Mon Sep 17 00:00:00 2001 From: "B.Fatih KOZ" <74361521+FatihKoz@users.noreply.github.com> Date: Mon, 1 Mar 2021 23:03:27 +0300 Subject: [PATCH] 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. --- app/Services/Finance/PirepFinanceService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/Finance/PirepFinanceService.php b/app/Services/Finance/PirepFinanceService.php index 623aeead..788caa0c 100644 --- a/app/Services/Finance/PirepFinanceService.php +++ b/app/Services/Finance/PirepFinanceService.php @@ -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();