mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
Compare commits
72 Commits
87739fccc5
...
aac159bcb0
Author | SHA1 | Date | |
---|---|---|---|
|
aac159bcb0 | ||
|
0df7600eb4 | ||
|
616e3e8ee7 | ||
|
f725281d7e | ||
|
e40e543a7d | ||
|
014481d455 | ||
|
b7cf1dd04a | ||
|
e81e404763 | ||
|
e51e1db15c | ||
|
1ff2878d06 | ||
|
b8d412ba93 | ||
|
04de0df0b6 | ||
|
00da78e863 | ||
|
6afedcd423 | ||
|
1cc50d5cd7 | ||
|
8c3442c73d | ||
|
389a29793a | ||
|
9fbc4e2f6b | ||
|
b6b08f74b6 | ||
|
26e6d773a9 | ||
|
4351fd7b9d | ||
|
3eb4d6bc3a | ||
|
fbe266c97c | ||
|
4fe1440dd0 | ||
|
cd77b75df9 | ||
|
9a9e34a32a | ||
|
58174a8eef | ||
|
1c8d64f3be | ||
|
f1400c4892 | ||
|
22620698a1 | ||
|
ea515b0727 | ||
|
4ed783a7ca | ||
|
4337a6503c | ||
|
6e834b6df2 | ||
|
01561960ec | ||
|
d0d9c4150b | ||
|
448d49ad6d | ||
|
eead996759 | ||
|
48dbbd1a8b | ||
|
8ebfc49ad2 | ||
|
7d18234567 | ||
|
35add7d292 | ||
|
8e950b5185 | ||
|
ef8825faa8 | ||
|
29f76aa9d9 | ||
|
f1bd502044 | ||
|
610ed35218 | ||
|
04daacb227 | ||
|
4b7f3e19e7 | ||
|
15c36925a2 | ||
|
471bceb060 | ||
|
9b3950e3aa | ||
|
bb4538498a | ||
|
b06e0aa3e4 | ||
|
f95918647a | ||
|
99b6a7c671 | ||
|
31b2d95ed1 | ||
|
5b9a04031a | ||
|
57a9aa23ff | ||
|
d20bbe79b3 | ||
|
4f106028c9 | ||
|
7f61cad921 | ||
|
e71da793a3 | ||
|
35e2feee2e | ||
|
365b87f734 | ||
|
f479a12c84 | ||
|
5c96cff8c3 | ||
|
823f35e44d | ||
|
bcc2f8f879 | ||
|
55e7934fe4 | ||
|
9d71d9812f | ||
|
9d547c6e52 |
@ -10,6 +10,15 @@ use Xentral\Components\Logger\Handler\LogHandlerInterface;
|
||||
|
||||
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 */
|
||||
private $logHandlers;
|
||||
|
||||
|
@ -1,24 +1,10 @@
|
||||
<?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 {
|
||||
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';
|
||||
}
|
||||
@ -35,9 +21,7 @@ if(!isset($app->erp) || !$app->erp) {
|
||||
} else {
|
||||
$erp = new erpAPI($app);
|
||||
}
|
||||
//$remote = new Remote($app);
|
||||
$app->erp = $erp;
|
||||
//$app->remote= $remote;
|
||||
}
|
||||
if (empty($app->remote)) {
|
||||
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
||||
@ -45,13 +29,14 @@ if(empty($app->remote)) {
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
}
|
||||
$app->remote = new RemoteCustom($app);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
}
|
||||
|
||||
$app->erp->LogFile('Cronjob Artikeluebertragung Start');
|
||||
$logger->debug(
|
||||
'Start'
|
||||
);
|
||||
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
@ -60,11 +45,14 @@ $app->DB->Update(
|
||||
);
|
||||
|
||||
if ($app->DB->Select("SELECT `mutex` FROM `prozessstarter` WHERE (`parameter` = 'artikeluebertragen') LIMIT 1") == 1) {
|
||||
$logger->debug(
|
||||
'Läuft bereits'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$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)) {
|
||||
/** @var Shopexport $objShopexport */
|
||||
@ -74,6 +62,13 @@ if(!empty($articles)) {
|
||||
}
|
||||
}
|
||||
|
||||
$logger->debug(
|
||||
'Prepare',
|
||||
[
|
||||
'articles' => $articles
|
||||
]
|
||||
);
|
||||
|
||||
$anzChecked = [];
|
||||
$anzChanged = [];
|
||||
$lastids = [];
|
||||
@ -123,6 +118,9 @@ while(!empty($articles)) {
|
||||
$anzChecked[$article['shop']]
|
||||
);
|
||||
if (method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
||||
$logger->debug(
|
||||
'!canRunCronjob'
|
||||
);
|
||||
return;
|
||||
}
|
||||
$articles = $app->DB->SelectArr(
|
||||
@ -141,6 +139,8 @@ $app->DB->Update(
|
||||
SET `letzteausfuerhung`=NOW(), `mutex` = 1,`mutexcounter`=0
|
||||
WHERE `parameter` = 'artikeluebertragen'"
|
||||
);
|
||||
|
||||
/*
|
||||
while ($check > 0) {
|
||||
$shopartikel = $app->DB->Query(
|
||||
"SELECT `id`,`shop`,`artikel`,`check_nr` FROM `shopexport_artikeluebertragen` ORDER BY `id` LIMIT 10"
|
||||
@ -156,8 +156,7 @@ while($check > 0) {
|
||||
try {
|
||||
$app->remote->RemoteSendArticleList($row['shop'], array($row['artikel']));
|
||||
$app->erp->LagerSync($row['artikel'], true);
|
||||
}
|
||||
catch (Execption $exception) {
|
||||
} catch (Execption $exception) {
|
||||
$app->erp->LogFile($app->DB->real_escape_string($exception->getMessage()));
|
||||
}
|
||||
$app->DB->Delete(
|
||||
@ -186,13 +185,86 @@ while($check > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
//sleep(20); // das performance nicht total spinnt
|
||||
$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(
|
||||
"UPDATE `prozessstarter`
|
||||
SET `letzteausfuerhung`= NOW(), `mutex` = 0,`mutexcounter`=0
|
||||
WHERE `parameter` = 'artikeluebertragen'"
|
||||
);
|
||||
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (file_exists(dirname(__DIR__) . '/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
|
||||
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
|
||||
}
|
||||
@ -17,8 +18,7 @@ if(empty($app->DB)) {
|
||||
if (empty($app->erp)) {
|
||||
if (class_exists('erpAPICustom')) {
|
||||
$erp = new erpAPICustom($app);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$erp = new erpAPI($app);
|
||||
}
|
||||
$app->erp = $erp;
|
||||
@ -29,8 +29,7 @@ if(empty($app->remote)) {
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
}
|
||||
$app->remote = new RemoteCustom($app);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
}
|
||||
@ -48,14 +47,13 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
||||
if (!$app->DB->Select(
|
||||
"SELECT `id` FROM `prozessstarter` WHERE `mutex` = 0 AND `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||
)) {
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Prozessstarter-Mutex nicht bereit");
|
||||
return;
|
||||
}
|
||||
|
||||
$shops = $app->DB->SelectArr('SELECT * FROM `shopexport` WHERE `aktiv` = 1');
|
||||
if (empty($shops)) {
|
||||
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Keine aktiven Shops");
|
||||
|
||||
return;
|
||||
}
|
||||
$shopByIds = [];
|
||||
@ -100,9 +98,7 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
||||
);
|
||||
|
||||
if (empty($lagerartikel)) {
|
||||
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Keine fälligen Artikel");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -110,14 +106,13 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
||||
$r = new ReflectionMethod($app->erp, 'LagerSync');
|
||||
$params = $r->getParameters();
|
||||
$anzargs = count($params);
|
||||
}
|
||||
catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$anzargs = 2;
|
||||
}
|
||||
|
||||
$clagerartikel = $lagerartikel ? count($lagerartikel) : 0;
|
||||
$app->erp->LogFile('Lagerzahlen-Synchronisation, Artikel gesamt: ' . $clagerartikel);
|
||||
foreach($lagerartikel as $ij => $articleId) {
|
||||
foreach ($lagerartikel as $articleCounter => $articleId) {
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutex` = 1 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
||||
@ -129,23 +124,23 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
||||
} else {
|
||||
$message .= $app->erp->LagerSync($articleId, false);
|
||||
}
|
||||
}
|
||||
catch (Exception $exception) {
|
||||
} catch (Exception $exception) {
|
||||
$message .= '<br>' . $exception->getMessage();
|
||||
}
|
||||
if ($message != '') {
|
||||
$message .= '<br>';
|
||||
}
|
||||
if($ij % 10 === 0 && method_exists($app->erp, 'canRunCronjob')
|
||||
&& !$app->erp->canRunCronjob(['lagerzahlen'])) {
|
||||
if ($articleCounter % 10 === 0 && method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['lagerzahlen'])) {
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
||||
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||
);
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: lagerzahlen-Job kann nicht geladen werden");
|
||||
return;
|
||||
}
|
||||
usleep(10000);
|
||||
// $app->erp->LogFile("Lagerzahlen-Synchronisation: Warte 10 Sekunden");
|
||||
// usleep(10000);
|
||||
}
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
@ -163,7 +158,6 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
||||
'Systemmeldung: Auto Update Lagerlampen',
|
||||
$message
|
||||
);
|
||||
|
||||
} else {
|
||||
if ($erp->GetFirmaBCC1() != '') {
|
||||
$erp->MailSend(
|
||||
@ -176,8 +170,7 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception $exception) {
|
||||
} catch (Exception $exception) {
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Exception:" . $app->DB->real_escape_string($exception->getMessage()));
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
||||
if (!class_exists('ApplicationCore') && is_file(dirname(__DIR__) . '/xentral_autoloader.php')) {
|
||||
include_once dirname(__DIR__) . '/xentral_autoloader.php';
|
||||
@ -34,19 +35,15 @@ if($phpversion[0] == '7' && (int)$phpversion[2] > 0) {
|
||||
}
|
||||
if ($aes == 2 && is_file(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';
|
||||
}
|
||||
|
||||
$classes = array('briefpapier', 'lieferschein', 'auftrag', 'anfrage', 'gutschrift', 'bestellung', 'rechnung', 'mahnwesen');
|
||||
foreach($classes as $class)
|
||||
{
|
||||
if(file_exists(dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'_custom.php'))
|
||||
{
|
||||
foreach ($classes as $class) {
|
||||
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')) {
|
||||
} elseif (file_exists(dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '.php')) {
|
||||
include_once dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '.php';
|
||||
}
|
||||
}
|
||||
@ -62,17 +59,18 @@ 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.mahnwesen.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 {
|
||||
|
||||
var $DB;
|
||||
var $erp;
|
||||
var $User;
|
||||
var $mail;
|
||||
var $remote;
|
||||
var $Secure;
|
||||
function GetLandLang($isocode)
|
||||
{
|
||||
|
||||
function GetLandLang($isocode) {
|
||||
$flipped = array_flip($this->GetLaender());
|
||||
if (isset($flipped[$isocode]))
|
||||
$land = $flipped[$isocode];
|
||||
@ -82,8 +80,7 @@ function GetLandLang($isocode)
|
||||
return $land;
|
||||
}
|
||||
|
||||
function GetLaender()
|
||||
{
|
||||
function GetLaender() {
|
||||
$laender = array(
|
||||
'Afghanistan' => 'AF',
|
||||
'Ägypten' => 'EG',
|
||||
@ -331,6 +328,7 @@ function GetLaender()
|
||||
return $laender;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//ENDE
|
||||
|
||||
@ -354,8 +352,7 @@ function GetLaender()
|
||||
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
$app->remote = new RemoteCustom($app);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
}
|
||||
@ -366,7 +363,6 @@ function GetLaender()
|
||||
define('FPDF_FONTPATH', dirname(__DIR__) . '/www/lib/pdf/font/');
|
||||
}
|
||||
|
||||
|
||||
//ENDE
|
||||
|
||||
const MAXIMUM_NUMBER_OF_TRIES = 10;
|
||||
@ -467,3 +463,4 @@ function GetLaender()
|
||||
}
|
||||
|
||||
$app->DB->Update("UPDATE prozessstarter SET mutex = 0, mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||
|
||||
|
@ -18692,6 +18692,14 @@
|
||||
"id"
|
||||
],
|
||||
"Non_unique": ""
|
||||
},
|
||||
{
|
||||
"Key_name": "eigenschaft_unique",
|
||||
"Index_type": "BTREE",
|
||||
"columns": [
|
||||
"name"
|
||||
],
|
||||
"Non_unique": "UNIQUE"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -18802,6 +18810,15 @@
|
||||
"artikel"
|
||||
],
|
||||
"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],
|
||||
'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_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' => [
|
||||
'auftrag' => ['createarticle' => self::UNDEFINED, 'updatearticle' => self::UNDEFINED, 'importarticle' => self::UNDEFINED, 'importorder' => self::UNDEFINED],
|
||||
|
@ -17199,7 +17199,7 @@ function CheckShopTabelle($artikel)
|
||||
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);
|
||||
if(!empty($this->app->stringcleaner)){
|
||||
@ -17711,6 +17711,9 @@ function CheckShopTabelle($artikel)
|
||||
if($doctype === 'angebot'){
|
||||
$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
|
||||
belegnr='$belegnr',
|
||||
@ -18674,15 +18677,23 @@ function CheckShopTabelle($artikel)
|
||||
$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');
|
||||
$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");
|
||||
}
|
||||
}
|
||||
} 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");
|
||||
|
||||
@ -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;
|
||||
$anzfehler = 0;
|
||||
|
||||
$result = null; // 1 on success
|
||||
$result = null; // $result['status'] == 1 on success
|
||||
|
||||
if(!empty($extnummer) && is_array($extnummer)) {
|
||||
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;
|
||||
$this->app->DB->Update(
|
||||
"UPDATE `artikel` SET `cache_lagerplatzinhaltmenge` = '{$cacheQuantity}'
|
||||
@ -27558,6 +27569,16 @@ function Firmendaten($field,$projekt="")
|
||||
return $buchstaben_anteil_string.$neue_nummer;
|
||||
}
|
||||
|
||||
function CalcNextArtikelNummer($nummer) {
|
||||
$check = null;
|
||||
do {
|
||||
$nummer = $this->CalcNextNummer($nummer);
|
||||
$sql = "SELECT id FROM artikel WHERE nummer = '".$nummer."'";
|
||||
$check = $this->app->DB->Select($sql);
|
||||
} while (!empty($check));
|
||||
return ($nummer);
|
||||
}
|
||||
|
||||
function GetNextNummer($type,$projekt="",$data="")
|
||||
{
|
||||
$doctype = $type;
|
||||
@ -28032,7 +28053,7 @@ function Firmendaten($field,$projekt="")
|
||||
$nurzahlen = preg_replace("/[^0-9]/","",$next_nummer_alt);
|
||||
$laenge = strlen($nurzahlen);
|
||||
|
||||
$next_nummer = $this->CalcNextNummer($next_nummer_alt);
|
||||
$next_nummer = $this->CalcNextArtikelNummer($next_nummer_alt);
|
||||
//$nurbuchstaben.str_pad($nurzahlen+1, $laenge ,'0', STR_PAD_LEFT);
|
||||
$neue_nummer = $next_nummer;
|
||||
|
||||
@ -28045,12 +28066,12 @@ function Firmendaten($field,$projekt="")
|
||||
if($eigenernummernkreis=="1")
|
||||
{
|
||||
$neue_nummer = $this->app->DB->Select("SELECT next_artikelnummer FROM projekt WHERE id='$projekt' LIMIT 1");
|
||||
if($this->app->DB->Select("SELECT id FROM artikel WHERE nummer = '".$this->app->DB->real_escape_string($neue_nummer)."' LIMIT 1"))$neue_nummer = $this->CalcNextNummer($neue_nummer);
|
||||
$next_nummer = $this->CalcNextNummer($neue_nummer);
|
||||
if($this->app->DB->Select("SELECT id FROM artikel WHERE nummer = '".$this->app->DB->real_escape_string($neue_nummer)."' LIMIT 1"))$neue_nummer = $this->CalcNextArtikelNummer($neue_nummer);
|
||||
$next_nummer = $this->CalcNextArtikelNummer($neue_nummer);
|
||||
$this->app->DB->Update("UPDATE projekt SET next_artikelnummer='".$next_nummer."' WHERE id='$projekt' LIMIT 1");
|
||||
} else {
|
||||
//zentraler nummernkreis mit prefix
|
||||
$next_nummer = $this->CalcNextNummer($this->Firmendaten("next_artikelnummer"));
|
||||
$next_nummer = $this->CalcNextArtikelNummer($this->Firmendaten("next_artikelnummer"));
|
||||
$this->FirmendatenSet("next_artikelnummer",$next_nummer);
|
||||
if($next_nummer_alt!="") $neue_nummer=$next_nummer_alt.$next_nummer;
|
||||
else $neue_nummer = $next_nummer;
|
||||
@ -28065,15 +28086,15 @@ function Firmendaten($field,$projekt="")
|
||||
if($eigenernummernkreis)
|
||||
{
|
||||
$neue_nummer = $this->app->DB->Select("SELECT next_artikelnummer FROM projekt WHERE id='$projekt' LIMIT 1");
|
||||
if($this->app->DB->Select("SELECT id FROM artikel WHERE nummer = '".$this->app->DB->real_escape_string($neue_nummer)."' LIMIT 1"))$neue_nummer = $this->CalcNextNummer($neue_nummer);
|
||||
$next_nummer = $this->CalcNextNummer($neue_nummer);
|
||||
if($this->app->DB->Select("SELECT id FROM artikel WHERE nummer = '".$this->app->DB->real_escape_string($neue_nummer)."' LIMIT 1"))$neue_nummer = $this->CalcNextArtikelNummer($neue_nummer);
|
||||
$next_nummer = $this->CalcNextArtikelNummer($neue_nummer);
|
||||
$this->app->DB->Update("UPDATE projekt SET next_artikelnummer='".$next_nummer."' WHERE id='$projekt' LIMIT 1");
|
||||
}else{
|
||||
$firmennummer = $this->app->erp->Firmendaten('next_artikelnummer');
|
||||
if($firmennummer)
|
||||
{
|
||||
$next_nummer = $firmennummer;
|
||||
$neue_nummer = $this->CalcNextNummer($next_nummer);
|
||||
$neue_nummer = $this->CalcNextArtikelNummer($next_nummer);
|
||||
$this->FirmendatenSet('next_artikelnummer', $neue_nummer);
|
||||
$neue_nummer = $this->app->erp->Firmendaten('next_artikelnummer');
|
||||
} else {
|
||||
@ -28095,10 +28116,11 @@ function Firmendaten($field,$projekt="")
|
||||
$neue_nummer = $this->app->DB->Select("SELECT MAX(CAST(nummer AS UNSIGNED)) FROM artikel WHERE nummer LIKE '1%'");
|
||||
if(($neue_nummer=="" || $neue_nummer=="0")) $neue_nummer = "100000";
|
||||
}
|
||||
$neue_nummer = $this->CalcNextNummer($neue_nummer);//$neue_nummer + 1;
|
||||
$neue_nummer = $this->CalcNextArtikelNummer($neue_nummer);//$neue_nummer + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->erp->ProzessUnlock($process_lock);
|
||||
$neue_nummer = str_replace('{JAHR}',date('Y'),$neue_nummer);
|
||||
$neue_nummer = str_replace('{MONAT}',date('m'),$neue_nummer);
|
||||
|
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',
|
||||
'Icon'=>'Icons_dunkel_1.gif',
|
||||
'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(
|
||||
'Bezeichnung'=>'Shopify API Advanced',
|
||||
'Link'=>'index.php?module=onlineshops&action=create&cmd=shopimporter_shopify',
|
||||
@ -3967,7 +3971,6 @@ class Appstore {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(isset($module['installiert'])) {
|
||||
foreach($module['installiert'] as $k => $v) {
|
||||
$moduleInstallKey = $module['installiert'][$k]['key'];
|
||||
|
@ -2841,25 +2841,21 @@ class Artikel extends GenArtikel {
|
||||
return ['status'=>$isOk, 'info'=>$info, 'msg_encoded' => $msg, 'error' => $error];
|
||||
}
|
||||
|
||||
public function ArtikelShopexport()
|
||||
{
|
||||
public function ArtikelShopexport() {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$shop = $this->app->Secure->GetGET('shop');
|
||||
$artikel = array($id);
|
||||
$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");
|
||||
$this->app->User->SetParameter('artikel_shopexport_shop', '');
|
||||
} else {
|
||||
if ($shop == '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");
|
||||
}
|
||||
elseif($shop=='3'){
|
||||
} elseif ($shop == '3') {
|
||||
$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");
|
||||
|
||||
if($externenummer)
|
||||
{
|
||||
if ($externenummer) {
|
||||
$extartikelnummer = array($externenummer);
|
||||
} else {
|
||||
$extartikelnummer = '';
|
||||
}
|
||||
|
||||
$pageContents = $this->app->remote->RemoteSendArticleList($shop,$artikel,$extartikelnummer);
|
||||
$check = strpos($pageContents ,'error:');
|
||||
$msg = '';
|
||||
if(!empty($pageContents) && is_array($pageContents)) {
|
||||
if(!empty($pageContents['status']) && !empty($pageContents['message'])) {
|
||||
$msg = $this->app->erp->base64_url_encode('<div class="info">'.$pageContents['message'].'</div>');
|
||||
$remote_result = $this->app->remote->RemoteSendArticleList($shop, $artikel, $extartikelnummer);
|
||||
|
||||
if (is_array($remote_result)) {
|
||||
$remote_status = $remote_result['status'];
|
||||
$remote_message = $remote_result['message'];
|
||||
} 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'])) {
|
||||
$msg = $this->app->erp->base64_url_encode('<div class="error">'.$pageContents['message'].'</div>');
|
||||
} else if ($remote_result === null) {
|
||||
$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!='') {
|
||||
$pageContents = " ($pageContents)";
|
||||
if ($remote_status) {
|
||||
$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
|
||||
if(empty($msg)) {
|
||||
if ($remote_status) {
|
||||
$linkToImporterSettings = '';
|
||||
if ($this->app->erp->RechteVorhanden('onlineshops', 'edit')) {
|
||||
$url = 'index.php?module=onlineshops&action=edit&id=' . $shop;
|
||||
$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->Location->execute("index.php?module=artikel&action=edit&id=$id&msg=$msg#tabs-4");
|
||||
}
|
||||
|
||||
|
||||
public function ArtikelShopexportFiles()
|
||||
{
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
|
@ -145,6 +145,7 @@ class Bundesstaaten {
|
||||
var bundeslandel = $(\'#'.$bundeslandid.'\');
|
||||
var bundeslandval = $(bundeslandel).val();
|
||||
$(bundeslandel).html(\'<option value=""></option>\');
|
||||
if (typeof bundeslaender'.$bundeslandid.' !== \'undefined\') {
|
||||
$(bundeslaender'.$bundeslandid.').each(function(k,v){
|
||||
if(landsel == v.land)
|
||||
{
|
||||
@ -152,6 +153,7 @@ class Bundesstaaten {
|
||||
}
|
||||
});
|
||||
$(bundeslaender'.$bundeslandid.').val(bundeslandval);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>');
|
||||
|
@ -61,6 +61,10 @@
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|PDF-Dateien exportieren:|}</td>
|
||||
<td><input type="checkbox" name="pdfexport" value="1" [PDFEXPORT] /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
@ -22,6 +22,7 @@
|
||||
<legend>{|Land|}</legend>
|
||||
<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>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 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>
|
||||
|
@ -75,7 +75,9 @@
|
||||
[MANUELLFREIGABEEINKAUF]
|
||||
[MANUELLFREIGABEBUCHHALTUNG]
|
||||
[ALSBEZAHLTMARKIEREN]
|
||||
<option value="drucken">{|drucken|}</option>
|
||||
</select>
|
||||
{|Drucker|}: <select name="seldrucker">[SELDRUCKER]</select>
|
||||
<button name="submit" value="ausfuehren" class="ui-button-icon">{|Ausführen|}</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
@ -75,7 +75,9 @@
|
||||
[MANUELLFREIGABEEINKAUF]
|
||||
[MANUELLFREIGABEBUCHHALTUNG]
|
||||
[ALSBEZAHLTMARKIEREN]
|
||||
<option value="drucken">{|drucken|}</option>
|
||||
</select>
|
||||
{|Drucker|}: <select name="seldrucker">[SELDRUCKER]</select>
|
||||
<button name="submit" value="ausfuehren" class="ui-button-icon">{|Ausführen|}</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
@ -46,6 +46,91 @@ class Exportbuchhaltung
|
||||
var $belegnummer;
|
||||
var $headerwritten = false;
|
||||
|
||||
function typen($rechnung, $gutschrift, $verbindlichkeit, $lieferantengutschrift) : array {
|
||||
return(
|
||||
array(
|
||||
array(
|
||||
'typ' => 'rechnung',
|
||||
'subtable' => 'rechnung_position',
|
||||
'kennzeichen' => 'S',
|
||||
'kennzeichen_negativ' => 'H',
|
||||
'field_belegnr' => 'b.belegnr',
|
||||
'field_name' => 'b.name',
|
||||
'field_date' => 'datum',
|
||||
'field_auftrag' => 'MAKE_SET(3,b.auftrag,(SELECT auftrag.internet FROM auftrag WHERE auftrag.id = auftragid))',
|
||||
'field_zahlweise' => 'CONCAT(UCASE(LEFT(b.zahlungsweise, 1)),SUBSTRING(b.zahlungsweise, 2))',
|
||||
'field_kontonummer' => 'a.kundennummer_buchhaltung',
|
||||
'field_kundennummer' => 'b.kundennummer',
|
||||
'field_betrag_gesamt' => 'b.soll',
|
||||
'field_betrag' => 'p.umsatz_brutto_gesamt',
|
||||
'condition_where' => ' AND b.status IN (\'freigegeben\',\'versendet\',\'storniert\')',
|
||||
'Buchungstyp' => 'SR',
|
||||
'do' => $rechnung,
|
||||
'pdf' => 'print'
|
||||
),
|
||||
array(
|
||||
'typ' => 'gutschrift',
|
||||
'subtable' => 'gutschrift_position',
|
||||
'kennzeichen' => 'H',
|
||||
'kennzeichen_negativ' => 'S',
|
||||
'field_belegnr' => 'b.belegnr',
|
||||
'field_name' => 'b.name',
|
||||
'field_date' => 'datum',
|
||||
'field_auftrag' => '\'\'',
|
||||
'field_zahlweise' => '\'\'',
|
||||
'field_kontonummer' => 'a.kundennummer_buchhaltung',
|
||||
'field_kundennummer' => 'b.kundennummer',
|
||||
'field_betrag_gesamt' => 'b.soll',
|
||||
'field_betrag' => 'p.umsatz_brutto_gesamt',
|
||||
'condition_where' => ' AND b.status IN (\'freigegeben\',\'versendet\')',
|
||||
'Buchungstyp' => '',
|
||||
'do' => $gutschrift,
|
||||
'pdf' => 'print'
|
||||
),
|
||||
array(
|
||||
'typ' => 'verbindlichkeit',
|
||||
'subtable' => 'verbindlichkeit_position',
|
||||
'kennzeichen' => 'H',
|
||||
'kennzeichen_negativ' => 'S',
|
||||
'field_belegnr' => 'b.rechnung',
|
||||
'field_name' => 'a.name',
|
||||
'field_date' => 'rechnungsdatum',
|
||||
'field_auftrag' => 'b.auftrag',
|
||||
'field_zahlweise' => '\'\'',
|
||||
'field_kontonummer' => 'a.lieferantennummer_buchhaltung',
|
||||
'field_kundennummer' => 'a.lieferantennummer',
|
||||
'field_betrag_gesamt' => 'b.betrag',
|
||||
'field_betrag' => 'p.preis*p.menge*((100+p.steuersatz)/100)',
|
||||
'field_gegenkonto' => '(SELECT sachkonto FROM kontorahmen k WHERE k.id = p.kontorahmen)',
|
||||
'condition_where' => ' AND b.status IN (\'freigegeben\', \'abgeschlossen\')',
|
||||
'Buchungstyp' => '',
|
||||
'do' => $verbindlichkeit,
|
||||
'pdf' => 'load'
|
||||
),
|
||||
array(
|
||||
'typ' => 'lieferantengutschrift',
|
||||
'subtable' => 'lieferantengutschrift_position',
|
||||
'kennzeichen' => 'S',
|
||||
'kennzeichen_negativ' => 'H',
|
||||
'field_belegnr' => 'b.rechnung',
|
||||
'field_name' => 'a.name',
|
||||
'field_date' => 'rechnungsdatum',
|
||||
'field_auftrag' => '\'\'',
|
||||
'field_zahlweise' => '\'\'',
|
||||
'field_kontonummer' => 'a.lieferantennummer_buchhaltung',
|
||||
'field_kundennummer' => 'a.lieferantennummer',
|
||||
'field_betrag_gesamt' => 'b.betrag',
|
||||
'field_betrag' => 'p.preis*p.menge*((100+p.steuersatz)/100)',
|
||||
'field_gegenkonto' => '(SELECT sachkonto FROM kontorahmen k WHERE k.id = p.kontorahmen)',
|
||||
'condition_where' => ' AND b.status IN (\'freigegeben\', \'abgeschlossen\')',
|
||||
'Buchungstyp' => '',
|
||||
'do' => $lieferantengutschrift,
|
||||
'pdf' => 'load'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exportbelegepositionen constructor.
|
||||
*
|
||||
@ -81,6 +166,7 @@ class Exportbuchhaltung
|
||||
$diffignore = $this->app->Secure->GetPOST("diffignore");
|
||||
$sachkonto = $this->app->Secure->GetPOST('sachkonto');
|
||||
$format = $this->app->Secure->GetPOST('format');
|
||||
$pdfexport = $this->app->Secure->GetPOST("pdfexport");
|
||||
|
||||
$account_id = null;
|
||||
if (!empty($sachkonto)) {
|
||||
@ -161,13 +247,93 @@ class Exportbuchhaltung
|
||||
}
|
||||
|
||||
if ($dataok) {
|
||||
$filename = "EXTF_".date('Ymd') . "_Buchungsstapel_DATEV_export.csv";
|
||||
$filename_csv = "EXTF_".date('Ymd') . "_Buchungsstapel_DATEV_export.csv";
|
||||
try {
|
||||
$csv = $this->DATEV_Buchuchungsstapel($rgchecked, $gschecked, $vbchecked, $lgchecked, $buchhaltung_berater, $buchhaltung_mandant, $buchhaltung_wj_beginn, $buchhaltung_sachkontenlaenge, $von, $bis, $projekt, $filename, $diffignore, $sachkonto_kennung, $format);
|
||||
header("Content-Disposition: attachment; filename=" . $filename);
|
||||
$csv = $this->DATEV_Buchuchungsstapel($rgchecked, $gschecked, $vbchecked, $lgchecked, $buchhaltung_berater, $buchhaltung_mandant, $buchhaltung_wj_beginn, $buchhaltung_sachkontenlaenge, $von, $bis, $projekt, $filename_csv, $diffignore, $sachkonto_kennung, $format);
|
||||
if ($pdfexport) {
|
||||
|
||||
$dateinamezip = 'Export_Buchhaltung_'.date('Y-m-d').'.zip';
|
||||
|
||||
$zip = new ZipArchive;
|
||||
$zip->open($dateinamezip, ZipArchive::CREATE);
|
||||
|
||||
$zip->addFromString($typ['typ']."/".$filename_csv, $csv);
|
||||
|
||||
$typen = $this->typen($rgchecked, $gschecked, $vbchecked, $lgchecked);
|
||||
|
||||
foreach ($typen as $typ) {
|
||||
$sql = "
|
||||
SELECT id, ".$typ['field_belegnr']." belegnr FROM ".$typ['typ']." b
|
||||
WHERE
|
||||
b.".$typ['field_date']." BETWEEN '".date_format($von,"Y-m-d")."' AND '".date_format($bis,"Y-m-d")."' AND (b.projekt=$projekt OR $projekt=0)".$typ['condition_where'];
|
||||
$belege = $this->app->DB->SelectArr($sql);
|
||||
foreach ($belege as $beleg) {
|
||||
|
||||
if (!$typ['do']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch ($typ['pdf']) {
|
||||
case 'print':
|
||||
switch ($typ['typ']) {
|
||||
case 'rechnung':
|
||||
if(class_exists('GutschriftPDFCustom')) {
|
||||
$Brief = new RechnungPDFCustom($this->app,$projekt);
|
||||
}
|
||||
else{
|
||||
$Brief = new RechnungPDF($this->app,$projekt);
|
||||
}
|
||||
$Brief->GetRechnung($beleg['id']);
|
||||
break;
|
||||
case 'gutschrift':
|
||||
if(class_exists('RechnungPDFCustom')) {
|
||||
$Brief = new GutschriftPDFCustom($this->app,$projekt);
|
||||
}
|
||||
else{
|
||||
$Brief = new GutschriftPDF($this->app,$projekt);
|
||||
}
|
||||
$Brief->GetGutschrift($beleg['id']);
|
||||
break;
|
||||
default:
|
||||
exit();
|
||||
break;
|
||||
}
|
||||
$tmpfile = $Brief->displayTMP();
|
||||
$file_name = $beleg['belegnr'].".pdf";
|
||||
$zip->addFromString($typ['typ']."/".$file_name, file_get_contents($tmpfile));
|
||||
break;
|
||||
case 'load':
|
||||
$file_attachments = $this->app->erp->GetDateiSubjektObjekt('%',$typ['typ'],$beleg['id']);
|
||||
$suffix = "";
|
||||
$count = 0;
|
||||
foreach ($file_attachments as $file_attachment) {
|
||||
if ($this->app->erp->GetDateiEndung($file_attachment) == 'pdf') {
|
||||
$file_contents = $this->app->erp->GetDatei($file_attachment);
|
||||
$file_name = filter_var($beleg['belegnr'],FILTER_SANITIZE_EMAIL).$suffix.".pdf";
|
||||
$zip->addFromString($typ['typ']."/".$file_name, $file_contents);
|
||||
$count++;
|
||||
$suffix = "_".$count;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
|
||||
// download
|
||||
header('Content-Type: application/zip');
|
||||
header("Content-Disposition: attachment; filename=$dateinamezip");
|
||||
header('Content-Length: ' . filesize($dateinamezip));
|
||||
|
||||
readfile($dateinamezip);
|
||||
unlink($dateinamezip);
|
||||
} else {
|
||||
header("Content-Disposition: attachment; filename=" . $filename_csv);
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: 0");
|
||||
echo($csv);
|
||||
}
|
||||
$this->app->ExitXentral();
|
||||
}
|
||||
catch (ConsistencyException $e) {
|
||||
@ -204,6 +370,7 @@ class Exportbuchhaltung
|
||||
$this->app->Tpl->SET('VBCHECKED',$vbchecked?'checked':'');
|
||||
$this->app->Tpl->SET('LGCHECKED',$lgchecked?'checked':'');
|
||||
$this->app->Tpl->SET('DIFFIGNORE',$diffignore?'checked':'');
|
||||
$this->app->Tpl->SET('PDFEXPORT',$pdfexport?'checked':'');
|
||||
|
||||
$this->app->Tpl->SET('VON', $von_form);
|
||||
$this->app->Tpl->SET('BIS', $bis_form);
|
||||
@ -444,90 +611,13 @@ class Exportbuchhaltung
|
||||
$csv .= "\r\n";
|
||||
|
||||
// Collate data and transform in RAM
|
||||
$typen = array(
|
||||
array(
|
||||
'typ' => 'rechnung',
|
||||
'subtable' => 'rechnung_position',
|
||||
'kennzeichen' => 'S',
|
||||
'kennzeichen_negativ' => 'H',
|
||||
'field_belegnr' => 'b.belegnr',
|
||||
'field_name' => 'b.name',
|
||||
'field_date' => 'datum',
|
||||
'field_auftrag' => 'MAKE_SET(3,b.auftrag,(SELECT auftrag.internet FROM auftrag WHERE auftrag.id = auftragid))',
|
||||
'field_zahlweise' => 'CONCAT(UCASE(LEFT(b.zahlungsweise, 1)),SUBSTRING(b.zahlungsweise, 2))',
|
||||
'field_kontonummer' => 'a.kundennummer_buchhaltung',
|
||||
'field_kundennummer' => 'b.kundennummer',
|
||||
'field_betrag_gesamt' => 'b.soll',
|
||||
'field_betrag' => 'p.umsatz_brutto_gesamt',
|
||||
'condition_where' => ' AND b.status IN (\'freigegeben\',\'versendet\',\'storniert\')',
|
||||
'Buchungstyp' => 'SR',
|
||||
'do' => $rechnung
|
||||
),
|
||||
array(
|
||||
'typ' => 'gutschrift',
|
||||
'subtable' => 'gutschrift_position',
|
||||
'kennzeichen' => 'H',
|
||||
'kennzeichen_negativ' => 'S',
|
||||
'field_belegnr' => 'b.belegnr',
|
||||
'field_name' => 'b.name',
|
||||
'field_date' => 'datum',
|
||||
'field_auftrag' => '\'\'',
|
||||
'field_zahlweise' => '\'\'',
|
||||
'field_kontonummer' => 'a.kundennummer_buchhaltung',
|
||||
'field_kundennummer' => 'b.kundennummer',
|
||||
'field_betrag_gesamt' => 'b.soll',
|
||||
'field_betrag' => 'p.umsatz_brutto_gesamt',
|
||||
'condition_where' => ' AND b.status IN (\'freigegeben\',\'versendet\')',
|
||||
'Buchungstyp' => '',
|
||||
'do' => $gutschrift
|
||||
),
|
||||
array(
|
||||
'typ' => 'verbindlichkeit',
|
||||
'subtable' => 'verbindlichkeit_position',
|
||||
'kennzeichen' => 'H',
|
||||
'kennzeichen_negativ' => 'S',
|
||||
'field_belegnr' => 'b.rechnung',
|
||||
'field_name' => 'a.name',
|
||||
'field_date' => 'rechnungsdatum',
|
||||
'field_auftrag' => 'b.auftrag',
|
||||
'field_zahlweise' => '\'\'',
|
||||
'field_kontonummer' => 'a.lieferantennummer_buchhaltung',
|
||||
'field_kundennummer' => 'a.lieferantennummer',
|
||||
'field_betrag_gesamt' => 'b.betrag',
|
||||
'field_betrag' => 'p.preis*p.menge*((100+p.steuersatz)/100)',
|
||||
'field_gegenkonto' => '(SELECT sachkonto FROM kontorahmen k WHERE k.id = p.kontorahmen)',
|
||||
'condition_where' => ' AND b.status IN (\'freigegeben\')',
|
||||
'Buchungstyp' => '',
|
||||
'do' => $verbindlichkeit
|
||||
),
|
||||
array(
|
||||
'typ' => 'lieferantengutschrift',
|
||||
'subtable' => 'lieferantengutschrift_position',
|
||||
'kennzeichen' => 'S',
|
||||
'kennzeichen_negativ' => 'H',
|
||||
'field_belegnr' => 'b.rechnung',
|
||||
'field_name' => 'a.name',
|
||||
'field_date' => 'rechnungsdatum',
|
||||
'field_auftrag' => '\'\'',
|
||||
'field_zahlweise' => '\'\'',
|
||||
'field_kontonummer' => 'a.lieferantennummer_buchhaltung',
|
||||
'field_kundennummer' => 'a.lieferantennummer',
|
||||
'field_betrag_gesamt' => 'b.betrag',
|
||||
'field_betrag' => 'p.preis*p.menge*((100+p.steuersatz)/100)',
|
||||
'field_gegenkonto' => '(SELECT sachkonto FROM kontorahmen k WHERE k.id = p.kontorahmen)',
|
||||
'condition_where' => ' AND b.status IN (\'freigegeben\')',
|
||||
'Buchungstyp' => '',
|
||||
'do' => $lieferantengutschrift
|
||||
)
|
||||
);
|
||||
|
||||
$typen = $this->typen($rechnung, $gutschrift, $verbindlichkeit, $lieferantengutschrift);
|
||||
foreach ($typen as $typ) {
|
||||
|
||||
if (!$typ['do']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!empty($typ['field_gegenkonto'])) {
|
||||
$sql_gegenkonto = $typ['field_gegenkonto'];
|
||||
} else
|
||||
|
@ -4067,6 +4067,25 @@ class Importvorlage extends GenImportvorlage {
|
||||
}
|
||||
} // 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
|
||||
foreach ($tmp as $feldname => $feldwerte) {
|
||||
if(strpos($feldname,'freifeld') !== false && strpos($feldname,'_')>0){
|
||||
|
@ -25,11 +25,11 @@ class Laender {
|
||||
case "laender_list":
|
||||
$allowed['laender'] = array('list');
|
||||
|
||||
$heading = array('ISO', 'Bezeichnung DE', 'Bezeichnung EN','EU', 'Menü');
|
||||
$width = array('9%', '40%', '40%','10%','1%');
|
||||
$heading = array('ISO', 'ISO3','Bezeichnung DE', 'Bezeichnung EN','EU', 'Menü');
|
||||
$width = array('9%', '9%','40%', '40%','10%','1%');
|
||||
|
||||
$findcols = array('l.iso', 'l.bezeichnung_de', 'l.bezeichnung_en', "if(l.eu,'EU','')", 'l.id');
|
||||
$searchsql = array('l.iso', 'l.bezeichnung_de', 'l.bezeichnung_en');
|
||||
$findcols = array('l.iso', 'l.iso3', 'l.bezeichnung_de', 'l.bezeichnung_en', "if(l.eu,'EU','')", 'l.id');
|
||||
$searchsql = array('l.iso','l.iso3', 'l.bezeichnung_de', 'l.bezeichnung_en');
|
||||
|
||||
$defaultorder = 1;
|
||||
$defaultorderdesc = 0;
|
||||
@ -38,7 +38,7 @@ class Laender {
|
||||
|
||||
$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";
|
||||
break;
|
||||
@ -118,7 +118,7 @@ class Laender {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
|
||||
}else{
|
||||
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){
|
||||
$this->app->Tpl->Set('EU', "checked");
|
||||
}
|
||||
@ -127,12 +127,14 @@ class Laender {
|
||||
}
|
||||
}
|
||||
$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_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'");
|
||||
|
||||
|
||||
$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_EN', $bezeichnung_en);
|
||||
if($eu == 1){
|
||||
@ -177,7 +179,7 @@ class Laender {
|
||||
if($error!=''){
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
|
||||
}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();
|
||||
$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");
|
||||
@ -194,6 +196,7 @@ class Laender {
|
||||
function GetInput(){
|
||||
$input = array();
|
||||
$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_en'] = $this->app->Secure->GetPOST('bezeichnung_en');
|
||||
$input['eu'] = (int)$this->app->Secure->GetPOST('eu');
|
||||
@ -203,6 +206,7 @@ class Laender {
|
||||
|
||||
function SetInput($input){
|
||||
$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_EN', $input['bezeichnung_en']);
|
||||
if($input['eu']==1){
|
||||
|
@ -514,6 +514,31 @@ class lieferantengutschrift {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'drucken':
|
||||
$drucker = $this->app->Secure->GetPOST('seldrucker');
|
||||
foreach ($selectedIds as $id) {
|
||||
$file_attachments = $this->app->erp->GetDateiSubjektObjekt('%','lieferantengutschrift',$id);
|
||||
if (!empty($file_attachments)) {
|
||||
foreach ($file_attachments as $file_attachment) {
|
||||
if ($this->app->erp->GetDateiEndung($file_attachment) == 'pdf') {
|
||||
$file_contents = $this->app->erp->GetDatei($file_attachment);
|
||||
$lieferantengutschrift = $this->app->DB->SelectRow("SELECT DATE_FORMAT(rechnungsdatum, '%Y%m%d') rechnungsdatum, belegnr FROM lieferantengutschrift WHERE id = ".$id." LIMIT 1");
|
||||
$file_name = $lieferantengutschrift['rechnungsdatum']."_LG".$lieferantengutschrift['belegnr'].".pdf";
|
||||
$file_path = rtrim($this->app->erp->GetTMP(),'/')."/".$file_name;
|
||||
$handle = fopen ($file_path, "wb");
|
||||
if ($handle)
|
||||
{
|
||||
fwrite($handle, $file_contents);
|
||||
fclose($handle);
|
||||
$this->app->printer->Drucken($drucker,$file_path);
|
||||
} else {
|
||||
$this->app->YUI->Message('error',"Drucken fehlgeschlagen!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -542,6 +567,8 @@ class lieferantengutschrift {
|
||||
$this->app->User->SetParameter('table_lieferantengutschrift_list_zahlbarbis', '');
|
||||
$this->app->User->SetParameter('table_lieferantengutschrift_list_skontobis', '');
|
||||
|
||||
$this->app->Tpl->Set('SELDRUCKER', $this->app->erp->GetSelectDrucker());
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "lieferantengutschrift_list.tpl");
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -502,6 +502,31 @@ class Verbindlichkeit {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'drucken':
|
||||
$drucker = $this->app->Secure->GetPOST('seldrucker');
|
||||
foreach ($selectedIds as $id) {
|
||||
$file_attachments = $this->app->erp->GetDateiSubjektObjekt('%','verbindlichkeit',$id);
|
||||
if (!empty($file_attachments)) {
|
||||
foreach ($file_attachments as $file_attachment) {
|
||||
if ($this->app->erp->GetDateiEndung($file_attachment) == 'pdf') {
|
||||
$file_contents = $this->app->erp->GetDatei($file_attachment);
|
||||
$verbindlichkeit = $this->app->DB->SelectRow("SELECT DATE_FORMAT(rechnungsdatum, '%Y%m%d') rechnungsdatum, belegnr FROM verbindlichkeit WHERE id = ".$id." LIMIT 1");
|
||||
$file_name = $verbindlichkeit['rechnungsdatum']."_VB".$verbindlichkeit['belegnr'].".pdf";
|
||||
$file_path = rtrim($this->app->erp->GetTMP(),'/')."/".$file_name;
|
||||
$handle = fopen ($file_path, "wb");
|
||||
if ($handle)
|
||||
{
|
||||
fwrite($handle, $file_contents);
|
||||
fclose($handle);
|
||||
$this->app->printer->Drucken($drucker,$file_path);
|
||||
} else {
|
||||
$this->app->YUI->Message('error',"Drucken fehlgeschlagen!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -530,6 +555,8 @@ class Verbindlichkeit {
|
||||
$this->app->User->SetParameter('table_verbindlichkeit_list_zahlbarbis', '');
|
||||
$this->app->User->SetParameter('table_verbindlichkeit_list_skontobis', '');
|
||||
|
||||
$this->app->Tpl->Set('SELDRUCKER', $this->app->erp->GetSelectDrucker());
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "verbindlichkeit_list.tpl");
|
||||
}
|
||||
|
||||
|
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>
|
||||
<td style="min-width:130px;"><label for="bezeichnung">{|Bezeichnung|}:</label></td>
|
||||
<td>[BEZEICHNUNG][MSGBEZEICHNUNG]</td>
|
||||
<td><label for="modus">{|Import-Modus|}:</label></td><td>[SELMODUS]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="aktiv">{|Aktiv|}:</label></td>
|
||||
<td>[AKTIV][MSGAKTIV]</td>
|
||||
<td><label for="einzelsync">{|Nur 1 Auftrag pro Anfrage|}:</label></td>
|
||||
<td class="einzelsyncclass">[EINZELSYNC][MSGEINZELSYNC]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="projekt">{|Projekt|}:</label></td>
|
||||
<td>[PROJEKT][MSGPROJEKT]</td>
|
||||
<td><label for="warteschlange">{|Aufträge in Zwischentabelle|}:</label></td><td>[WARTESCHLANGE] <i>{|Freigabe erfolgt manuell|}</i>
|
||||
</td></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>
|
||||
</tr>
|
||||
<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">
|
||||
<td><label for="vondatum">{|Datum von|}:</label></td>
|
||||
<td nowrap>
|
||||
@ -98,8 +114,8 @@
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset><legend>{|Aktion|}</legend>
|
||||
<table width="100%">
|
||||
<tr><td><input type="button" onclick="verpruefen();" 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><input type="submit" form="frmpruefen" value="{|Verbindung prüfen|}" class="aktionbutton" ></td></tr>
|
||||
<tr><td width="50%"><input type="submit" form="frmabholen" value="{|Aufträge abholen|}" class="aktionbutton" ></td></tr>
|
||||
[AKTIONBUTTONS]
|
||||
</table>
|
||||
</fieldset>
|
||||
|
@ -861,7 +861,7 @@ class WidgetShopexport extends WidgetGenShopexport
|
||||
switch($typ)
|
||||
{
|
||||
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;
|
||||
case 'checkbox':
|
||||
$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;
|
||||
case 'info':
|
||||
$aktcol .= $val['text'];
|
||||
break;
|
||||
default:
|
||||
switch($typ) {
|
||||
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;" ':'').' />';
|
||||
}
|
||||
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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user