This commit is contained in:
@@ -14,6 +14,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
|
||||
#[AsCommand(
|
||||
name: 'hiltes:import',
|
||||
@@ -50,11 +51,11 @@ class HiltesImportCommand extends Command
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
$io->success('Start Hiltes Import');
|
||||
|
||||
$rootPath = $this->GetProjectRootDir();
|
||||
/**
|
||||
* @var HiltesImport
|
||||
*/
|
||||
$hiltesImport = new HiltesImport($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger);
|
||||
$hiltesImport = new HiltesImport($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger, $rootPath);
|
||||
|
||||
|
||||
$hiltesImport->startImport($input->getOption('delta'));
|
||||
@@ -66,13 +67,31 @@ class HiltesImportCommand extends Command
|
||||
} else {
|
||||
$io->info('Start Hiltes Push JTL');
|
||||
|
||||
$jtl = new Jtl($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger);
|
||||
$jtl = new Jtl($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger, $rootPath);
|
||||
|
||||
$jtl->createExportFile($jtl->getProducts(0), 'standard');
|
||||
$jtl->createExportFile($jtl->getProducts(8), 'wms');
|
||||
//Export für Standartlager
|
||||
dump("Standard");
|
||||
$jtl->createExportFile($jtl->getProducts(['1', '3', '5', '10']), 'standard');
|
||||
dump("WMS");
|
||||
//Export für WMS Lager
|
||||
$jtl->createExportFile($jtl->getProducts(['8']), 'wms');
|
||||
|
||||
$io->success('Done.');
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
public static function GetProjectRootDir()
|
||||
{
|
||||
$dirFullPath = __DIR__;
|
||||
|
||||
//PRE: $dirs = /app/public/src/Helpers
|
||||
$dirs = explode('/', $dirFullPath);
|
||||
|
||||
array_pop($dirs); //remove last element in array ('Helpers')
|
||||
array_pop($dirs); //remove the next last element from array ('src')
|
||||
|
||||
//POST: $dirs = /app/public
|
||||
return implode('/', $dirs);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user