Laravel 9 Update (#1413)
Update to Laravel 9 and PHP 8+ Co-authored-by: B.Fatih KOZ <fatih.koz@gmail.com>
This commit is contained in:
@@ -27,10 +27,10 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
class PirepFinanceService extends Service
|
||||
{
|
||||
private $expenseRepo;
|
||||
private $fareSvc;
|
||||
private $financeSvc;
|
||||
private $journalRepo;
|
||||
private ExpenseRepository $expenseRepo;
|
||||
private FareService $fareSvc;
|
||||
private FinanceService $financeSvc;
|
||||
private JournalRepository $journalRepo;
|
||||
|
||||
/**
|
||||
* FinanceService constructor.
|
||||
@@ -240,18 +240,18 @@ class PirepFinanceService extends Service
|
||||
if ($prev_flight) {
|
||||
// If there is a pirep use its values to calculate the remaining fuel
|
||||
// and calculate the uplifted fuel amount for this pirep
|
||||
$fuel_amount = $pirep->block_fuel - ($prev_flight->block_fuel - $prev_flight->fuel_used);
|
||||
$fuel_amount = $pirep->block_fuel->internal() - ($prev_flight->block_fuel->internal() - $prev_flight->fuel_used->internal());
|
||||
// Aircraft has more than enough fuel in its tanks, no uplift necessary
|
||||
if ($fuel_amount < 0) {
|
||||
$fuel_amount = 0;
|
||||
}
|
||||
} else {
|
||||
// No pirep found for aircraft, debit full block fuel
|
||||
$fuel_amount = $pirep->block_fuel;
|
||||
$fuel_amount = $pirep->block_fuel->internal();
|
||||
}
|
||||
} else {
|
||||
// Setting is false, switch back to basic calculation
|
||||
$fuel_amount = $pirep->fuel_used;
|
||||
$fuel_amount = $pirep->fuel_used->internal();
|
||||
}
|
||||
|
||||
$debit = Money::createFromAmount($fuel_amount * $fuel_cost);
|
||||
|
||||
Reference in New Issue
Block a user