fix Hiltes import
This commit is contained in:
parent
88dd4a4c3d
commit
5bca054a32
17359
jtl/cds-export.csv
17359
jtl/cds-export.csv
File diff suppressed because it is too large
Load Diff
@ -168,7 +168,7 @@ class HiltesImport
|
||||
* @return void
|
||||
*/
|
||||
protected function saveData(Array $arr){
|
||||
dump($arr);
|
||||
//dump($arr);
|
||||
#*** Speichert und/oder Holt WareHouse ab
|
||||
$wareHouse = $this->checkWareHouseName($arr[2]);
|
||||
|
||||
@ -178,16 +178,16 @@ class HiltesImport
|
||||
#*** Ermitteln ob schon ein ID vorhadnen für ProdId und WareHouseId
|
||||
if(!empty($wareHouse) && !empty($this->cachedStockIds[$prodId][$wareHouse->getId()])){
|
||||
$stock = $this->cachedStockIds[$prodId][$wareHouse->getId()];
|
||||
#dd('JAAAAA');
|
||||
//dd('JAAAAA');
|
||||
}else{
|
||||
$stock = new Stock();
|
||||
$stock->setProductId($prodId);
|
||||
$stock->setWarehouse($wareHouse);
|
||||
}
|
||||
#dd('CHCEK');
|
||||
$stock->setInstock((int)$arr[2]);
|
||||
//dd('CHCEK');
|
||||
$stock->setInstock((int)$arr[1]);
|
||||
#$stock->setWarehouseId($wareHouseId);
|
||||
#dump($stock);
|
||||
//dump($stock);
|
||||
$this->stockRepository->save($stock,true);
|
||||
|
||||
#dd($stock);
|
||||
@ -263,9 +263,9 @@ class HiltesImport
|
||||
#*** WEnn keine geCached Id Vorhanden
|
||||
if(empty($this->cachedProdIds[$gtin])){
|
||||
#*** Check
|
||||
dump($gtin);
|
||||
//dump($gtin);
|
||||
$prod2 = $this->productRepository->findOneBy(['gtin'=> $gtin]);
|
||||
dump($prod2);
|
||||
//dump($prod2);
|
||||
if(empty($prod2)){
|
||||
$prod = new Product();
|
||||
$prod->setGtin($gtin);
|
||||
|
@ -74,7 +74,7 @@ class Jtl
|
||||
public function createExportFile($data): void
|
||||
{
|
||||
try {
|
||||
$writer = Writer::createFromPath('./jtl/cds-export.csv', 'x');
|
||||
$writer = Writer::createFromPath(getcwd().'/jtl/cds-export.csv', 'w+');
|
||||
$writer->insertAll(new \ArrayIterator($data));
|
||||
|
||||
}catch (\Exception $e){
|
||||
|
@ -23,7 +23,7 @@ class StockRepository extends ServiceEntityRepository
|
||||
|
||||
public function save(Stock $entity, bool $flush = false): void
|
||||
{
|
||||
//$entity->setUpdateTime(new \DateTime());
|
||||
$entity->setUpdateTime(new \DateTime());
|
||||
|
||||
$this->getEntityManager()->persist($entity);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user