mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
Merge branch 'onlineshops'
This commit is contained in:
commit
aac159bcb0
@ -10,6 +10,15 @@ use Xentral\Components\Logger\Handler\LogHandlerInterface;
|
|||||||
|
|
||||||
final class Logger extends AbstractLogger
|
final class Logger extends AbstractLogger
|
||||||
{
|
{
|
||||||
|
const EMERGENCY = 'emergency';
|
||||||
|
const ALERT = 'alert';
|
||||||
|
const CRITICAL = 'critical';
|
||||||
|
const ERROR = 'error';
|
||||||
|
const WARNING = 'warning';
|
||||||
|
const NOTICE = 'notice';
|
||||||
|
const INFO = 'info';
|
||||||
|
const DEBUG = 'debug';
|
||||||
|
|
||||||
/** @var LogHandlerInterface[] $levelHandlers */
|
/** @var LogHandlerInterface[] $levelHandlers */
|
||||||
private $logHandlers;
|
private $logHandlers;
|
||||||
|
|
||||||
|
@ -1,57 +1,42 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
|
||||||
include(dirname(__FILE__)."/../conf/main.conf.php");
|
|
||||||
include(dirname(__FILE__)."/../phpwf/plugins/class.mysql.php");
|
|
||||||
include(dirname(__FILE__)."/../www/lib/imap.inc.php");
|
|
||||||
include(dirname(__FILE__)."/../www/lib/class.erpapi.php");
|
|
||||||
include(dirname(__FILE__)."/../www/lib/class.erpapi_custom.php");
|
|
||||||
include(dirname(__FILE__)."/../www/lib/class.remote.php");
|
|
||||||
include(dirname(__FILE__)."/../www/lib/class.httpclient.php");
|
|
||||||
include(dirname(__FILE__)."/../www/lib/class.aes.php");
|
|
||||||
|
|
||||||
|
use Xentral\Components\Logger\Logger;
|
||||||
|
|
||||||
|
/** @var Logger $logger */
|
||||||
|
$logger = $app->Container->get('Logger');
|
||||||
|
|
||||||
class app_t {
|
if (file_exists(dirname(__DIR__) . '/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
|
||||||
var $DB;
|
|
||||||
var $erp;
|
|
||||||
var $user;
|
|
||||||
var $remote;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//ENDE
|
|
||||||
if(file_exists(dirname(__DIR__).'/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')){
|
|
||||||
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
|
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
|
||||||
}
|
}
|
||||||
if(empty($app->Conf)) {
|
if (empty($app->Conf)) {
|
||||||
$conf = new Config();
|
$conf = new Config();
|
||||||
$app->Conf = $conf;
|
$app->Conf = $conf;
|
||||||
}
|
}
|
||||||
if(empty($app->DB) || empty($app->DB->connection)) {
|
if (empty($app->DB) || empty($app->DB->connection)) {
|
||||||
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
|
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
|
||||||
}
|
}
|
||||||
if(!isset($app->erp) || !$app->erp) {
|
if (!isset($app->erp) || !$app->erp) {
|
||||||
if (class_exists('erpAPICustom')) {
|
if (class_exists('erpAPICustom')) {
|
||||||
$erp = new erpAPICustom($app);
|
$erp = new erpAPICustom($app);
|
||||||
} else {
|
} else {
|
||||||
$erp = new erpAPI($app);
|
$erp = new erpAPI($app);
|
||||||
}
|
}
|
||||||
//$remote = new Remote($app);
|
|
||||||
$app->erp = $erp;
|
$app->erp = $erp;
|
||||||
//$app->remote= $remote;
|
|
||||||
}
|
}
|
||||||
if(empty($app->remote)) {
|
if (empty($app->remote)) {
|
||||||
if(is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
||||||
if(!class_exists('RemoteCustom')){
|
if (!class_exists('RemoteCustom')) {
|
||||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||||
}
|
}
|
||||||
$app->remote = new RemoteCustom($app);
|
$app->remote = new RemoteCustom($app);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$app->remote = new Remote($app);
|
$app->remote = new Remote($app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$app->erp->LogFile('Cronjob Artikeluebertragung Start');
|
$logger->debug(
|
||||||
|
'Start'
|
||||||
|
);
|
||||||
|
|
||||||
$app->DB->Update(
|
$app->DB->Update(
|
||||||
"UPDATE `prozessstarter`
|
"UPDATE `prozessstarter`
|
||||||
@ -59,39 +44,49 @@ $app->DB->Update(
|
|||||||
WHERE `mutex` = 1 AND (`parameter` = 'artikeluebertragen') AND `aktiv` = 1"
|
WHERE `mutex` = 1 AND (`parameter` = 'artikeluebertragen') AND `aktiv` = 1"
|
||||||
);
|
);
|
||||||
|
|
||||||
if($app->DB->Select("SELECT `mutex` FROM `prozessstarter` WHERE (`parameter` = 'artikeluebertragen') LIMIT 1") == 1){
|
if ($app->DB->Select("SELECT `mutex` FROM `prozessstarter` WHERE (`parameter` = 'artikeluebertragen') LIMIT 1") == 1) {
|
||||||
|
$logger->debug(
|
||||||
|
'Läuft bereits'
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$articles = $app->DB->SelectArr(
|
$articles = $app->DB->SelectArr(
|
||||||
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id` LIMIT 10'
|
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id`'
|
||||||
);
|
);
|
||||||
if(!empty($articles)) {
|
if (!empty($articles)) {
|
||||||
/** @var Shopexport $objShopexport */
|
/** @var Shopexport $objShopexport */
|
||||||
$objShopexport = $app->loadModule('shopexport');
|
$objShopexport = $app->loadModule('shopexport');
|
||||||
if($objShopexport !== null && method_exists($objShopexport, 'addChangedArticles')) {
|
if ($objShopexport !== null && method_exists($objShopexport, 'addChangedArticles')) {
|
||||||
$objShopexport->addChangedArticles();
|
$objShopexport->addChangedArticles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$logger->debug(
|
||||||
|
'Prepare',
|
||||||
|
[
|
||||||
|
'articles' => $articles
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$anzChecked = [];
|
$anzChecked = [];
|
||||||
$anzChanged = [];
|
$anzChanged = [];
|
||||||
$lastids = [];
|
$lastids = [];
|
||||||
while(!empty($articles)) {
|
while (!empty($articles)) {
|
||||||
foreach($articles as $article) {
|
foreach ($articles as $article) {
|
||||||
if(empty($anzChanged[$article['shop']])) {
|
if (empty($anzChanged[$article['shop']])) {
|
||||||
$anzChanged[$article['shop']] = 0;
|
$anzChanged[$article['shop']] = 0;
|
||||||
}
|
}
|
||||||
if(empty($anzChecked[$article['shop']])) {
|
if (empty($anzChecked[$article['shop']])) {
|
||||||
$anzChecked[$article['shop']] = 0;
|
$anzChecked[$article['shop']] = 0;
|
||||||
}
|
}
|
||||||
if(!isset($lastids[$article['shop']])) {
|
if (!isset($lastids[$article['shop']])) {
|
||||||
$lastids[$article['shop']] = (int)$app->erp->GetKonfiguration(
|
$lastids[$article['shop']] = (int) $app->erp->GetKonfiguration(
|
||||||
'shopexport_artikeluebertragen_check_lastid_' . $article['shop']
|
'shopexport_artikeluebertragen_check_lastid_' . $article['shop']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$changed = $objShopexport->hasArticleHashChanged($article['artikel'], $article['shop']);
|
$changed = $objShopexport->hasArticleHashChanged($article['artikel'], $article['shop']);
|
||||||
if($changed['changed']) {
|
if ($changed['changed']) {
|
||||||
$app->DB->Insert(
|
$app->DB->Insert(
|
||||||
sprintf(
|
sprintf(
|
||||||
'INSERT INTO `shopexport_artikeluebertragen` (`artikel`, `shop`, `check_nr`) VALUES (%d, %d, %d)',
|
'INSERT INTO `shopexport_artikeluebertragen` (`artikel`, `shop`, `check_nr`) VALUES (%d, %d, %d)',
|
||||||
@ -115,14 +110,17 @@ while(!empty($articles)) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
$app->erp->SetKonfigurationValue(
|
$app->erp->SetKonfigurationValue(
|
||||||
'shopexport_artikeluebertragen_check_changed_'.$article['shop'],
|
'shopexport_artikeluebertragen_check_changed_' . $article['shop'],
|
||||||
$anzChanged[$article['shop']]
|
$anzChanged[$article['shop']]
|
||||||
);
|
);
|
||||||
$app->erp->SetKonfigurationValue(
|
$app->erp->SetKonfigurationValue(
|
||||||
'shopexport_artikeluebertragen_check_checked_'.$article['shop'],
|
'shopexport_artikeluebertragen_check_checked_' . $article['shop'],
|
||||||
$anzChecked[$article['shop']]
|
$anzChecked[$article['shop']]
|
||||||
);
|
);
|
||||||
if(method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
if (method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
||||||
|
$logger->debug(
|
||||||
|
'!canRunCronjob'
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$articles = $app->DB->SelectArr(
|
$articles = $app->DB->SelectArr(
|
||||||
@ -141,23 +139,24 @@ $app->DB->Update(
|
|||||||
SET `letzteausfuerhung`=NOW(), `mutex` = 1,`mutexcounter`=0
|
SET `letzteausfuerhung`=NOW(), `mutex` = 1,`mutexcounter`=0
|
||||||
WHERE `parameter` = 'artikeluebertragen'"
|
WHERE `parameter` = 'artikeluebertragen'"
|
||||||
);
|
);
|
||||||
while($check > 0) {
|
|
||||||
|
/*
|
||||||
|
while ($check > 0) {
|
||||||
$shopartikel = $app->DB->Query(
|
$shopartikel = $app->DB->Query(
|
||||||
"SELECT `id`,`shop`,`artikel`,`check_nr` FROM `shopexport_artikeluebertragen` ORDER BY `id` LIMIT 10"
|
"SELECT `id`,`shop`,`artikel`,`check_nr` FROM `shopexport_artikeluebertragen` ORDER BY `id` LIMIT 10"
|
||||||
);
|
);
|
||||||
if(!empty($shopartikel)) {
|
if (!empty($shopartikel)) {
|
||||||
$anz = 0;
|
$anz = 0;
|
||||||
while ($row = $app->DB->Fetch_Assoc($shopartikel)) {
|
while ($row = $app->DB->Fetch_Assoc($shopartikel)) {
|
||||||
if(!isset($lastids[$row['shop']])) {
|
if (!isset($lastids[$row['shop']])) {
|
||||||
$lastids[$row['shop']] = (int)$app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_lastid_' . $row['shop']);
|
$lastids[$row['shop']] = (int) $app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_lastid_' . $row['shop']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$anz++;
|
$anz++;
|
||||||
try {
|
try {
|
||||||
$app->remote->RemoteSendArticleList($row['shop'], array($row['artikel']));
|
$app->remote->RemoteSendArticleList($row['shop'], array($row['artikel']));
|
||||||
$app->erp->LagerSync($row['artikel'], true);
|
$app->erp->LagerSync($row['artikel'], true);
|
||||||
}
|
} catch (Execption $exception) {
|
||||||
catch (Execption $exception) {
|
|
||||||
$app->erp->LogFile($app->DB->real_escape_string($exception->getMessage()));
|
$app->erp->LogFile($app->DB->real_escape_string($exception->getMessage()));
|
||||||
}
|
}
|
||||||
$app->DB->Delete(
|
$app->DB->Delete(
|
||||||
@ -167,9 +166,9 @@ while($check > 0) {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if(!empty($row['check_nr']) && $row['check_nr'] == $lastids[$row['shop']]) {
|
if (!empty($row['check_nr']) && $row['check_nr'] == $lastids[$row['shop']]) {
|
||||||
$transfered = 1+(int)$app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_transfered_'.$row['shop']);
|
$transfered = 1 + (int) $app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_transfered_' . $row['shop']);
|
||||||
$app->erp->SetKonfigurationValue('shopexport_artikeluebertragen_check_transfered_'.$row['shop'], $transfered);
|
$app->erp->SetKonfigurationValue('shopexport_artikeluebertragen_check_transfered_' . $row['shop'], $transfered);
|
||||||
}
|
}
|
||||||
|
|
||||||
$app->DB->Update(
|
$app->DB->Update(
|
||||||
@ -182,17 +181,90 @@ while($check > 0) {
|
|||||||
$app->DB->free($shopartikel);
|
$app->DB->free($shopartikel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
if (method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//sleep(20); // das performance nicht total spinnt
|
|
||||||
$check = $app->DB->Select('SELECT COUNT(`id`) FROM `shopexport_artikeluebertragen`');
|
$check = $app->DB->Select('SELECT COUNT(`id`) FROM `shopexport_artikeluebertragen`');
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
$sql = "SELECT DISTINCT `shop`, shopexport.`bezeichnung` FROM `shopexport_artikeluebertragen` INNER JOIN shopexport ON shopexport.id = `shop`";
|
||||||
|
$shops_to_transmit = $app->DB->SelectArr($sql);
|
||||||
|
|
||||||
|
//$app->erp->LogFile('Cronjob artikeluebertragen '.(!empty($shops_to_transmit)?count($shops_to_transmit):0)." shops", print_r($shops_to_transmit, true));
|
||||||
|
$logger->debug(
|
||||||
|
'{count} Shops',
|
||||||
|
[
|
||||||
|
'count' => (!empty($shops_to_transmit)?count($shops_to_transmit):0),
|
||||||
|
'shops_to_transmit' => $shops_to_transmit
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($shops_to_transmit as $shop_to_transmit) {
|
||||||
|
$sql = "SELECT `artikel` FROM `shopexport_artikeluebertragen` WHERE `shop` = '".$shop_to_transmit['shop']."'";
|
||||||
|
$articles_to_transmit = $app->DB->SelectArr($sql);
|
||||||
|
|
||||||
|
$logger->debug(
|
||||||
|
'{bezeichnung} (Shop {shop_to_transmit}) {count} Artikel',
|
||||||
|
[
|
||||||
|
'shop_to_transmit' => $shop_to_transmit['shop'],
|
||||||
|
'bezeichnung' => $shop_to_transmit['bezeichnung'],
|
||||||
|
'count' => (!empty($articles_to_transmit)?count($articles_to_transmit):0),
|
||||||
|
'articles_to_transmit' => $articles_to_transmit
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!empty($articles_to_transmit)) {
|
||||||
|
|
||||||
|
$article_ids_to_transmit = array_column($articles_to_transmit, 'artikel');
|
||||||
|
|
||||||
|
try {
|
||||||
|
$result = $app->remote->RemoteSendArticleList($shop_to_transmit['shop'], $article_ids_to_transmit); // Expected result is array $articles_to_transmit, field status contains transmission status
|
||||||
|
} catch (Execption $exception) {
|
||||||
|
$logger->error(
|
||||||
|
'Fehler {bezeichnung} (Shop {shop_to_transmit}) {count} Artikel',
|
||||||
|
[
|
||||||
|
'shop_to_transmit' => $shop_to_transmit['shop'],
|
||||||
|
'bezeichnung' => $shop_to_transmit['bezeichnung'],
|
||||||
|
'count' => (!empty($articles_to_transmit)?count($articles_to_transmit):0),
|
||||||
|
'exception' => $exception
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$logger->debug(
|
||||||
|
'Ende {bezeichnung} (Shop {shop_to_transmit}) {count} Artikel',
|
||||||
|
[
|
||||||
|
'shop_to_transmit' => $shop_to_transmit['shop'],
|
||||||
|
'bezeichnung' => $shop_to_transmit['bezeichnung'],
|
||||||
|
'count' => (!empty($articles_to_transmit)?count($articles_to_transmit):0),
|
||||||
|
'result' => $result
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
// See description of return format in function class.remote.php -> RemoteSendArticleList()
|
||||||
|
foreach ($result['articlelist'] as $article) {
|
||||||
|
$app->DB->Delete(
|
||||||
|
sprintf(
|
||||||
|
'DELETE FROM `shopexport_artikeluebertragen` WHERE `artikel`= %d AND `shop` = %d',
|
||||||
|
$article['artikel'],
|
||||||
|
$shop_to_transmit['shop']
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$app->erp->LagerSync($article['artikel'], true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$logger->debug(
|
||||||
|
'Ende'
|
||||||
|
);
|
||||||
|
|
||||||
$app->DB->Update(
|
$app->DB->Update(
|
||||||
"UPDATE `prozessstarter`
|
"UPDATE `prozessstarter`
|
||||||
SET `letzteausfuerhung`= NOW(), `mutex` = 0,`mutexcounter`=0
|
SET `letzteausfuerhung`= NOW(), `mutex` = 0,`mutexcounter`=0
|
||||||
WHERE `parameter` = 'artikeluebertragen'"
|
WHERE `parameter` = 'artikeluebertragen'"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,36 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
if(file_exists(dirname(__DIR__).'/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
|
|
||||||
|
if (file_exists(dirname(__DIR__) . '/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
|
||||||
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
|
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
if (empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
||||||
$app = new app_t();
|
$app = new app_t();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($app->Conf)) {
|
if (empty($app->Conf)) {
|
||||||
$conf = new Config();
|
$conf = new Config();
|
||||||
$app->Conf = $conf;
|
$app->Conf = $conf;
|
||||||
}
|
}
|
||||||
if(empty($app->DB)) {
|
if (empty($app->DB)) {
|
||||||
$app->DB = new DB($app->Conf->WFdbhost,$app->Conf->WFdbname,$app->Conf->WFdbuser,$app->Conf->WFdbpass,null,$app->Conf->WFdbport);
|
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
|
||||||
}
|
}
|
||||||
if(empty($app->erp)) {
|
if (empty($app->erp)) {
|
||||||
if(class_exists('erpAPICustom')) {
|
if (class_exists('erpAPICustom')) {
|
||||||
$erp = new erpAPICustom($app);
|
$erp = new erpAPICustom($app);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$erp = new erpAPI($app);
|
$erp = new erpAPI($app);
|
||||||
}
|
}
|
||||||
$app->erp = $erp;
|
$app->erp = $erp;
|
||||||
}
|
}
|
||||||
if(empty($app->remote)) {
|
if (empty($app->remote)) {
|
||||||
if(is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')){
|
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
||||||
if(!class_exists('RemoteCustom')) {
|
if (!class_exists('RemoteCustom')) {
|
||||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||||
}
|
}
|
||||||
$app->remote = new RemoteCustom($app);
|
$app->remote = new RemoteCustom($app);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$app->remote = new Remote($app);
|
$app->remote = new Remote($app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -40,33 +39,32 @@ $app->erp->LogFile("Lagerzahlen-Synchronisation Start");
|
|||||||
|
|
||||||
$firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
$firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
||||||
|
|
||||||
$app->DB->Update(
|
$app->DB->Update(
|
||||||
"UPDATE `prozessstarter`
|
"UPDATE `prozessstarter`
|
||||||
SET `mutexcounter` = `mutexcounter` + 1
|
SET `mutexcounter` = `mutexcounter` + 1
|
||||||
WHERE `mutex` = 1 AND `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
WHERE `mutex` = 1 AND `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||||
);
|
);
|
||||||
if(!$app->DB->Select(
|
if (!$app->DB->Select(
|
||||||
"SELECT `id` FROM `prozessstarter` WHERE `mutex` = 0 AND `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
"SELECT `id` FROM `prozessstarter` WHERE `mutex` = 0 AND `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||||
)) {
|
)) {
|
||||||
|
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Prozessstarter-Mutex nicht bereit");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$shops = $app->DB->SelectArr('SELECT * FROM `shopexport` WHERE `aktiv` = 1');
|
|
||||||
if(empty($shops)) {
|
|
||||||
|
|
||||||
|
$shops = $app->DB->SelectArr('SELECT * FROM `shopexport` WHERE `aktiv` = 1');
|
||||||
|
if (empty($shops)) {
|
||||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Keine aktiven Shops");
|
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Keine aktiven Shops");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$shopByIds = [];
|
$shopByIds = [];
|
||||||
foreach($shops as $shop) {
|
foreach ($shops as $shop) {
|
||||||
$shopByIds[$shop['id']] = $shop;
|
$shopByIds[$shop['id']] = $shop;
|
||||||
}
|
}
|
||||||
$shopIds = array_keys($shopByIds);
|
$shopIds = array_keys($shopByIds);
|
||||||
$shopIdsStr = implode(',', $shopIds);
|
$shopIdsStr = implode(',', $shopIds);
|
||||||
$hours = 12;
|
$hours = 12;
|
||||||
$hoursShop = 48;
|
$hoursShop = 48;
|
||||||
$lagerartikel = $app->DB->SelectFirstCols(
|
$lagerartikel = $app->DB->SelectFirstCols(
|
||||||
"SELECT a.id
|
"SELECT a.id
|
||||||
FROM `artikel` AS `a`
|
FROM `artikel` AS `a`
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
@ -97,64 +95,61 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
|||||||
ORDER BY a.cache_lagerplatzinhaltmenge = -999 DESC,
|
ORDER BY a.cache_lagerplatzinhaltmenge = -999 DESC,
|
||||||
ao.cache_reseted DESC,
|
ao.cache_reseted DESC,
|
||||||
a.laststorage_sync"
|
a.laststorage_sync"
|
||||||
);
|
);
|
||||||
|
|
||||||
if(empty($lagerartikel)) {
|
|
||||||
|
|
||||||
|
if (empty($lagerartikel)) {
|
||||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Keine fälligen Artikel");
|
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Keine fälligen Artikel");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$r = new ReflectionMethod($app->erp, 'LagerSync');
|
$r = new ReflectionMethod($app->erp, 'LagerSync');
|
||||||
$params = $r->getParameters();
|
$params = $r->getParameters();
|
||||||
$anzargs = count($params);
|
$anzargs = count($params);
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch(Exception $e) {
|
|
||||||
$anzargs = 2;
|
$anzargs = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
$clagerartikel = $lagerartikel?count($lagerartikel):0;
|
$clagerartikel = $lagerartikel ? count($lagerartikel) : 0;
|
||||||
$app->erp->LogFile('Lagerzahlen-Synchronisation, Artikel gesamt: '.$clagerartikel);
|
$app->erp->LogFile('Lagerzahlen-Synchronisation, Artikel gesamt: ' . $clagerartikel);
|
||||||
foreach($lagerartikel as $ij => $articleId) {
|
foreach ($lagerartikel as $articleCounter => $articleId) {
|
||||||
$app->DB->Update(
|
$app->DB->Update(
|
||||||
"UPDATE `prozessstarter`
|
"UPDATE `prozessstarter`
|
||||||
SET `mutex` = 1 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
SET `mutex` = 1 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
||||||
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
if($anzargs > 2){
|
if ($anzargs > 2) {
|
||||||
$message .= $app->erp->LagerSync($articleId, false, $shopByIds); // 2nd parameter is print_echo -> prints via echo to logfile (big print_r)
|
$message .= $app->erp->LagerSync($articleId, false, $shopByIds); // 2nd parameter is print_echo -> prints via echo to logfile (big print_r)
|
||||||
}else{
|
} else {
|
||||||
$message .= $app->erp->LagerSync($articleId, false);
|
$message .= $app->erp->LagerSync($articleId, false);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $exception) {
|
||||||
catch (Exception $exception) {
|
|
||||||
$message .= '<br>' . $exception->getMessage();
|
$message .= '<br>' . $exception->getMessage();
|
||||||
}
|
}
|
||||||
if($message!='') {
|
if ($message != '') {
|
||||||
$message .='<br>';
|
$message .= '<br>';
|
||||||
}
|
}
|
||||||
if($ij % 10 === 0 && method_exists($app->erp, 'canRunCronjob')
|
if ($articleCounter % 10 === 0 && method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['lagerzahlen'])) {
|
||||||
&& !$app->erp->canRunCronjob(['lagerzahlen'])) {
|
|
||||||
$app->DB->Update(
|
$app->DB->Update(
|
||||||
"UPDATE `prozessstarter`
|
"UPDATE `prozessstarter`
|
||||||
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
||||||
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||||
);
|
);
|
||||||
|
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: lagerzahlen-Job kann nicht geladen werden");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
usleep(10000);
|
// $app->erp->LogFile("Lagerzahlen-Synchronisation: Warte 10 Sekunden");
|
||||||
}
|
// usleep(10000);
|
||||||
$app->DB->Update(
|
}
|
||||||
|
$app->DB->Update(
|
||||||
"UPDATE `prozessstarter`
|
"UPDATE `prozessstarter`
|
||||||
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
||||||
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||||
);
|
);
|
||||||
if($message !='' && $erp->Firmendaten('systemmailsabschalten') == 0 && $erp->GetFirmaMail()!='') {
|
if ($message != '' && $erp->Firmendaten('systemmailsabschalten') == 0 && $erp->GetFirmaMail() != '') {
|
||||||
try {
|
try {
|
||||||
if($erp->Firmendaten('systemmailsempfaenger') != ''){
|
if ($erp->Firmendaten('systemmailsempfaenger') != '') {
|
||||||
$erp->MailSend(
|
$erp->MailSend(
|
||||||
$erp->GetFirmaMail(),
|
$erp->GetFirmaMail(),
|
||||||
$erp->GetFirmaName(),
|
$erp->GetFirmaName(),
|
||||||
@ -163,9 +158,8 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
|||||||
'Systemmeldung: Auto Update Lagerlampen',
|
'Systemmeldung: Auto Update Lagerlampen',
|
||||||
$message
|
$message
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
}else{
|
if ($erp->GetFirmaBCC1() != '') {
|
||||||
if($erp->GetFirmaBCC1() != ''){
|
|
||||||
$erp->MailSend(
|
$erp->MailSend(
|
||||||
$erp->GetFirmaMail(),
|
$erp->GetFirmaMail(),
|
||||||
$erp->GetFirmaName(),
|
$erp->GetFirmaName(),
|
||||||
@ -176,12 +170,11 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception $exception) {
|
||||||
|
$app->erp->LogFile("Lagerzahlen-Synchronisation Exception:" . $app->DB->real_escape_string($exception->getMessage()));
|
||||||
}
|
}
|
||||||
catch (Exception $exception) {
|
}
|
||||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Exception:".$app->DB->real_escape_string($exception->getMessage()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende");
|
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende");
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,89 +1,86 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
||||||
if(!class_exists('ApplicationCore') && is_file(dirname(__DIR__).'/xentral_autoloader.php')) {
|
if (!class_exists('ApplicationCore') && is_file(dirname(__DIR__) . '/xentral_autoloader.php')) {
|
||||||
include_once dirname(__DIR__).'/xentral_autoloader.php';
|
include_once dirname(__DIR__) . '/xentral_autoloader.php';
|
||||||
}
|
}
|
||||||
include_once dirname(__DIR__).'/conf/main.conf.php';
|
include_once dirname(__DIR__) . '/conf/main.conf.php';
|
||||||
include_once dirname(__DIR__).'/phpwf/plugins/class.mysql.php';
|
include_once dirname(__DIR__) . '/phpwf/plugins/class.mysql.php';
|
||||||
include_once dirname(__DIR__).'/phpwf/plugins/class.secure.php';
|
include_once dirname(__DIR__) . '/phpwf/plugins/class.secure.php';
|
||||||
include_once dirname(__DIR__).'/phpwf/plugins/class.user.php';
|
include_once dirname(__DIR__) . '/phpwf/plugins/class.user.php';
|
||||||
if(file_exists(dirname(__DIR__).'/conf/user_defined.php')) {
|
if (file_exists(dirname(__DIR__) . '/conf/user_defined.php')) {
|
||||||
include_once dirname(__DIR__).'/conf/user_defined.php';
|
include_once dirname(__DIR__) . '/conf/user_defined.php';
|
||||||
}
|
}
|
||||||
if(!class_exists('FPDFWAWISION')){
|
if (!class_exists('FPDFWAWISION')) {
|
||||||
if(file_exists(dirname(__DIR__).'/conf/user_defined.php')){
|
if (file_exists(dirname(__DIR__) . '/conf/user_defined.php')) {
|
||||||
include_once dirname(__DIR__) . '/conf/user_defined.php';
|
include_once dirname(__DIR__) . '/conf/user_defined.php';
|
||||||
}
|
}
|
||||||
if(defined('USEFPDF3') && USEFPDF3 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php')){
|
if (defined('USEFPDF3') && USEFPDF3 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php')) {
|
||||||
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php';
|
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php';
|
||||||
}else if(defined('USEFPDF2') && USEFPDF2 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php')){
|
} else if (defined('USEFPDF2') && USEFPDF2 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php')) {
|
||||||
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php';
|
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php';
|
||||||
}else{
|
} else {
|
||||||
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf.php';
|
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf.php';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
include_once dirname(__DIR__).'/www/lib/pdf/fpdf_final.php';
|
include_once dirname(__DIR__) . '/www/lib/pdf/fpdf_final.php';
|
||||||
include_once dirname(__DIR__).'/www/lib/imap.inc.php';
|
include_once dirname(__DIR__) . '/www/lib/imap.inc.php';
|
||||||
include_once dirname(__DIR__).'/www/lib/class.erpapi.php';
|
include_once dirname(__DIR__) . '/www/lib/class.erpapi.php';
|
||||||
include_once dirname(__DIR__).'/www/lib/class.remote.php';
|
include_once dirname(__DIR__) . '/www/lib/class.remote.php';
|
||||||
include_once dirname(__DIR__).'/www/lib/class.httpclient.php';
|
include_once dirname(__DIR__) . '/www/lib/class.httpclient.php';
|
||||||
$aes = '';
|
$aes = '';
|
||||||
$phpversion = (String)phpversion();
|
$phpversion = (String) phpversion();
|
||||||
if($phpversion[0] == '7' && (int)$phpversion[2] > 0) {
|
if ($phpversion[0] == '7' && (int) $phpversion[2] > 0) {
|
||||||
$aes = '2';
|
$aes = '2';
|
||||||
}
|
}
|
||||||
if($aes == 2 && is_file(dirname(__DIR__).'/www/lib/class.aes2.php')) {
|
if ($aes == 2 && is_file(dirname(__DIR__) . '/www/lib/class.aes2.php')) {
|
||||||
include_once dirname(__DIR__).'/www/lib/class.aes2.php';
|
include_once dirname(__DIR__) . '/www/lib/class.aes2.php';
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
include_once dirname(__DIR__) . '/www/lib/class.aes.php';
|
include_once dirname(__DIR__) . '/www/lib/class.aes.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
$classes = array('briefpapier','lieferschein','auftrag','anfrage','gutschrift','bestellung','rechnung','mahnwesen');
|
$classes = array('briefpapier', 'lieferschein', 'auftrag', 'anfrage', 'gutschrift', 'bestellung', 'rechnung', 'mahnwesen');
|
||||||
foreach($classes as $class)
|
foreach ($classes as $class) {
|
||||||
{
|
if (file_exists(dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '_custom.php')) {
|
||||||
if(file_exists(dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'_custom.php'))
|
include_once dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '_custom.php';
|
||||||
{
|
} elseif (file_exists(dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '.php')) {
|
||||||
include_once dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'_custom.php';
|
include_once dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '.php';
|
||||||
}
|
|
||||||
elseif(file_exists(dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'.php')) {
|
|
||||||
include_once dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'.php';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.briefpapier.php");
|
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.briefpapier.php");
|
||||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.lieferschein.php");
|
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.lieferschein.php");
|
||||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.auftrag.php");
|
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.auftrag.php");
|
||||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.angebot.php");
|
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.angebot.php");
|
||||||
if(file_exists(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php"))include_once(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php");
|
if(file_exists(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php"))include_once(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php");
|
||||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.gutschrift.php");
|
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.gutschrift.php");
|
||||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.bestellung.php");
|
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.bestellung.php");
|
||||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.rechnung.php");
|
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.rechnung.php");
|
||||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.mahnwesen.php");*/
|
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.mahnwesen.php"); */
|
||||||
include_once dirname(__DIR__).'/phpwf/plugins/class.string.php';
|
include_once dirname(__DIR__) . '/phpwf/plugins/class.string.php';
|
||||||
if(!class_exists('app_t2'))
|
if (!class_exists('app_t2')) {
|
||||||
{
|
|
||||||
class app_t2 extends ApplicationCore {
|
class app_t2 extends ApplicationCore {
|
||||||
|
|
||||||
var $DB;
|
var $DB;
|
||||||
var $erp;
|
var $erp;
|
||||||
var $User;
|
var $User;
|
||||||
var $mail;
|
var $mail;
|
||||||
var $remote;
|
var $remote;
|
||||||
var $Secure;
|
var $Secure;
|
||||||
function GetLandLang($isocode)
|
|
||||||
{
|
function GetLandLang($isocode) {
|
||||||
$flipped = array_flip($this->GetLaender());
|
$flipped = array_flip($this->GetLaender());
|
||||||
if(isset($flipped[$isocode]))
|
if (isset($flipped[$isocode]))
|
||||||
$land = $flipped[$isocode];
|
$land = $flipped[$isocode];
|
||||||
else {
|
else {
|
||||||
$land = 'unkown';
|
$land = 'unkown';
|
||||||
}
|
}
|
||||||
return $land;
|
return $land;
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetLaender()
|
function GetLaender() {
|
||||||
{
|
|
||||||
$laender = array(
|
$laender = array(
|
||||||
'Afghanistan' => 'AF',
|
'Afghanistan' => 'AF',
|
||||||
'Ägypten' => 'EG',
|
'Ägypten' => 'EG',
|
||||||
@ -329,64 +326,63 @@ function GetLaender()
|
|||||||
'Zypern' => 'CY'
|
'Zypern' => 'CY'
|
||||||
);
|
);
|
||||||
return $laender;
|
return $laender;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//ENDE
|
//ENDE
|
||||||
|
|
||||||
|
|
||||||
if(empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
if (empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
||||||
$app = new app_t2();
|
$app = new app_t2();
|
||||||
}
|
}
|
||||||
if(empty($app->Conf)){
|
if (empty($app->Conf)) {
|
||||||
$conf = new Config();
|
$conf = new Config();
|
||||||
$app->Conf = $conf;
|
$app->Conf = $conf;
|
||||||
}
|
}
|
||||||
if(empty($app->DB)){
|
if (empty($app->DB)) {
|
||||||
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
|
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
|
||||||
}
|
}
|
||||||
if(empty($app->erp)){
|
if (empty($app->erp)) {
|
||||||
$erp = new erpAPI($app);
|
$erp = new erpAPI($app);
|
||||||
$app->erp = $erp;
|
$app->erp = $erp;
|
||||||
}
|
}
|
||||||
$app->String = new WawiString();
|
$app->String = new WawiString();
|
||||||
if(empty($app->remote)){
|
if (empty($app->remote)) {
|
||||||
if(is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')){
|
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
||||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||||
$app->remote = new RemoteCustom($app);
|
$app->remote = new RemoteCustom($app);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$app->remote = new Remote($app);
|
$app->remote = new Remote($app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//$app->remote = new Remote($app);
|
//$app->remote = new Remote($app);
|
||||||
$app->Secure = new Secure($app);
|
$app->Secure = new Secure($app);
|
||||||
$app->User = new User($app);
|
$app->User = new User($app);
|
||||||
if(!defined('FPDF_FONTPATH')) {
|
if (!defined('FPDF_FONTPATH')) {
|
||||||
define('FPDF_FONTPATH',dirname(__DIR__).'/www/lib/pdf/font/');
|
define('FPDF_FONTPATH', dirname(__DIR__) . '/www/lib/pdf/font/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//ENDE
|
//ENDE
|
||||||
|
|
||||||
const MAXIMUM_NUMBER_OF_TRIES = 10;
|
const MAXIMUM_NUMBER_OF_TRIES = 10;
|
||||||
|
|
||||||
$shops = $app->DB->SelectFirstCols(
|
$shops = $app->DB->SelectFirstCols(
|
||||||
'SELECT id FROM shopexport WHERE auftragabgleich = 1 AND aktiv = 1 AND demomodus <> 1 AND sendonlywithtracking = 0'
|
'SELECT id FROM shopexport WHERE auftragabgleich = 1 AND aktiv = 1 AND demomodus <> 1 AND sendonlywithtracking = 0'
|
||||||
);
|
);
|
||||||
if(empty($shops)) {
|
if (empty($shops)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$app->DB->Update("UPDATE prozessstarter SET mutexcounter = mutexcounter + 1 WHERE mutex = 1 AND (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
$app->DB->Update("UPDATE prozessstarter SET mutexcounter = mutexcounter + 1 WHERE mutex = 1 AND (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||||
if(!$app->DB->Select("SELECT id FROM prozessstarter WHERE mutex = 0 AND (parameter = 'shop_rueckmeldungen') AND aktiv = 1")) {
|
if (!$app->DB->Select("SELECT id FROM prozessstarter WHERE mutex = 0 AND (parameter = 'shop_rueckmeldungen') AND aktiv = 1")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||||
|
|
||||||
$subwhere = sprintf(' a.shop IN (%s) ', implode(',', $shops));
|
$subwhere = sprintf(' a.shop IN (%s) ', implode(',', $shops));
|
||||||
$join = '';
|
$join = '';
|
||||||
$where = '';
|
$where = '';
|
||||||
$app->erp->RunHook('shop_rueckmeldung', 2, $join, $where);
|
$app->erp->RunHook('shop_rueckmeldung', 2, $join, $where);
|
||||||
$sql = "SELECT DISTINCT a.id, a.shop
|
$sql = "SELECT DISTINCT a.id, a.shop
|
||||||
FROM auftrag a
|
FROM auftrag a
|
||||||
LEFT JOIN lieferschein l on l.auftragid = a.id
|
LEFT JOIN lieferschein l on l.auftragid = a.id
|
||||||
@ -404,7 +400,7 @@ function GetLaender()
|
|||||||
((pr.kommissionierverfahren = 'lieferschein' OR pr.kommissionierverfahren = 'rechnungsmail') AND isnull(v.id))
|
((pr.kommissionierverfahren = 'lieferschein' OR pr.kommissionierverfahren = 'rechnungsmail') AND isnull(v.id))
|
||||||
)
|
)
|
||||||
AND (ISNULL(a.shop_status_update_last_attempt_at) OR a.shop_status_update_last_attempt_at < DATE_SUB(NOW(), INTERVAL 4 HOUR))
|
AND (ISNULL(a.shop_status_update_last_attempt_at) OR a.shop_status_update_last_attempt_at < DATE_SUB(NOW(), INTERVAL 4 HOUR))
|
||||||
AND a.shop_status_update_attempt <= ".MAXIMUM_NUMBER_OF_TRIES."
|
AND a.shop_status_update_attempt <= " . MAXIMUM_NUMBER_OF_TRIES . "
|
||||||
$where
|
$where
|
||||||
ORDER BY a.id, l.id DESC, v.id DESC
|
ORDER BY a.id, l.id DESC, v.id DESC
|
||||||
";
|
";
|
||||||
@ -418,12 +414,12 @@ function GetLaender()
|
|||||||
);
|
);
|
||||||
$auftragid = null;
|
$auftragid = null;
|
||||||
$countRequests = 0;
|
$countRequests = 0;
|
||||||
foreach($auftraege as $auftrag) {
|
foreach ($auftraege as $auftrag) {
|
||||||
if($auftrag['id'] != $auftragid) {
|
if ($auftrag['id'] != $auftragid) {
|
||||||
$countRequests++;
|
$countRequests++;
|
||||||
$auftragid = $auftrag['id'];
|
$auftragid = $auftrag['id'];
|
||||||
$app->remote->RemoteUpdateAuftrag($auftrag['shop'], $auftrag['id']);
|
$app->remote->RemoteUpdateAuftrag($auftrag['shop'], $auftrag['id']);
|
||||||
if($countRequests % 10 === 0) {
|
if ($countRequests % 10 === 0) {
|
||||||
$app->DB->Update(
|
$app->DB->Update(
|
||||||
"UPDATE prozessstarter
|
"UPDATE prozessstarter
|
||||||
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
|
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
|
||||||
@ -433,11 +429,11 @@ function GetLaender()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($auftraege);
|
unset($auftraege);
|
||||||
}
|
}
|
||||||
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||||
|
|
||||||
//Zahlungsstatus
|
//Zahlungsstatus
|
||||||
$query = $app->DB->Query(
|
$query = $app->DB->Query(
|
||||||
"SELECT a.id
|
"SELECT a.id
|
||||||
FROM `auftrag` AS `a`
|
FROM `auftrag` AS `a`
|
||||||
LEFT JOIN `rechnung` AS `r1` ON r1.id = a.rechnungid
|
LEFT JOIN `rechnung` AS `r1` ON r1.id = a.rechnungid
|
||||||
@ -449,13 +445,13 @@ function GetLaender()
|
|||||||
AND (r1.zahlungsstatus = 'bezahlt' OR r2.zahlungsstatus = 'bezahlt') AND DATEDIFF(NOW(), a.datum) <= 28
|
AND (r1.zahlungsstatus = 'bezahlt' OR r2.zahlungsstatus = 'bezahlt') AND DATEDIFF(NOW(), a.datum) <= 28
|
||||||
GROUP BY a.id
|
GROUP BY a.id
|
||||||
LIMIT 1000"
|
LIMIT 1000"
|
||||||
);
|
);
|
||||||
if($query) {
|
if ($query) {
|
||||||
$countRequests = 0;
|
$countRequests = 0;
|
||||||
while($row = $app->DB->Fetch_Assoc($query)) {
|
while ($row = $app->DB->Fetch_Assoc($query)) {
|
||||||
$app->erp->ImportUpdateZahlungsstatus($row['id']);
|
$app->erp->ImportUpdateZahlungsstatus($row['id']);
|
||||||
$countRequests++;
|
$countRequests++;
|
||||||
if($countRequests % 10 === 0) {
|
if ($countRequests % 10 === 0) {
|
||||||
$app->DB->Update(
|
$app->DB->Update(
|
||||||
"UPDATE prozessstarter
|
"UPDATE prozessstarter
|
||||||
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
|
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
|
||||||
@ -464,6 +460,7 @@ function GetLaender()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$app->DB->free($query);
|
$app->DB->free($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$app->DB->Update("UPDATE prozessstarter SET mutex = 0, mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||||
|
|
||||||
$app->DB->Update("UPDATE prozessstarter SET mutex = 0, mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
|
||||||
|
@ -18692,6 +18692,14 @@
|
|||||||
"id"
|
"id"
|
||||||
],
|
],
|
||||||
"Non_unique": ""
|
"Non_unique": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Key_name": "eigenschaft_unique",
|
||||||
|
"Index_type": "BTREE",
|
||||||
|
"columns": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
|
"Non_unique": "UNIQUE"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -18802,6 +18810,15 @@
|
|||||||
"artikel"
|
"artikel"
|
||||||
],
|
],
|
||||||
"Non_unique": ""
|
"Non_unique": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Key_name": "eigenschaft_artikel_unique",
|
||||||
|
"Index_type": "BTREE",
|
||||||
|
"columns": [
|
||||||
|
"artikel",
|
||||||
|
"artikeleigenschaften"
|
||||||
|
],
|
||||||
|
"Non_unique": "UNIQUE"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1329,6 +1329,46 @@ Class ShopimporterBase{
|
|||||||
'metabeschreibung' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
'metabeschreibung' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
'metakeywords' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
'metakeywords' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
'freifelder' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
'freifelder' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
],
|
||||||
|
'shopimporter_mirakl' => [
|
||||||
|
'auftrag' => ['createarticle' => self::UNDEFINED, 'updatearticle' => self::UNDEFINED, 'importarticle' => self::UNDEFINED, 'importorder' => self::UNDEFINED],
|
||||||
|
'artikelname' => ['createarticle' => self::MUST, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CAN],
|
||||||
|
'artikelnummer' => ['createarticle' => self::MUST, 'updatearticle' => self::MUST, 'importarticle' => self::CANNOT, 'importorder' => self::CAN],
|
||||||
|
'aktiv' => ['createarticle' => self::MUST, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'restmenge' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'beschreibung' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CAN],
|
||||||
|
'ean' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'hersteller' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'herstellerlink' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'herstellernummer' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'zolltarifnummer' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'gewicht' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'einheit' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'laenge' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'hoehe' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'breite' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'verkaufspreis' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CAN],
|
||||||
|
'pseudopreis' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'lagerzahlen' => ['createarticle' => self::MUST, 'updatearticle' => self::MUST, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'pseudolager' => ['createarticle' => self::MUST, 'updatearticle' => self::MUST, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'staffelpreise' => ['createarticle' => self::MUST, 'updatearticle' => self::MUST, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'gruppenpreise' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'fremdsprachen' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'kategorie' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'kategoriebaum' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'bilder' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'varianten' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'matrixeigenschaften' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'über 5000 Varianten' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'eigenschaften' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'crossselling' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'kurztext' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'herkunftsland' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'umsatzsteuer' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'metatitel' => ['createarticle' => self::CANNOT, 'updatearticle' => self::CANNOT, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'metabeschreibung' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'metakeywords' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
|
'freifelder' => ['createarticle' => self::CAN, 'updatearticle' => self::CAN, 'importarticle' => self::CANNOT, 'importorder' => self::CANNOT],
|
||||||
],
|
],
|
||||||
'shopimporter_modified' => [
|
'shopimporter_modified' => [
|
||||||
'auftrag' => ['createarticle' => self::UNDEFINED, 'updatearticle' => self::UNDEFINED, 'importarticle' => self::UNDEFINED, 'importorder' => self::UNDEFINED],
|
'auftrag' => ['createarticle' => self::UNDEFINED, 'updatearticle' => self::UNDEFINED, 'importarticle' => self::UNDEFINED, 'importorder' => self::UNDEFINED],
|
||||||
|
@ -17199,7 +17199,7 @@ function CheckShopTabelle($artikel)
|
|||||||
return $taxrates;
|
return $taxrates;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ImportAuftrag($adresse,$warenkorb,$projekt,$shop="",$auftrag=0)
|
function ImportAuftrag($adresse,$warenkorb,$projekt,$shop="",$auftrag=0) : array
|
||||||
{
|
{
|
||||||
$this->RunHook('ImportAuftragBefore',4, $adresse,$warenkorb,$projekt,$shop);
|
$this->RunHook('ImportAuftragBefore',4, $adresse,$warenkorb,$projekt,$shop);
|
||||||
if(!empty($this->app->stringcleaner)){
|
if(!empty($this->app->stringcleaner)){
|
||||||
@ -17711,6 +17711,9 @@ function CheckShopTabelle($artikel)
|
|||||||
if($doctype === 'angebot'){
|
if($doctype === 'angebot'){
|
||||||
$this->app->DB->Update("UPDATE angebot SET anfrage = '".$this->app->DB->real_escape_string($warenkorb['onlinebestellnummer'])."' WHERE id = '$auftrag' LIMIT 1");
|
$this->app->DB->Update("UPDATE angebot SET anfrage = '".$this->app->DB->real_escape_string($warenkorb['onlinebestellnummer'])."' WHERE id = '$auftrag' LIMIT 1");
|
||||||
}
|
}
|
||||||
|
if($doctype === 'auftrag'){
|
||||||
|
$this->app->DB->Update("UPDATE auftrag SET ihrebestellnummer = '".$this->app->DB->real_escape_string($warenkorb['ihrebestellnummer'])."' WHERE id = '$auftrag' LIMIT 1");
|
||||||
|
}
|
||||||
|
|
||||||
$this->app->DB->Update("UPDATE $doctype SET
|
$this->app->DB->Update("UPDATE $doctype SET
|
||||||
belegnr='$belegnr',
|
belegnr='$belegnr',
|
||||||
@ -18674,15 +18677,23 @@ function CheckShopTabelle($artikel)
|
|||||||
$artikelporto = $artikelportoermaessigt;
|
$artikelporto = $artikelportoermaessigt;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($artikelporto) && $this->app->DB->Select("SELECT portoartikelanlegen FROM shopexport WHERE id = '$shop' LIMIT 1"))
|
if(empty($artikelporto)) {
|
||||||
|
if ($this->app->DB->Select("SELECT portoartikelanlegen FROM shopexport WHERE id = '$shop' LIMIT 1"))
|
||||||
|
{
|
||||||
|
if($warenkorb['versandkostennetto'] != 0 || $warenkorb['versandkostenbrutto'] != 0 || $portocheck == 1)
|
||||||
{
|
{
|
||||||
if($warenkorb['versandkostennetto'] != 0 || $warenkorb['versandkostenbrutto'] != 0 || $portocheck == 1){
|
|
||||||
$portoartikelarr = array('projekt'=>$projekt,'porto'=>1, 'lagerartikel'=>0,'name_de'=>'Porto','umsatzsteuer'=>'normal');
|
$portoartikelarr = array('projekt'=>$projekt,'porto'=>1, 'lagerartikel'=>0,'name_de'=>'Porto','umsatzsteuer'=>'normal');
|
||||||
$artikelporto = $this->app->erp->InsertUpdateArtikel($portoartikelarr);
|
$artikelporto = $this->app->erp->InsertUpdateArtikel($portoartikelarr);
|
||||||
if($artikelporto){
|
if($artikelporto)
|
||||||
|
{
|
||||||
$this->app->DB->Update("UPDATE shopexport SET artikelporto = '$artikelporto' WHERE id = '$shop' AND artikelporto = 0 LIMIT 1");
|
$this->app->DB->Update("UPDATE shopexport SET artikelporto = '$artikelporto' WHERE id = '$shop' AND artikelporto = 0 LIMIT 1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$error_msg = 'Importauftrag Shop '.$shop.' Fehler: Kein Portoartikel vorhanden';
|
||||||
|
$this->LogFile($error_msg,['Onlinebestellnummer' => $warenkorb['onlinebestellnummer']]);
|
||||||
|
return(array("status" => false, "message" => $error_msg, "onlinebestellnummer" => $warenkorb['onlinebestellnummer']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$umsatzsteuer_porto = $this->app->DB->Select("SELECT umsatzsteuer FROM artikel WHERE id='$artikelporto' LIMIT 1");
|
$umsatzsteuer_porto = $this->app->DB->Select("SELECT umsatzsteuer FROM artikel WHERE id='$artikelporto' LIMIT 1");
|
||||||
|
|
||||||
@ -19029,7 +19040,7 @@ function CheckShopTabelle($artikel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $auftrag;
|
return array("status" => true, "$auftragid" => $auftrag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -21022,7 +21033,7 @@ function ChargenMHDAuslagern($artikel, $menge, $lagerplatztyp, $lpid,$typ,$wert,
|
|||||||
$anzges = 0;
|
$anzges = 0;
|
||||||
$anzfehler = 0;
|
$anzfehler = 0;
|
||||||
|
|
||||||
$result = null; // 1 on success
|
$result = null; // $result['status'] == 1 on success
|
||||||
|
|
||||||
if(!empty($extnummer) && is_array($extnummer)) {
|
if(!empty($extnummer) && is_array($extnummer)) {
|
||||||
foreach($extnummer as $nummer) {
|
foreach($extnummer as $nummer) {
|
||||||
@ -21053,9 +21064,9 @@ function ChargenMHDAuslagern($artikel, $menge, $lagerplatztyp, $lpid,$typ,$wert,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->LogFile('*** UPDATE '.$lagerartikel[$ij]['nummer'].' '.$lagerartikel[$ij]['name_de'].' Shop: '.$shop.' Lagernd: '.$verkaufbare_menge.' Korrektur: '.round((float) ($verkaufbare_menge_korrektur - $verkaufbare_menge),7).' Pseudolager: '.round((float) $pseudolager,8).' Result: '.gettype($result).' '.$result);
|
$this->LogFile('*** UPDATE '.$lagerartikel[$ij]['nummer'].' '.$lagerartikel[$ij]['name_de'].' Shop: '.$shop.' Lagernd: '.$verkaufbare_menge.' Korrektur: '.round((float) ($verkaufbare_menge_korrektur - $verkaufbare_menge),7).' Pseudolager: '.round((float) $pseudolager,8).' Result: '.(is_array($result)?$result['status']:$result), $result);
|
||||||
|
|
||||||
if ($result == 1) {
|
if ((is_array($result)?$result['status'] == 1:false) || $result === 1) {
|
||||||
$cacheQuantity = (int) $verkaufbare_menge_korrektur + (int) $pseudolager;
|
$cacheQuantity = (int) $verkaufbare_menge_korrektur + (int) $pseudolager;
|
||||||
$this->app->DB->Update(
|
$this->app->DB->Update(
|
||||||
"UPDATE `artikel` SET `cache_lagerplatzinhaltmenge` = '{$cacheQuantity}'
|
"UPDATE `artikel` SET `cache_lagerplatzinhaltmenge` = '{$cacheQuantity}'
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2628,6 +2628,10 @@ class Appstore {
|
|||||||
'Link'=>'index.php?module=onlineshops&action=create&cmd=shopimporter_presta',
|
'Link'=>'index.php?module=onlineshops&action=create&cmd=shopimporter_presta',
|
||||||
'Icon'=>'Icons_dunkel_1.gif',
|
'Icon'=>'Icons_dunkel_1.gif',
|
||||||
'Versionen'=>'ALL','install'=>true, 'beta' => false,'kategorie'=>'{|Shop Schnittstelle|}')
|
'Versionen'=>'ALL','install'=>true, 'beta' => false,'kategorie'=>'{|Shop Schnittstelle|}')
|
||||||
|
,'shopimporter_mirakl'=>array('Bezeichnung'=>'Mirakl',
|
||||||
|
'Link'=>'index.php?module=onlineshops&action=create&cmd=shopimporter_mirakl',
|
||||||
|
'Icon'=>'Icons_dunkel_1.gif',
|
||||||
|
'Versionen'=>'ALL','install'=>true, 'beta' => false,'kategorie'=>'{|Shop Schnittstelle|}')
|
||||||
,'shopimporter_shopify'=>array(
|
,'shopimporter_shopify'=>array(
|
||||||
'Bezeichnung'=>'Shopify API Advanced',
|
'Bezeichnung'=>'Shopify API Advanced',
|
||||||
'Link'=>'index.php?module=onlineshops&action=create&cmd=shopimporter_shopify',
|
'Link'=>'index.php?module=onlineshops&action=create&cmd=shopimporter_shopify',
|
||||||
@ -3967,7 +3971,6 @@ class Appstore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(isset($module['installiert'])) {
|
if(isset($module['installiert'])) {
|
||||||
foreach($module['installiert'] as $k => $v) {
|
foreach($module['installiert'] as $k => $v) {
|
||||||
$moduleInstallKey = $module['installiert'][$k]['key'];
|
$moduleInstallKey = $module['installiert'][$k]['key'];
|
||||||
|
@ -2841,25 +2841,21 @@ class Artikel extends GenArtikel {
|
|||||||
return ['status'=>$isOk, 'info'=>$info, 'msg_encoded' => $msg, 'error' => $error];
|
return ['status'=>$isOk, 'info'=>$info, 'msg_encoded' => $msg, 'error' => $error];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ArtikelShopexport()
|
public function ArtikelShopexport() {
|
||||||
{
|
|
||||||
$id = $this->app->Secure->GetGET('id');
|
$id = $this->app->Secure->GetGET('id');
|
||||||
$shop = $this->app->Secure->GetGET('shop');
|
$shop = $this->app->Secure->GetGET('shop');
|
||||||
$artikel = array($id);
|
$artikel = array($id);
|
||||||
$artikelshopid = (int)$this->app->Secure->GetGET('artikelshopid');
|
$artikelshopid = (int) $this->app->Secure->GetGET('artikelshopid');
|
||||||
|
|
||||||
if($artikelshopid > 0)
|
if ($artikelshopid > 0) {
|
||||||
{
|
|
||||||
$shop = $this->app->DB->Select("SELECT shop FROM artikel_onlineshops WHERE id = '$artikelshopid' AND artikel = '$id' AND aktiv = 1 LIMIT 1");
|
$shop = $this->app->DB->Select("SELECT shop FROM artikel_onlineshops WHERE id = '$artikelshopid' AND artikel = '$id' AND aktiv = 1 LIMIT 1");
|
||||||
$this->app->User->SetParameter('artikel_shopexport_shop', '');
|
$this->app->User->SetParameter('artikel_shopexport_shop', '');
|
||||||
}else{
|
} else {
|
||||||
if($shop=='1'){
|
if ($shop == '1') {
|
||||||
$shop = $this->app->DB->Select("SELECT shop FROM artikel WHERE id='$id' LIMIT 1");
|
$shop = $this->app->DB->Select("SELECT shop FROM artikel WHERE id='$id' LIMIT 1");
|
||||||
}
|
} elseif ($shop == '2') {
|
||||||
elseif($shop=='2'){
|
|
||||||
$shop = $this->app->DB->Select("SELECT shop2 FROM artikel WHERE id='$id' LIMIT 1");
|
$shop = $this->app->DB->Select("SELECT shop2 FROM artikel WHERE id='$id' LIMIT 1");
|
||||||
}
|
} elseif ($shop == '3') {
|
||||||
elseif($shop=='3'){
|
|
||||||
$shop = $this->app->DB->Select("SELECT shop3 FROM artikel WHERE id='$id' LIMIT 1");
|
$shop = $this->app->DB->Select("SELECT shop3 FROM artikel WHERE id='$id' LIMIT 1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2869,73 +2865,59 @@ class Artikel extends GenArtikel {
|
|||||||
|
|
||||||
$externenummer = $this->app->DB->Select("SELECT nummer FROM artikelnummer_fremdnummern WHERE artikel = '$id' AND aktiv = 1 AND shopid = '$shop' AND nummer <> '' ORDER BY bezeichnung = 'SHOPID' DESC LIMIT 1");
|
$externenummer = $this->app->DB->Select("SELECT nummer FROM artikelnummer_fremdnummern WHERE artikel = '$id' AND aktiv = 1 AND shopid = '$shop' AND nummer <> '' ORDER BY bezeichnung = 'SHOPID' DESC LIMIT 1");
|
||||||
|
|
||||||
if($externenummer)
|
if ($externenummer) {
|
||||||
{
|
|
||||||
$extartikelnummer = array($externenummer);
|
$extartikelnummer = array($externenummer);
|
||||||
}else{
|
} else {
|
||||||
$extartikelnummer = '';
|
$extartikelnummer = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$pageContents = $this->app->remote->RemoteSendArticleList($shop,$artikel,$extartikelnummer);
|
$remote_result = $this->app->remote->RemoteSendArticleList($shop, $artikel, $extartikelnummer);
|
||||||
$check = strpos($pageContents ,'error:');
|
|
||||||
$msg = '';
|
if (is_array($remote_result)) {
|
||||||
if(!empty($pageContents) && is_array($pageContents)) {
|
$remote_status = $remote_result['status'];
|
||||||
if(!empty($pageContents['status']) && !empty($pageContents['message'])) {
|
$remote_message = $remote_result['message'];
|
||||||
$msg = $this->app->erp->base64_url_encode('<div class="info">'.$pageContents['message'].'</div>');
|
} else if (is_numeric($remote_result)) {
|
||||||
|
if ($remote_result == 1) {
|
||||||
|
$remote_status = true;
|
||||||
|
} else {
|
||||||
|
$remote_status = false;
|
||||||
|
$remote_message = "Der Artikel konnte nicht zum Shop übertragen werden!";
|
||||||
}
|
}
|
||||||
elseif(isset($pageContents['status']) && !empty($pageContents['message'])) {
|
} else if ($remote_result === null) {
|
||||||
$msg = $this->app->erp->base64_url_encode('<div class="error">'.$pageContents['message'].'</div>');
|
$remote_status = false;
|
||||||
|
$remote_message = "Keine Aktion durchgeführt";
|
||||||
|
} else {
|
||||||
|
$remote_message = $remote_result;
|
||||||
|
if (strpos((string) $remote_result, 'error:') === 0) {
|
||||||
|
$remote_status = false;
|
||||||
|
} else {
|
||||||
|
$remote_status = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($pageContents=='1') {
|
|
||||||
$pageContents='success';
|
|
||||||
}
|
|
||||||
|
|
||||||
if(empty($msg) && $pageContents!='') {
|
if ($remote_status) {
|
||||||
$pageContents = " ($pageContents)";
|
$msg = $this->app->erp->base64_url_encode('<div class="info">' . $remote_message . '</div>');
|
||||||
|
} else {
|
||||||
|
$msg = $this->app->erp->base64_url_encode('<div class="error">' . $remote_message . '</div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->app->erp->LogFile($this->app->DB->real_escape_string('manueller Shopexport Artikel: '.$this->app->DB->Select("SELECT nummer FROM artikel WHERE id = '$id' LIMIT 1").' Shop: '.$shop.' Status: '.$pageContents));
|
$this->app->erp->LogFile($this->app->DB->real_escape_string('manueller Shopexport Artikel: '.$this->app->DB->Select("SELECT nummer FROM artikel WHERE id = '$id' LIMIT 1").' Shop: '.$shop.' Status: '.((int) $remote_status)), $remote_message);
|
||||||
|
|
||||||
// keine fehlermeldung vom shop
|
// keine fehlermeldung vom shop
|
||||||
if(empty($msg)) {
|
if ($remote_status) {
|
||||||
$linkToImporterSettings = '';
|
$linkToImporterSettings = '';
|
||||||
if($this->app->erp->RechteVorhanden('onlineshops', 'edit')){
|
if ($this->app->erp->RechteVorhanden('onlineshops', 'edit')) {
|
||||||
$url = 'index.php?module=onlineshops&action=edit&id='.$shop;
|
$url = 'index.php?module=onlineshops&action=edit&id=' . $shop;
|
||||||
$linkToImporterSettings = "<a href='$url' class='button button-primary'>Zu den Shopeinstellungen</a>";
|
$linkToImporterSettings = "<a href='$url' class='button button-primary'>Zu den Shopeinstellungen</a>";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($check === 0){
|
|
||||||
$msg = $this->app->erp->base64_url_encode("<div class=\"error\">Es gab einen Fehler beim Aktualisieren des Artikels im Shop!$pageContents</div>");
|
|
||||||
}
|
|
||||||
else if($pageContents == ''){
|
|
||||||
if($artikelexport != 1 && $lagerexport != 1){
|
|
||||||
$msg = $this->app->erp->base64_url_encode("<div class=\"error\">Der Artikel konnte nicht zum Shop übertragen werden! In den Shopeinstellungen ist festgelegt, dass die Artikelinformation- und Lagerbestandsübertragung nicht erlaubt ist!$pageContents $linkToImporterSettings</div>");
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if($pageContents === '0' || $pageContents === 0){
|
|
||||||
$msg = $this->app->erp->base64_url_encode("<div class=\"error\">Es gab einen Fehler beim Aktualisieren des Artikels im Shop! Stellen Sie sicher, dass die Zugangsdaten und URL's korrekt sind! Möglicherweise kein Artikelpreis hinterlegt</div>");
|
|
||||||
}else{
|
|
||||||
$msg = $this->app->erp->base64_url_encode("<div class=\"error\">Es gab einen Fehler beim Aktualisieren des Artikels im Shop! Stellen Sie sicher, dass die Zugangsdaten und URL's korrekt sind!$pageContents $linkToImporterSettings</div>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if($artikelexport != 1 && $lagerexport == 1){
|
|
||||||
$msg = $this->app->erp->base64_url_encode("<div class=info>Es wurde nur der Lagerbestand (nicht die Artikelinfos entsprechend der Einstellungen) im Shop aktualisiert!$pageContents $linkToImporterSettings</div>");
|
|
||||||
}
|
|
||||||
else if($lagerexport != 1 && $artikelexport == 1){
|
|
||||||
$msg = $this->app->erp->base64_url_encode("<div class=info>Es wurde nur der Artikel (nicht der Lagerbestand entsprechend der Einstellungen) im Shop aktualisiert!$pageContents $linkToImporterSettings</div>");
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$msg = $this->app->erp->base64_url_encode("<div class=info>Der Artikel wurde im Shop aktualisiert!$pageContents</div>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->app->erp->LagerSync($artikel);
|
$this->app->erp->LagerSync($artikel);
|
||||||
|
|
||||||
$this->app->Location->execute("index.php?module=artikel&action=edit&id=$id&msg=$msg#tabs-4");
|
$this->app->Location->execute("index.php?module=artikel&action=edit&id=$id&msg=$msg#tabs-4");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function ArtikelShopexportFiles()
|
public function ArtikelShopexportFiles()
|
||||||
{
|
{
|
||||||
$id = $this->app->Secure->GetGET('id');
|
$id = $this->app->Secure->GetGET('id');
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
<legend>{|Land|}</legend>
|
<legend>{|Land|}</legend>
|
||||||
<table width="100%" border="0" class="mkTableFormular">
|
<table width="100%" border="0" class="mkTableFormular">
|
||||||
<tr><td>Zweistelliger ISO Code:</td><td><input type="text" name="iso" value="[ISO]" size="40"></td></tr>
|
<tr><td>Zweistelliger ISO Code:</td><td><input type="text" name="iso" value="[ISO]" size="40"></td></tr>
|
||||||
|
<tr><td>Dreistelliger ISO Code:</td><td><input type="text" name="iso3" value="[ISO3]" size="40"></td></tr>
|
||||||
<tr><td>Bezeichnung Deutsch:</td><td><input type="text" name="bezeichnung_de" value="[BEZEICHNUNG_DE]" size="40"></td></tr>
|
<tr><td>Bezeichnung Deutsch:</td><td><input type="text" name="bezeichnung_de" value="[BEZEICHNUNG_DE]" size="40"></td></tr>
|
||||||
<tr><td>Bezeichnung Englisch:</td><td><input type="text" name="bezeichnung_en" value="[BEZEICHNUNG_EN]" size="40"></td></tr>
|
<tr><td>Bezeichnung Englisch:</td><td><input type="text" name="bezeichnung_en" value="[BEZEICHNUNG_EN]" size="40"></td></tr>
|
||||||
<tr><td>EU:</td><td><input type="checkbox" name="eu" value="1" [EU]></td></tr>
|
<tr><td>EU:</td><td><input type="checkbox" name="eu" value="1" [EU]></td></tr>
|
||||||
|
@ -4067,6 +4067,25 @@ class Importvorlage extends GenImportvorlage {
|
|||||||
}
|
}
|
||||||
} // Sprachen
|
} // Sprachen
|
||||||
|
|
||||||
|
// Artikeleigenschaften
|
||||||
|
// leer = löschen
|
||||||
|
|
||||||
|
$artikeleigenschaften = array();
|
||||||
|
foreach ($tmp as $feldname => $feldwerte) {
|
||||||
|
if (strpos($feldname,'eigenschaftname') !== false) {
|
||||||
|
$eigenschaftspaltennummer = substr($feldname,strlen('eigenschaftname'));
|
||||||
|
$artikeleigenschaften[$feldwerte[$i]] = $tmp['eigenschaftwert'.$eigenschaftspaltennummer][$i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($artikeleigenschaften as $key => $value) {
|
||||||
|
$sql = "INSERT INTO artikeleigenschaften (name) VALUES ('".$key."') ON DUPLICATE KEY UPDATE name = '".$key."'";
|
||||||
|
$this->app->DB->Update($sql);
|
||||||
|
$sql = "INSERT INTO artikeleigenschaftenwerte (artikel, artikeleigenschaften, wert) VALUES ('".$artikelid."' ,(SELECT id FROM artikeleigenschaften WHERE name = '".$key."'), '".$value."') ON DUPLICATE KEY UPDATE wert = '".$value."'";
|
||||||
|
$this->app->DB->Update($sql);
|
||||||
|
}
|
||||||
|
$sql = "DELETE FROM artikeleigenschaftenwerte WHERE wert = ''";
|
||||||
|
$this->app->DB->Delete($sql);
|
||||||
|
|
||||||
//freifelduebersetzungen
|
//freifelduebersetzungen
|
||||||
foreach ($tmp as $feldname => $feldwerte) {
|
foreach ($tmp as $feldname => $feldwerte) {
|
||||||
if(strpos($feldname,'freifeld') !== false && strpos($feldname,'_')>0){
|
if(strpos($feldname,'freifeld') !== false && strpos($feldname,'_')>0){
|
||||||
|
@ -25,11 +25,11 @@ class Laender {
|
|||||||
case "laender_list":
|
case "laender_list":
|
||||||
$allowed['laender'] = array('list');
|
$allowed['laender'] = array('list');
|
||||||
|
|
||||||
$heading = array('ISO', 'Bezeichnung DE', 'Bezeichnung EN','EU', 'Menü');
|
$heading = array('ISO', 'ISO3','Bezeichnung DE', 'Bezeichnung EN','EU', 'Menü');
|
||||||
$width = array('9%', '40%', '40%','10%','1%');
|
$width = array('9%', '9%','40%', '40%','10%','1%');
|
||||||
|
|
||||||
$findcols = array('l.iso', 'l.bezeichnung_de', 'l.bezeichnung_en', "if(l.eu,'EU','')", 'l.id');
|
$findcols = array('l.iso', 'l.iso3', 'l.bezeichnung_de', 'l.bezeichnung_en', "if(l.eu,'EU','')", 'l.id');
|
||||||
$searchsql = array('l.iso', 'l.bezeichnung_de', 'l.bezeichnung_en');
|
$searchsql = array('l.iso','l.iso3', 'l.bezeichnung_de', 'l.bezeichnung_en');
|
||||||
|
|
||||||
$defaultorder = 1;
|
$defaultorder = 1;
|
||||||
$defaultorderdesc = 0;
|
$defaultorderdesc = 0;
|
||||||
@ -38,7 +38,7 @@ class Laender {
|
|||||||
|
|
||||||
$where = " l.id > 0 ";
|
$where = " l.id > 0 ";
|
||||||
|
|
||||||
$sql = "SELECT SQL_CALC_FOUND_ROWS l.id, l.iso, l.bezeichnung_de, l.bezeichnung_en, if(l.eu,'EU',''), l.id FROM laender l";
|
$sql = "SELECT SQL_CALC_FOUND_ROWS l.id, l.iso, l.iso3, l.bezeichnung_de, l.bezeichnung_en, if(l.eu,'EU',''), l.id FROM laender l";
|
||||||
|
|
||||||
$count = "SELECT count(l.id) FROM laender l WHERE $where";
|
$count = "SELECT count(l.id) FROM laender l WHERE $where";
|
||||||
break;
|
break;
|
||||||
@ -118,7 +118,7 @@ class Laender {
|
|||||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
|
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
|
||||||
}else{
|
}else{
|
||||||
if($error == ""){
|
if($error == ""){
|
||||||
$this->app->DB->Update("UPDATE laender SET iso='{$input['iso']}', bezeichnung_de='{$input['bezeichnung_de']}', bezeichnung_en='{$input['bezeichnung_en']}', eu='{$input['eu']}' WHERE id = '$id' LIMIT 1");
|
$this->app->DB->Update("UPDATE laender SET iso='{$input['iso']}', iso3='{$input['iso3']}', bezeichnung_de='{$input['bezeichnung_de']}', bezeichnung_en='{$input['bezeichnung_en']}', eu='{$input['eu']}' WHERE id = '$id' LIMIT 1");
|
||||||
if($input['eu']==1){
|
if($input['eu']==1){
|
||||||
$this->app->Tpl->Set('EU', "checked");
|
$this->app->Tpl->Set('EU', "checked");
|
||||||
}
|
}
|
||||||
@ -127,12 +127,14 @@ class Laender {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$iso = $this->app->DB->Select("SELECT iso FROM laender WHERE id = '$id'");
|
$iso = $this->app->DB->Select("SELECT iso FROM laender WHERE id = '$id'");
|
||||||
|
$iso3 = $this->app->DB->Select("SELECT iso3 FROM laender WHERE id = '$id'");
|
||||||
$bezeichnung_de = $this->app->DB->Select("SELECT bezeichnung_de FROM laender WHERE id = '$id'");
|
$bezeichnung_de = $this->app->DB->Select("SELECT bezeichnung_de FROM laender WHERE id = '$id'");
|
||||||
$bezeichnung_en = $this->app->DB->Select("SELECT bezeichnung_en FROM laender WHERE id = '$id'");
|
$bezeichnung_en = $this->app->DB->Select("SELECT bezeichnung_en FROM laender WHERE id = '$id'");
|
||||||
$eu = $this->app->DB->Select("SELECT eu FROM laender WHERE id = '$id'");
|
$eu = $this->app->DB->Select("SELECT eu FROM laender WHERE id = '$id'");
|
||||||
|
|
||||||
|
|
||||||
$this->app->Tpl->Set('ISO', $iso);
|
$this->app->Tpl->Set('ISO', $iso);
|
||||||
|
$this->app->Tpl->Set('ISO3', $iso3);
|
||||||
$this->app->Tpl->Set('BEZEICHNUNG_DE', $bezeichnung_de);
|
$this->app->Tpl->Set('BEZEICHNUNG_DE', $bezeichnung_de);
|
||||||
$this->app->Tpl->Set('BEZEICHNUNG_EN', $bezeichnung_en);
|
$this->app->Tpl->Set('BEZEICHNUNG_EN', $bezeichnung_en);
|
||||||
if($eu == 1){
|
if($eu == 1){
|
||||||
@ -177,7 +179,7 @@ class Laender {
|
|||||||
if($error!=''){
|
if($error!=''){
|
||||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
|
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
|
||||||
}else {
|
}else {
|
||||||
$this->app->DB->Insert("INSERT INTO laender (iso, bezeichnung_de, bezeichnung_en, eu) VALUES ('{$input['iso']}', '{$input['bezeichnung_de']}', '{$input['bezeichnung_en']}', '{$input['eu']}')");
|
$this->app->DB->Insert("INSERT INTO laender (iso, iso3, bezeichnung_de, bezeichnung_en, eu) VALUES ('{$input['iso']}', '{$input['iso3']}', '{$input['bezeichnung_de']}', '{$input['bezeichnung_en']}', '{$input['eu']}')");
|
||||||
$newid = $this->app->DB->GetInsertID();
|
$newid = $this->app->DB->GetInsertID();
|
||||||
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Der Ländereintrag wurde erfolgreich angelegt.</div>");
|
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Der Ländereintrag wurde erfolgreich angelegt.</div>");
|
||||||
header("Location: index.php?module=laender&action=edit&id=$newid&msg=$msg");
|
header("Location: index.php?module=laender&action=edit&id=$newid&msg=$msg");
|
||||||
@ -194,6 +196,7 @@ class Laender {
|
|||||||
function GetInput(){
|
function GetInput(){
|
||||||
$input = array();
|
$input = array();
|
||||||
$input['iso'] = $this->app->Secure->GetPOST('iso');
|
$input['iso'] = $this->app->Secure->GetPOST('iso');
|
||||||
|
$input['iso3'] = $this->app->Secure->GetPOST('iso3');
|
||||||
$input['bezeichnung_de'] = $this->app->Secure->GetPOST('bezeichnung_de');
|
$input['bezeichnung_de'] = $this->app->Secure->GetPOST('bezeichnung_de');
|
||||||
$input['bezeichnung_en'] = $this->app->Secure->GetPOST('bezeichnung_en');
|
$input['bezeichnung_en'] = $this->app->Secure->GetPOST('bezeichnung_en');
|
||||||
$input['eu'] = (int)$this->app->Secure->GetPOST('eu');
|
$input['eu'] = (int)$this->app->Secure->GetPOST('eu');
|
||||||
@ -203,6 +206,7 @@ class Laender {
|
|||||||
|
|
||||||
function SetInput($input){
|
function SetInput($input){
|
||||||
$this->app->Tpl->Set('ISO', $input['iso']);
|
$this->app->Tpl->Set('ISO', $input['iso']);
|
||||||
|
$this->app->Tpl->Set('ISO3', $input['iso3']);
|
||||||
$this->app->Tpl->Set('BEZEICHNUNG_DE', $input['bezeichnung_de']);
|
$this->app->Tpl->Set('BEZEICHNUNG_DE', $input['bezeichnung_de']);
|
||||||
$this->app->Tpl->Set('BEZEICHNUNG_EN', $input['bezeichnung_en']);
|
$this->app->Tpl->Set('BEZEICHNUNG_EN', $input['bezeichnung_en']);
|
||||||
if($input['eu']==1){
|
if($input['eu']==1){
|
||||||
|
File diff suppressed because it is too large
Load Diff
36
www/themes/new/images/lupe.svg
Normal file
36
www/themes/new/images/lupe.svg
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="5.56mm" height="5.56mm" fill-rule="evenodd" stroke-linejoin="round" stroke-width="28.222" preserveAspectRatio="xMidYMid" version="1.2" viewBox="0 0 556 556" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<defs class="ClipPathGroup"><clipPath id="presentation_clip_path">
|
||||||
|
<rect width="556" height="556"/>
|
||||||
|
</clipPath></defs>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<g class="Master_Slide">
|
||||||
|
|
||||||
|
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g class="SlideGroup">
|
||||||
|
|
||||||
|
|
||||||
|
<g class="Slide" clip-path="url(#presentation_clip_path)">
|
||||||
|
<g class="Page">
|
||||||
|
<g class="com.sun.star.drawing.ClosedBezierShape">
|
||||||
|
|
||||||
|
<rect class="BoundingBox" x="175" y="80" width="302" height="302" fill="none"/>
|
||||||
|
<path d="m421 286c10-17 15-36 15-56 0-19-5-38-15-55s-23-30-40-40-36-15-56-15c-19 0-38 5-55 15s-30 23-40 40-15 36-15 56c0 19 5 38 15 55s23 30 40 40 36 15 56 15c19 0 38-5 55-15s30-23 40-40zm35 20c-13 23-32 42-55 55s-49 20-75 20c-27 0-53-7-76-20s-42-32-55-55-20-49-20-75c0-27 7-53 20-76s32-42 55-55 49-20 75-20c27 0 53 7 76 20s42 32 55 55 20 49 20 75c0 27-7 53-20 76z" fill="#929292"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<rect class="BoundingBox" x="78" y="286" width="190" height="191" fill="none"/>
|
||||||
|
<path d="m195 306c13 23 32 42 55 55 6 3 11 6 17 8l-102 102c-2 3-5 4-8 4h-67c-6 0-11-5-11-11v-67c0-3 1-6 4-8l103-103c2 7 6 14 9 20z" fill="#929292"/>
|
||||||
|
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
@ -53,20 +53,36 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="min-width:130px;"><label for="bezeichnung">{|Bezeichnung|}:</label></td>
|
<td style="min-width:130px;"><label for="bezeichnung">{|Bezeichnung|}:</label></td>
|
||||||
<td>[BEZEICHNUNG][MSGBEZEICHNUNG]</td>
|
<td>[BEZEICHNUNG][MSGBEZEICHNUNG]</td>
|
||||||
<td><label for="modus">{|Import-Modus|}:</label></td><td>[SELMODUS]</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="aktiv">{|Aktiv|}:</label></td>
|
<td><label for="aktiv">{|Aktiv|}:</label></td>
|
||||||
<td>[AKTIV][MSGAKTIV]</td>
|
<td>[AKTIV][MSGAKTIV]</td>
|
||||||
<td><label for="einzelsync">{|Nur 1 Auftrag pro Anfrage|}:</label></td>
|
|
||||||
<td class="einzelsyncclass">[EINZELSYNC][MSGEINZELSYNC]</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="projekt">{|Projekt|}:</label></td>
|
<td><label for="projekt">{|Projekt|}:</label></td>
|
||||||
<td>[PROJEKT][MSGPROJEKT]</td>
|
<td>[PROJEKT][MSGPROJEKT]</td>
|
||||||
<td><label for="warteschlange">{|Aufträge in Zwischentabelle|}:</label></td><td>[WARTESCHLANGE] <i>{|Freigabe erfolgt manuell|}</i>
|
</tr>
|
||||||
</td></tr>
|
<tr>
|
||||||
<tr><td><label for="abholmodus">{|Abholmodus|}:</label></td><td>[SELABHOLMODUS]</td><td class="manuellebegrenzung">{|Anzahl abholen begrenzen|}:</td><td class="manuellebegrenzung">[MAXMANUELL][MSGMAXMANUELL] <i>{|0 bedeutet Begrenzung auf 100|}</i></td></tr>
|
<td><label for="abholmodus">{|Abholmodus|}:</label></td><td>[SELABHOLMODUS]</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="manuellebegrenzung">{|Anzahl abholen begrenzen|}:</td>
|
||||||
|
<td class="manuellebegrenzung">[MAXMANUELL][MSGMAXMANUELL]</td>
|
||||||
|
<td><i>{|0 bedeutet Begrenzung auf 100|}</i></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="modus">{|Import-Modus|}:</label></td><td>[SELMODUS]</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="einzelsync">{|Nur 1 Auftrag pro Anfrage|}:</label></td>
|
||||||
|
<td class="einzelsyncclass">[EINZELSYNC][MSGEINZELSYNC]</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
</tr>
|
||||||
|
<td><label for="warteschlange">{|Aufträge in Zwischentabelle|}:</label></td><td>[WARTESCHLANGE]</td>
|
||||||
|
<td><i>{|Freigabe erfolgt manuell|}</i></td>
|
||||||
|
<tr>
|
||||||
|
</tr>
|
||||||
<tr class="ab_nummerzeitraum zeitraum">
|
<tr class="ab_nummerzeitraum zeitraum">
|
||||||
<td><label for="vondatum">{|Datum von|}:</label></td>
|
<td><label for="vondatum">{|Datum von|}:</label></td>
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
@ -98,8 +114,8 @@
|
|||||||
<div class="inside inside-full-height">
|
<div class="inside inside-full-height">
|
||||||
<fieldset><legend>{|Aktion|}</legend>
|
<fieldset><legend>{|Aktion|}</legend>
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tr><td><input type="button" onclick="verpruefen();" value="{|Verbindung prüfen|}" class="aktionbutton" ></td></tr>
|
<tr><td><input type="submit" form="frmpruefen" value="{|Verbindung prüfen|}" class="aktionbutton" ></td></tr>
|
||||||
<tr><td width="50%"><input type="button" onclick="Holeauftrag();" value="{|Aufträge abholen|}" class="aktionbutton" ></td></tr>
|
<tr><td width="50%"><input type="submit" form="frmabholen" value="{|Aufträge abholen|}" class="aktionbutton" ></td></tr>
|
||||||
[AKTIONBUTTONS]
|
[AKTIONBUTTONS]
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
@ -861,7 +861,7 @@ class WidgetShopexport extends WidgetGenShopexport
|
|||||||
switch($typ)
|
switch($typ)
|
||||||
{
|
{
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
$aktcol .= '<textarea name="'.$name.'" id="'.$name.'">'.(!isset($json['felder'][$name])?'':htmlspecialchars($json['felder'][$name])).'</textarea>';
|
$aktcol .= '<textarea name="'.$name.'" id="'.$name.'" placeholder = "'.$val['placeholder'].'" cols="'.$val['cols'].'" rows="'.$val['rows'].'">'.(!isset($json['felder'][$name])?'':htmlspecialchars($json['felder'][$name])).'</textarea>';
|
||||||
break;
|
break;
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
$aktcol .= '<input type="checkbox" name="'.$name.'" id="'.$name.'" value="1" '.((isset($json['felder'][$name]) && $json['felder'][$name])?' checked="checked" ':'').' />';
|
$aktcol .= '<input type="checkbox" name="'.$name.'" id="'.$name.'" value="1" '.((isset($json['felder'][$name]) && $json['felder'][$name])?' checked="checked" ':'').' />';
|
||||||
@ -894,6 +894,9 @@ class WidgetShopexport extends WidgetGenShopexport
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'info':
|
||||||
|
$aktcol .= $val['text'];
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
switch($typ) {
|
switch($typ) {
|
||||||
case 'datum':
|
case 'datum':
|
||||||
@ -912,7 +915,7 @@ class WidgetShopexport extends WidgetGenShopexport
|
|||||||
$aktcol .= ' <input type="button" value="'.($val['vorschlag_label']!=''?$val['vorschlag_label']:$val['vorschlag']).'" onclick="$(\'#'.$name.'\').val(\''.$val['vorschlag'].'\');" '.(isset($val['minvorschlagsize']) && $val['minvorschlagsize']?' style="min-width:'.$val['minvorschlagsize'].'px;" ':'').' />';
|
$aktcol .= ' <input type="button" value="'.($val['vorschlag_label']!=''?$val['vorschlag_label']:$val['vorschlag']).'" onclick="$(\'#'.$name.'\').val(\''.$val['vorschlag'].'\');" '.(isset($val['minvorschlagsize']) && $val['minvorschlagsize']?' style="min-width:'.$val['minvorschlagsize'].'px;" ':'').' />';
|
||||||
}
|
}
|
||||||
if(isset($val['info']) && $val['info']){
|
if(isset($val['info']) && $val['info']){
|
||||||
$aktcol .= ' <i>'.$val['info'].'</i>';
|
$aktcol .= '<td> <i>'.$val['info'].'</i></td>';
|
||||||
}
|
}
|
||||||
if(isset($val['col']) && $val['col'] == 2)
|
if(isset($val['col']) && $val['col'] == 2)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user