Staging #1663

Merged
korina.cordero merged 16 commits from staging into master 2023-02-09 10:19:34 +00:00
Showing only changes of commit ab2d6be08e - Show all commits

View file

@ -43,14 +43,10 @@ class GenerateBatteryCompatibilityCommand extends Command
$vehicles = $vm->getVehicles(); $vehicles = $vm->getVehicles();
foreach ($vehicles as $vehicle) foreach ($vehicles as $vehicle)
{ {
$batteries = $vehicle->getBatteries(); $batteries = $vehicle->getActiveBatteries();
$comp_batt = []; $comp_batt = [];
foreach ($batteries as $battery) foreach ($batteries as $battery)
{ {
// check if battery is active
if (!($battery->isActive()))
continue;
// set to the first compatible battery found until a more expensive one is found // set to the first compatible battery found until a more expensive one is found
$comp_batt['id'] = $battery->getID(); $comp_batt['id'] = $battery->getID();
$comp_batt['name'] = $battery->getModel()->getName() . ' ' . $comp_batt['name'] = $battery->getModel()->getName() . ' ' .