add fixed export
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Marko
2023-11-23 16:54:04 +01:00
parent 231e9390b8
commit 6e98fca7ad
13 changed files with 101 additions and 158 deletions

View File

@@ -53,12 +53,13 @@ class HiltesExportCommand extends Command
if (!$l) {
dd('Login faild' . 'STOP ' . __METHOD__ . ' / ' . __LINE__);
}
$orders = $this->orderRepository->findAll();
#dump($orders);
/**
* @var Order
*/
$order = false;
$orders = $this->orderRepository->findAll();
#dump($orders);
foreach ($orders as $order) {
if ($order->getStatus() > 0) continue;
$tA = $order->getData();#json_decode($order->getData());

View File

@@ -57,7 +57,7 @@ class HiltesImportCommand extends Command
$hiltesImport = new HiltesImport($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger);
$r = $hiltesImport->startImport($input->getOption('delta'));
$hiltesImport->startImport($input->getOption('delta'));
if (isset($r['error'])) {
$io->error($r['text']);
@@ -67,7 +67,9 @@ class HiltesImportCommand extends Command
$io->info('Start Hiltes Push JTL');
$jtl = new Jtl($this->productRepository, $this->warehouseRepository, $this->stockRepository, $this->logger);
$jtl->createExportFile($jtl->getProducts());
$jtl->createExportFile($jtl->getProducts(0), 'standard');
$jtl->createExportFile($jtl->getProducts(8), 'wms');
$io->success('Done.');
return Command::SUCCESS;

View File

@@ -51,18 +51,6 @@ class JtlExportCommand extends Command
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
// $arg1 = $input->getArgument('arg1');
//
// if ($arg1) {
// $io->note(sprintf('You passed an argument: %s', $arg1));
// }
//
// if ($input->getOption('option1')) {
// // ...
// }
$io = new SymfonyStyle($input, $output);
$io->success('Start JTL Export');
/**

View File

@@ -1,57 +0,0 @@
<?php
namespace App\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Notifier\Chatter;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Transport;
#[AsCommand(
name: 'jtl:import',
description: 'Add a short description for your command',
)]
class JtlImportCommand extends Command
{
protected function configure(): void
{
$this
->addArgument('arg1', InputArgument::OPTIONAL, 'Argument description')
->addOption('option1', null, InputOption::VALUE_NONE, 'Option description');
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$arg1 = $input->getArgument('arg1');
if ($arg1) {
$io->note(sprintf('You passed an argument: %s', $arg1));
}
if ($input->getOption('option1')) {
// ...
}
$chatter = new Chatter(new Transport('xoxb-1234-56789abcdefghijklmnopqrstuv'));
$message = (new ChatMessage('You got a new invoice for 15 EUR.'))
// if not set explicitly, the message is sent to the
// default transport (the first one configured)
->transport('slack');
$sentMessage = $chatter->send($message);
$io->success('You have a new command! Now make it your own! Pass --help to see your options.');
return Command::SUCCESS;
}
}