fix Hiltes import

This commit is contained in:
Marko 2023-09-13 16:09:09 +02:00
parent 88dd4a4c3d
commit 5bca054a32
No known key found for this signature in database
4 changed files with 6415 additions and 10962 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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);

View File

@ -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){

View File

@ -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);