update stock jtl export
This commit is contained in:
parent
d5ad48e468
commit
7e36873da3
@ -58,11 +58,12 @@ class JtlExportCommand extends Command
|
||||
*/
|
||||
$jtl = new Jtl($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger, $rootPath);
|
||||
|
||||
|
||||
//Export für Standartlager
|
||||
$jtl->createExportFile($jtl->getProducts(['1', '3', '5', '10']), 'standard' . ($delta ? '_delta' : ''));
|
||||
$jtl->createExportFile($jtl->getProducts([0], ['1', '3', '5', '10']), 'standard' . ($delta ? '_delta' : ''));
|
||||
|
||||
//Export für WMS Lager
|
||||
$jtl->createExportFile($jtl->getProducts(['8']), 'wms' . ($delta ? '_delta' : ''));
|
||||
$jtl->createExportFile($jtl->getProducts([0], ['8']), 'wms' . ($delta ? '_delta' : ''));
|
||||
|
||||
|
||||
$io->success('Ende JTL Export');
|
||||
|
@ -62,7 +62,12 @@ class Jtl
|
||||
public function getProducts(array $prodIds, array $warehousesName): array
|
||||
{
|
||||
$data = array();
|
||||
if ($prodIds == array(0)) {
|
||||
$products = $this->productRepository->findAll();
|
||||
} else {
|
||||
$products = $this->productRepository->findById($prodIds);
|
||||
}
|
||||
|
||||
|
||||
$warehouse = $this->warehouseRepository->findByWarehouseByName($warehousesName);
|
||||
|
||||
@ -82,8 +87,13 @@ class Jtl
|
||||
'lager' => '01'
|
||||
];
|
||||
} else {
|
||||
//Wenn Product nicht gefunden werden kann, dann setzte Bestand auf Null
|
||||
$this->logger->info('No stock for warehouse ' . $w->getName());
|
||||
//setze Produkt auf 0 wenn kein Bestand vorhanden
|
||||
$data[$p->getId() . $warehousesName] = [
|
||||
'gtin' => $p->getGtin(),
|
||||
'stock' => 0,
|
||||
'warehouse' => $this->arrLager[$warehousesName] ?? 'Lager_' . $warehousesName,
|
||||
'lager' => '01'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user