JTL Import

This commit is contained in:
Marko
2023-09-13 14:59:34 +02:00
parent ca3b3761ee
commit 88dd4a4c3d
33 changed files with 11685 additions and 111522 deletions

View File

@@ -33,7 +33,7 @@ class Order
#[ORM\Column]
private array $data = [];
#[ORM\Column(type: Types::DATETIME_MUTABLE, name: 'change_date', options: ['default' => 'CURRENT_TIMESTAMP'])]
#[ORM\Column(name: 'change_date',type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])]
private ?\DateTimeInterface $changeDate = null;
public function getId(): ?int

View File

@@ -27,7 +27,7 @@ class Product
// #[ORM\Column(length: 255)]
// private ?string $modellbez = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, name: 'change_date', options: ['default' => 'CURRENT_TIMESTAMP'])]
#[ORM\Column(name: 'change_date', type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])]
private ?\DateTimeInterface $updateTime = null;

View File

@@ -29,7 +29,7 @@ class Stock
#[ORM\ManyToOne(inversedBy: 'stocks')]
private ?Warehouse $warehouse = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, name: 'change_date', options: ['default' => 'CURRENT_TIMESTAMP'])]
#[ORM\Column(name: 'change_date',type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])]
private ?\DateTimeInterface $update_time = null;

View File

@@ -68,7 +68,7 @@ class HiltesImport
{
$finder = Finder::create();
$finder
->in($this->currentDirPath.'/hiltes/')
->in($this->currentDirPath.'/hiltes/h2c/')
->depth(0);
#->filter(static function (SplFileInfo $file) {
# return $file->isDir() || \preg_match('/\.(php|json)$/', $file->getPathname());
@@ -170,11 +170,11 @@ class HiltesImport
protected function saveData(Array $arr){
dump($arr);
#*** Speichert und/oder Holt WareHouse ab
$wareHouse = $this->checkWareHouseName($arr[0]);
$wareHouse = $this->checkWareHouseName($arr[2]);
#*** PRodukt wird angelegt oder geholt ****
#filiale;etikettnr;menge;
$prodId = $this->checkProduct($arr[1]);
$prodId = $this->checkProduct($arr[0]);
#*** 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()];