This commit is contained in:
@@ -52,13 +52,15 @@ class HiltesImportCommand extends Command
|
||||
|
||||
$io->success('Start Hiltes Import');
|
||||
$rootPath = $this->GetProjectRootDir();
|
||||
|
||||
$delta = $input->getOption('delta');
|
||||
/**
|
||||
* @var HiltesImport
|
||||
*/
|
||||
$hiltesImport = new HiltesImport($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger, $rootPath);
|
||||
|
||||
|
||||
$hiltesImport->startImport($input->getOption('delta'));
|
||||
$hiltesImport->startImport($delta);
|
||||
|
||||
if (isset($r['error'])) {
|
||||
$io->error($r['text']);
|
||||
@@ -70,11 +72,10 @@ class HiltesImportCommand extends Command
|
||||
$jtl = new Jtl($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger, $rootPath);
|
||||
|
||||
//Export für Standartlager
|
||||
dump("Standard");
|
||||
$jtl->createExportFile($jtl->getProducts(['1', '3', '5', '10']), 'standard');
|
||||
dump("WMS");
|
||||
$jtl->createExportFile($jtl->getProducts(['1', '3', '5', '10']), 'standard' . ($delta ? '_delta' : ''));
|
||||
|
||||
//Export für WMS Lager
|
||||
$jtl->createExportFile($jtl->getProducts(['8']), 'wms');
|
||||
$jtl->createExportFile($jtl->getProducts(['8']), 'wms' . ($delta ? '_delta' : ''));
|
||||
|
||||
$io->success('Done.');
|
||||
return Command::SUCCESS;
|
||||
|
||||
@@ -43,27 +43,45 @@ class JtlExportCommand extends Command
|
||||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this
|
||||
->addArgument('arg1', InputArgument::OPTIONAL, 'Argument description')
|
||||
->addOption('option1', null, InputOption::VALUE_NONE, 'Option description');
|
||||
$this->addOption('delta', 'd', InputOption::VALUE_NONE, 'Delta Import');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$io->success('Start JTL Export');
|
||||
$rootPath = $this->GetProjectRootDir();
|
||||
$delta = $input->getOption('delta');
|
||||
|
||||
/**
|
||||
* @var HiltesImport
|
||||
*/
|
||||
$jtl = new Jtl($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger);
|
||||
$jtl = new Jtl($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger, $rootPath);
|
||||
|
||||
$data = $jtl->getProducts();
|
||||
$jtl->createExportFile($data);
|
||||
//Export für Standartlager
|
||||
$jtl->createExportFile($jtl->getProducts(['1', '3', '5', '10']), 'standard' . ($delta ? '_delta' : ''));
|
||||
|
||||
//Export für WMS Lager
|
||||
$jtl->createExportFile($jtl->getProducts(['8']), 'wms' . ($delta ? '_delta' : ''));
|
||||
|
||||
|
||||
$io->success('Ende JTL Export');
|
||||
|
||||
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