JTL Import
This commit is contained in:
parent
30a8e73f21
commit
873162859c
31
migrations/Version20230615125815.php
Normal file
31
migrations/Version20230615125815.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20230615125815 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE `order` ADD change_date DATETIME NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE `order` DROP change_date');
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use App\Repository\OrdersRepository;
|
||||
use App\Repository\OrderRepository;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
@ -19,9 +19,9 @@ use App\Helper\Hiltes;
|
||||
)]
|
||||
class HiltesExportCommand extends Command
|
||||
{
|
||||
public function __construct(OrdersRepository $ordersRepository, LoggerInterface $logger)
|
||||
public function __construct(OrderRepository $orderRepository, LoggerInterface $logger)
|
||||
{
|
||||
$this->ordersRepository = $ordersRepository;
|
||||
$this->orderRepository = $orderRepository;
|
||||
$this->logger = $logger;
|
||||
|
||||
parent::__construct();
|
||||
@ -46,8 +46,22 @@ class HiltesExportCommand extends Command
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
$io->info('Start Hiltes Export');
|
||||
|
||||
$hiltes = new Hiltes();
|
||||
|
||||
|
||||
$orders = $this->orderRepository->findAll();
|
||||
|
||||
dump($orders);
|
||||
|
||||
die();
|
||||
|
||||
foreach ($orders as $order) {
|
||||
$hiltes->addOrder($order);
|
||||
}
|
||||
|
||||
|
||||
$hiltes->export('Test Test');
|
||||
|
||||
|
||||
@ -55,4 +69,4 @@ class HiltesExportCommand extends Command
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
@ -67,12 +67,15 @@ class HiltesImportCommand extends Command
|
||||
$this->logger->error($r['text']);
|
||||
return Command::FAILURE;
|
||||
}else{
|
||||
$io->info('Start Hiltes Push Stock');
|
||||
$pushStock = new SwPushStockCommand($this->productRepository,$this->logger);
|
||||
$pushStock->execute($input,$output);
|
||||
$io->info('Start Hiltes Push JTL');
|
||||
// $pushStock = new SwPushStockCommand($this->productRepository,$this->logger);
|
||||
// $pushStock->execute($input,$output);
|
||||
|
||||
$jtl = new JtlExportCommand($this->productRepository,$this->stockRepository,$this->warehouseRepository,$this->logger);
|
||||
$jtl->execute($input,$output);
|
||||
|
||||
$io->success('Done.');
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -4,8 +4,16 @@ namespace App\Entity;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use App\Repository\OrderRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
|
||||
/*
|
||||
* Bestellungen Status:
|
||||
* 1 = Bestellung eingegangen
|
||||
* 2 = Bestellung in Bearbeitung
|
||||
* 3 = Bestellung versendet
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: OrderRepository::class)]
|
||||
#[ORM\Table(name: '`order`')]
|
||||
#[ApiResource]
|
||||
@ -25,6 +33,9 @@ class Order
|
||||
#[ORM\Column]
|
||||
private array $data = [];
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
|
||||
private ?\DateTimeInterface $changeDate = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@ -65,4 +76,16 @@ class Order
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
public function getChangeDate(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->changeDate;
|
||||
}
|
||||
|
||||
public function setChangeDate(\DateTimeInterface $changeDate): static
|
||||
{
|
||||
$this->changeDate = $changeDate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ namespace App\EventSubscriber;
|
||||
use ApiPlatform\Symfony\EventListener\EventPriorities;
|
||||
use App\Helper\Slack;
|
||||
use App\Entity\Order;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\Event\ViewEvent;
|
||||
@ -17,10 +18,12 @@ class SlackNotifySubscriber implements EventSubscriberInterface
|
||||
* @var Slack
|
||||
*/
|
||||
public $slack;
|
||||
public $logger;
|
||||
|
||||
public function __construct(ChatterInterface $chatter)
|
||||
public function __construct(ChatterInterface $chatter, LoggerInterface $logger)
|
||||
{
|
||||
$this->slack = new Slack($chatter);
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents(): array
|
||||
@ -40,6 +43,9 @@ class SlackNotifySubscriber implements EventSubscriberInterface
|
||||
$order = $event->getControllerResult();
|
||||
$method = $event->getRequest()->getMethod();
|
||||
|
||||
$this->logger->info('SlackNotifySubscriber: ' . $method);
|
||||
//$this->logger->info('SlackNotifySubscriber: ' . $order);
|
||||
|
||||
//wenn es keine Bestellung ist oder es kein POST Request ist, dann return
|
||||
if (!$order instanceof Order || Request::METHOD_POST !== $method) {
|
||||
return;
|
||||
|
@ -71,5 +71,69 @@ class Hiltes
|
||||
}
|
||||
}
|
||||
|
||||
public function checkData($data)
|
||||
{
|
||||
$umsatz = [
|
||||
'EtikettKz' => 'E', // E = EAN, I = Ident, W = Warengruppe
|
||||
'Etikettnummer'=> $data['sku'], // mit führenden Nullen bei Satzart „W“ die Warengruppennummer
|
||||
'Warengruppennummer'=> '0000', // mit führenden Nullen
|
||||
'Groessenbez'=> '',
|
||||
'Kundennummer'=> '00000000000000000000',
|
||||
'Nachlassart'=> '0',
|
||||
'Menge'=> '00000000000000000000', //7 Vor – und 2 Nachkommastellen (Darstellung ohne Komma mit führenden Nullen).
|
||||
'Kalk-VkPreis'=> '00000000000000000000', //7 Vor – und 2 Nachkommastellen (Darstellung ohne Komma mit führenden Nullen).
|
||||
'Vorgangsart'=> 'v', // u = Umtausch, v = Verkauf
|
||||
'Belegnummer'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Verkaufsdatum'=> '00000000', // YYYYMMTT
|
||||
'Verkaufszeit'=> '000000', // HHMM
|
||||
'Zahlungsart'=>2, // 1 = Kreditkarte, 2 = Rechnung, 3 = Lastschrift, 4 = Gutschein, 5 = Gutschrift, 6 = Mischzahlung
|
||||
'Währung'=> 'EUR', // EUR
|
||||
'Einheit'=> 'S', // S= Stück, M = Meter
|
||||
'Vertriebskanal'=> '0000', // Vertriebskanäle werden über das Stammdatenprogramm angelegt und müssen mit der hinterlegten Nummer aus dem Webshop übergeben werden
|
||||
];
|
||||
|
||||
}
|
||||
$kunde = [
|
||||
'Kunden-Nummer'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Kartennummer'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Nachname'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Vorname'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Ort'=> '00000000000000000000', // mit führenden Nullen
|
||||
'PLZ'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Straße'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Land'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Postfach'=> '00000000000000000000', // mit führenden Nullen
|
||||
'PostfachPLZ'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Titel'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Telefon1'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Telefon2'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Telefax'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Geburtsdatum'=> '00000000', // YYYYMMDD
|
||||
'Geschlecht'=> '00000000000000000000', // s = sonstiges, m = männlich, w = weiblich
|
||||
'Email'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Rabatt'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Limit'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Sperr Kennzeichen'=> '0', // 0 = nicht gesperrt, 1 = gesperrt
|
||||
'Dubios Kennzeichen'=> '0', // 0 = nicht dubios, 1 = dubios
|
||||
'Bankeinzug'=> '0', // 0 = kein Bankeinzug, 1 = Bankeinzug
|
||||
'BankName1'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Konto1'=> '00000000000000000000', // mit führenden Nullen
|
||||
'BLZ1'=> '00000000000000000000', // mit führenden Nullen
|
||||
'BankName2'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Konto2'=> '00000000000000000000', // mit führenden Nullen
|
||||
'BLZ2'=> '00000000000000000000', // mit führenden Nullen
|
||||
'BankName3'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Konto3'=> '00000000000000000000', // mit führenden Nullen
|
||||
'BLZ3'=> '00000000000000000000', // mit führenden Nullen
|
||||
'Kreditkartennummer Kreditkarte1'=> '', // mit führenden Nullen
|
||||
'Kreditkartennummer Kreditkarte2'=> '', // mit führenden Nullen
|
||||
'Kreditkartennummer Kreditkarte3'=> '', // mit führenden Nullen
|
||||
'Kreditkartennummer Kreditkarte4'=> '', // mit führenden Nullen
|
||||
'Änderungskennzeichen'=> '0', // 0 = Kunde ist OK, 1 = Änderung
|
||||
'Newsletter'=> '0', // 0 = kein Newsletter, 1 = Newsletter
|
||||
'Passwort'=> '', //
|
||||
'Werbesperre'=> '0', // 0 = keine Werbung, 1 = Werbung
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -30,6 +30,7 @@ class Jtl
|
||||
*/
|
||||
public function getProducts(): array
|
||||
{
|
||||
|
||||
$r = $this->productRepository->findAll();
|
||||
|
||||
$data = array();
|
||||
|
Loading…
Reference in New Issue
Block a user