mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-24 13:40:29 +01:00
Merge branch 'master' into tmp2711221817
This commit is contained in:
commit
ca1db638b4
@ -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;
|
||||
|
||||
|
@ -14,17 +14,17 @@ class Shipment
|
||||
public int $id;
|
||||
|
||||
/**
|
||||
* @var string plain tracking number
|
||||
* @var ?string plain tracking number
|
||||
*/
|
||||
public string $trackingNumber;
|
||||
public ?string $trackingNumber;
|
||||
|
||||
/**
|
||||
* @var string URL to view tracking details
|
||||
* @var ?string URL to view tracking details
|
||||
*/
|
||||
public string $trackingUrl;
|
||||
public ?string $trackingUrl;
|
||||
|
||||
/**
|
||||
* @var string shipping method (after mapping to Shop domain)
|
||||
* @var ?string shipping method (after mapping to Shop domain)
|
||||
*/
|
||||
public string $shippingMethod;
|
||||
public ?string $shippingMethod;
|
||||
}
|
@ -270,7 +270,7 @@ class TOTPLoginService
|
||||
$secret = $this->getTOTPSecret($userId);
|
||||
}
|
||||
|
||||
$query = "otpauth://totp/{$label}?secret=" . $secret . '&issuer=Xentral&algorithm=SHA1&digits=6&period=30';
|
||||
$query = "otpauth://totp/{$label}?secret=" . $secret . '&issuer=OpenXE&algorithm=SHA1&digits=6&period=30';
|
||||
|
||||
return $this->barcodeService->createQrCode($query);
|
||||
}
|
||||
|
@ -1,198 +1,270 @@
|
||||
<?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;
|
||||
if (file_exists(dirname(__DIR__) . '/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
|
||||
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
|
||||
}
|
||||
*/
|
||||
//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';
|
||||
if (empty($app->Conf)) {
|
||||
$conf = new Config();
|
||||
$app->Conf = $conf;
|
||||
}
|
||||
if(empty($app->Conf)) {
|
||||
$conf = new Config();
|
||||
$app->Conf = $conf;
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
if(!isset($app->erp) || !$app->erp) {
|
||||
if (class_exists('erpAPICustom')) {
|
||||
$erp = new erpAPICustom($app);
|
||||
} 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')) {
|
||||
if(!class_exists('RemoteCustom')){
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
if (!isset($app->erp) || !$app->erp) {
|
||||
if (class_exists('erpAPICustom')) {
|
||||
$erp = new erpAPICustom($app);
|
||||
} else {
|
||||
$erp = new erpAPI($app);
|
||||
}
|
||||
$app->erp = $erp;
|
||||
}
|
||||
if (empty($app->remote)) {
|
||||
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
||||
if (!class_exists('RemoteCustom')) {
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
}
|
||||
$app->remote = new RemoteCustom($app);
|
||||
} else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
$app->remote = new RemoteCustom($app);
|
||||
}
|
||||
else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
}
|
||||
|
||||
$app->erp->LogFile('Cronjob Artikeluebertragung Start');
|
||||
$logger->debug(
|
||||
'Start'
|
||||
);
|
||||
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutexcounter` = `mutexcounter` + 1
|
||||
WHERE `mutex` = 1 AND (`parameter` = 'artikeluebertragen') AND `aktiv` = 1"
|
||||
);
|
||||
|
||||
if($app->DB->Select("SELECT `mutex` FROM `prozessstarter` WHERE (`parameter` = 'artikeluebertragen') LIMIT 1") == 1){
|
||||
return;
|
||||
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 */
|
||||
$objShopexport = $app->loadModule('shopexport');
|
||||
if($objShopexport !== null && method_exists($objShopexport, 'addChangedArticles')) {
|
||||
$objShopexport->addChangedArticles();
|
||||
}
|
||||
if (!empty($articles)) {
|
||||
/** @var Shopexport $objShopexport */
|
||||
$objShopexport = $app->loadModule('shopexport');
|
||||
if ($objShopexport !== null && method_exists($objShopexport, 'addChangedArticles')) {
|
||||
$objShopexport->addChangedArticles();
|
||||
}
|
||||
}
|
||||
|
||||
$logger->debug(
|
||||
'Prepare',
|
||||
[
|
||||
'articles' => $articles
|
||||
]
|
||||
);
|
||||
|
||||
$anzChecked = [];
|
||||
$anzChanged = [];
|
||||
$lastids = [];
|
||||
while(!empty($articles)) {
|
||||
foreach($articles as $article) {
|
||||
if(empty($anzChanged[$article['shop']])) {
|
||||
$anzChanged[$article['shop']] = 0;
|
||||
while (!empty($articles)) {
|
||||
foreach ($articles as $article) {
|
||||
if (empty($anzChanged[$article['shop']])) {
|
||||
$anzChanged[$article['shop']] = 0;
|
||||
}
|
||||
if (empty($anzChecked[$article['shop']])) {
|
||||
$anzChecked[$article['shop']] = 0;
|
||||
}
|
||||
if (!isset($lastids[$article['shop']])) {
|
||||
$lastids[$article['shop']] = (int) $app->erp->GetKonfiguration(
|
||||
'shopexport_artikeluebertragen_check_lastid_' . $article['shop']
|
||||
);
|
||||
}
|
||||
$changed = $objShopexport->hasArticleHashChanged($article['artikel'], $article['shop']);
|
||||
if ($changed['changed']) {
|
||||
$app->DB->Insert(
|
||||
sprintf(
|
||||
'INSERT INTO `shopexport_artikeluebertragen` (`artikel`, `shop`, `check_nr`) VALUES (%d, %d, %d)',
|
||||
$article['artikel'], $article['shop'], $lastids[$article['shop']]
|
||||
)
|
||||
);
|
||||
$anzChanged[$article['shop']]++;
|
||||
}
|
||||
$anzChecked[$article['shop']]++;
|
||||
$app->DB->Delete(
|
||||
sprintf(
|
||||
'DELETE FROM `shopexport_artikeluebertragen_check` WHERE `id` = %d',
|
||||
$article['id']
|
||||
)
|
||||
);
|
||||
$app->DB->Update(
|
||||
sprintf(
|
||||
"UPDATE `shopexport` SET `autosendarticle_last` = NOW() WHERE `id` = %d",
|
||||
$article['shop']
|
||||
)
|
||||
);
|
||||
}
|
||||
if(empty($anzChecked[$article['shop']])) {
|
||||
$anzChecked[$article['shop']] = 0;
|
||||
$app->erp->SetKonfigurationValue(
|
||||
'shopexport_artikeluebertragen_check_changed_' . $article['shop'],
|
||||
$anzChanged[$article['shop']]
|
||||
);
|
||||
$app->erp->SetKonfigurationValue(
|
||||
'shopexport_artikeluebertragen_check_checked_' . $article['shop'],
|
||||
$anzChecked[$article['shop']]
|
||||
);
|
||||
if (method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
||||
$logger->debug(
|
||||
'!canRunCronjob'
|
||||
);
|
||||
return;
|
||||
}
|
||||
if(!isset($lastids[$article['shop']])) {
|
||||
$lastids[$article['shop']] = (int)$app->erp->GetKonfiguration(
|
||||
'shopexport_artikeluebertragen_check_lastid_' . $article['shop']
|
||||
);
|
||||
}
|
||||
$changed = $objShopexport->hasArticleHashChanged($article['artikel'], $article['shop']);
|
||||
if($changed['changed']) {
|
||||
$app->DB->Insert(
|
||||
sprintf(
|
||||
'INSERT INTO `shopexport_artikeluebertragen` (`artikel`, `shop`, `check_nr`) VALUES (%d, %d, %d)',
|
||||
$article['artikel'], $article['shop'], $lastids[$article['shop']]
|
||||
)
|
||||
);
|
||||
$anzChanged[$article['shop']]++;
|
||||
}
|
||||
$anzChecked[$article['shop']]++;
|
||||
$app->DB->Delete(
|
||||
sprintf(
|
||||
'DELETE FROM `shopexport_artikeluebertragen_check` WHERE `id` = %d',
|
||||
$article['id']
|
||||
)
|
||||
$articles = $app->DB->SelectArr(
|
||||
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id` LIMIT 10'
|
||||
);
|
||||
$app->DB->Update(
|
||||
sprintf(
|
||||
"UPDATE `shopexport` SET `autosendarticle_last` = NOW() WHERE `id` = %d",
|
||||
$article['shop']
|
||||
)
|
||||
);
|
||||
}
|
||||
$app->erp->SetKonfigurationValue(
|
||||
'shopexport_artikeluebertragen_check_changed_'.$article['shop'],
|
||||
$anzChanged[$article['shop']]
|
||||
);
|
||||
$app->erp->SetKonfigurationValue(
|
||||
'shopexport_artikeluebertragen_check_checked_'.$article['shop'],
|
||||
$anzChecked[$article['shop']]
|
||||
);
|
||||
if(method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
||||
return;
|
||||
}
|
||||
$articles = $app->DB->SelectArr(
|
||||
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id` LIMIT 10'
|
||||
);
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
"UPDATE `prozessstarter`
|
||||
SET `letzteausfuerhung`=NOW(), `mutex` = 1,`mutexcounter`=0
|
||||
WHERE `parameter` = 'artikeluebertragen'"
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
$check = $app->DB->Select('SELECT COUNT(`id`) FROM `shopexport_artikeluebertragen`');
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
"UPDATE `prozessstarter`
|
||||
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"
|
||||
);
|
||||
if(!empty($shopartikel)) {
|
||||
$anz = 0;
|
||||
while ($row = $app->DB->Fetch_Assoc($shopartikel)) {
|
||||
if(!isset($lastids[$row['shop']])) {
|
||||
$lastids[$row['shop']] = (int)$app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_lastid_' . $row['shop']);
|
||||
}
|
||||
|
||||
$anz++;
|
||||
try {
|
||||
$app->remote->RemoteSendArticleList($row['shop'], array($row['artikel']));
|
||||
$app->erp->LagerSync($row['artikel'], true);
|
||||
}
|
||||
catch (Execption $exception) {
|
||||
$app->erp->LogFile($app->DB->real_escape_string($exception->getMessage()));
|
||||
}
|
||||
$app->DB->Delete(
|
||||
sprintf(
|
||||
'DELETE FROM `shopexport_artikeluebertragen` WHERE `id`= %d LIMIT 1',
|
||||
$row['id']
|
||||
)
|
||||
);
|
||||
/*
|
||||
while ($check > 0) {
|
||||
$shopartikel = $app->DB->Query(
|
||||
"SELECT `id`,`shop`,`artikel`,`check_nr` FROM `shopexport_artikeluebertragen` ORDER BY `id` LIMIT 10"
|
||||
);
|
||||
if (!empty($shopartikel)) {
|
||||
$anz = 0;
|
||||
while ($row = $app->DB->Fetch_Assoc($shopartikel)) {
|
||||
if (!isset($lastids[$row['shop']])) {
|
||||
$lastids[$row['shop']] = (int) $app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_lastid_' . $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']);
|
||||
$app->erp->SetKonfigurationValue('shopexport_artikeluebertragen_check_transfered_'.$row['shop'], $transfered);
|
||||
}
|
||||
$anz++;
|
||||
try {
|
||||
$app->remote->RemoteSendArticleList($row['shop'], array($row['artikel']));
|
||||
$app->erp->LagerSync($row['artikel'], true);
|
||||
} catch (Execption $exception) {
|
||||
$app->erp->LogFile($app->DB->real_escape_string($exception->getMessage()));
|
||||
}
|
||||
$app->DB->Delete(
|
||||
sprintf(
|
||||
'DELETE FROM `shopexport_artikeluebertragen` WHERE `id`= %d LIMIT 1',
|
||||
$row['id']
|
||||
)
|
||||
);
|
||||
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
if (!empty($row['check_nr']) && $row['check_nr'] == $lastids[$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->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
SET `letzteausfuerhung`=NOW(), `mutex` = 1,`mutexcounter`=0
|
||||
WHERE `parameter` = 'artikeluebertragen'"
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
$app->DB->free($shopartikel);
|
||||
}
|
||||
|
||||
$app->DB->free($shopartikel);
|
||||
}
|
||||
if (method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
||||
return;
|
||||
}
|
||||
$check = $app->DB->Select('SELECT COUNT(`id`) FROM `shopexport_artikeluebertragen`');
|
||||
}*/
|
||||
|
||||
//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`
|
||||
"UPDATE `prozessstarter`
|
||||
SET `letzteausfuerhung`= NOW(), `mutex` = 0,`mutexcounter`=0
|
||||
WHERE `parameter` = 'artikeluebertragen'"
|
||||
);
|
||||
|
||||
|
||||
|
@ -148,8 +148,7 @@ $tables = [
|
||||
'templatemessage',
|
||||
'shopimport_auftraege',
|
||||
'versandzentrum_log',
|
||||
'api_request_response_log',
|
||||
'shopimport_amazon_fees',
|
||||
'api_request_response_log'
|
||||
];
|
||||
$minMemoryMb = 1;
|
||||
$minMemory = $minMemoryMb * 1024 * 1024;
|
||||
@ -623,34 +622,11 @@ if($shopExportLogCleanerActive && $tage > 0) {
|
||||
|
||||
$shopExportLogCleanerActive = $app->erp->Firmendaten('cleaner_shopexportlog');
|
||||
$tage = (int)$app->erp->Firmendaten('cleaner_shopexportlog_tage');
|
||||
$isToDelete = !empty($tableSchemaByTables['shopimport_amazon_fees'])
|
||||
&& !empty($tableSchemaByTables['shopimport_amazon_fees']['todelete']);
|
||||
if((!$shopExportLogCleanerActive || $tage <= 0 || $tage > 30) && $isToDelete) {
|
||||
$shopExportLogCleanerActive = true;
|
||||
if($tage <= 0 || $tage > 30) {
|
||||
$tage = 30;
|
||||
}
|
||||
}
|
||||
|
||||
if($shopExportLogCleanerActive && $tage > 0) {
|
||||
if($tage < 30) {
|
||||
$tage = 30;
|
||||
}
|
||||
$app->DB->Delete(
|
||||
sprintf(
|
||||
"DELETE FROM `shopimport_amazon_fees`
|
||||
WHERE DATE_SUB(NOW(), INTERVAL %d DAY) >= `zeitstempel` OR `zeitstempel` = '0000-00-00 00:00:00'",
|
||||
$tage
|
||||
)
|
||||
);
|
||||
$affectedRows = $app->DB->affected_rows();
|
||||
if(!empty($tableSchemaByTables['shopimport_amazon_fees'])
|
||||
&& ($tableSchemaByTables['shopimport_amazon_fees']['todelete'] > 0)) {
|
||||
$tableSchemaByTables['shopimport_amazon_fees']['todelete'] -= $affectedRows;
|
||||
}
|
||||
if($affectedRows > 0 && !empty($optimize['shopimport_amazon_fees'])) {
|
||||
$app->DB->Query('OPTIMIZE TABLE `shopimport_amazon_fees`');
|
||||
unset($optimize['shopimport_amazon_fees']);
|
||||
}
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter SET letzteausfuerhung=NOW(),mutex=1,mutexcounter=0 WHERE parameter = 'cleaner' AND aktiv = 1"
|
||||
);
|
||||
|
@ -1,38 +1,37 @@
|
||||
<?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';
|
||||
|
||||
if (file_exists(dirname(__DIR__) . '/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
|
||||
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
|
||||
}
|
||||
|
||||
if(empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
||||
$app = new app_t();
|
||||
if (empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
||||
$app = new app_t();
|
||||
}
|
||||
|
||||
if(empty($app->Conf)) {
|
||||
$conf = new Config();
|
||||
$app->Conf = $conf;
|
||||
if (empty($app->Conf)) {
|
||||
$conf = new Config();
|
||||
$app->Conf = $conf;
|
||||
}
|
||||
if(empty($app->DB)) {
|
||||
$app->DB = new DB($app->Conf->WFdbhost,$app->Conf->WFdbname,$app->Conf->WFdbuser,$app->Conf->WFdbpass,null,$app->Conf->WFdbport);
|
||||
if (empty($app->DB)) {
|
||||
$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(class_exists('erpAPICustom')) {
|
||||
$erp = new erpAPICustom($app);
|
||||
}
|
||||
else {
|
||||
$erp = new erpAPI($app);
|
||||
}
|
||||
$app->erp = $erp;
|
||||
}
|
||||
if(empty($app->remote)) {
|
||||
if(is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')){
|
||||
if(!class_exists('RemoteCustom')) {
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
if (empty($app->erp)) {
|
||||
if (class_exists('erpAPICustom')) {
|
||||
$erp = new erpAPICustom($app);
|
||||
} else {
|
||||
$erp = new erpAPI($app);
|
||||
}
|
||||
$app->erp = $erp;
|
||||
}
|
||||
if (empty($app->remote)) {
|
||||
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
||||
if (!class_exists('RemoteCustom')) {
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
}
|
||||
$app->remote = new RemoteCustom($app);
|
||||
} else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
$app->remote = new RemoteCustom($app);
|
||||
}
|
||||
else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
}
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Start");
|
||||
|
||||
@ -40,34 +39,33 @@ $app->erp->LogFile("Lagerzahlen-Synchronisation Start");
|
||||
|
||||
$firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
||||
|
||||
$app->DB->Update(
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutexcounter` = `mutexcounter` + 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"
|
||||
)) {
|
||||
)) {
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Prozessstarter-Mutex nicht bereit");
|
||||
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");
|
||||
|
||||
return;
|
||||
}
|
||||
$shopByIds = [];
|
||||
foreach($shops as $shop) {
|
||||
}
|
||||
$shopByIds = [];
|
||||
foreach ($shops as $shop) {
|
||||
$shopByIds[$shop['id']] = $shop;
|
||||
}
|
||||
$shopIds = array_keys($shopByIds);
|
||||
$shopIdsStr = implode(',', $shopIds);
|
||||
$hours = 12;
|
||||
$hoursShop = 48;
|
||||
$lagerartikel = $app->DB->SelectFirstCols(
|
||||
"SELECT a.id
|
||||
}
|
||||
$shopIds = array_keys($shopByIds);
|
||||
$shopIdsStr = implode(',', $shopIds);
|
||||
$hours = 12;
|
||||
$hoursShop = 48;
|
||||
$lagerartikel = $app->DB->SelectFirstCols(
|
||||
"SELECT a.id
|
||||
FROM `artikel` AS `a`
|
||||
LEFT JOIN (
|
||||
SELECT ao2.artikel, 1 AS `autolagerlampe`,
|
||||
@ -97,91 +95,86 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
||||
ORDER BY a.cache_lagerplatzinhaltmenge = -999 DESC,
|
||||
ao.cache_reseted DESC,
|
||||
a.laststorage_sync"
|
||||
);
|
||||
|
||||
if(empty($lagerartikel)) {
|
||||
);
|
||||
|
||||
if (empty($lagerartikel)) {
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Keine fälligen Artikel");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
$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) {
|
||||
$clagerartikel = $lagerartikel ? count($lagerartikel) : 0;
|
||||
$app->erp->LogFile('Lagerzahlen-Synchronisation, Artikel gesamt: ' . $clagerartikel);
|
||||
foreach ($lagerartikel as $articleCounter => $articleId) {
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutex` = 1 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
||||
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||
);
|
||||
try {
|
||||
if($anzargs > 2){
|
||||
$message .= $app->erp->LagerSync($articleId, false, $shopByIds); // 2nd parameter is print_echo -> prints via echo to logfile (big print_r)
|
||||
}else{
|
||||
$message .= $app->erp->LagerSync($articleId, false);
|
||||
}
|
||||
if ($anzargs > 2) {
|
||||
$message .= $app->erp->LagerSync($articleId, false, $shopByIds); // 2nd parameter is print_echo -> prints via echo to logfile (big print_r)
|
||||
} else {
|
||||
$message .= $app->erp->LagerSync($articleId, false);
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
$message .= '<br>' . $exception->getMessage();
|
||||
}
|
||||
catch (Exception $exception) {
|
||||
$message .= '<br>' . $exception->getMessage();
|
||||
if ($message != '') {
|
||||
$message .= '<br>';
|
||||
}
|
||||
if($message!='') {
|
||||
$message .='<br>';
|
||||
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;
|
||||
}
|
||||
if($ij % 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"
|
||||
);
|
||||
return;
|
||||
}
|
||||
usleep(10000);
|
||||
}
|
||||
$app->DB->Update(
|
||||
// $app->erp->LogFile("Lagerzahlen-Synchronisation: Warte 10 Sekunden");
|
||||
// usleep(10000);
|
||||
}
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
||||
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||
);
|
||||
if($message !='' && $erp->Firmendaten('systemmailsabschalten') == 0 && $erp->GetFirmaMail()!='') {
|
||||
);
|
||||
if ($message != '' && $erp->Firmendaten('systemmailsabschalten') == 0 && $erp->GetFirmaMail() != '') {
|
||||
try {
|
||||
if($erp->Firmendaten('systemmailsempfaenger') != ''){
|
||||
$erp->MailSend(
|
||||
$erp->GetFirmaMail(),
|
||||
$erp->GetFirmaName(),
|
||||
$erp->Firmendaten('systemmailsempfaenger'),
|
||||
'Lagerverwaltung',
|
||||
'Systemmeldung: Auto Update Lagerlampen',
|
||||
$message
|
||||
);
|
||||
|
||||
}else{
|
||||
if($erp->GetFirmaBCC1() != ''){
|
||||
$erp->MailSend(
|
||||
$erp->GetFirmaMail(),
|
||||
$erp->GetFirmaName(),
|
||||
$erp->GetFirmaBCC1(),
|
||||
'Lagerverwaltung',
|
||||
'Systemmeldung: Auto Update Lagerlampen',
|
||||
$message
|
||||
);
|
||||
if ($erp->Firmendaten('systemmailsempfaenger') != '') {
|
||||
$erp->MailSend(
|
||||
$erp->GetFirmaMail(),
|
||||
$erp->GetFirmaName(),
|
||||
$erp->Firmendaten('systemmailsempfaenger'),
|
||||
'Lagerverwaltung',
|
||||
'Systemmeldung: Auto Update Lagerlampen',
|
||||
$message
|
||||
);
|
||||
} else {
|
||||
if ($erp->GetFirmaBCC1() != '') {
|
||||
$erp->MailSend(
|
||||
$erp->GetFirmaMail(),
|
||||
$erp->GetFirmaName(),
|
||||
$erp->GetFirmaBCC1(),
|
||||
'Lagerverwaltung',
|
||||
'Systemmeldung: Auto Update Lagerlampen',
|
||||
$message
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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,392 +1,388 @@
|
||||
<?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';
|
||||
if (!class_exists('ApplicationCore') && is_file(dirname(__DIR__) . '/xentral_autoloader.php')) {
|
||||
include_once dirname(__DIR__) . '/xentral_autoloader.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.secure.php';
|
||||
include_once dirname(__DIR__).'/phpwf/plugins/class.user.php';
|
||||
if(file_exists(dirname(__DIR__).'/conf/user_defined.php')) {
|
||||
include_once dirname(__DIR__).'/conf/user_defined.php';
|
||||
}
|
||||
if(!class_exists('FPDFWAWISION')){
|
||||
if(file_exists(dirname(__DIR__).'/conf/user_defined.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.secure.php';
|
||||
include_once dirname(__DIR__) . '/phpwf/plugins/class.user.php';
|
||||
if (file_exists(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')){
|
||||
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')){
|
||||
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php';
|
||||
}else{
|
||||
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/imap.inc.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.httpclient.php';
|
||||
if (!class_exists('FPDFWAWISION')) {
|
||||
if (file_exists(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')) {
|
||||
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')) {
|
||||
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php';
|
||||
} else {
|
||||
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/imap.inc.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.httpclient.php';
|
||||
$aes = '';
|
||||
$phpversion = (String)phpversion();
|
||||
if($phpversion[0] == '7' && (int)$phpversion[2] > 0) {
|
||||
$aes = '2';
|
||||
$phpversion = (String) phpversion();
|
||||
if ($phpversion[0] == '7' && (int) $phpversion[2] > 0) {
|
||||
$aes = '2';
|
||||
}
|
||||
if($aes == 2 && is_file(dirname(__DIR__).'/www/lib/class.aes2.php')) {
|
||||
include_once dirname(__DIR__).'/www/lib/class.aes2.php';
|
||||
}
|
||||
else{
|
||||
include_once dirname(__DIR__) . '/www/lib/class.aes.php';
|
||||
if ($aes == 2 && is_file(dirname(__DIR__) . '/www/lib/class.aes2.php')) {
|
||||
include_once dirname(__DIR__) . '/www/lib/class.aes2.php';
|
||||
} 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'))
|
||||
{
|
||||
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.'.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')) {
|
||||
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 . '.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.auftrag.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");
|
||||
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.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'))
|
||||
{
|
||||
class app_t2 extends ApplicationCore {
|
||||
var $DB;
|
||||
var $erp;
|
||||
var $User;
|
||||
var $mail;
|
||||
var $remote;
|
||||
var $Secure;
|
||||
function GetLandLang($isocode)
|
||||
{
|
||||
$flipped = array_flip($this->GetLaender());
|
||||
if(isset($flipped[$isocode]))
|
||||
$land = $flipped[$isocode];
|
||||
else {
|
||||
$land = 'unkown';
|
||||
}
|
||||
return $land;
|
||||
}
|
||||
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.auftrag.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");
|
||||
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.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')) {
|
||||
|
||||
class app_t2 extends ApplicationCore {
|
||||
|
||||
var $DB;
|
||||
var $erp;
|
||||
var $User;
|
||||
var $mail;
|
||||
var $remote;
|
||||
var $Secure;
|
||||
|
||||
function GetLandLang($isocode) {
|
||||
$flipped = array_flip($this->GetLaender());
|
||||
if (isset($flipped[$isocode]))
|
||||
$land = $flipped[$isocode];
|
||||
else {
|
||||
$land = 'unkown';
|
||||
}
|
||||
return $land;
|
||||
}
|
||||
|
||||
function GetLaender() {
|
||||
$laender = array(
|
||||
'Afghanistan' => 'AF',
|
||||
'Ägypten' => 'EG',
|
||||
'Albanien' => 'AL',
|
||||
'Algerien' => 'DZ',
|
||||
'Andorra' => 'AD',
|
||||
'Angola' => 'AO',
|
||||
'Anguilla' => 'AI',
|
||||
'Antarktis' => 'AQ',
|
||||
'Antigua und Barbuda' => 'AG',
|
||||
'Äquatorial Guinea' => 'GQ',
|
||||
'Argentinien' => 'AR',
|
||||
'Armenien' => 'AM',
|
||||
'Aruba' => 'AW',
|
||||
'Aserbaidschan' => 'AZ',
|
||||
'Äthiopien' => 'ET',
|
||||
'Australien' => 'AU',
|
||||
'Bahamas' => 'BS',
|
||||
'Bahrain' => 'BH',
|
||||
'Bangladesh' => 'BD',
|
||||
'Barbados' => 'BB',
|
||||
'Belgien' => 'BE',
|
||||
'Belize' => 'BZ',
|
||||
'Benin' => 'BJ',
|
||||
'Bermudas' => 'BM',
|
||||
'Bhutan' => 'BT',
|
||||
'Birma' => 'MM',
|
||||
'Bolivien' => 'BO',
|
||||
'Bosnien-Herzegowina' => 'BA',
|
||||
'Botswana' => 'BW',
|
||||
'Bouvet Inseln' => 'BV',
|
||||
'Brasilien' => 'BR',
|
||||
'Britisch-Indischer Ozean' => 'IO',
|
||||
'Brunei' => 'BN',
|
||||
'Bulgarien' => 'BG',
|
||||
'Burkina Faso' => 'BF',
|
||||
'Burundi' => 'BI',
|
||||
'Chile' => 'CL',
|
||||
'China' => 'CN',
|
||||
'Christmas Island' => 'CX',
|
||||
'Cook Inseln' => 'CK',
|
||||
'Costa Rica' => 'CR',
|
||||
'Dänemark' => 'DK',
|
||||
'Deutschland' => 'DE',
|
||||
'Djibuti' => 'DJ',
|
||||
'Dominika' => 'DM',
|
||||
'Dominikanische Republik' => 'DO',
|
||||
'Ecuador' => 'EC',
|
||||
'El Salvador' => 'SV',
|
||||
'Elfenbeinküste' => 'CI',
|
||||
'Eritrea' => 'ER',
|
||||
'Estland' => 'EE',
|
||||
'Falkland Inseln' => 'FK',
|
||||
'Färöer Inseln' => 'FO',
|
||||
'Fidschi' => 'FJ',
|
||||
'Finnland' => 'FI',
|
||||
'Frankreich' => 'FR',
|
||||
'Französisch Guyana' => 'GF',
|
||||
'Französisch Polynesien' => 'PF',
|
||||
'Französisches Süd-Territorium' => 'TF',
|
||||
'Gabun' => 'GA',
|
||||
'Gambia' => 'GM',
|
||||
'Georgien' => 'GE',
|
||||
'Ghana' => 'GH',
|
||||
'Gibraltar' => 'GI',
|
||||
'Grenada' => 'GD',
|
||||
'Griechenland' => 'GR',
|
||||
'Grönland' => 'GL',
|
||||
'Großbritannien' => 'UK',
|
||||
'Großbritannien (UK)' => 'GB',
|
||||
'Guadeloupe' => 'GP',
|
||||
'Guam' => 'GU',
|
||||
'Guatemala' => 'GT',
|
||||
'Guinea' => 'GN',
|
||||
'Guinea Bissau' => 'GW',
|
||||
'Guyana' => 'GY',
|
||||
'Haiti' => 'HT',
|
||||
'Heard und McDonald Islands' => 'HM',
|
||||
'Honduras' => 'HN',
|
||||
'Hong Kong' => 'HK',
|
||||
'Indien' => 'IN',
|
||||
'Indonesien' => 'ID',
|
||||
'Irak' => 'IQ',
|
||||
'Iran' => 'IR',
|
||||
'Irland' => 'IE',
|
||||
'Island' => 'IS',
|
||||
'Israel' => 'IL',
|
||||
'Italien' => 'IT',
|
||||
'Jamaika' => 'JM',
|
||||
'Japan' => 'JP',
|
||||
'Jemen' => 'YE',
|
||||
'Jordanien' => 'JO',
|
||||
'Jugoslawien' => 'YU',
|
||||
'Kaiman Inseln' => 'KY',
|
||||
'Kambodscha' => 'KH',
|
||||
'Kamerun' => 'CM',
|
||||
'Kanada' => 'CA',
|
||||
'Kap Verde' => 'CV',
|
||||
'Kasachstan' => 'KZ',
|
||||
'Kenia' => 'KE',
|
||||
'Kirgisistan' => 'KG',
|
||||
'Kiribati' => 'KI',
|
||||
'Kokosinseln' => 'CC',
|
||||
'Kolumbien' => 'CO',
|
||||
'Komoren' => 'KM',
|
||||
'Kongo' => 'CG',
|
||||
'Kongo, Demokratische Republik' => 'CD',
|
||||
'Kosovo' => 'KO',
|
||||
'Kroatien' => 'HR',
|
||||
'Kuba' => 'CU',
|
||||
'Kuwait' => 'KW',
|
||||
'Laos' => 'LA',
|
||||
'Lesotho' => 'LS',
|
||||
'Lettland' => 'LV',
|
||||
'Libanon' => 'LB',
|
||||
'Liberia' => 'LR',
|
||||
'Libyen' => 'LY',
|
||||
'Liechtenstein' => 'LI',
|
||||
'Litauen' => 'LT',
|
||||
'Luxemburg' => 'LU',
|
||||
'Macao' => 'MO',
|
||||
'Madagaskar' => 'MG',
|
||||
'Malawi' => 'MW',
|
||||
'Malaysia' => 'MY',
|
||||
'Malediven' => 'MV',
|
||||
'Mali' => 'ML',
|
||||
'Malta' => 'MT',
|
||||
'Marianen' => 'MP',
|
||||
'Marokko' => 'MA',
|
||||
'Marshall Inseln' => 'MH',
|
||||
'Martinique' => 'MQ',
|
||||
'Mauretanien' => 'MR',
|
||||
'Mauritius' => 'MU',
|
||||
'Mayotte' => 'YT',
|
||||
'Mazedonien' => 'MK',
|
||||
'Mexiko' => 'MX',
|
||||
'Mikronesien' => 'FM',
|
||||
'Mocambique' => 'MZ',
|
||||
'Moldavien' => 'MD',
|
||||
'Monaco' => 'MC',
|
||||
'Mongolei' => 'MN',
|
||||
'Montenegro' => 'ME',
|
||||
'Montserrat' => 'MS',
|
||||
'Namibia' => 'NA',
|
||||
'Nauru' => 'NR',
|
||||
'Nepal' => 'NP',
|
||||
'Neukaledonien' => 'NC',
|
||||
'Neuseeland' => 'NZ',
|
||||
'Nicaragua' => 'NI',
|
||||
'Niederlande' => 'NL',
|
||||
'Niederländische Antillen' => 'AN',
|
||||
'Niger' => 'NE',
|
||||
'Nigeria' => 'NG',
|
||||
'Niue' => 'NU',
|
||||
'Nord Korea' => 'KP',
|
||||
'Norfolk Inseln' => 'NF',
|
||||
'Norwegen' => 'NO',
|
||||
'Oman' => 'OM',
|
||||
'Österreich' => 'AT',
|
||||
'Pakistan' => 'PK',
|
||||
'Palästina' => 'PS',
|
||||
'Palau' => 'PW',
|
||||
'Panama' => 'PA',
|
||||
'Papua Neuguinea' => 'PG',
|
||||
'Paraguay' => 'PY',
|
||||
'Peru' => 'PE',
|
||||
'Philippinen' => 'PH',
|
||||
'Pitcairn' => 'PN',
|
||||
'Polen' => 'PL',
|
||||
'Portugal' => 'PT',
|
||||
'Puerto Rico' => 'PR',
|
||||
'Qatar' => 'QA',
|
||||
'Reunion' => 'RE',
|
||||
'Ruanda' => 'RW',
|
||||
'Rumänien' => 'RO',
|
||||
'Rußland' => 'RU',
|
||||
'Saint Lucia' => 'LC',
|
||||
'Sambia' => 'ZM',
|
||||
'Samoa' => 'AS',
|
||||
'Samoa' => 'WS',
|
||||
'San Marino' => 'SM',
|
||||
'Sao Tome' => 'ST',
|
||||
'Saudi Arabien' => 'SA',
|
||||
'Schweden' => 'SE',
|
||||
'Schweiz' => 'CH',
|
||||
'Senegal' => 'SN',
|
||||
'Serbien' => 'RS',
|
||||
'Seychellen' => 'SC',
|
||||
'Sierra Leone' => 'SL',
|
||||
'Singapur' => 'SG',
|
||||
'Slowakei -slowakische Republik-' => 'SK',
|
||||
'Slowenien' => 'SI',
|
||||
'Solomon Inseln' => 'SB',
|
||||
'Somalia' => 'SO',
|
||||
'South Georgia, South Sandwich Isl.' => 'GS',
|
||||
'Spanien' => 'ES',
|
||||
'Sri Lanka' => 'LK',
|
||||
'St. Helena' => 'SH',
|
||||
'St. Kitts Nevis Anguilla' => 'KN',
|
||||
'St. Pierre und Miquelon' => 'PM',
|
||||
'St. Vincent' => 'VC',
|
||||
'Süd Korea' => 'KR',
|
||||
'Südafrika' => 'ZA',
|
||||
'Sudan' => 'SD',
|
||||
'Surinam' => 'SR',
|
||||
'Svalbard und Jan Mayen Islands' => 'SJ',
|
||||
'Swasiland' => 'SZ',
|
||||
'Syrien' => 'SY',
|
||||
'Tadschikistan' => 'TJ',
|
||||
'Taiwan' => 'TW',
|
||||
'Tansania' => 'TZ',
|
||||
'Thailand' => 'TH',
|
||||
'Timor' => 'TP',
|
||||
'Togo' => 'TG',
|
||||
'Tokelau' => 'TK',
|
||||
'Tonga' => 'TO',
|
||||
'Trinidad Tobago' => 'TT',
|
||||
'Tschad' => 'TD',
|
||||
'Tschechische Republik' => 'CZ',
|
||||
'Tunesien' => 'TN',
|
||||
'Türkei' => 'TR',
|
||||
'Turkmenistan' => 'TM',
|
||||
'Turks und Kaikos Inseln' => 'TC',
|
||||
'Tuvalu' => 'TV',
|
||||
'Uganda' => 'UG',
|
||||
'Ukraine' => 'UA',
|
||||
'Ungarn' => 'HU',
|
||||
'Uruguay' => 'UY',
|
||||
'Usbekistan' => 'UZ',
|
||||
'Vanuatu' => 'VU',
|
||||
'Vatikan' => 'VA',
|
||||
'Venezuela' => 'VE',
|
||||
'Vereinigte Arabische Emirate' => 'AE',
|
||||
'Vereinigte Staaten von Amerika' => 'US',
|
||||
'Vietnam' => 'VN',
|
||||
'Virgin Island (Brit.)' => 'VG',
|
||||
'Virgin Island (USA)' => 'VI',
|
||||
'Wallis et Futuna' => 'WF',
|
||||
'Weißrußland' => 'BY',
|
||||
'Westsahara' => 'EH',
|
||||
'Zentralafrikanische Republik' => 'CF',
|
||||
'Zimbabwe' => 'ZW',
|
||||
'Zypern' => 'CY'
|
||||
);
|
||||
return $laender;
|
||||
}
|
||||
}
|
||||
|
||||
function GetLaender()
|
||||
{
|
||||
$laender = array(
|
||||
'Afghanistan' => 'AF',
|
||||
'Ägypten' => 'EG',
|
||||
'Albanien' => 'AL',
|
||||
'Algerien' => 'DZ',
|
||||
'Andorra' => 'AD',
|
||||
'Angola' => 'AO',
|
||||
'Anguilla' => 'AI',
|
||||
'Antarktis' => 'AQ',
|
||||
'Antigua und Barbuda' => 'AG',
|
||||
'Äquatorial Guinea' => 'GQ',
|
||||
'Argentinien' => 'AR',
|
||||
'Armenien' => 'AM',
|
||||
'Aruba' => 'AW',
|
||||
'Aserbaidschan' => 'AZ',
|
||||
'Äthiopien' => 'ET',
|
||||
'Australien' => 'AU',
|
||||
'Bahamas' => 'BS',
|
||||
'Bahrain' => 'BH',
|
||||
'Bangladesh' => 'BD',
|
||||
'Barbados' => 'BB',
|
||||
'Belgien' => 'BE',
|
||||
'Belize' => 'BZ',
|
||||
'Benin' => 'BJ',
|
||||
'Bermudas' => 'BM',
|
||||
'Bhutan' => 'BT',
|
||||
'Birma' => 'MM',
|
||||
'Bolivien' => 'BO',
|
||||
'Bosnien-Herzegowina' => 'BA',
|
||||
'Botswana' => 'BW',
|
||||
'Bouvet Inseln' => 'BV',
|
||||
'Brasilien' => 'BR',
|
||||
'Britisch-Indischer Ozean' => 'IO',
|
||||
'Brunei' => 'BN',
|
||||
'Bulgarien' => 'BG',
|
||||
'Burkina Faso' => 'BF',
|
||||
'Burundi' => 'BI',
|
||||
'Chile' => 'CL',
|
||||
'China' => 'CN',
|
||||
'Christmas Island' => 'CX',
|
||||
'Cook Inseln' => 'CK',
|
||||
'Costa Rica' => 'CR',
|
||||
'Dänemark' => 'DK',
|
||||
'Deutschland' => 'DE',
|
||||
'Djibuti' => 'DJ',
|
||||
'Dominika' => 'DM',
|
||||
'Dominikanische Republik' => 'DO',
|
||||
'Ecuador' => 'EC',
|
||||
'El Salvador' => 'SV',
|
||||
'Elfenbeinküste' => 'CI',
|
||||
'Eritrea' => 'ER',
|
||||
'Estland' => 'EE',
|
||||
'Falkland Inseln' => 'FK',
|
||||
'Färöer Inseln' => 'FO',
|
||||
'Fidschi' => 'FJ',
|
||||
'Finnland' => 'FI',
|
||||
'Frankreich' => 'FR',
|
||||
'Französisch Guyana' => 'GF',
|
||||
'Französisch Polynesien' => 'PF',
|
||||
'Französisches Süd-Territorium' => 'TF',
|
||||
'Gabun' => 'GA',
|
||||
'Gambia' => 'GM',
|
||||
'Georgien' => 'GE',
|
||||
'Ghana' => 'GH',
|
||||
'Gibraltar' => 'GI',
|
||||
'Grenada' => 'GD',
|
||||
'Griechenland' => 'GR',
|
||||
'Grönland' => 'GL',
|
||||
'Großbritannien' => 'UK',
|
||||
'Großbritannien (UK)' => 'GB',
|
||||
'Guadeloupe' => 'GP',
|
||||
'Guam' => 'GU',
|
||||
'Guatemala' => 'GT',
|
||||
'Guinea' => 'GN',
|
||||
'Guinea Bissau' => 'GW',
|
||||
'Guyana' => 'GY',
|
||||
'Haiti' => 'HT',
|
||||
'Heard und McDonald Islands' => 'HM',
|
||||
'Honduras' => 'HN',
|
||||
'Hong Kong' => 'HK',
|
||||
'Indien' => 'IN',
|
||||
'Indonesien' => 'ID',
|
||||
'Irak' => 'IQ',
|
||||
'Iran' => 'IR',
|
||||
'Irland' => 'IE',
|
||||
'Island' => 'IS',
|
||||
'Israel' => 'IL',
|
||||
'Italien' => 'IT',
|
||||
'Jamaika' => 'JM',
|
||||
'Japan' => 'JP',
|
||||
'Jemen' => 'YE',
|
||||
'Jordanien' => 'JO',
|
||||
'Jugoslawien' => 'YU',
|
||||
'Kaiman Inseln' => 'KY',
|
||||
'Kambodscha' => 'KH',
|
||||
'Kamerun' => 'CM',
|
||||
'Kanada' => 'CA',
|
||||
'Kap Verde' => 'CV',
|
||||
'Kasachstan' => 'KZ',
|
||||
'Kenia' => 'KE',
|
||||
'Kirgisistan' => 'KG',
|
||||
'Kiribati' => 'KI',
|
||||
'Kokosinseln' => 'CC',
|
||||
'Kolumbien' => 'CO',
|
||||
'Komoren' => 'KM',
|
||||
'Kongo' => 'CG',
|
||||
'Kongo, Demokratische Republik' => 'CD',
|
||||
'Kosovo' => 'KO',
|
||||
'Kroatien' => 'HR',
|
||||
'Kuba' => 'CU',
|
||||
'Kuwait' => 'KW',
|
||||
'Laos' => 'LA',
|
||||
'Lesotho' => 'LS',
|
||||
'Lettland' => 'LV',
|
||||
'Libanon' => 'LB',
|
||||
'Liberia' => 'LR',
|
||||
'Libyen' => 'LY',
|
||||
'Liechtenstein' => 'LI',
|
||||
'Litauen' => 'LT',
|
||||
'Luxemburg' => 'LU',
|
||||
'Macao' => 'MO',
|
||||
'Madagaskar' => 'MG',
|
||||
'Malawi' => 'MW',
|
||||
'Malaysia' => 'MY',
|
||||
'Malediven' => 'MV',
|
||||
'Mali' => 'ML',
|
||||
'Malta' => 'MT',
|
||||
'Marianen' => 'MP',
|
||||
'Marokko' => 'MA',
|
||||
'Marshall Inseln' => 'MH',
|
||||
'Martinique' => 'MQ',
|
||||
'Mauretanien' => 'MR',
|
||||
'Mauritius' => 'MU',
|
||||
'Mayotte' => 'YT',
|
||||
'Mazedonien' => 'MK',
|
||||
'Mexiko' => 'MX',
|
||||
'Mikronesien' => 'FM',
|
||||
'Mocambique' => 'MZ',
|
||||
'Moldavien' => 'MD',
|
||||
'Monaco' => 'MC',
|
||||
'Mongolei' => 'MN',
|
||||
'Montenegro' => 'ME',
|
||||
'Montserrat' => 'MS',
|
||||
'Namibia' => 'NA',
|
||||
'Nauru' => 'NR',
|
||||
'Nepal' => 'NP',
|
||||
'Neukaledonien' => 'NC',
|
||||
'Neuseeland' => 'NZ',
|
||||
'Nicaragua' => 'NI',
|
||||
'Niederlande' => 'NL',
|
||||
'Niederländische Antillen' => 'AN',
|
||||
'Niger' => 'NE',
|
||||
'Nigeria' => 'NG',
|
||||
'Niue' => 'NU',
|
||||
'Nord Korea' => 'KP',
|
||||
'Norfolk Inseln' => 'NF',
|
||||
'Norwegen' => 'NO',
|
||||
'Oman' => 'OM',
|
||||
'Österreich' => 'AT',
|
||||
'Pakistan' => 'PK',
|
||||
'Palästina' => 'PS',
|
||||
'Palau' => 'PW',
|
||||
'Panama' => 'PA',
|
||||
'Papua Neuguinea' => 'PG',
|
||||
'Paraguay' => 'PY',
|
||||
'Peru' => 'PE',
|
||||
'Philippinen' => 'PH',
|
||||
'Pitcairn' => 'PN',
|
||||
'Polen' => 'PL',
|
||||
'Portugal' => 'PT',
|
||||
'Puerto Rico' => 'PR',
|
||||
'Qatar' => 'QA',
|
||||
'Reunion' => 'RE',
|
||||
'Ruanda' => 'RW',
|
||||
'Rumänien' => 'RO',
|
||||
'Rußland' => 'RU',
|
||||
'Saint Lucia' => 'LC',
|
||||
'Sambia' => 'ZM',
|
||||
'Samoa' => 'AS',
|
||||
'Samoa' => 'WS',
|
||||
'San Marino' => 'SM',
|
||||
'Sao Tome' => 'ST',
|
||||
'Saudi Arabien' => 'SA',
|
||||
'Schweden' => 'SE',
|
||||
'Schweiz' => 'CH',
|
||||
'Senegal' => 'SN',
|
||||
'Serbien' => 'RS',
|
||||
'Seychellen' => 'SC',
|
||||
'Sierra Leone' => 'SL',
|
||||
'Singapur' => 'SG',
|
||||
'Slowakei -slowakische Republik-' => 'SK',
|
||||
'Slowenien' => 'SI',
|
||||
'Solomon Inseln' => 'SB',
|
||||
'Somalia' => 'SO',
|
||||
'South Georgia, South Sandwich Isl.' => 'GS',
|
||||
'Spanien' => 'ES',
|
||||
'Sri Lanka' => 'LK',
|
||||
'St. Helena' => 'SH',
|
||||
'St. Kitts Nevis Anguilla' => 'KN',
|
||||
'St. Pierre und Miquelon' => 'PM',
|
||||
'St. Vincent' => 'VC',
|
||||
'Süd Korea' => 'KR',
|
||||
'Südafrika' => 'ZA',
|
||||
'Sudan' => 'SD',
|
||||
'Surinam' => 'SR',
|
||||
'Svalbard und Jan Mayen Islands' => 'SJ',
|
||||
'Swasiland' => 'SZ',
|
||||
'Syrien' => 'SY',
|
||||
'Tadschikistan' => 'TJ',
|
||||
'Taiwan' => 'TW',
|
||||
'Tansania' => 'TZ',
|
||||
'Thailand' => 'TH',
|
||||
'Timor' => 'TP',
|
||||
'Togo' => 'TG',
|
||||
'Tokelau' => 'TK',
|
||||
'Tonga' => 'TO',
|
||||
'Trinidad Tobago' => 'TT',
|
||||
'Tschad' => 'TD',
|
||||
'Tschechische Republik' => 'CZ',
|
||||
'Tunesien' => 'TN',
|
||||
'Türkei' => 'TR',
|
||||
'Turkmenistan' => 'TM',
|
||||
'Turks und Kaikos Inseln' => 'TC',
|
||||
'Tuvalu' => 'TV',
|
||||
'Uganda' => 'UG',
|
||||
'Ukraine' => 'UA',
|
||||
'Ungarn' => 'HU',
|
||||
'Uruguay' => 'UY',
|
||||
'Usbekistan' => 'UZ',
|
||||
'Vanuatu' => 'VU',
|
||||
'Vatikan' => 'VA',
|
||||
'Venezuela' => 'VE',
|
||||
'Vereinigte Arabische Emirate' => 'AE',
|
||||
'Vereinigte Staaten von Amerika' => 'US',
|
||||
'Vietnam' => 'VN',
|
||||
'Virgin Island (Brit.)' => 'VG',
|
||||
'Virgin Island (USA)' => 'VI',
|
||||
'Wallis et Futuna' => 'WF',
|
||||
'Weißrußland' => 'BY',
|
||||
'Westsahara' => 'EH',
|
||||
'Zentralafrikanische Republik' => 'CF',
|
||||
'Zimbabwe' => 'ZW',
|
||||
'Zypern' => 'CY'
|
||||
);
|
||||
return $laender;
|
||||
}
|
||||
}
|
||||
}
|
||||
//ENDE
|
||||
|
||||
|
||||
if(empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
||||
if (empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
||||
$app = new app_t2();
|
||||
}
|
||||
if(empty($app->Conf)){
|
||||
}
|
||||
if (empty($app->Conf)) {
|
||||
$conf = new Config();
|
||||
$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);
|
||||
}
|
||||
if(empty($app->erp)){
|
||||
}
|
||||
if (empty($app->erp)) {
|
||||
$erp = new erpAPI($app);
|
||||
$app->erp = $erp;
|
||||
}
|
||||
$app->String = new WawiString();
|
||||
if(empty($app->remote)){
|
||||
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);
|
||||
}
|
||||
$app->String = new WawiString();
|
||||
if (empty($app->remote)) {
|
||||
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 {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
else{
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
}
|
||||
//$app->remote = new Remote($app);
|
||||
$app->Secure = new Secure($app);
|
||||
$app->User = new User($app);
|
||||
if(!defined('FPDF_FONTPATH')) {
|
||||
define('FPDF_FONTPATH',dirname(__DIR__).'/www/lib/pdf/font/');
|
||||
}
|
||||
|
||||
}
|
||||
//$app->remote = new Remote($app);
|
||||
$app->Secure = new Secure($app);
|
||||
$app->User = new User($app);
|
||||
if (!defined('FPDF_FONTPATH')) {
|
||||
define('FPDF_FONTPATH', dirname(__DIR__) . '/www/lib/pdf/font/');
|
||||
}
|
||||
|
||||
//ENDE
|
||||
|
||||
const MAXIMUM_NUMBER_OF_TRIES = 10;
|
||||
const MAXIMUM_NUMBER_OF_TRIES = 10;
|
||||
|
||||
$shops = $app->DB->SelectFirstCols(
|
||||
'SELECT id FROM shopexport WHERE auftragabgleich = 1 AND aktiv = 1 AND demomodus <> 1 AND sendonlywithtracking = 0'
|
||||
);
|
||||
if(empty($shops)) {
|
||||
$shops = $app->DB->SelectFirstCols(
|
||||
'SELECT id FROM shopexport WHERE auftragabgleich = 1 AND aktiv = 1 AND demomodus <> 1 AND sendonlywithtracking = 0'
|
||||
);
|
||||
if (empty($shops)) {
|
||||
return;
|
||||
}
|
||||
$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")) {
|
||||
}
|
||||
$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")) {
|
||||
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));
|
||||
$join = '';
|
||||
$where = '';
|
||||
$app->erp->RunHook('shop_rueckmeldung', 2, $join, $where);
|
||||
$subwhere = sprintf(' a.shop IN (%s) ', implode(',', $shops));
|
||||
$join = '';
|
||||
$where = '';
|
||||
$app->erp->RunHook('shop_rueckmeldung', 2, $join, $where);
|
||||
$sql = "SELECT DISTINCT a.id, a.shop
|
||||
FROM auftrag a
|
||||
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))
|
||||
)
|
||||
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
|
||||
ORDER BY a.id, l.id DESC, v.id DESC
|
||||
";
|
||||
@ -412,33 +408,33 @@ function GetLaender()
|
||||
$auftraege = $app->DB->SelectArr($sql);
|
||||
if(!empty($auftraege)) {
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter
|
||||
"UPDATE prozessstarter
|
||||
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
|
||||
WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1"
|
||||
);
|
||||
$auftragid = null;
|
||||
$countRequests = 0;
|
||||
foreach($auftraege as $auftrag) {
|
||||
if($auftrag['id'] != $auftragid) {
|
||||
$countRequests++;
|
||||
$auftragid = $auftrag['id'];
|
||||
$app->remote->RemoteUpdateAuftrag($auftrag['shop'], $auftrag['id']);
|
||||
if($countRequests % 10 === 0) {
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter
|
||||
foreach ($auftraege as $auftrag) {
|
||||
if ($auftrag['id'] != $auftragid) {
|
||||
$countRequests++;
|
||||
$auftragid = $auftrag['id'];
|
||||
$app->remote->RemoteUpdateAuftrag($auftrag['shop'], $auftrag['id']);
|
||||
if ($countRequests % 10 === 0) {
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter
|
||||
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
|
||||
WHERE parameter = 'shop_rueckmeldungen' AND aktiv = 1"
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
$query = $app->DB->Query(
|
||||
"SELECT a.id
|
||||
//Zahlungsstatus
|
||||
$query = $app->DB->Query(
|
||||
"SELECT a.id
|
||||
FROM `auftrag` AS `a`
|
||||
LEFT JOIN `rechnung` AS `r1` ON r1.id = a.rechnungid
|
||||
LEFT JOIN `rechnung` AS `r2` ON r2.auftragid = a.id
|
||||
@ -449,21 +445,22 @@ function GetLaender()
|
||||
AND (r1.zahlungsstatus = 'bezahlt' OR r2.zahlungsstatus = 'bezahlt') AND DATEDIFF(NOW(), a.datum) <= 28
|
||||
GROUP BY a.id
|
||||
LIMIT 1000"
|
||||
);
|
||||
if($query) {
|
||||
);
|
||||
if ($query) {
|
||||
$countRequests = 0;
|
||||
while($row = $app->DB->Fetch_Assoc($query)) {
|
||||
$app->erp->ImportUpdateZahlungsstatus($row['id']);
|
||||
$countRequests++;
|
||||
if($countRequests % 10 === 0) {
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter
|
||||
while ($row = $app->DB->Fetch_Assoc($query)) {
|
||||
$app->erp->ImportUpdateZahlungsstatus($row['id']);
|
||||
$countRequests++;
|
||||
if ($countRequests % 10 === 0) {
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter
|
||||
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
|
||||
WHERE parameter = 'shop_rueckmeldungen' AND aktiv = 1"
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
$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");
|
||||
|
@ -17869,6 +17869,23 @@ INSERT INTO `hook_register` (`hook_action`, `function`, `aktiv`, `position`, `ho
|
||||
;
|
||||
/* OpenXE 2024-02-03 für belegvorlagen */
|
||||
|
||||
/* OpenXE 2024-08-11 für TOTP */
|
||||
INSERT INTO `hook`(`name`, `aktiv`, `parametercount`, `alias`, `description`) VALUES
|
||||
('login_password_check_otp', 1, 3, '', '');
|
||||
|
||||
INSERT INTO `hook_register`(
|
||||
`hook_action`, `function`, `aktiv`, `position`, `hook`, `module`, `module_parameter`) VALUES
|
||||
( 0, 'TOTPCheckLogin', 1, 1, (SELECT id FROM hook WHERE NAME = 'login_password_check_otp' LIMIT 1), 'totp', 0);
|
||||
/* OpenXE 2024-08-11 für TOTP */
|
||||
|
||||
/* OpenXE 2024-08-11 für Smarty shopimport */
|
||||
INSERT INTO `hook` (`name`, `aktiv`, `parametercount`, `alias`, `description`) VALUES
|
||||
('ImportAuftragBefore', 1, 4, '', '');
|
||||
|
||||
INSERT INTO `hook_register` (`hook_action`, `function`, `aktiv`, `position`, `hook`, `module`, `module_parameter`) VALUES
|
||||
(0, 'ImportAuftragBeforeHook', 1, 1, (SELECT id FROM hook WHERE name = 'ImportAuftragBefore' LIMIT 1), 'onlineshops', 0);
|
||||
/* OpenXE 2024-08-11 für Smarty shopimport */
|
||||
|
||||
/*
|
||||
BelegPositionenButtons
|
||||
|
||||
|
@ -620,7 +620,7 @@ class TemplateParser {
|
||||
}
|
||||
}
|
||||
|
||||
if(count($this->VARARRAY)>0)
|
||||
if(!empty($this->VARARRAY))
|
||||
foreach($this->VARARRAY as $key=>$value)
|
||||
{
|
||||
if($key!="")
|
||||
|
@ -1938,8 +1938,17 @@ class YUI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->app->erp->RunHook('AARLGPositionenSprache', 6, $module, $id, $artikel_id, $sprache, $bezeichnung, $beschreibung);
|
||||
|
||||
// OpenXE artikel_texte
|
||||
$language = $this->app->erp->GetSpracheBeleg($module,$id);
|
||||
$sql = "SELECT * FROM artikel_texte WHERE artikel = '".$artikel_id."' AND sprache = '".$language."'";
|
||||
$uebersetzung = $this->app->DB->SelectRow($sql);
|
||||
if ($uebersetzung) {
|
||||
$bezeichnung = $uebersetzung['name'];
|
||||
$beschreibung = $uebersetzung['beschreibung'];
|
||||
}
|
||||
|
||||
$bezeichnung = $this->app->DB->real_escape_string($bezeichnung);
|
||||
$beschreibung = $this->app->DB->real_escape_string($beschreibung);
|
||||
|
||||
@ -5290,6 +5299,25 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
|
||||
)
|
||||
";
|
||||
}
|
||||
|
||||
if(isset($parameter['lieferadresse']) && !empty($parameter['lieferadresse'])) {
|
||||
$paramsArray[] = "
|
||||
(
|
||||
a.id IN
|
||||
(
|
||||
SELECT
|
||||
adresse
|
||||
FROM
|
||||
lieferadressen lfadr
|
||||
WHERE
|
||||
lfadr.name LIKE '%" . $parameter['lieferadresse'] . "%' OR
|
||||
lfadr.strasse LIKE '%" . $parameter['lieferadresse'] . "%' OR
|
||||
lfadr.plz LIKE '%" . $parameter['lieferadresse'] . "%' OR
|
||||
lfadr.ort LIKE '%" . $parameter['lieferadresse'] . "%'
|
||||
)
|
||||
)
|
||||
";
|
||||
}
|
||||
|
||||
if(isset($parameter['abteilung']) && !empty($parameter['abteilung'])) {
|
||||
$paramsArray[] = "a.abteilung LIKE '%".$parameter['abteilung']."%' ";
|
||||
@ -14131,24 +14159,18 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
|
||||
$action = $this->app->Secure->GetGET("action");
|
||||
$id = $this->app->Secure->GetGET("id");
|
||||
if($id)$this->app->Tpl->Set('ID',$id);
|
||||
if ($speichern != "") {
|
||||
$titel = $this->app->Secure->GetPOST("titel");
|
||||
$beschreibung = $this->app->Secure->GetPOST("beschreibung");
|
||||
$stichwort = $this->app->Secure->GetPOST("stichwort");
|
||||
$this->app->Tpl->Set('TITLE', $titel);
|
||||
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
|
||||
|
||||
if ($_FILES['upload']['tmp_name'] == "") {
|
||||
$this->app->Tpl->Set('ERROR', "<div class=\"info\">Bitte wählen Sie eine Datei aus und laden Sie diese herauf!</div>");
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
} else {
|
||||
|
||||
//$fileid = $this->app->erp->CreateDatei($_FILES['upload']['name'],$titel,$beschreibung,"",$_FILES['upload']['tmp_name'],$this->app->User->GetName());
|
||||
$this->app->erp->AddDateiVersion($datei, $this->app->User->GetName(), $_FILES['upload']['name'], "Neue Version", $_FILES['upload']['tmp_name']);
|
||||
header("Location: index.php?module=$module&action=$action&id=$id");
|
||||
exit;
|
||||
// Get files here
|
||||
if ($speichern != "") {
|
||||
$retval = $this->FilesFromUploadtoDMS(null, null, $datei);
|
||||
if ($retval !== true) {
|
||||
$this->app->Tpl->Set('ERROR', implode(', ',$retval));
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
} else {
|
||||
header("Location: index.php?module=$module&action=$action&id=$id");
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('STARTDISABLE', "<!--");
|
||||
$this->app->Tpl->Set('ENDEDISABLE', "-->");
|
||||
$this->app->Tpl->Parse($parsetarget, "datei_neudirekt.tpl");
|
||||
@ -14225,61 +14247,18 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
|
||||
$id = $this->app->Secure->GetGET("id");
|
||||
$sid = $this->app->Secure->GetGET("sid");
|
||||
if($id)$this->app->Tpl->Set('ID', $id);
|
||||
|
||||
// Get files here
|
||||
if ($speichern != "") {
|
||||
if($parameter == '')$parameter = $id;
|
||||
if(isset($_POST['dateiv']))
|
||||
{
|
||||
foreach($_POST['dateiv'] as $k => $v)
|
||||
{
|
||||
$name = $this->app->DB->real_escape_string($_POST['dateiname'][$k]);
|
||||
$titel = $this->app->DB->real_escape_string($_POST['dateititel'][$k]);
|
||||
$beschreibung = $this->app->DB->real_escape_string($_POST['beschreibung'][$k]);
|
||||
$stichwort = $this->app->DB->real_escape_string($_POST['dateistichwort'][$k]);
|
||||
|
||||
//$getMime = explode('.', $name);
|
||||
//$mime = end($getMime);
|
||||
|
||||
$data = explode(',', $v);
|
||||
|
||||
$encodedData = str_replace(' ','+',$data[1]);
|
||||
$decodedData = base64_decode($encodedData);
|
||||
|
||||
$this->app->Tpl->Set('TITLE', $titel);
|
||||
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
|
||||
|
||||
if ($v == "" ) {
|
||||
$this->app->Tpl->Set('ERROR', "<div class=\"error\">Keine Datei ausgewählt!</div>");
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
} else {
|
||||
$fileid = $this->app->erp->CreateDatei($name, $titel, $beschreibung, "", $decodedData, $this->app->User->GetName());
|
||||
|
||||
// stichwoerter hinzufuegen
|
||||
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
|
||||
}
|
||||
}
|
||||
if($_FILES['upload']['tmp_name'] == "")
|
||||
{
|
||||
header("Location: index.php?module=$_module&action=$_action&id=$id&sid=$sid".($typ!=''?"&typ=".$typ:''));
|
||||
}
|
||||
if($parameter == '') {
|
||||
$parameter = $id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$titel = $this->app->Secure->GetPOST("titel");
|
||||
$beschreibung = $this->app->Secure->GetPOST("beschreibung");
|
||||
$stichwort = $this->app->Secure->GetPOST("stichwort");
|
||||
$this->app->Tpl->Set('TITLE', $titel);
|
||||
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
|
||||
|
||||
if ($_FILES['upload']['tmp_name'] == "" && empty($_POST['dateiv'])) {
|
||||
$this->app->Tpl->Set('ERROR', "<div class=\"error\">Keine Datei ausgewählt!</div>");
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
} elseif($_FILES['upload']['tmp_name'] != '') {
|
||||
$fileid = $this->app->erp->CreateDatei($_FILES['upload']['name'], $titel, $beschreibung, "", $_FILES['upload']['tmp_name'], $this->app->User->GetName());
|
||||
|
||||
// stichwoerter hinzufuegen
|
||||
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
|
||||
header("Location: index.php?module=$_module&action=$_action&id=$id&sid=$sid".($typ!=''?"&typ=".$typ:''));
|
||||
$retval = $this->FilesFromUploadtoDMS($objekt, $parameter);
|
||||
if ($retval !== true) {
|
||||
$this->app->Tpl->Set('ERROR', implode(', ',$retval));
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
} else {
|
||||
header("Location: index.php?module=$_module&action=$_action&id=$id&sid=$sid".($typ!=''?"&typ=".$typ:''));
|
||||
}
|
||||
}
|
||||
|
||||
@ -14547,6 +14526,87 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Retrieve uploaded files and put them into DMS
|
||||
* $datei: given file, just add a new version
|
||||
* Return array of errors or true
|
||||
*/
|
||||
function FilesFromUploadtoDMS($objekt, $parameter, $datei = false) {
|
||||
|
||||
$retval = true;
|
||||
// Files come from drag'n'drop
|
||||
if(isset($_POST['dateiv']))
|
||||
{
|
||||
foreach($_POST['dateiv'] as $k => $v)
|
||||
{
|
||||
$name = $this->app->DB->real_escape_string($_POST['dateiname'][$k]);
|
||||
$titel = $this->app->DB->real_escape_string($_POST['dateititel'][$k]);
|
||||
$beschreibung = $this->app->DB->real_escape_string($_POST['dateibeschreibung'][$k]);
|
||||
$stichwort = $this->app->DB->real_escape_string($_POST['dateistichwort'][$k]);
|
||||
|
||||
$data = explode(',', $v);
|
||||
|
||||
$encodedData = str_replace(' ','+',$data[1]);
|
||||
$decodedData = base64_decode($encodedData);
|
||||
|
||||
$this->app->Tpl->Set('TITLE', $titel);
|
||||
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
|
||||
|
||||
if ($v == "" ) {
|
||||
$this->app->Tpl->Set('ERROR', "<div class=\"error\">Keine Datei ausgewählt!</div>");
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
} else {
|
||||
// Save file to disk first
|
||||
$tempfilename = rtrim($this->app->erp->GetTMP(), '/') . "/" . $name;
|
||||
if($handle = fopen($tempfilename, "wb")){
|
||||
fwrite($handle, $decodedData);
|
||||
fclose($handle);
|
||||
// Add file to DMS
|
||||
if ($datei) {
|
||||
$this->app->erp->AddDateiVersion($datei, $this->app->User->GetName(), $name, "Neue Version", $tempfilename);
|
||||
} else {
|
||||
$fileid = $this->app->erp->CreateDatei($name, $titel, $beschreibung, "", $tempfilename, $this->app->User->GetName());
|
||||
// stichwoerter hinzufuegen
|
||||
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
|
||||
}
|
||||
} else {
|
||||
if ($retval === true) {
|
||||
$retval = array();
|
||||
}
|
||||
$retval[] = "<div class=\"error\">Datei konnte nicht gespeichert werden: ".$name."</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
} // drag'n'drop
|
||||
// Single file comes from browse button
|
||||
else {
|
||||
$titel = $this->app->Secure->GetPOST("titel");
|
||||
$beschreibung = $this->app->Secure->GetPOST("beschreibung");
|
||||
$stichwort = $this->app->Secure->GetPOST("stichwort");
|
||||
$this->app->Tpl->Set('TITLE', $titel);
|
||||
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
|
||||
|
||||
if ($_FILES['upload']['tmp_name'] == "" && empty($_POST['dateiv'])) {
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
if ($retval === true) {
|
||||
$retval = array();
|
||||
}
|
||||
$retval[] = "<div class=\"error\">Keine Datei ausgewählt!</div>";
|
||||
|
||||
} elseif ($_FILES['upload']['tmp_name'] != '') {
|
||||
if ($datei) {
|
||||
$this->app->erp->AddDateiVersion($datei, $this->app->User->GetName(), $_FILES['upload']['name'], "Neue Version", $_FILES['upload']['tmp_name']);
|
||||
}
|
||||
else {
|
||||
$fileid = $this->app->erp->CreateDatei($_FILES['upload']['name'], $titel, $beschreibung, "", $_FILES['upload']['tmp_name'], $this->app->User->GetName());
|
||||
// stichwoerter hinzufuegen
|
||||
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
return($retval);
|
||||
}
|
||||
|
||||
function SortListAdd($parsetarget, &$ref, $menu, $sql, $sort = true) {
|
||||
|
||||
$module = $this->app->Secure->GetGET("module");
|
||||
|
@ -36,7 +36,7 @@ class PLACEHOLDER_MODULECLASSNAME {
|
||||
// columns that are aligned right (numbers etc)
|
||||
// $alignright = array(4,5,6,7,8);
|
||||
|
||||
$findcols = array('PLACEHOLDER_ID_COLUMN','PLACEHOLDER_ID_COLUMN',PLACEHOLDER_SQL_COLUMNS);
|
||||
$findcols = array('PLACEHOLDER_ID_COLUMN','PLACEHOLDER_ID_COLUMN',PLACEHOLDER_SQL_COLUMNS); // use 'null' for non-searchable columns
|
||||
$searchsql = array(PLACEHOLDER_SQL_COLUMNS);
|
||||
|
||||
$defaultorder = 1;
|
||||
@ -60,6 +60,8 @@ class PLACEHOLDER_MODULECLASSNAME {
|
||||
$count = "SELECT count(DISTINCT id) FROM PLACEHOLDER_MODULENAME WHERE $where";
|
||||
// $groupby = "";
|
||||
|
||||
// echo($sql." WHERE ".$where." ".$groupby);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -18196,7 +18196,7 @@
|
||||
},
|
||||
{
|
||||
"Field": "sprache",
|
||||
"Type": "varchar(11)",
|
||||
"Type": "varchar(30)",
|
||||
"Collation": "utf8mb3_general_ci",
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
@ -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"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
$version="OSS";
|
||||
$version_revision="1.11";
|
||||
$version_revision="1.12";
|
||||
$gitinfo = file_get_contents("../gitinfo.json");
|
||||
if (!empty($gitinfo)) {
|
||||
$gitinfo = json_decode($gitinfo);
|
||||
|
@ -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],
|
||||
|
@ -7095,155 +7095,138 @@ title: 'Abschicken',
|
||||
{
|
||||
// admin menu
|
||||
$menu = 0;
|
||||
|
||||
// ------ Stammdaten
|
||||
$navarray['menu']['admin'][++$menu]['first'] = array('Stammdaten','adresse','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Adressen','adresse','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Artikel','artikel','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Projekte','projekt','list');
|
||||
|
||||
// ------ Verkauf
|
||||
$navarray['menu']['admin'][++$menu]['first'] = array('Verkauf','auftrag','list');
|
||||
if($this->ModulVorhanden("anfrage")){
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Anfrage', 'anfrage', 'list');
|
||||
}
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Angebot'.($this->Firmendaten("bezeichnungangebotersatz") && $this->Firmendaten("bezeichnungangebotersatz") != 'Angebot'? ' / '.$this->Firmendaten("bezeichnungangebotersatz"):''),'angebot','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Auftrag','auftrag','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('POS','pos','list');
|
||||
|
||||
$navarray['menu']['admin'][++$menu]['first'] = array('Einkauf','auftrag','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Preisanfrage','preisanfrage','list');
|
||||
// ------ Beschaffung
|
||||
$navarray['menu']['admin'][++$menu]['first'] = array('Beschaffung','auftrag','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Bestellung','bestellung','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Bestellvorschlag','bestellvorschlag','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Erweiterter Bestellvorschlag','bestellvorschlagapp','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Preisanfrage','preisanfrage','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Produktion','produktion','list');
|
||||
|
||||
// ------ Logistik
|
||||
$navarray['menu']['admin'][++$menu]['first'] = array('Logistik','lager','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Wareneingang','wareneingang','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Lieferschein','lieferschein','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Versand','versandpakete','lieferungen');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Artikelkontingente','artikelkontingente','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Ein- und auslagern','lager','letztebewegungen');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Inventur','inventur','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Kommissionieraufkleber','kommissionieraufkleber','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Kommissionierung','kommissionierung','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Lagermindestmengen','lagermindestmengen','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Lagerverwaltung','lager','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Lieferschein','lieferschein','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Mindesthaltbarkeit','mhdwarning','list');
|
||||
if($this->ModulVorhanden('lagermobil')) {
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Mobile Lagerverwaltung','lagermobil','list');
|
||||
}
|
||||
if($this->ModulVorhanden('multiorderpicking')) {
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Multiorder-Picking','multiorderpicking','list');
|
||||
}
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Reservierung','lager','reservierungen');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Kommissionierung','kommissionierung','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Inventur','inventur','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Versandzentrum','versanderzeugen','offene');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Produktionszentrum','produktionszentrum','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Kommissionieraufkleber','kommissionieraufkleber','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Mindesthaltbarkeit','mhdwarning','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Lagermindestmengen','lagermindestmengen','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Artikelkontingente','artikelkontingente','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Ein- und auslagern','lager','letztebewegungen');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Reservierung','lager','reservierungen');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Versand','versandpakete','lieferungen');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Versandzentrum','versanderzeugen','offene');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Wareneingang','wareneingang','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Zwischenlager','lager','buchenzwischenlager');
|
||||
|
||||
// ------ Buchhaltung
|
||||
$navarray['menu']['admin'][++$menu]['first'] = array('Buchhaltung','rechnung','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Rechnungen','rechnung','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Zahlungseingang','zahlungseingang','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Reisekosten','reisekosten','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Arbeitsnachweis','arbeitsnachweis','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Gutschrift / '.$this->Firmendaten("bezeichnungstornorechnung"),'gutschrift','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Proformarechnung','proformarechnung','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Kontoauszüge','kontoauszuege','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Buchungen','fibu_buchungen','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Abolauf','rechnungslauf','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Mahnwesen','mahnwesen','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Abolauf','rechnungslauf','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Arbeitsnachweis','arbeitsnachweis','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Buchungen','fibu_buchungen','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Dokumenten Scanner','docscan','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Gutschriften / '.$this->Firmendaten("bezeichnungstornorechnung"),'gutschrift','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Kontoauszüge','kontoauszuege','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Lieferantengutschriften','lieferantengutschrift','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Mahnwesen','mahnwesen','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Proformarechnung','proformarechnung','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Rechnungen','rechnung','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Reisekosten','reisekosten','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Finanzbuchhaltung Export','buchhaltungexport','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Zahlungsverkehr','zahlungsverkehr','ueberweisung');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Verbandsabrechnungen','verband','offene');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Vertreterabrechnungen','vertreter','list');
|
||||
if($this->ModulVorhanden('provisionenartikelvertreter'))
|
||||
if ($this->ModulVorhanden('provisionenartikelvertreter'))
|
||||
{
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Provisionen','provisionenartikelvertreter','list');
|
||||
}else{
|
||||
} else {
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Provisionen','provisionenartikel','list');
|
||||
}
|
||||
|
||||
if($this->Firmendaten("modul_mlm")=="1"){
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Multilevel', 'multilevel', 'list');
|
||||
}
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Lohnabrechnung','lohnabrechnung','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Verbindlichkeiten','verbindlichkeit','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Lieferantengutschriften','lieferantengutschrift','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Kassenbuch','kasse','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Zahlungseingang','zahlungseingang','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Zahlungsverkehr','zahlungsverkehr','ueberweisung');
|
||||
|
||||
// ------ Controlling
|
||||
$navarray['menu']['admin'][++$menu]['first'] = array('Controlling','marketing','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Verkaufszahlen','verkaufszahlen','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Umsatzstatistik','umsatzstatistik','allgemein');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Statistiken','statistiken','dashboard');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Aktionscodes','aktionscodes','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Berichte','report','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Management Board','managementboard','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Aktionscodes','aktionscodes','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Statistiken','statistiken','dashboard');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Umsatzstatistik','umsatzstatistik','allgemein');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Verkaufszahlen','verkaufszahlen','list');
|
||||
|
||||
// ------ Verwaltung
|
||||
$navarray['menu']['admin'][++$menu]['first'] = array('Verwaltung','rechnung','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Ticketregeln','ticketregeln','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Zeitkonten','zeiterfassung','list');
|
||||
if(!$this->RechteVorhanden('mitarbeiterzeiterfassung','dashboard')){
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Antrag einreichen','mitarbeiterzeiterfassung','timemanagementrequest');
|
||||
}
|
||||
else{
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Mitarbeiterzeiterfassung','mitarbeiterzeiterfassung','dashboard');
|
||||
}
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Import/Export Zentrale','importvorlage','uebersicht');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Währungen','waehrungumrechnung','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Seriennummern','seriennummern','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Chargen','chargen','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('RMA Lieferungen','rma','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Service & Support','service','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Etikettendrucker','etikettendrucker','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Währungen','waehrungumrechnung','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Ticketregeln','ticketregeln','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Zeitkonten','zeiterfassung','list');
|
||||
|
||||
// ------ System
|
||||
$navarray['menu']['admin'][++$menu]['first'] = array('System','rechnung','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Einstellungen','einstellungen','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Online-Shops / Marktplätze','onlineshops','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Backup','backup','list','recover','delete','reset');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Upgrade','upgrade','list','recover','delete','reset');
|
||||
//$navarray['menu']['admin'][$menu]['sec'][] = array('AppStore','appstore','list');
|
||||
|
||||
// ------ Mein Bereich
|
||||
$navarray['menu']['admin'][++$menu]['first'] = array('Mein Bereich','welcome','main');
|
||||
$startseite = $this->app->DB->Select("SELECT startseite FROM user WHERE id='".$this->app->User->GetID()."' LIMIT 1");
|
||||
if($startseite!="")
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Meine Startseite','welcome','startseite');
|
||||
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Startseite','welcome','start');
|
||||
// $navarray['menu']['admin'][$menu]['sec'][] = array('Meine Apps','welcome','meineapps');
|
||||
if($this->app->User->GetType() === 'admin') {
|
||||
// $navarray['menu']['admin'][$menu]['sec'][] = ['Learning Dashboard', 'learningdashboard', 'list'];
|
||||
if($startseite!="") {
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Meine Startseite','welcome','startseite');
|
||||
}
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Tickets','ticket','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Kalender','kalender','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Pinnwand','welcome','pinwand');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Aufgaben','aufgaben','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('E-Mail','webmail','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Chat','chat','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Zeiterfassung','zeiterfassung','create');
|
||||
|
||||
// $navarray['menu']['admin'][$menu]['sec'][] = array('Stechuhr','stechuhr','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Wiedervorlage','wiedervorlage','list');
|
||||
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Wiki','wiki','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Interner Support', 'internalsupport', 'list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Einstellungen','welcome','settings');
|
||||
// $navarray['menu']['admin'][$menu]['sec'][] = array('Datenschutz', 'dataprotection','list');
|
||||
// $navarray['menu']['admin'][$menu]['sec'][] = array('Lizenz','appstore','buy');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('E-Mail','webmail','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Kalender','kalender','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Interner Support', 'internalsupport', 'list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Pinnwand','welcome','pinwand');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Startseite','welcome','start');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Tickets','ticket','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Wiedervorlage','wiedervorlage','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Wiki','wiki','list');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Zeiterfassung','zeiterfassung','create');
|
||||
$navarray['menu']['admin'][$menu]['sec'][] = array('Abmelden','welcome','logout');
|
||||
|
||||
return $this->CalculateNavigation($navarray);
|
||||
@ -16642,9 +16625,10 @@ function Gegenkonto($ust_befreit,$ustid='', $doctype = '', $doctypeId = 0)
|
||||
$check = $this->app->DB->Select("SELECT $key FROM adresse WHERE id='$adresse' LIMIT 1");
|
||||
if($check!=${$key})
|
||||
{
|
||||
$this->app->DB->Update("UPDATE adresse SET $key='".${$key}."' WHERE id='$adresse' LIMIT 1");
|
||||
$val = $this->app->DB->real_escape_string(${$key});
|
||||
$this->app->DB->Update("UPDATE adresse SET $key='$val' WHERE id='$adresse' LIMIT 1");
|
||||
$logfile = $this->app->DB->Select("SELECT `logfile` FROM adresse WHERE id='$adresse' LIMIT 1");
|
||||
$this->app->DB->Update("UPDATE adresse SET `logfile`='".$logfile." Update Feld $key alt:$check neu:".${$key}.";' WHERE id='$adresse' LIMIT 1");
|
||||
$this->app->DB->Update("UPDATE adresse SET `logfile`='".$logfile." Update Feld $key alt:$check neu:".$val.";' WHERE id='$adresse' LIMIT 1");
|
||||
}
|
||||
|
||||
}
|
||||
@ -17233,7 +17217,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)){
|
||||
@ -17745,6 +17729,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',
|
||||
@ -18708,16 +18695,24 @@ function CheckShopTabelle($artikel)
|
||||
$artikelporto = $artikelportoermaessigt;
|
||||
}
|
||||
|
||||
if(empty($artikelporto) && $this->app->DB->Select("SELECT portoartikelanlegen FROM shopexport WHERE id = '$shop' LIMIT 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){
|
||||
$this->app->DB->Update("UPDATE shopexport SET artikelporto = '$artikelporto' WHERE id = '$shop' AND artikelporto = 0 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)
|
||||
{
|
||||
$portoartikelarr = array('projekt'=>$projekt,'porto'=>1, 'lagerartikel'=>0,'name_de'=>'Porto','umsatzsteuer'=>'normal');
|
||||
$artikelporto = $this->app->erp->InsertUpdateArtikel($portoartikelarr);
|
||||
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");
|
||||
|
||||
$versandname = '';
|
||||
@ -19063,7 +19058,7 @@ function CheckShopTabelle($artikel)
|
||||
}
|
||||
}
|
||||
|
||||
return $auftrag;
|
||||
return array("status" => true, "$auftragid" => $auftrag);
|
||||
}
|
||||
|
||||
|
||||
@ -21058,7 +21053,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) {
|
||||
@ -21089,9 +21084,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}'
|
||||
@ -27594,6 +27589,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;
|
||||
@ -28068,7 +28073,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;
|
||||
|
||||
@ -28081,12 +28086,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;
|
||||
@ -28101,15 +28106,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 {
|
||||
@ -28131,10 +28136,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);
|
||||
@ -31297,15 +31303,15 @@ function Firmendaten($field,$projekt="")
|
||||
$variante_von = $this->app->DB->Select("SELECT variante_von FROM artikel WHERE id = '$artikel' LIMIT 1");
|
||||
if($variante_von)$beschreibung = $this->app->DB->real_escape_string($this->app->DB->Select("SELECT anabregs_text FROM artikel WHERE id='$variante_von' LIMIT 1"));
|
||||
}
|
||||
if($this->ModulVorhanden('artikel_texte')){
|
||||
if(array_key_exists($belegsprache,$adresssprachen)){
|
||||
|
||||
if(array_key_exists($belegsprache,$adresssprachen)){
|
||||
$belegsprache = $adresssprachen[$belegsprache];
|
||||
}
|
||||
$artikelbeschreibung = $this->app->DB->Select("SELECT beschreibung FROM artikel_texte WHERE artikel=$artikel AND sprache='$belegsprache'");
|
||||
if($artikelbeschreibung){
|
||||
$beschreibung = $artikelbeschreibung;
|
||||
}
|
||||
}
|
||||
$artikelbeschreibung = $this->app->DB->Select("SELECT beschreibung FROM artikel_texte WHERE artikel=$artikel AND sprache='$belegsprache'");
|
||||
if($artikelbeschreibung){
|
||||
$beschreibung = $artikelbeschreibung;
|
||||
}
|
||||
|
||||
}
|
||||
//$vpe = $this->app->DB->Select("SELECT vpe FROM verkaufspreise WHERE id='$verkauf' LIMIT 1");
|
||||
$sort = $this->app->DB->Select("SELECT MAX(sort) FROM ".$typ."_position WHERE $typ='$id' LIMIT 1");
|
||||
@ -31320,20 +31326,19 @@ function Firmendaten($field,$projekt="")
|
||||
if($this->app->DB->Select("SELECT adr.id FROM auftrag auf INNER JOIN adresse adr ON auf.adresse = adr.id AND adr.sprache = 'englisch' WHERE auf.id = '$id' LIMIT 1"))
|
||||
$name = $this->app->DB->Select("SELECT name_en FROM artikel WHERE id = '$artikel'");
|
||||
if($name === '')$name = $this->app->DB->Select("SELECT name_de FROM artikel WHERE id = '$artikel'");
|
||||
if($this->ModulVorhanden('artikel_texte')){
|
||||
if(array_key_exists($belegsprache,$adresssprachen)){
|
||||
|
||||
if(array_key_exists($belegsprache,$adresssprachen)){
|
||||
$belegsprache = $adresssprachen[$belegsprache];
|
||||
}
|
||||
$artikelbezeichnung = $this->app->DB->Select(
|
||||
}
|
||||
$artikelbezeichnung = $this->app->DB->Select(
|
||||
"SELECT name
|
||||
FROM artikel_texte
|
||||
WHERE artikel=$artikel AND sprache='$belegsprache'
|
||||
ORDER BY name <> '' DESC
|
||||
LIMIT 1"
|
||||
);
|
||||
if($artikelbezeichnung){
|
||||
);
|
||||
if($artikelbezeichnung){
|
||||
$name = $artikelbezeichnung;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -37456,7 +37461,8 @@ function Firmendaten($field,$projekt="")
|
||||
SELECT dv.datei AS datei
|
||||
FROM datei_stichwoerter AS ds
|
||||
JOIN (SELECT datei, MAX(id) AS id FROM datei_version GROUP BY datei) AS dv ON dv.datei = ds.datei
|
||||
WHERE ds.objekt LIKE 'Artikel' AND
|
||||
JOIN datei AS d on ds.datei = d.id
|
||||
WHERE ds.objekt LIKE 'Artikel' AND d.geloescht = 0 AND
|
||||
ds.parameter = '%d' AND
|
||||
(ds.subjekt LIKE 'Shopbild' OR ds.subjekt LIKE 'Druckbild' OR ds.subjekt LIKE 'Bild')
|
||||
ORDER BY ds.subjekt LIKE 'Shopbild' DESC, ds.subjekt LIKE 'Druckbild' DESC, ds.sort
|
||||
@ -38124,7 +38130,7 @@ function Firmendaten($field,$projekt="")
|
||||
$sql_erweiterung = '';
|
||||
if(!empty($gruppenarr))
|
||||
{
|
||||
$sql_erweiterung .= ' OR v.gruppe IN ('.implode(' ', $gruppenarr).') ';
|
||||
$sql_erweiterung .= ' OR v.gruppe IN ('.implode(', ', $gruppenarr).') ';
|
||||
}
|
||||
if(!$guenstigste_vk) {
|
||||
$vkarr = $this->app->DB->SelectArr("SELECT * FROM verkaufspreise v WHERE v.ab_menge <= '$menge' AND
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -62,6 +62,9 @@ abstract class Versanddienstleister
|
||||
$auftragId = $this->app->DB->Select("SELECT auftragid FROM rechnung WHERE id=$rechnungId LIMIT 1");
|
||||
|
||||
if ($sid === 'rechnung' || $sid === 'lieferschein' || $sid === 'adresse') {
|
||||
|
||||
$ret['addresstype'] = 0; // 0 = firma, 1 = packstation, 2 = postfiliale, 3 = privatadresse
|
||||
|
||||
$docArr = $this->app->DB->SelectRow("SELECT * FROM `$sid` WHERE id = $id LIMIT 1");
|
||||
$ret['addressId'] = $docArr['adresse'];
|
||||
$ret['auftragId'] = $auftragId;
|
||||
@ -73,12 +76,28 @@ abstract class Versanddienstleister
|
||||
|
||||
$ret['original'] = array_filter($docArr, fn($key) => in_array($key, $addressfields), ARRAY_FILTER_USE_KEY);
|
||||
|
||||
$ret['name'] = empty(trim($docArr['ansprechpartner'])) ? trim($docArr['name']) : trim($docArr['ansprechpartner']);
|
||||
$ret['name2'] = !empty(trim($docArr['ansprechpartner'])) ? trim($docArr['name']) : '';
|
||||
$ret['name3'] = join(';', array_filter([
|
||||
$docArr['abteilung'],
|
||||
$docArr['unterabteilung']
|
||||
], fn(string $item) => !empty(trim($item))));
|
||||
if ($docArr['typ'] == "firma") {
|
||||
$ret['company_name'] = $docArr['name'];
|
||||
$ret['addresstype'] = 0;
|
||||
} else {
|
||||
$ret['addresstype'] = 3;
|
||||
}
|
||||
|
||||
$ret['contact_name'] = $docArr['ansprechpartner'];
|
||||
|
||||
$ret['company_division'] = join(
|
||||
';',
|
||||
array_filter(
|
||||
[
|
||||
$docArr['abteilung'],
|
||||
$docArr['unterabteilung']
|
||||
],
|
||||
fn(string $item) => !empty(trim($item))
|
||||
)
|
||||
);
|
||||
|
||||
$ret['name'] = $docArr['name'];
|
||||
|
||||
$ret['address2'] = $docArr['adresszusatz'];
|
||||
|
||||
$ret['city'] = $docArr['ort'];
|
||||
@ -86,7 +105,6 @@ abstract class Versanddienstleister
|
||||
$ret['country'] = $docArr['land'];
|
||||
$ret['phone'] = $docArr['telefon'];
|
||||
$ret['email'] = $docArr['email'];
|
||||
$ret['addresstype'] = 0;
|
||||
|
||||
$strasse = trim($docArr['strasse']);
|
||||
$ret['streetwithnumber'] = $strasse;
|
||||
|
@ -1,235 +1,236 @@
|
||||
<?php
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class AdressstammblattPDF extends Dokumentenvorlage {
|
||||
public $doctype;
|
||||
|
||||
function __construct($app,$projekt="")
|
||||
{
|
||||
$this->app=$app;
|
||||
//parent::Dokumentenvorlage();
|
||||
$this->doctype="adresse";
|
||||
$this->doctypeOrig="Adressstammblatt";
|
||||
parent::__construct($this->app,$projekt);
|
||||
}
|
||||
|
||||
public function renderDocument() {
|
||||
// prepare page details
|
||||
SuperFPDF::__construct('P','mm','A4');
|
||||
|
||||
|
||||
$this->AddPage();
|
||||
$this->SetDisplayMode("real","single");
|
||||
|
||||
$this->SetMargins(15,50);
|
||||
$this->SetAutoPageBreak(true,40);
|
||||
$this->AliasNbPages('{nb}');
|
||||
|
||||
|
||||
// Bei Adressstammblatt immer oben beginnen
|
||||
$this->abstand_betreffzeileoben=0;
|
||||
$this->logofile = "";//$this->app->erp->GetTMP()."/".$this->app->Conf->WFdbname."_logo.jpg";
|
||||
$this->briefpapier="";
|
||||
|
||||
|
||||
$schrift = $this->app->erp->Firmendaten('schriftgroesse');
|
||||
|
||||
$this->SetFontSize($schrift);
|
||||
$this->SetFont($this->GetFont(),'','10');
|
||||
$this->SetX($this->GetX()+160);
|
||||
$this->Cell(10,0,date("d.m.Y"),"","","L");
|
||||
|
||||
$this->renderDoctype();
|
||||
|
||||
$adresse = $this->app->DB->SelectArr("SELECT * FROM adresse WHERE id='".$this->id."'");
|
||||
$adresse = reset($adresse);
|
||||
|
||||
if($adresse['typ']=="firma")
|
||||
{
|
||||
$infofields[]=array("Firma",$adresse['name']);
|
||||
if($adresse['ansprechpartner']!="")
|
||||
$infofields[]=array("Ansprechpartner",$adresse['ansprechpartner']);
|
||||
} else {
|
||||
$infofields[]=array("Name",$adresse['name']);
|
||||
}
|
||||
|
||||
$infofields[]=array("Anschrift",$adresse['land']."-".$adresse['plz']." ".$adresse['ort'].", ".$adresse['strasse']);
|
||||
|
||||
$felder = array('telefon','telefax','mobil','email','web');
|
||||
foreach($felder as $feldname)
|
||||
{
|
||||
$infofields[]=array(ucfirst($feldname),$adresse[$feldname=='web'?'internetseite':$feldname]);
|
||||
}
|
||||
|
||||
|
||||
if($this->app->erp->Firmendaten("modul_mlm")==1)
|
||||
{
|
||||
$mlmvertragsbeginn = $this->app->DB->Select("SELECT DATE_FORMAT(mlmvertragsbeginn,'%d.%m.%Y') FROM adresse WHERE id='".$adresse['id']."' LIMIT 1");
|
||||
if($mlmvertragsbeginn=="00.00.0000") $mlmvertragsbeginn = "kein Vertragsbeginn eingestellt";
|
||||
$sponsorid = $this->app->DB->Select("SELECT sponsor FROM adresse WHERE id='".$adresse['id']."' LIMIT 1");
|
||||
if($sponsorid> 0)
|
||||
$sponsor = $this->app->DB->Select("SELECT CONCAT(kundennummer,' ',name) FROM adresse WHERE id='$sponsorid' LIMIT 1");
|
||||
else
|
||||
$sponsor = "Kein Sponsor vorhanden";
|
||||
|
||||
$erfasstam = $this->app->DB->Select("SELECT DATE_FORMAT(zeitstempel,'%d.%m.%Y') FROM objekt_protokoll WHERE objekt='adresse' AND objektid='".$adresse['id']."' AND action_long='adresse_create' LIMIT 1");
|
||||
|
||||
$infofields[]=array("Sponsor",$sponsor);
|
||||
$infofields[]=array("Erfasst am",$erfasstam);
|
||||
$infofields[]=array("Vertragsbeginn am",$mlmvertragsbeginn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$infofields[]=array("UST-ID",$adresse['ustid']);
|
||||
|
||||
|
||||
if($adresse['kundennummer']!="")
|
||||
$numbers[] = array("Kunden Nr.",$adresse['kundennummer']);
|
||||
|
||||
if($adresse['lieferantennummer']!="")
|
||||
$numbers[] = array("Lieferanten Nr.",$adresse['lieferantennummer']);
|
||||
|
||||
if($adresse['mitarbeiternummer']!="")
|
||||
$numbers[] = array("Mitarbeiter Nr.",$adresse['mitarbeiternummer']);
|
||||
|
||||
if(count($numbers)>0)
|
||||
$this->renderInfoBox($numbers);
|
||||
|
||||
$this->Ln(5);
|
||||
$this->renderHeading("Adressstammblatt",8);
|
||||
$this->renderInfoBox($infofields);
|
||||
|
||||
|
||||
|
||||
$ansprechpartner_tmp = $this->app->DB->SelectArr("SELECT CONCAT(name,', ',if(bereich='','-',bereich),
|
||||
', Telefon: ',telefon,
|
||||
', Mobil: ',mobil,
|
||||
', E-Mail: ',email
|
||||
) as 'value' FROM ansprechpartner WHERE adresse='".$adresse['id']."'");
|
||||
|
||||
for($i=0;$i<count($ansprechpartner_tmp);$i++) $ansprechpartner[] = $ansprechpartner_tmp[$i]['value'];
|
||||
if(count($ansprechpartner) > 0)
|
||||
{
|
||||
$this->Ln(5);
|
||||
$this->renderHeading("Ansprechpartner",8);
|
||||
$this->renderInfoBoxSingle($ansprechpartner);
|
||||
}
|
||||
|
||||
$lieferadressen_tmp = $this->app->DB->SelectArr("SELECT name,abteilung,unterabteilung,adresszusatz,strasse,plz,ort,land,
|
||||
telefon,email
|
||||
FROM lieferadressen WHERE adresse='".$adresse['id']."' ORDER by standardlieferadresse DESC");
|
||||
|
||||
for($i=0;$i<count($lieferadressen_tmp);$i++) {
|
||||
$lieferadressen_tmp[$i]['value']="";
|
||||
foreach($lieferadressen_tmp[$i] as $key=>$value)
|
||||
{
|
||||
switch($key)
|
||||
{
|
||||
case "email":
|
||||
$lieferadressen_tmp[$i]['value'] .= "E-Mail: $value, ";
|
||||
break;
|
||||
|
||||
case "telefon":
|
||||
$lieferadressen_tmp[$i]['value'] .= "Telefon: $value, ";
|
||||
break;
|
||||
case "telefax":
|
||||
$lieferadressen_tmp[$i]['value'] .= "Telefax: $value, ";
|
||||
break;
|
||||
|
||||
default:
|
||||
if($value!="")
|
||||
$lieferadressen_tmp[$i]['value'] .= "$value, ";
|
||||
}
|
||||
}
|
||||
|
||||
$lieferadressen_tmp[$i]['value'] = trim($lieferadressen_tmp[$i]['value'],', ');
|
||||
if($i==0) $standard = " (Standard)"; else $standard="";
|
||||
|
||||
$lieferadressen[] = $lieferadressen_tmp[$i]['value'].$standard;
|
||||
}
|
||||
|
||||
if(count($lieferadressen) > 0)
|
||||
{
|
||||
$this->Ln(5);
|
||||
$this->renderHeading("Lieferadressen",8);
|
||||
$this->renderInfoBoxSingle($lieferadressen);
|
||||
}
|
||||
|
||||
|
||||
$this->Ln(5);
|
||||
|
||||
if($adresse['sonstiges']!="")
|
||||
{
|
||||
$this->renderHeading("Sonstiges",8);
|
||||
$this->SetFont($this->GetFont(),'',7);
|
||||
$this->MultiCell(180,4,$this->WriteHTML($adresse['sonstiges']));
|
||||
}
|
||||
|
||||
$this->renderFooter();
|
||||
}
|
||||
|
||||
|
||||
function GetAdressstammblatt($id,$info="",$extrafreitext="")
|
||||
{
|
||||
$this->id = $id;
|
||||
// das muss vom reisekosten sein!!!!
|
||||
//$this->setRecipientLieferadresse($id,"reisekosten");
|
||||
|
||||
// OfferNo, customerId, OfferDate
|
||||
/*$auftrag = $this->app->DB->Select("SELECT auftragid FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$auftrag = $this->app->DB->Select("SELECT belegnr FROM auftrag WHERE id='$auftrag' LIMIT 1");
|
||||
$bearbeiter = $this->app->DB->Select("SELECT bearbeiter FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$prefix = $this->app->DB->Select("SELECT prefix FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$bestellbestaetigung = $this->app->DB->Select("SELECT bestellbestaetigung FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->datum = $this->app->DB->Select("SELECT DATE_FORMAT(datum,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
|
||||
$this->von = $this->app->DB->Select("SELECT DATE_FORMAT(von,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->bis = $this->app->DB->Select("SELECT DATE_FORMAT(bis,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->von_zeit = $this->app->DB->Select("SELECT von_zeit FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->bis_zeit = $this->app->DB->Select("SELECT bis_zeit FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$belegnr = $this->app->DB->Select("SELECT belegnr FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->anlass = $this->app->DB->Select("SELECT anlass FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->freitext = $this->app->DB->Select("SELECT freitext FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$projekt = $this->app->DB->Select("SELECT projekt FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$mitarbeiter = $this->app->DB->Select("SELECT mitarbeiter FROM reisekosten WHERE id='$id' LIMIT 1");*/
|
||||
$kunde= $this->app->DB->SelectArr("SELECT name,kundennummer,lieferantennummer FROM adresse WHERE id='$id' LIMIT 1");
|
||||
$kunde = reset($kunde);
|
||||
|
||||
$kundennummer = $kunde['kundennummer'];
|
||||
$this->name = $kunde['name'];
|
||||
|
||||
$this->projektabkuerzung = $this->app->DB->Select("SELECT abkuerzung FROM projekt WHERE id='$projekt'");
|
||||
$this->firmenname = $this->app->erp->Firmendaten('name');
|
||||
$this->doctypeOrig="Adresse: ".$kunde['name'];
|
||||
$this->barcode=$belegnr;
|
||||
|
||||
//$ohne_briefpapier = $this->app->DB->Select("SELECT ohne_briefpapier FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
|
||||
|
||||
|
||||
|
||||
//$artikel = $this->app->DB->SelectArr("SELECT *,DATE_FORMAT(datum,'%d.%m.%Y') as datum, CONCAT(rk.nummer,'- ',rk.beschreibung) as reisekostenart FROM reisekosten_position rp LEFT JOIN reisekostenart rk ON rk.id=rp.reisekostenart WHERE rp.reisekosten='$id' ORDER By rp.sort");
|
||||
|
||||
//$waehrung = $this->app->DB->Select("SELECT waehrung FROM reisekosten_position WHERE reisekosten='$id' LIMIT 1");
|
||||
|
||||
/* Dateiname */
|
||||
$this->filename = date('Ymd')."_STAMMDATEN_ADRESSE_".$this->app->erp->Dateinamen($kunde['name']).".pdf";
|
||||
|
||||
$this->setBarcode($id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
<?php
|
||||
class AdressstammblattPDF extends Dokumentenvorlage {
|
||||
public $doctype;
|
||||
|
||||
function __construct($app,$projekt="")
|
||||
{
|
||||
$this->app=$app;
|
||||
//parent::Dokumentenvorlage();
|
||||
$this->doctype="adresse";
|
||||
$this->table="adresse";
|
||||
$this->doctypeOrig="Adressstammblatt";
|
||||
parent::__construct($this->app,$projekt);
|
||||
}
|
||||
|
||||
public function renderDocument() {
|
||||
// prepare page details
|
||||
SuperFPDF::__construct('P','mm','A4');
|
||||
|
||||
|
||||
$this->AddPage();
|
||||
$this->SetDisplayMode("real","single");
|
||||
|
||||
$this->SetMargins(15,50);
|
||||
$this->SetAutoPageBreak(true,40);
|
||||
$this->AliasNbPages('{nb}');
|
||||
|
||||
|
||||
// Bei Adressstammblatt immer oben beginnen
|
||||
$this->abstand_betreffzeileoben=0;
|
||||
$this->logofile = "";//$this->app->erp->GetTMP()."/".$this->app->Conf->WFdbname."_logo.jpg";
|
||||
$this->briefpapier="";
|
||||
|
||||
|
||||
$schrift = $this->app->erp->Firmendaten('schriftgroesse');
|
||||
|
||||
$this->SetFontSize($schrift);
|
||||
$this->SetFont($this->GetFont(),'','10');
|
||||
$this->SetX($this->GetX()+160);
|
||||
$this->Cell(10,0,date("d.m.Y"),"","","L");
|
||||
|
||||
$this->renderDoctype();
|
||||
|
||||
$adresse = $this->app->DB->SelectArr("SELECT * FROM adresse WHERE id='".$this->id."'");
|
||||
$adresse = reset($adresse);
|
||||
|
||||
if($adresse['typ']=="firma")
|
||||
{
|
||||
$infofields[]=array("Firma",$adresse['name']);
|
||||
if($adresse['ansprechpartner']!="")
|
||||
$infofields[]=array("Ansprechpartner",$adresse['ansprechpartner']);
|
||||
} else {
|
||||
$infofields[]=array("Name",$adresse['name']);
|
||||
}
|
||||
|
||||
$infofields[]=array("Anschrift",$adresse['land']."-".$adresse['plz']." ".$adresse['ort'].", ".$adresse['strasse']);
|
||||
|
||||
$felder = array('telefon','telefax','mobil','email','web');
|
||||
foreach($felder as $feldname)
|
||||
{
|
||||
$infofields[]=array(ucfirst($feldname),$adresse[$feldname=='web'?'internetseite':$feldname]);
|
||||
}
|
||||
|
||||
|
||||
if($this->app->erp->Firmendaten("modul_mlm")==1)
|
||||
{
|
||||
$mlmvertragsbeginn = $this->app->DB->Select("SELECT DATE_FORMAT(mlmvertragsbeginn,'%d.%m.%Y') FROM adresse WHERE id='".$adresse['id']."' LIMIT 1");
|
||||
if($mlmvertragsbeginn=="00.00.0000") $mlmvertragsbeginn = "kein Vertragsbeginn eingestellt";
|
||||
$sponsorid = $this->app->DB->Select("SELECT sponsor FROM adresse WHERE id='".$adresse['id']."' LIMIT 1");
|
||||
if($sponsorid> 0)
|
||||
$sponsor = $this->app->DB->Select("SELECT CONCAT(kundennummer,' ',name) FROM adresse WHERE id='$sponsorid' LIMIT 1");
|
||||
else
|
||||
$sponsor = "Kein Sponsor vorhanden";
|
||||
|
||||
$erfasstam = $this->app->DB->Select("SELECT DATE_FORMAT(zeitstempel,'%d.%m.%Y') FROM objekt_protokoll WHERE objekt='adresse' AND objektid='".$adresse['id']."' AND action_long='adresse_create' LIMIT 1");
|
||||
|
||||
$infofields[]=array("Sponsor",$sponsor);
|
||||
$infofields[]=array("Erfasst am",$erfasstam);
|
||||
$infofields[]=array("Vertragsbeginn am",$mlmvertragsbeginn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$infofields[]=array("UST-ID",$adresse['ustid']);
|
||||
|
||||
|
||||
if($adresse['kundennummer']!="")
|
||||
$numbers[] = array("Kunden Nr.",$adresse['kundennummer']);
|
||||
|
||||
if($adresse['lieferantennummer']!="")
|
||||
$numbers[] = array("Lieferanten Nr.",$adresse['lieferantennummer']);
|
||||
|
||||
if($adresse['mitarbeiternummer']!="")
|
||||
$numbers[] = array("Mitarbeiter Nr.",$adresse['mitarbeiternummer']);
|
||||
|
||||
if($numbers?count($numbers):0>0)
|
||||
$this->renderInfoBox($numbers);
|
||||
|
||||
$this->Ln(5);
|
||||
$this->renderHeading("Adressstammblatt",8);
|
||||
$this->renderInfoBox($infofields);
|
||||
|
||||
|
||||
|
||||
$ansprechpartner_tmp = $this->app->DB->SelectArr("SELECT CONCAT(name,', ',if(bereich='','-',bereich),
|
||||
', Telefon: ',telefon,
|
||||
', Mobil: ',mobil,
|
||||
', E-Mail: ',email
|
||||
) as 'value' FROM ansprechpartner WHERE adresse='".$adresse['id']."'");
|
||||
|
||||
for($i=0;$i<($ansprechpartner_tmp?count($ansprechpartner_tmp):0);$i++) $ansprechpartner[] = $ansprechpartner_tmp[$i]['value'];
|
||||
if($ansprechpartner_tmp?count($ansprechpartner):0 > 0)
|
||||
{
|
||||
$this->Ln(5);
|
||||
$this->renderHeading("Ansprechpartner",8);
|
||||
$this->renderInfoBoxSingle($ansprechpartner);
|
||||
}
|
||||
|
||||
$lieferadressen_tmp = $this->app->DB->SelectArr("SELECT name,abteilung,unterabteilung,adresszusatz,strasse,plz,ort,land,
|
||||
telefon,email
|
||||
FROM lieferadressen WHERE adresse='".$adresse['id']."' ORDER by standardlieferadresse DESC");
|
||||
|
||||
for($i=0;$i<($lieferadressen_tmp?count($lieferadressen_tmp):0);$i++) {
|
||||
$lieferadressen_tmp[$i]['value']="";
|
||||
foreach($lieferadressen_tmp[$i] as $key=>$value)
|
||||
{
|
||||
switch($key)
|
||||
{
|
||||
case "email":
|
||||
$lieferadressen_tmp[$i]['value'] .= "E-Mail: $value, ";
|
||||
break;
|
||||
|
||||
case "telefon":
|
||||
$lieferadressen_tmp[$i]['value'] .= "Telefon: $value, ";
|
||||
break;
|
||||
case "telefax":
|
||||
$lieferadressen_tmp[$i]['value'] .= "Telefax: $value, ";
|
||||
break;
|
||||
|
||||
default:
|
||||
if($value!="")
|
||||
$lieferadressen_tmp[$i]['value'] .= "$value, ";
|
||||
}
|
||||
}
|
||||
|
||||
$lieferadressen_tmp[$i]['value'] = trim($lieferadressen_tmp[$i]['value'],', ');
|
||||
if($i==0) $standard = " (Standard)"; else $standard="";
|
||||
|
||||
$lieferadressen[] = $lieferadressen_tmp[$i]['value'].$standard;
|
||||
}
|
||||
|
||||
if($lieferadressen?count($lieferadressen):0 > 0)
|
||||
{
|
||||
$this->Ln(5);
|
||||
$this->renderHeading("Lieferadressen",8);
|
||||
$this->renderInfoBoxSingle($lieferadressen);
|
||||
}
|
||||
|
||||
|
||||
$this->Ln(5);
|
||||
|
||||
if($adresse['sonstiges']!="")
|
||||
{
|
||||
$this->renderHeading("Sonstiges",8);
|
||||
$this->SetFont($this->GetFont(),'',7);
|
||||
$this->MultiCell(180,4,$this->WriteHTML($adresse['sonstiges']));
|
||||
}
|
||||
|
||||
$this->renderFooter();
|
||||
}
|
||||
|
||||
|
||||
function GetAdressstammblatt($id,$info="",$extrafreitext="")
|
||||
{
|
||||
$this->id = $id;
|
||||
// das muss vom reisekosten sein!!!!
|
||||
//$this->setRecipientLieferadresse($id,"reisekosten");
|
||||
|
||||
// OfferNo, customerId, OfferDate
|
||||
/*$auftrag = $this->app->DB->Select("SELECT auftragid FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$auftrag = $this->app->DB->Select("SELECT belegnr FROM auftrag WHERE id='$auftrag' LIMIT 1");
|
||||
$bearbeiter = $this->app->DB->Select("SELECT bearbeiter FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$prefix = $this->app->DB->Select("SELECT prefix FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$bestellbestaetigung = $this->app->DB->Select("SELECT bestellbestaetigung FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->datum = $this->app->DB->Select("SELECT DATE_FORMAT(datum,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
|
||||
$this->von = $this->app->DB->Select("SELECT DATE_FORMAT(von,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->bis = $this->app->DB->Select("SELECT DATE_FORMAT(bis,'%d.%m.%Y') FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->von_zeit = $this->app->DB->Select("SELECT von_zeit FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->bis_zeit = $this->app->DB->Select("SELECT bis_zeit FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$belegnr = $this->app->DB->Select("SELECT belegnr FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->anlass = $this->app->DB->Select("SELECT anlass FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$this->freitext = $this->app->DB->Select("SELECT freitext FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$projekt = $this->app->DB->Select("SELECT projekt FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
$mitarbeiter = $this->app->DB->Select("SELECT mitarbeiter FROM reisekosten WHERE id='$id' LIMIT 1");*/
|
||||
$kunde= $this->app->DB->SelectArr("SELECT name,kundennummer,lieferantennummer FROM adresse WHERE id='$id' LIMIT 1");
|
||||
$kunde = reset($kunde);
|
||||
|
||||
$kundennummer = $kunde['kundennummer'];
|
||||
$this->name = $kunde['name'];
|
||||
|
||||
$this->projektabkuerzung = $this->app->DB->Select("SELECT abkuerzung FROM projekt WHERE id='$projekt'");
|
||||
$this->firmenname = $this->app->erp->Firmendaten('name');
|
||||
$this->doctypeOrig="Adresse: ".$kunde['name'];
|
||||
$this->barcode=$belegnr;
|
||||
|
||||
//$ohne_briefpapier = $this->app->DB->Select("SELECT ohne_briefpapier FROM reisekosten WHERE id='$id' LIMIT 1");
|
||||
|
||||
|
||||
|
||||
|
||||
//$artikel = $this->app->DB->SelectArr("SELECT *,DATE_FORMAT(datum,'%d.%m.%Y') as datum, CONCAT(rk.nummer,'- ',rk.beschreibung) as reisekostenart FROM reisekosten_position rp LEFT JOIN reisekostenart rk ON rk.id=rp.reisekostenart WHERE rp.reisekosten='$id' ORDER By rp.sort");
|
||||
|
||||
//$waehrung = $this->app->DB->Select("SELECT waehrung FROM reisekosten_position WHERE reisekosten='$id' LIMIT 1");
|
||||
|
||||
/* Dateiname */
|
||||
$this->filename = date('Ymd')."_STAMMDATEN_ADRESSE_".$this->app->erp->Dateinamen($kunde['name']).".pdf";
|
||||
|
||||
$this->setBarcode($id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -3560,7 +3560,7 @@ class Briefpapier extends SuperFPDF {
|
||||
($this->doctype == "gutschrift" && $this->getStyleElement("gutschrift_artikelbild")) ||
|
||||
($this->doctype == "angebot" && $this->getStyleElement("angebot_artikelbild"))
|
||||
){
|
||||
$datei = $this->app->DB->Select("SELECT datei FROM `datei_stichwoerter` WHERE subjekt='Shopbild' AND objekt='Artikel' AND parameter='" . $item['artikel'] . "' ORDER by sort ASC LIMIT 1");
|
||||
$datei = $this->app->erp->GetArtikelStandardbild($item['artikel'],true);
|
||||
if(!empty($datei)){
|
||||
$datei = $this->app->DB->Select("SELECT id FROM datei_version WHERE datei = '$datei' ORDER BY id DESC LIMIT 1");
|
||||
}
|
||||
|
@ -474,9 +474,11 @@ class Dokumentenvorlage extends SuperFPDF {
|
||||
$this->Output($dir."/".$this->table."/".$this->id."_".$this->filename,'F');
|
||||
}
|
||||
|
||||
public function displayDocument() {
|
||||
public function displayDocument($archive = true) {
|
||||
$this->renderDocument();
|
||||
$this->archiveDocument();
|
||||
if ($archive) {
|
||||
$this->archiveDocument();
|
||||
}
|
||||
$this->Output($this->filename,'D');
|
||||
exit;
|
||||
}
|
||||
|
@ -18,29 +18,34 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
<td>{|Adresstyp|}:</td>
|
||||
<td>
|
||||
<select v-model.number="form.addresstype">
|
||||
<option value="0">Haus</option>
|
||||
<option value="0">Firma</option>
|
||||
<option value="1">Packstation</option>
|
||||
<option value="2">Filiale</option>
|
||||
<option value="3">Privatadresse</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Name / Zeile 1|}:</td>
|
||||
<td><input type="text" size="36" v-model.trim="form.name"></td>
|
||||
<tr v-if="form.addresstype === 0">
|
||||
<td>{|Firma|}:</td>
|
||||
<td><input type="text" size="36" v-model.trim="form.company_name"></td>
|
||||
</tr>
|
||||
<tr v-if="form.addresstype === 0">
|
||||
<td>{|Firmenname / Zeile 2|}:</td>
|
||||
<td><input type="text" size="36" v-model.trim="form.name2"></td>
|
||||
<td>{|Abteilung|}:</td>
|
||||
<td><input type="text" size="36" v-model.trim="form.company_division"></td>
|
||||
</tr>
|
||||
<tr v-if="form.addresstype === 3">
|
||||
<td>{|Name|}:</td>
|
||||
<td><input type="text" size="36" v-model.trim="form.name"></td>
|
||||
</tr>
|
||||
<tr v-if="form.addresstype === 0 || form.addresstype === 3">
|
||||
<td>{|Ansprechpartner|}:</td>
|
||||
<td><input type="text" size="36" v-model.trim="form.contact_name"></td>
|
||||
</tr>
|
||||
<tr v-if="form.addresstype === 1 || form.addresstype === 2">
|
||||
<td>{|Postnummer|}:</td>
|
||||
<td><input type="text" size="36" v-model.trim="form.postnumber"></td>
|
||||
</tr>
|
||||
<tr v-if="form.addresstype === 0">
|
||||
<td>{|Firmenname / Zeile 3|}:</td>
|
||||
<td><input type="text" size="36" v-model.trim="form.name3"></td>
|
||||
</tr>
|
||||
<tr v-if="form.addresstype === 0">
|
||||
<tr v-if="form.addresstype === 0 || form.addresstype === 3">
|
||||
<td>{|Strasse/Hausnummer|}:</td>
|
||||
<td>
|
||||
<input type="text" size="30" v-model.trim="form.street">
|
||||
@ -55,7 +60,7 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
<td>{|Postfilialnummer|}:</td>
|
||||
<td><input type="text" size="10" v-model.trim="form.postofficeNumber"></td>
|
||||
</tr>
|
||||
<tr v-if="form.addresstype === 0">
|
||||
<tr v-if="form.addresstype === 0 || form.addresstype === 3">
|
||||
<td>{|Adresszeile 2|}:</td>
|
||||
<td><input type="text" size="36" v-model.trim="form.address2"></td>
|
||||
</tr>
|
||||
@ -77,10 +82,6 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Ansprechpartner|}:</td>
|
||||
<td><input type="text" size="36" v-model="form.contactperson"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|E-Mail|}:</td>
|
||||
<td><input type="text" size="36" v-model.trim="form.email"></td>
|
||||
|
@ -102,7 +102,19 @@ class Versandart_dhl extends Versanddienstleister{
|
||||
switch ($json->addresstype) {
|
||||
case 0:
|
||||
$shipment->Receiver->Address = new ReceiverNativeAddress();
|
||||
$shipment->Receiver->Address->name2 = $json->name2;
|
||||
|
||||
$shipment->Receiver->name1 = $json->company_name;
|
||||
$shipment->Receiver->Address->name2 = join(
|
||||
';',
|
||||
array_filter(
|
||||
[
|
||||
$json->contact_name,
|
||||
$json->company_division
|
||||
],
|
||||
fn(string $item) => !empty(trim($item))
|
||||
)
|
||||
);
|
||||
|
||||
$shipment->Receiver->Address->streetName = $json->street ?? '';
|
||||
$shipment->Receiver->Address->streetNumber = $json->streetnumber;
|
||||
$shipment->Receiver->Address->city = $json->city ?? '';
|
||||
@ -127,6 +139,20 @@ class Versandart_dhl extends Versanddienstleister{
|
||||
$shipment->Receiver->Postfiliale->zip = $json->zip ?? '';
|
||||
$shipment->Receiver->Postfiliale->Origin = Country::Create($json->country ?? 'DE', $json->state);
|
||||
break;
|
||||
case 3:
|
||||
$shipment->Receiver->Address = new ReceiverNativeAddress();
|
||||
|
||||
$shipment->Receiver->name1 = $json->name;
|
||||
$shipment->Receiver->Address->name2 = $json->contact_name;
|
||||
|
||||
$shipment->Receiver->Address->streetName = $json->street ?? '';
|
||||
$shipment->Receiver->Address->streetNumber = $json->streetnumber;
|
||||
$shipment->Receiver->Address->city = $json->city ?? '';
|
||||
$shipment->Receiver->Address->zip = $json->zip ?? '';
|
||||
$shipment->Receiver->Address->Origin = Country::Create($json->country ?? 'DE', $json->state);
|
||||
if (isset($json->address2) && !empty($json->address2))
|
||||
$shipment->Receiver->Address->addressAddition[] = $json->address2;
|
||||
break;
|
||||
}
|
||||
$shipment->Receiver->Communication = new Communication();
|
||||
$shipment->Receiver->Communication->email = $json->email;
|
||||
|
@ -82,8 +82,18 @@ class Versandart_sendcloud extends Versanddienstleister
|
||||
$parcel->ShippingMethodId = $json->product;
|
||||
$parcel->Name = $json->name;
|
||||
switch ($json->addresstype) {
|
||||
case 0:
|
||||
$parcel->CompanyName = trim("$json->name2 $json->name3");
|
||||
case 0:
|
||||
$parcel->CompanyName = $json->company_name;
|
||||
$parcel->Name = join(
|
||||
';',
|
||||
array_filter(
|
||||
[
|
||||
$json->contact_name,
|
||||
$json->company_division
|
||||
],
|
||||
fn(string $item) => !empty(trim($item))
|
||||
)
|
||||
);
|
||||
$parcel->Address = $json->street;
|
||||
$parcel->Address2 = $json->address2;
|
||||
$parcel->HouseNumber = $json->streetnumber;
|
||||
@ -98,6 +108,23 @@ class Versandart_sendcloud extends Versanddienstleister
|
||||
$parcel->Address = "Postfiliale";
|
||||
$parcel->HouseNumber = $json->postofficeNumber;
|
||||
break;
|
||||
case 3:
|
||||
$parcel->Name = join(
|
||||
';',
|
||||
array_filter(
|
||||
[
|
||||
$json->name,
|
||||
$json->contact_name
|
||||
],
|
||||
fn(string $item) => !empty(trim($item))
|
||||
)
|
||||
);
|
||||
|
||||
$parcel->Address = $json->street;
|
||||
$parcel->Address2 = $json->address2;
|
||||
$parcel->HouseNumber = $json->streetnumber;
|
||||
break;
|
||||
|
||||
}
|
||||
$parcel->Country = $json->country;
|
||||
$parcel->PostalCode = $json->zip;
|
||||
@ -164,4 +191,4 @@ class Versandart_sendcloud extends Versanddienstleister
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ class Adresse extends GenAdresse {
|
||||
}
|
||||
|
||||
$Brief->GetAdressstammblatt($id);
|
||||
$Brief->displayDocument();
|
||||
$Brief->displayDocument(archive: false);
|
||||
$this->app->ExitXentral();
|
||||
}
|
||||
|
||||
|
@ -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,100 +2841,82 @@ class Artikel extends GenArtikel {
|
||||
return ['status'=>$isOk, 'info'=>$info, 'msg_encoded' => $msg, 'error' => $error];
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
$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'){
|
||||
$shop = $this->app->DB->Select("SELECT shop2 FROM artikel WHERE id='$id' LIMIT 1");
|
||||
}
|
||||
elseif($shop=='3'){
|
||||
$shop = $this->app->DB->Select("SELECT shop3 FROM artikel WHERE id='$id' LIMIT 1");
|
||||
}
|
||||
}
|
||||
|
||||
$artikelexport = $this->app->DB->Select("SELECT artikelexport FROM shopexport WHERE id='$shop' LIMIT 1");
|
||||
$lagerexport = $this->app->DB->Select("SELECT lagerexport FROM shopexport WHERE id='$shop' LIMIT 1");
|
||||
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');
|
||||
|
||||
$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)
|
||||
{
|
||||
$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>');
|
||||
}
|
||||
elseif(isset($pageContents['status']) && !empty($pageContents['message'])) {
|
||||
$msg = $this->app->erp->base64_url_encode('<div class="error">'.$pageContents['message'].'</div>');
|
||||
}
|
||||
}
|
||||
elseif($pageContents=='1') {
|
||||
$pageContents='success';
|
||||
}
|
||||
|
||||
if(empty($msg) && $pageContents!='') {
|
||||
$pageContents = " ($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: '.$pageContents));
|
||||
// keine fehlermeldung vom shop
|
||||
if(empty($msg)) {
|
||||
$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>");
|
||||
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') {
|
||||
$shop = $this->app->DB->Select("SELECT shop2 FROM artikel WHERE id='$id' LIMIT 1");
|
||||
} elseif ($shop == '3') {
|
||||
$shop = $this->app->DB->Select("SELECT shop3 FROM artikel WHERE id='$id' LIMIT 1");
|
||||
}
|
||||
}
|
||||
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");
|
||||
}
|
||||
$artikelexport = $this->app->DB->Select("SELECT artikelexport FROM shopexport WHERE id='$shop' LIMIT 1");
|
||||
$lagerexport = $this->app->DB->Select("SELECT lagerexport FROM shopexport WHERE id='$shop' 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) {
|
||||
$extartikelnummer = array($externenummer);
|
||||
} else {
|
||||
$extartikelnummer = '';
|
||||
}
|
||||
|
||||
$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!";
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
||||
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: '.((int) $remote_status)), $remote_message);
|
||||
|
||||
// keine fehlermeldung vom shop
|
||||
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>";
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->erp->LagerSync($artikel);
|
||||
|
||||
$this->app->Location->execute("index.php?module=artikel&action=edit&id=$id&msg=$msg#tabs-4");
|
||||
}
|
||||
|
||||
|
||||
public function ArtikelShopexportFiles()
|
||||
{
|
||||
@ -7200,6 +7182,9 @@ class Artikel extends GenArtikel {
|
||||
if ($tmp[0]['matrixprodukt']==1) {
|
||||
$this->app->erp->MenuEintrag("index.php?module=matrixprodukt&action=artikel&id=$id", 'Matrixprodukt');
|
||||
}
|
||||
$this->app->erp->MenuEintrag("index.php?module=artikeltexte&action=list&artikel=$id",'Übersetzung');
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=artikel&action=baum&id=$id",'Artikelbaum');
|
||||
|
||||
if($rabatt!='1'){
|
||||
$this->app->erp->MenuEintrag("index.php?module=artikel&action=einkauf&id=$id",'Einkauf');
|
||||
@ -7261,7 +7246,7 @@ class Artikel extends GenArtikel {
|
||||
}
|
||||
|
||||
$this->app->erp->MenuEintrag('index.php?module=artikel&action=list','Zurück zur Übersicht');
|
||||
$this->app->erp->InsertMenuAfter("index.php?module=artikel&action=baum&id=$id",'Artikelbaum','artikel','eigenschaften');
|
||||
|
||||
}
|
||||
}
|
||||
$this->app->erp->MenuEintrag('index.php?module=artikel&action=create','Neuen Artikel anlegen');
|
||||
@ -8432,7 +8417,7 @@ padding: 10px;\">
|
||||
FROM `datei_stichwoerter` AS `ds`
|
||||
INNER JOIN `datei_version` AS `dv` ON dv.datei = ds.datei
|
||||
INNER JOIN `datei` AS `d` ON dv.datei = d.id AND IFNULL(d.geloescht, 0) = 0
|
||||
WHERE ds.objekt LIKE 'artikel' AND ds.parameter = '%d'
|
||||
WHERE ds.objekt LIKE 'artikel' AND ds.parameter = '%d' AND d.geloescht = 0
|
||||
AND
|
||||
(
|
||||
ds.subjekt like 'Shopbild'
|
||||
|
289
www/pages/artikeltexte.php
Normal file
289
www/pages/artikeltexte.php
Normal file
@ -0,0 +1,289 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022 OpenXE project
|
||||
*/
|
||||
|
||||
use Xentral\Components\Database\Exception\QueryFailureException;
|
||||
|
||||
class Artikeltexte {
|
||||
|
||||
function __construct($app, $intern = false) {
|
||||
$this->app = $app;
|
||||
if ($intern)
|
||||
return;
|
||||
|
||||
$this->app->ActionHandlerInit($this);
|
||||
$this->app->ActionHandler("list", "artikel_texte_list");
|
||||
$this->app->ActionHandler("create", "artikel_texte_edit"); // This automatically adds a "New" button
|
||||
$this->app->ActionHandler("edit", "artikel_texte_edit");
|
||||
$this->app->ActionHandler("delete", "artikel_texte_delete");
|
||||
$this->app->DefaultActionHandler("list");
|
||||
$this->app->ActionHandlerListen($app);
|
||||
}
|
||||
|
||||
public function Install() {
|
||||
/* Fill out manually later */
|
||||
}
|
||||
|
||||
static function TableSearch(&$app, $name, $erlaubtevars) {
|
||||
switch ($name) {
|
||||
case "artikel_texte_list":
|
||||
$allowed['artikel_texte_list'] = array('list');
|
||||
$heading = array('','','Nummer','Artikel','Sprache', 'Aktiv', 'Name', 'Kurztext', 'Beschreibung', 'Beschreibung online', 'Meta title', 'Meta description', 'Meta keywords', 'Katalogartikel', 'Katalogbezeichnung', 'Katalogtext', 'Shop', 'Menü');
|
||||
$width = array('1%','1%','1%'); // Fill out manually later
|
||||
|
||||
$artikel = $app->User->GetParameter('artikeltexte_artikel');
|
||||
|
||||
// columns that are aligned right (numbers etc)
|
||||
// $alignright = array(4,5,6,7,8);
|
||||
|
||||
$findcols = array('a.id','a.id','art.nummer', 'art.name_de', 'a.sprache', 'a.aktiv', 'a.name', 'a.kurztext', 'a.beschreibung', 'a.beschreibung_online', 'a.meta_title', 'a.meta_description', 'a.meta_keywords', 'a.katalogartikel', 'a.katalog_bezeichnung', 'a.katalog_text', 'a.shop' );
|
||||
$searchsql = array('a.artikel', 'a.sprache', 'a.name', 'a.kurztext', 'a.beschreibung', 'a.beschreibung_online', 'a.meta_title', 'a.meta_description', 'a.meta_keywords', 'a.katalog_bezeichnung', 'a.katalog_text');
|
||||
|
||||
$defaultorder = 1;
|
||||
$defaultorderdesc = 0;
|
||||
$aligncenter = array();
|
||||
$alignright = array();
|
||||
$numbercols = array();
|
||||
$sumcol = array();
|
||||
|
||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',a.id,'\" />') AS `auswahl`";
|
||||
|
||||
// $moreinfo = true; // Allow drop down details
|
||||
// $moreinfoaction = "lieferschein"; // specify suffix for minidetail-URL to allow different minidetails
|
||||
// $mencol = 11; // Set id col for moredata/menu
|
||||
|
||||
$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap>" . "<a href=\"index.php?module=artikeltexte&action=edit&id=%value%\"><img src=\"./themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=artikeltexte&action=delete&id=%value%\");>" . "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>" . "</td></tr></table>";
|
||||
|
||||
$sql = "
|
||||
SELECT SQL_CALC_FOUND_ROWS a.id, $dropnbox,
|
||||
art.nummer,
|
||||
art.name_de,
|
||||
a.sprache,
|
||||
a.aktiv,
|
||||
a.name,
|
||||
a.kurztext,
|
||||
a.beschreibung,
|
||||
a.beschreibung_online,
|
||||
a.meta_title,
|
||||
a.meta_description,
|
||||
a.meta_keywords,
|
||||
a.katalogartikel,
|
||||
a.katalog_bezeichnung,
|
||||
a.katalog_text,
|
||||
shopexport.bezeichnung as shop,
|
||||
a.id FROM artikel_texte a
|
||||
INNER JOIN artikel art ON art.id = a.artikel
|
||||
LEFT JOIN shopexport ON shopexport.id = a.shop
|
||||
";
|
||||
|
||||
$where = "1";
|
||||
|
||||
if ($artikel) {
|
||||
$where .= " AND a.artikel = '".$artikel."'";
|
||||
}
|
||||
|
||||
$count = "SELECT count(DISTINCT id) FROM artikel_texte a WHERE $where";
|
||||
// $groupby = "";
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$erg = false;
|
||||
|
||||
foreach ($erlaubtevars as $k => $v) {
|
||||
if (isset($$v)) {
|
||||
$erg[$v] = $$v;
|
||||
}
|
||||
}
|
||||
return $erg;
|
||||
}
|
||||
|
||||
function artikel_texte_list() {
|
||||
|
||||
$artikel = $this->app->Secure->GetGET('artikel');
|
||||
if ($artikel) {
|
||||
$this->app->erp->MenuEintrag("index.php?module=artikeltexte&action=create&artikel=".$artikel, "Neu anlegen");
|
||||
$this->app->erp->MenuEintrag("index.php?module=artikel&action=edit&id=".$artikel."#tabs-2", "Zurück");
|
||||
}
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=artikeltexte&action=list&artikel=".$artikel, "Übersicht");
|
||||
|
||||
$this->app->User->SetParameter('artikeltexte_artikel', $artikel);
|
||||
|
||||
$this->app->YUI->TableSearch('TAB1', 'artikel_texte_list', "show", "", "", basename(__FILE__), __CLASS__);
|
||||
$this->app->Tpl->Parse('PAGE', "artikeltexte_list.tpl");
|
||||
}
|
||||
|
||||
public function artikel_texte_delete() {
|
||||
$id = (int) $this->app->Secure->GetGET('id');
|
||||
$artikel = $this->app->DB->Select("SELECT artikel FROM `artikel_texte` WHERE `id` = '{$id}'");
|
||||
$this->app->DB->Delete("DELETE FROM `artikel_texte` WHERE `id` = '{$id}'");
|
||||
$msg = $this->app->erp->base64_url_encode("<div class=\"error\">Der Eintrag wurde gelöscht.</div>");
|
||||
header("Location: index.php?module=artikeltexte&action=list&artikel=".$artikel."&msg=".$msg);
|
||||
}
|
||||
|
||||
/*
|
||||
* Edit artikel_texte item
|
||||
* If id is empty, create a new one
|
||||
*/
|
||||
|
||||
function artikel_texte_edit() {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$artikel = $this->app->Secure->GetGET('artikel');
|
||||
// Check if other users are editing this id
|
||||
/* if($this->app->erp->DisableModul('artikel_texte',$id))
|
||||
{
|
||||
return;
|
||||
} */
|
||||
|
||||
$this->app->Tpl->Set('ID', $id);
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=artikeltexte&action=edit&id=$id", "Details");
|
||||
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$input = $this->GetInput();
|
||||
$submit = $this->app->Secure->GetPOST('submit');
|
||||
|
||||
if (empty($id)) {
|
||||
// New item
|
||||
$id = 'NULL';
|
||||
$input['artikel'] = $artikel;
|
||||
$input['aktiv'] = 1;
|
||||
}
|
||||
|
||||
if ($submit != '' || $id == 'NULL')
|
||||
{
|
||||
|
||||
// Write to database
|
||||
|
||||
// Add checks here
|
||||
|
||||
// $input['projekt'] = $this->app->erp->ReplaceProjekt(true,$input['projekt'],true); // Parameters: Target db?, value, from form?
|
||||
|
||||
$columns = "id, ";
|
||||
$values = "$id, ";
|
||||
$update = "";
|
||||
|
||||
$fix = "";
|
||||
|
||||
foreach ($input as $key => $value) {
|
||||
$columns = $columns.$fix.$key;
|
||||
$values = $values.$fix."'".$value."'";
|
||||
$update = $update.$fix.$key." = '$value'";
|
||||
|
||||
$fix = ", ";
|
||||
}
|
||||
|
||||
// echo($columns."<br>");
|
||||
// echo($values."<br>");
|
||||
// echo($update."<br>");
|
||||
|
||||
$sql = "INSERT INTO artikel_texte (".$columns.") VALUES (".$values.") ON DUPLICATE KEY UPDATE ".$update;
|
||||
|
||||
// echo($sql);
|
||||
|
||||
$this->app->DB->Update($sql);
|
||||
|
||||
if ($id == 'NULL') {
|
||||
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>");
|
||||
header("Location: index.php?module=artikeltexte&action=list&artikel=".$artikel."&msg=".$msg);
|
||||
} else {
|
||||
$this->app->Tpl->addMessage('success', 'Die Einstellungen wurden erfolgreich übernommen.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Load values again from database
|
||||
if ($id != 'NULL') {
|
||||
|
||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',a.id,'\" />') AS `auswahl`";
|
||||
$result = $this->app->DB->SelectArr("
|
||||
SELECT SQL_CALC_FOUND_ROWS
|
||||
a.id,
|
||||
$dropnbox,
|
||||
art.name_de,
|
||||
a.sprache,
|
||||
a.aktiv,
|
||||
a.name,
|
||||
a.kurztext,
|
||||
a.beschreibung,
|
||||
a.beschreibung_online,
|
||||
a.meta_title,
|
||||
a.meta_description,
|
||||
a.meta_keywords,
|
||||
a.katalogartikel,
|
||||
a.katalog_bezeichnung,
|
||||
a.katalog_text,
|
||||
a.shop,
|
||||
a.id,
|
||||
a.artikel
|
||||
FROM
|
||||
artikel_texte a
|
||||
INNER JOIN artikel art ON a.artikel = art.id
|
||||
WHERE a.id=$id
|
||||
");
|
||||
|
||||
|
||||
foreach ($result[0] as $key => $value) {
|
||||
$this->app->Tpl->Set(strtoupper($key), $value);
|
||||
}
|
||||
|
||||
if (!empty($result)) {
|
||||
$artikel_texte_from_db = $result[0];
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ($artikel_texte_from_db['artikel']) {
|
||||
$this->app->erp->MenuEintrag("index.php?module=artikeltexte&action=create&artikel=".$artikel_texte_from_db['artikel'], "Neu anlegen");
|
||||
$this->app->erp->MenuEintrag("index.php?module=artikeltexte&action=list&artikel=".$artikel_texte_from_db['artikel'], "Zurück");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Add displayed items later
|
||||
*
|
||||
$this->app->Tpl->Add('EMAIL', $email);
|
||||
$this->app->Tpl->Add('ANGEZEIGTERNAME', $angezeigtername);
|
||||
|
||||
$this->app->YUI->AutoComplete("artikel", "artikelnummer");
|
||||
|
||||
*/
|
||||
|
||||
$this->app->Tpl->Set('AKTIV', $artikel_texte_from_db['aktiv']?'checked':'');
|
||||
$this->app->Tpl->Set('KATALOGARTIKEL', $artikel_texte_from_db['katalogartikel']?'checked':'');
|
||||
|
||||
$this->app->YUI->AutoComplete('shop','shopnameid');
|
||||
|
||||
$sprachenOptions = $this->app->erp->GetSprachenSelect();
|
||||
$this->app->Tpl->Set('SPRACHE', $this->app->erp->GetSelectAsso($sprachenOptions, $artikel_texte_from_db['sprache']));
|
||||
$this->app->Tpl->Parse('PAGE', "artikeltexte_edit.tpl");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all paramters from html form and save into $input
|
||||
*/
|
||||
public function GetInput(): array {
|
||||
$input = array();
|
||||
//$input['EMAIL'] = $this->app->Secure->GetPOST('email');
|
||||
|
||||
$input['sprache'] = $this->app->Secure->GetPOST('sprache');
|
||||
$input['name'] = $this->app->Secure->GetPOST('name');
|
||||
$input['kurztext'] = $this->app->Secure->GetPOST('kurztext');
|
||||
$input['beschreibung'] = $this->app->Secure->GetPOST('beschreibung');
|
||||
$input['beschreibung_online'] = $this->app->Secure->GetPOST('beschreibung_online');
|
||||
$input['meta_title'] = $this->app->Secure->GetPOST('meta_title');
|
||||
$input['meta_description'] = $this->app->Secure->GetPOST('meta_description');
|
||||
$input['meta_keywords'] = $this->app->Secure->GetPOST('meta_keywords');
|
||||
$input['katalogartikel'] = $this->app->Secure->GetPOST('katalogartikel')?'1':'0';
|
||||
$input['katalog_bezeichnung'] = $this->app->Secure->GetPOST('katalog_bezeichnung');
|
||||
$input['katalog_text'] = $this->app->Secure->GetPOST('katalog_text');
|
||||
$input['shop'] = $this->app->Secure->GetPOST('shop');
|
||||
$input['aktiv'] = $this->app->Secure->GetPOST('aktiv')?'1':'0';
|
||||
|
||||
return $input;
|
||||
}
|
||||
}
|
@ -1,408 +1,410 @@
|
||||
<?php
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
|
||||
class Bundesstaaten {
|
||||
/** @var erpooSystem $app */
|
||||
var $app;
|
||||
|
||||
static function TableSearch(&$app, $name, $erlaubtevars)
|
||||
{
|
||||
// in dieses switch alle lokalen Tabellen (diese Live Tabellen mit Suche etc.) für dieses Modul
|
||||
switch($name)
|
||||
{
|
||||
case "bundesstaaten_list":
|
||||
$allowed['bundesstaaten'] = array('list');
|
||||
|
||||
$heading = array('Land', 'ISO', 'Bundesstaat', 'Aktiv', 'Menü');
|
||||
$width = array('20%', '10%', '60%', '10%', '1%');
|
||||
|
||||
$findcols = array('l.bezeichnung_de', 'b.iso', 'b.bundesstaat', "if(b.aktiv, 'ja', '-')", 'b.id');
|
||||
$searchsql = array('l.bezeichnung_de', 'b.iso', 'b.bundesstaat');
|
||||
|
||||
$defaultorder = 1;
|
||||
$defaultorderdesc = 0;
|
||||
|
||||
$menu = "<table cellpadding=0 cellspacing=0>";
|
||||
$menu .= "<tr>";
|
||||
$menu .= "<td nowrap>";
|
||||
$menu .= '<a href="javascript:;" onclick="BundesstaatenEdit(%value%);">';
|
||||
$menu .= "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\">";
|
||||
$menu .= "</a> ";
|
||||
$menu .= '<a href="javascript:;" onclick="BundesstaatenDelete(%value%);">';
|
||||
$menu .= "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\">";
|
||||
$menu .= "</a>";
|
||||
$menu .= "</td>";
|
||||
$menu .= "</tr>";
|
||||
$menu .= "</table>";
|
||||
|
||||
$finaktiv = $app->YUI->TableSearchFilter($name, 5, 'inaktiv', '0', 0, 'checkbox');
|
||||
$subwhere = '';
|
||||
if($finaktiv == 0){
|
||||
$subwhere .= ' AND b.aktiv = 1';
|
||||
}
|
||||
|
||||
$where = " b.id > 0".$subwhere;
|
||||
|
||||
$sql = "SELECT SQL_CALC_FOUND_ROWS b.id, l.bezeichnung_de, b.iso, b.bundesstaat, if(b.aktiv, 'ja', '-') as aktiv, b.id FROM bundesstaaten b LEFT JOIN laender l ON b.land = l.iso";
|
||||
|
||||
$count = "SELECT count(b.id) FROM bundesstaaten b WHERE $where";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
$erg = [];
|
||||
|
||||
foreach($erlaubtevars as $k => $v)
|
||||
{
|
||||
if(isset($$v))$erg[$v] = $$v;
|
||||
}
|
||||
return $erg;
|
||||
}
|
||||
|
||||
|
||||
function __construct($app, $intern = false) {
|
||||
$this->app=$app;
|
||||
if($intern)return;
|
||||
$this->app->ActionHandlerInit($this);
|
||||
|
||||
// ab hier alle Action Handler definieren die das Modul hat
|
||||
$this->app->ActionHandler("list", "BundesstaatenList");
|
||||
$this->app->ActionHandler("edit", "BundesstaatenEdit");
|
||||
$this->app->ActionHandler("save", "BundesstaatenSave");
|
||||
$this->app->ActionHandler("delete", "BundesstaatenDelete");
|
||||
|
||||
$this->app->ActionHandlerListen($app);
|
||||
|
||||
$this->Install();
|
||||
|
||||
}
|
||||
|
||||
function Install(){
|
||||
$this->app->erp->CheckTable("bundesstaaten");
|
||||
$this->app->erp->CheckColumn("id", "int(11)", "bundesstaaten", "NOT NULL AUTO_INCREMENT");
|
||||
$this->app->erp->CheckColumn("land", "varchar(255)", "bundesstaaten", "NOT NULL");
|
||||
$this->app->erp->CheckColumn("iso", "varchar(255)", "bundesstaaten", "NOT NULL");
|
||||
$this->app->erp->CheckColumn("bundesstaat", "varchar(255)", "bundesstaaten", "NOT NULL");
|
||||
$this->app->erp->CheckColumn("aktiv", "int(11)", "bundesstaaten", "NOT NULL DEFAULT 0");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $target
|
||||
* @param $landid
|
||||
* @param $bundeslandid
|
||||
* @param string $valueland
|
||||
* @param string $valuebundesland
|
||||
* @param bool $disabled
|
||||
*/
|
||||
function BundeslaenderSelect($target, $landid, $bundeslandid, $valueland = '', $valuebundesland = '', $disabled = false)
|
||||
{
|
||||
if($valueland == '')$valueland = $this->app->erp->Firmendaten('land');
|
||||
$arr = $this->app->DB->SelectArr("SELECT * FROM bundesstaaten WHERE land <> '' AND iso <> '' AND ( aktiv = 1 OR (land = '$valueland' AND iso = '$valuebundesland')) ORDER BY land, bundesstaat");
|
||||
$this->app->Tpl->Add($target,'<select id="'.$bundeslandid.'" name="'.$bundeslandid.'"'.($disabled?' disabled="disabled" ':'').'><option value=""></option>');
|
||||
if($arr)
|
||||
{
|
||||
foreach($arr as $i => $v)
|
||||
{
|
||||
if($v['land'] == $valueland)
|
||||
{
|
||||
$this->app->Tpl->Add($target,'<option value="'.$v['iso'].'"'.($v['iso'] == $valuebundesland?' selected="selected" ':'').'>'.htmlspecialchars($v['bundesstaat']).'</option>');
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->app->Tpl->Add($target,'</select>');
|
||||
$this->app->Tpl->Add($target,'<script type="text/javascript">');
|
||||
if($arr)
|
||||
{
|
||||
$this->app->Tpl->Add($target,"\r\nvar bundeslaender$bundeslandid = new Array();\r\n");
|
||||
$i = 0;
|
||||
foreach($arr as $i => $v)
|
||||
{
|
||||
$this->app->Tpl->Add($target,"\r\n bundeslaender$bundeslandid"."[".$i."] = new Object();\r\n");
|
||||
$this->app->Tpl->Add($target,"\r\n bundeslaender$bundeslandid"."[".$i."].land = '".htmlspecialchars($v['land'])."';\r\n");
|
||||
$this->app->Tpl->Add($target,"\r\n bundeslaender$bundeslandid"."[".$i."].iso = '".htmlspecialchars($v['iso'])."';\r\n");
|
||||
$this->app->Tpl->Add($target,"\r\n bundeslaender$bundeslandid"."[".$i."].bundesstaat = '".htmlspecialchars($v['bundesstaat'])."';\r\n");
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->Tpl->Add($target,'
|
||||
$(document).ready(function() {
|
||||
$(\'select[name="'.$landid.'"]\').on(\'change\', function(){
|
||||
var landsel = $(this).val();
|
||||
var bundeslandel = $(\'#'.$bundeslandid.'\');
|
||||
var bundeslandval = $(bundeslandel).val();
|
||||
$(bundeslandel).html(\'<option value=""></option>\');
|
||||
$(bundeslaender'.$bundeslandid.').each(function(k,v){
|
||||
if(landsel == v.land)
|
||||
{
|
||||
$(bundeslandel).html($(bundeslandel).html()+\'<option value="\'+v.iso+\'">\'+v.bundesstaat+\'</option>\');
|
||||
}
|
||||
});
|
||||
$(bundeslaender'.$bundeslandid.').val(bundeslandval);
|
||||
});
|
||||
});
|
||||
</script>');
|
||||
}
|
||||
|
||||
function BundesstaatenMenu()
|
||||
{
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=bundesstaaten&action=list","Zurück zur Übersicht");
|
||||
$this->app->erp->MenuEintrag("index.php?module=bundesstaaten&action=list","Details");
|
||||
$this->app->erp->MenuEintrag("BundesstaatenEdit(0)","Neuer Eintrag");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $needle
|
||||
* @param $haystack
|
||||
* @param bool $strict
|
||||
* @return bool
|
||||
*/
|
||||
function in_array_r($needle, $haystack, $strict = false){
|
||||
foreach($haystack as $item){
|
||||
if(($strict ? $item === $needle : $item == $needle) || (is_array($item) && $this->in_array_r($needle, $item, $strict))){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function BundesstaatenList()
|
||||
{
|
||||
$this->BundesstaatenMenu();
|
||||
$this->app->Tpl->Set("KURZUEBERSCHRIFT","Bundesstaaten");
|
||||
|
||||
$bundesstaatende = $this->app->erp->GetSelectStaatenliste('DE');
|
||||
$bundesstaatendedb = $this->app->DB->SelectArr("SELECT bundesstaat, iso FROM bundesstaaten WHERE land = 'DE'");
|
||||
$fehlende = array();
|
||||
foreach($bundesstaatende as $key=>$value){
|
||||
if($this->in_array_r($value,$bundesstaatendedb)){
|
||||
}else{
|
||||
$fehlende[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$bundesstaatenat = $this->app->erp->GetSelectStaatenliste('AT');
|
||||
$bundesstaatenatdb = $this->app->DB->SelectArr("SELECT bundesstaat, iso FROM bundesstaaten WHERE land = 'AT'");
|
||||
$fehlenat = array();
|
||||
foreach($bundesstaatenat as $key=>$value){
|
||||
if($this->in_array_r($value,$bundesstaatenatdb)){
|
||||
}else{
|
||||
$fehlenat[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$bundesstaatench = $this->app->erp->GetSelectStaatenliste('CH');
|
||||
$bundesstaatenchdb = $this->app->DB->SelectArr("SELECT bundesstaat, iso FROM bundesstaaten WHERE land = 'CH'");
|
||||
$fehlench = array();
|
||||
foreach($bundesstaatench as $key=>$value){
|
||||
if($this->in_array_r($value,$bundesstaatenchdb)){
|
||||
}else{
|
||||
$fehlench[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$bundesstaatenus = $this->app->erp->GetSelectStaatenliste('US');
|
||||
$bundesstaatenusdb = $this->app->DB->SelectArr("SELECT bundesstaat, iso FROM bundesstaaten WHERE land = 'US'");
|
||||
$fehlenus = array();
|
||||
foreach($bundesstaatenus as $key=>$value){
|
||||
if($this->in_array_r($value,$bundesstaatenusdb)){
|
||||
}else{
|
||||
$fehlenus[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$bundesstaatenca = $this->app->erp->GetSelectStaatenliste('CA');
|
||||
$bundesstaatencadb = $this->app->DB->SelectArr("SELECT bundesstaat, iso FROM bundesstaaten WHERE land = 'CA'");
|
||||
$fehlenca = array();
|
||||
foreach($bundesstaatenca as $key=>$value){
|
||||
if($this->in_array_r($value,$bundesstaatencadb)){
|
||||
}else{
|
||||
$fehlenca[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$anzahlfehlen = (!empty($fehlende)?count($fehlende):0) + (!empty($fehlenat)?count($fehlenat):0) + (!empty($fehlench)?count($fehlench):0) + (!empty($fehlenus)?count($fehlenus):0) + (!empty($fehlenca)?count($fehlenca):0);
|
||||
|
||||
|
||||
if($anzahlfehlen > 0){
|
||||
if($anzahlfehlen == 1){
|
||||
$info = "Es steht ".$anzahlfehlen." neuer Bundesstaaten Eintrag in Xentral zur Verfügung.";
|
||||
}else{
|
||||
$info = "Es stehen ".$anzahlfehlen." neue Bundesstaaten Einträge in Xentral zur Verfügung.";
|
||||
}
|
||||
$nachladebutton = "<input type='submit' name='nachladen' id='nachladen' value='Jetzt nachladen'>";
|
||||
$info .= $nachladebutton;
|
||||
$this->app->Tpl->Set('MESSAGE',"<div class=\"info\">$info</div>");
|
||||
}
|
||||
|
||||
$nachladen = $this->app->Secure->GetPOST("nachladen");
|
||||
if($nachladen != ""){
|
||||
if((!empty($fehlende)?count($fehlende):0) > 0){
|
||||
foreach($fehlende as $key=>$value){
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('DE', '$key', '$value', 1)");
|
||||
}
|
||||
}
|
||||
|
||||
if((!empty($fehlenat)?count($fehlenat):0) > 0){
|
||||
foreach($fehlenat as $key=>$value){
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('AT', '$key', '$value', 1)");
|
||||
}
|
||||
}
|
||||
|
||||
if((!empty($fehlench)?count($fehlench):0) > 0){
|
||||
foreach($fehlench as $key=>$value){
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('CH', '$key', '$value', 1)");
|
||||
}
|
||||
}
|
||||
|
||||
if((!empty($fehlenus)?count($fehlenus):0) > 0){
|
||||
foreach($fehlenus as $key=>$value){
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('US', '$key', '$value', 1)");
|
||||
}
|
||||
}
|
||||
|
||||
if((!empty($fehlenca)?count($fehlenca):0) > 0){
|
||||
foreach($fehlenca as $key=>$value){
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('CA', '$key', '$value', 1)");
|
||||
}
|
||||
}
|
||||
|
||||
header("Location:index.php?module=bundesstaaten&action=list");
|
||||
exit;
|
||||
}
|
||||
|
||||
$laenderanzahl = $this->app->DB->Select("SELECT COUNT(id) FROM laender");
|
||||
//if($laenderanzahl <= 0){
|
||||
$select = '';
|
||||
$laender = $this->app->erp->GetSelectLaenderliste();
|
||||
foreach($laender as $key=>$value){
|
||||
if(trim($key) != "" && trim($key) != "0"){
|
||||
$select .= "<option value='".$key."'>".htmlspecialchars($value)."</option>";
|
||||
}
|
||||
|
||||
}
|
||||
//}else{
|
||||
//$laender = $this->app->DB->SelectArr("SELECT iso, bezeichnung_de FROM laender");
|
||||
//foreach($laender as $key=>$value){
|
||||
//$select .= "<option value='".$value['iso']."'>".$value['bezeichnung_de']."</option>";
|
||||
//}
|
||||
|
||||
$this->app->Tpl->Add("LAENDER", $select);
|
||||
//}
|
||||
|
||||
$this->app->YUI->TableSearch('TAB1','bundesstaaten_list', "show","","",basename(__FILE__), __CLASS__);
|
||||
$this->app->Tpl->Parse("PAGE","bundesstaaten_list.tpl");
|
||||
}
|
||||
|
||||
function BundesstaatenEdit()
|
||||
{
|
||||
if($this->app->Secure->GetGET('cmd')=='get'){
|
||||
$id = (int)$this->app->Secure->GetPOST('id');
|
||||
|
||||
$data = $this->app->DB->SelectArr("SELECT b.id, b.land, b.iso, b.bundesstaat, b.aktiv FROM bundesstaaten b WHERE b.id = '$id' LIMIT 1");
|
||||
|
||||
if($data){
|
||||
$data = reset($data);
|
||||
|
||||
}else{
|
||||
$data['id'] = 0;
|
||||
$data['land'] = '';
|
||||
$data['iso'] = '';
|
||||
$data['bundesstaat'] = '';
|
||||
$data['aktiv'] = 1;
|
||||
|
||||
}
|
||||
echo json_encode($data);
|
||||
exit;
|
||||
}
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "bundesstaaten_list.tpl");
|
||||
}
|
||||
|
||||
function BundesstaatenSave()
|
||||
{
|
||||
$id = (int)$this->app->Secure->GetPOST('id');
|
||||
$land = trim($this->app->Secure->GetPOST('land'));
|
||||
$iso = trim($this->app->Secure->GetPOST('iso'));
|
||||
$bundesstaat = trim($this->app->Secure->GetPOST('bundesstaat'));
|
||||
$aktiv = $this->app->Secure->GetPOST('aktiv');
|
||||
|
||||
$error = "";
|
||||
|
||||
if($land == ""){
|
||||
$error .= "Bitte Land ausfüllen\n";
|
||||
}
|
||||
|
||||
if($iso == ""){
|
||||
$error .= "Bitte ISO-Code ausfüllen"."\n";
|
||||
}
|
||||
|
||||
if(strlen($iso) > 2){
|
||||
$error .= "Bitte 2-stelligen ISO-Code für den Bundesstaat ausfüllen"."\n";
|
||||
}
|
||||
|
||||
if($bundesstaat == ""){
|
||||
$error .= "Bitte Bundesstaat ausfüllen"."\n";
|
||||
}
|
||||
|
||||
if($land != "" && $bundesstaat != ""){
|
||||
$isovorhanden = $this->app->DB->Select("SELECT id FROM bundesstaaten WHERE land = '$land' AND iso = '$iso' AND id != '$id' LIMIT 1");
|
||||
if($isovorhanden != ""){
|
||||
$error .= "Es gibt diesen ISO-Code bereits für dieses Land"."\n";
|
||||
}else{
|
||||
$schonvorhanden = $this->app->DB->Select("SELECT id FROM bundesstaaten WHERE land = '$land' AND iso = '$iso' AND bundesstaat = '$bundesstaat' AND id != '$id' LIMIT 1");
|
||||
if($schonvorhanden != ""){
|
||||
$error .= "Diesen Eintrag gibt es bereits"."\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($error == ""){
|
||||
if($id){
|
||||
$this->app->DB->Update("UPDATE bundesstaaten SET land = '$land', iso = '$iso', bundesstaat = '$bundesstaat', aktiv = '$aktiv' WHERE id = '$id'");
|
||||
|
||||
echo json_encode(array('status'=>1));
|
||||
exit;
|
||||
}else{
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('$land', '$iso', '$bundesstaat', '$aktiv')");
|
||||
|
||||
echo json_encode(array('status'=>1));
|
||||
exit;
|
||||
|
||||
}
|
||||
}else{
|
||||
echo json_encode(array('status'=>0,'statusText'=>$error));
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function BundesstaatenDelete()
|
||||
{
|
||||
$id = (int) $this->app->Secure->GetPOST('id');
|
||||
if($id)
|
||||
$this->app->DB->Update("DELETE FROM bundesstaaten WHERE id = '$id'");
|
||||
|
||||
echo json_encode(array('status'=>1));
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
class Bundesstaaten {
|
||||
/** @var erpooSystem $app */
|
||||
var $app;
|
||||
|
||||
static function TableSearch(&$app, $name, $erlaubtevars)
|
||||
{
|
||||
// in dieses switch alle lokalen Tabellen (diese Live Tabellen mit Suche etc.) für dieses Modul
|
||||
switch($name)
|
||||
{
|
||||
case "bundesstaaten_list":
|
||||
$allowed['bundesstaaten'] = array('list');
|
||||
|
||||
$heading = array('Land', 'ISO', 'Bundesstaat', 'Aktiv', 'Menü');
|
||||
$width = array('20%', '10%', '60%', '10%', '1%');
|
||||
|
||||
$findcols = array('l.bezeichnung_de', 'b.iso', 'b.bundesstaat', "if(b.aktiv, 'ja', '-')", 'b.id');
|
||||
$searchsql = array('l.bezeichnung_de', 'b.iso', 'b.bundesstaat');
|
||||
|
||||
$defaultorder = 1;
|
||||
$defaultorderdesc = 0;
|
||||
|
||||
$menu = "<table cellpadding=0 cellspacing=0>";
|
||||
$menu .= "<tr>";
|
||||
$menu .= "<td nowrap>";
|
||||
$menu .= '<a href="javascript:;" onclick="BundesstaatenEdit(%value%);">';
|
||||
$menu .= "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\">";
|
||||
$menu .= "</a> ";
|
||||
$menu .= '<a href="javascript:;" onclick="BundesstaatenDelete(%value%);">';
|
||||
$menu .= "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\">";
|
||||
$menu .= "</a>";
|
||||
$menu .= "</td>";
|
||||
$menu .= "</tr>";
|
||||
$menu .= "</table>";
|
||||
|
||||
$finaktiv = $app->YUI->TableSearchFilter($name, 5, 'inaktiv', '0', 0, 'checkbox');
|
||||
$subwhere = '';
|
||||
if($finaktiv == 0){
|
||||
$subwhere .= ' AND b.aktiv = 1';
|
||||
}
|
||||
|
||||
$where = " b.id > 0".$subwhere;
|
||||
|
||||
$sql = "SELECT SQL_CALC_FOUND_ROWS b.id, l.bezeichnung_de, b.iso, b.bundesstaat, if(b.aktiv, 'ja', '-') as aktiv, b.id FROM bundesstaaten b LEFT JOIN laender l ON b.land = l.iso";
|
||||
|
||||
$count = "SELECT count(b.id) FROM bundesstaaten b WHERE $where";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
$erg = [];
|
||||
|
||||
foreach($erlaubtevars as $k => $v)
|
||||
{
|
||||
if(isset($$v))$erg[$v] = $$v;
|
||||
}
|
||||
return $erg;
|
||||
}
|
||||
|
||||
|
||||
function __construct($app, $intern = false) {
|
||||
$this->app=$app;
|
||||
if($intern)return;
|
||||
$this->app->ActionHandlerInit($this);
|
||||
|
||||
// ab hier alle Action Handler definieren die das Modul hat
|
||||
$this->app->ActionHandler("list", "BundesstaatenList");
|
||||
$this->app->ActionHandler("edit", "BundesstaatenEdit");
|
||||
$this->app->ActionHandler("save", "BundesstaatenSave");
|
||||
$this->app->ActionHandler("delete", "BundesstaatenDelete");
|
||||
|
||||
$this->app->ActionHandlerListen($app);
|
||||
|
||||
$this->Install();
|
||||
|
||||
}
|
||||
|
||||
function Install(){
|
||||
$this->app->erp->CheckTable("bundesstaaten");
|
||||
$this->app->erp->CheckColumn("id", "int(11)", "bundesstaaten", "NOT NULL AUTO_INCREMENT");
|
||||
$this->app->erp->CheckColumn("land", "varchar(255)", "bundesstaaten", "NOT NULL");
|
||||
$this->app->erp->CheckColumn("iso", "varchar(255)", "bundesstaaten", "NOT NULL");
|
||||
$this->app->erp->CheckColumn("bundesstaat", "varchar(255)", "bundesstaaten", "NOT NULL");
|
||||
$this->app->erp->CheckColumn("aktiv", "int(11)", "bundesstaaten", "NOT NULL DEFAULT 0");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $target
|
||||
* @param $landid
|
||||
* @param $bundeslandid
|
||||
* @param string $valueland
|
||||
* @param string $valuebundesland
|
||||
* @param bool $disabled
|
||||
*/
|
||||
function BundeslaenderSelect($target, $landid, $bundeslandid, $valueland = '', $valuebundesland = '', $disabled = false)
|
||||
{
|
||||
if($valueland == '')$valueland = $this->app->erp->Firmendaten('land');
|
||||
$arr = $this->app->DB->SelectArr("SELECT * FROM bundesstaaten WHERE land <> '' AND iso <> '' AND ( aktiv = 1 OR (land = '$valueland' AND iso = '$valuebundesland')) ORDER BY land, bundesstaat");
|
||||
$this->app->Tpl->Add($target,'<select id="'.$bundeslandid.'" name="'.$bundeslandid.'"'.($disabled?' disabled="disabled" ':'').'><option value=""></option>');
|
||||
if($arr)
|
||||
{
|
||||
foreach($arr as $i => $v)
|
||||
{
|
||||
if($v['land'] == $valueland)
|
||||
{
|
||||
$this->app->Tpl->Add($target,'<option value="'.$v['iso'].'"'.($v['iso'] == $valuebundesland?' selected="selected" ':'').'>'.htmlspecialchars($v['bundesstaat']).'</option>');
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->app->Tpl->Add($target,'</select>');
|
||||
$this->app->Tpl->Add($target,'<script type="text/javascript">');
|
||||
if($arr)
|
||||
{
|
||||
$this->app->Tpl->Add($target,"\r\nvar bundeslaender$bundeslandid = new Array();\r\n");
|
||||
$i = 0;
|
||||
foreach($arr as $i => $v)
|
||||
{
|
||||
$this->app->Tpl->Add($target,"\r\n bundeslaender$bundeslandid"."[".$i."] = new Object();\r\n");
|
||||
$this->app->Tpl->Add($target,"\r\n bundeslaender$bundeslandid"."[".$i."].land = '".htmlspecialchars($v['land'])."';\r\n");
|
||||
$this->app->Tpl->Add($target,"\r\n bundeslaender$bundeslandid"."[".$i."].iso = '".htmlspecialchars($v['iso'])."';\r\n");
|
||||
$this->app->Tpl->Add($target,"\r\n bundeslaender$bundeslandid"."[".$i."].bundesstaat = '".htmlspecialchars($v['bundesstaat'])."';\r\n");
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->Tpl->Add($target,'
|
||||
$(document).ready(function() {
|
||||
$(\'select[name="'.$landid.'"]\').on(\'change\', function(){
|
||||
var landsel = $(this).val();
|
||||
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)
|
||||
{
|
||||
$(bundeslandel).html($(bundeslandel).html()+\'<option value="\'+v.iso+\'">\'+v.bundesstaat+\'</option>\');
|
||||
}
|
||||
});
|
||||
$(bundeslaender'.$bundeslandid.').val(bundeslandval);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>');
|
||||
}
|
||||
|
||||
function BundesstaatenMenu()
|
||||
{
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=bundesstaaten&action=list","Zurück zur Übersicht");
|
||||
$this->app->erp->MenuEintrag("index.php?module=bundesstaaten&action=list","Details");
|
||||
$this->app->erp->MenuEintrag("BundesstaatenEdit(0)","Neuer Eintrag");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $needle
|
||||
* @param $haystack
|
||||
* @param bool $strict
|
||||
* @return bool
|
||||
*/
|
||||
function in_array_r($needle, $haystack, $strict = false){
|
||||
foreach($haystack as $item){
|
||||
if(($strict ? $item === $needle : $item == $needle) || (is_array($item) && $this->in_array_r($needle, $item, $strict))){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function BundesstaatenList()
|
||||
{
|
||||
$this->BundesstaatenMenu();
|
||||
$this->app->Tpl->Set("KURZUEBERSCHRIFT","Bundesstaaten");
|
||||
|
||||
$bundesstaatende = $this->app->erp->GetSelectStaatenliste('DE');
|
||||
$bundesstaatendedb = $this->app->DB->SelectArr("SELECT bundesstaat, iso FROM bundesstaaten WHERE land = 'DE'");
|
||||
$fehlende = array();
|
||||
foreach($bundesstaatende as $key=>$value){
|
||||
if($this->in_array_r($value,$bundesstaatendedb)){
|
||||
}else{
|
||||
$fehlende[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$bundesstaatenat = $this->app->erp->GetSelectStaatenliste('AT');
|
||||
$bundesstaatenatdb = $this->app->DB->SelectArr("SELECT bundesstaat, iso FROM bundesstaaten WHERE land = 'AT'");
|
||||
$fehlenat = array();
|
||||
foreach($bundesstaatenat as $key=>$value){
|
||||
if($this->in_array_r($value,$bundesstaatenatdb)){
|
||||
}else{
|
||||
$fehlenat[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$bundesstaatench = $this->app->erp->GetSelectStaatenliste('CH');
|
||||
$bundesstaatenchdb = $this->app->DB->SelectArr("SELECT bundesstaat, iso FROM bundesstaaten WHERE land = 'CH'");
|
||||
$fehlench = array();
|
||||
foreach($bundesstaatench as $key=>$value){
|
||||
if($this->in_array_r($value,$bundesstaatenchdb)){
|
||||
}else{
|
||||
$fehlench[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$bundesstaatenus = $this->app->erp->GetSelectStaatenliste('US');
|
||||
$bundesstaatenusdb = $this->app->DB->SelectArr("SELECT bundesstaat, iso FROM bundesstaaten WHERE land = 'US'");
|
||||
$fehlenus = array();
|
||||
foreach($bundesstaatenus as $key=>$value){
|
||||
if($this->in_array_r($value,$bundesstaatenusdb)){
|
||||
}else{
|
||||
$fehlenus[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$bundesstaatenca = $this->app->erp->GetSelectStaatenliste('CA');
|
||||
$bundesstaatencadb = $this->app->DB->SelectArr("SELECT bundesstaat, iso FROM bundesstaaten WHERE land = 'CA'");
|
||||
$fehlenca = array();
|
||||
foreach($bundesstaatenca as $key=>$value){
|
||||
if($this->in_array_r($value,$bundesstaatencadb)){
|
||||
}else{
|
||||
$fehlenca[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$anzahlfehlen = (!empty($fehlende)?count($fehlende):0) + (!empty($fehlenat)?count($fehlenat):0) + (!empty($fehlench)?count($fehlench):0) + (!empty($fehlenus)?count($fehlenus):0) + (!empty($fehlenca)?count($fehlenca):0);
|
||||
|
||||
|
||||
if($anzahlfehlen > 0){
|
||||
if($anzahlfehlen == 1){
|
||||
$info = "Es steht ".$anzahlfehlen." neuer Bundesstaaten Eintrag in Xentral zur Verfügung.";
|
||||
}else{
|
||||
$info = "Es stehen ".$anzahlfehlen." neue Bundesstaaten Einträge in Xentral zur Verfügung.";
|
||||
}
|
||||
$nachladebutton = "<input type='submit' name='nachladen' id='nachladen' value='Jetzt nachladen'>";
|
||||
$info .= $nachladebutton;
|
||||
$this->app->Tpl->Set('MESSAGE',"<div class=\"info\">$info</div>");
|
||||
}
|
||||
|
||||
$nachladen = $this->app->Secure->GetPOST("nachladen");
|
||||
if($nachladen != ""){
|
||||
if((!empty($fehlende)?count($fehlende):0) > 0){
|
||||
foreach($fehlende as $key=>$value){
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('DE', '$key', '$value', 1)");
|
||||
}
|
||||
}
|
||||
|
||||
if((!empty($fehlenat)?count($fehlenat):0) > 0){
|
||||
foreach($fehlenat as $key=>$value){
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('AT', '$key', '$value', 1)");
|
||||
}
|
||||
}
|
||||
|
||||
if((!empty($fehlench)?count($fehlench):0) > 0){
|
||||
foreach($fehlench as $key=>$value){
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('CH', '$key', '$value', 1)");
|
||||
}
|
||||
}
|
||||
|
||||
if((!empty($fehlenus)?count($fehlenus):0) > 0){
|
||||
foreach($fehlenus as $key=>$value){
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('US', '$key', '$value', 1)");
|
||||
}
|
||||
}
|
||||
|
||||
if((!empty($fehlenca)?count($fehlenca):0) > 0){
|
||||
foreach($fehlenca as $key=>$value){
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('CA', '$key', '$value', 1)");
|
||||
}
|
||||
}
|
||||
|
||||
header("Location:index.php?module=bundesstaaten&action=list");
|
||||
exit;
|
||||
}
|
||||
|
||||
$laenderanzahl = $this->app->DB->Select("SELECT COUNT(id) FROM laender");
|
||||
//if($laenderanzahl <= 0){
|
||||
$select = '';
|
||||
$laender = $this->app->erp->GetSelectLaenderliste();
|
||||
foreach($laender as $key=>$value){
|
||||
if(trim($key) != "" && trim($key) != "0"){
|
||||
$select .= "<option value='".$key."'>".htmlspecialchars($value)."</option>";
|
||||
}
|
||||
|
||||
}
|
||||
//}else{
|
||||
//$laender = $this->app->DB->SelectArr("SELECT iso, bezeichnung_de FROM laender");
|
||||
//foreach($laender as $key=>$value){
|
||||
//$select .= "<option value='".$value['iso']."'>".$value['bezeichnung_de']."</option>";
|
||||
//}
|
||||
|
||||
$this->app->Tpl->Add("LAENDER", $select);
|
||||
//}
|
||||
|
||||
$this->app->YUI->TableSearch('TAB1','bundesstaaten_list', "show","","",basename(__FILE__), __CLASS__);
|
||||
$this->app->Tpl->Parse("PAGE","bundesstaaten_list.tpl");
|
||||
}
|
||||
|
||||
function BundesstaatenEdit()
|
||||
{
|
||||
if($this->app->Secure->GetGET('cmd')=='get'){
|
||||
$id = (int)$this->app->Secure->GetPOST('id');
|
||||
|
||||
$data = $this->app->DB->SelectArr("SELECT b.id, b.land, b.iso, b.bundesstaat, b.aktiv FROM bundesstaaten b WHERE b.id = '$id' LIMIT 1");
|
||||
|
||||
if($data){
|
||||
$data = reset($data);
|
||||
|
||||
}else{
|
||||
$data['id'] = 0;
|
||||
$data['land'] = '';
|
||||
$data['iso'] = '';
|
||||
$data['bundesstaat'] = '';
|
||||
$data['aktiv'] = 1;
|
||||
|
||||
}
|
||||
echo json_encode($data);
|
||||
exit;
|
||||
}
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "bundesstaaten_list.tpl");
|
||||
}
|
||||
|
||||
function BundesstaatenSave()
|
||||
{
|
||||
$id = (int)$this->app->Secure->GetPOST('id');
|
||||
$land = trim($this->app->Secure->GetPOST('land'));
|
||||
$iso = trim($this->app->Secure->GetPOST('iso'));
|
||||
$bundesstaat = trim($this->app->Secure->GetPOST('bundesstaat'));
|
||||
$aktiv = $this->app->Secure->GetPOST('aktiv');
|
||||
|
||||
$error = "";
|
||||
|
||||
if($land == ""){
|
||||
$error .= "Bitte Land ausfüllen\n";
|
||||
}
|
||||
|
||||
if($iso == ""){
|
||||
$error .= "Bitte ISO-Code ausfüllen"."\n";
|
||||
}
|
||||
|
||||
if(strlen($iso) > 2){
|
||||
$error .= "Bitte 2-stelligen ISO-Code für den Bundesstaat ausfüllen"."\n";
|
||||
}
|
||||
|
||||
if($bundesstaat == ""){
|
||||
$error .= "Bitte Bundesstaat ausfüllen"."\n";
|
||||
}
|
||||
|
||||
if($land != "" && $bundesstaat != ""){
|
||||
$isovorhanden = $this->app->DB->Select("SELECT id FROM bundesstaaten WHERE land = '$land' AND iso = '$iso' AND id != '$id' LIMIT 1");
|
||||
if($isovorhanden != ""){
|
||||
$error .= "Es gibt diesen ISO-Code bereits für dieses Land"."\n";
|
||||
}else{
|
||||
$schonvorhanden = $this->app->DB->Select("SELECT id FROM bundesstaaten WHERE land = '$land' AND iso = '$iso' AND bundesstaat = '$bundesstaat' AND id != '$id' LIMIT 1");
|
||||
if($schonvorhanden != ""){
|
||||
$error .= "Diesen Eintrag gibt es bereits"."\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($error == ""){
|
||||
if($id){
|
||||
$this->app->DB->Update("UPDATE bundesstaaten SET land = '$land', iso = '$iso', bundesstaat = '$bundesstaat', aktiv = '$aktiv' WHERE id = '$id'");
|
||||
|
||||
echo json_encode(array('status'=>1));
|
||||
exit;
|
||||
}else{
|
||||
$this->app->DB->Insert("INSERT INTO bundesstaaten (land, iso, bundesstaat, aktiv) VALUES ('$land', '$iso', '$bundesstaat', '$aktiv')");
|
||||
|
||||
echo json_encode(array('status'=>1));
|
||||
exit;
|
||||
|
||||
}
|
||||
}else{
|
||||
echo json_encode(array('status'=>0,'statusText'=>$error));
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function BundesstaatenDelete()
|
||||
{
|
||||
$id = (int) $this->app->Secure->GetPOST('id');
|
||||
if($id)
|
||||
$this->app->DB->Update("DELETE FROM bundesstaaten WHERE id = '$id'");
|
||||
|
||||
echo json_encode(array('status'=>1));
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -62,10 +62,14 @@
|
||||
<td>{|E-Mail|}:</td>
|
||||
<td><input type="text" name="email" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Kunde hat Abo|}</td><td><input type="checkbox" name="abo" value="1" /> {|Marketingsperre|}: <input type="checkbox" name="marketingsperre" value="1" /> {|Lead|}: <input type="checkbox" name="lead" value="1" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Lieferadresse|}:</td>
|
||||
<td><input type="text" name="lieferadresse" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Kunde hat Abo|}</td><td><input type="checkbox" name="abo" value="1" /> {|Marketingsperre|}: <input type="checkbox" name="marketingsperre" value="1" /> {|Lead|}: <input type="checkbox" name="lead" value="1" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -150,13 +154,15 @@
|
||||
[ROLLEN]
|
||||
</select>
|
||||
</td>
|
||||
<td>Gruppen:</td>
|
||||
<td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gruppen:</td>
|
||||
<td>
|
||||
<select name="gruppe">
|
||||
<option value="">{|Alle|}</option>
|
||||
[GRUPPEN]
|
||||
</select>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
145
www/pages/content/artikeltexte_edit.tpl
Normal file
145
www/pages/content/artikeltexte_edit.tpl
Normal file
@ -0,0 +1,145 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1"></a></li>
|
||||
</ul>
|
||||
<!-- Example for multiple tabs
|
||||
<ul hidden">
|
||||
<li><a href="#tabs-1">First Tab</a></li>
|
||||
<li><a href="#tabs-2">Second Tab</a></li>
|
||||
</ul>
|
||||
-->
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
<form action="" method="post">
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Artikeltexte (Übersetzung)|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr>
|
||||
<td>
|
||||
{|Artikel|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" value="[NAME_DE]" size="20" disabled>
|
||||
<input type="text" value="[ARTIKEL]" name="artikel" size="20" hidden>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Sprache|}:
|
||||
</td>
|
||||
<td>
|
||||
<select name="sprache">[SPRACHE]</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Aktiv|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="aktiv" id="aktiv" value="1" [AKTIV] size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Name|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="name" id="name" cols="160">[NAME]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Kurztext|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="kurztext" id="kurztext" cols="160">[KURZTEXT]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Beschreibung|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="beschreibung" id="beschreibung" cols="160">[BESCHREIBUNG]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Beschreibung online|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="beschreibung_online" id="beschreibung_online" cols="160">[BESCHREIBUNG_ONLINE]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Meta title|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="meta_title" id="meta_title" cols="160">[META_TITLE]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Meta description|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="meta_description" id="meta_description" cols="160">[META_DESCRIPTION]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Meta keywords|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="meta_keywords" id="meta_keywords" cols="160">[META_KEYWORDS]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Katalogartikel|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="katalogartikel" id="katalogartikel" value="1" [KATALOGARTIKEL] size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Katalogbezeichnung|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="katalog_bezeichnung" id="katalog_bezeichnung" cols="160">[KATALOG_BEZEICHNUNG]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Katalogtext|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="katalog_text" id="katalog_text" cols="160">[KATALOG_TEXT]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Shop|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="shop" id="shop" value="[SHOP]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" name="submit" value="Speichern" style="float:right" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
10
www/pages/content/artikeltexte_list.tpl
Normal file
10
www/pages/content/artikeltexte_list.tpl
Normal file
@ -0,0 +1,10 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">[TABTEXT1]</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
[TAB1]
|
||||
[TAB1NEXT]
|
||||
</div>
|
||||
</div>
|
@ -11,7 +11,7 @@
|
||||
<td colspan="4">[ERROR]</td>
|
||||
</tr>
|
||||
<tr id="trdropfiles">
|
||||
<td colspan="4">
|
||||
<td colspan="6">
|
||||
<div id="drop-files" ondragover="return false">
|
||||
{|Dateien hier einfügen|}
|
||||
</div>
|
||||
@ -333,8 +333,8 @@ $(document).ready(function() {
|
||||
}
|
||||
}
|
||||
|
||||
$('#trdatei').before('<tr><td>Datei '+vorschau+'</td><td class="tddateiname"><input type="hidden" name="dateiv[]" value="'+image+'" /><input type="hidden" name="dateiname[]" value="'+filenameEncoded+'" />'+filenameEncoded+'</td><td>Titel: <input type="text" name="dateititel[]" /></td><td><select name="dateistichwort[]">'+$('#stichwort').html()+'</select></td></tr>');
|
||||
};
|
||||
$('#trdatei').before(' <tr> <td>Datei '+vorschau+'</td> <td class="tddateiname"><input type="hidden" name="dateiv[]" value="'+image+'" /><input type="hidden" name="dateiname[]" value="'+filenameEncoded+'" />'+filenameEncoded+'</td> <td>Titel: <input type="text" name="dateititel[]" /></td> <td>{|Beschreibung|}:</td> <td><textarea name="dateibeschreibung[]" cols="50"></textarea></td> <td><select name="dateistichwort[]">'+$('#stichwort').html()+'</select></td> </tr> ');
|
||||
};
|
||||
|
||||
})(files[index]);
|
||||
fileReader.readAsDataURL(file);
|
||||
|
@ -51,7 +51,21 @@
|
||||
<td>Konto für Differenzen:</td>
|
||||
<td><input type="text" name="sachkonto" id="sachkonto" value="[SACHKONTO]" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<tr>
|
||||
<td>Format:</td>
|
||||
<td>
|
||||
<select name="format">
|
||||
<option value="ISO-8859-1">ISO-8859-1</option>
|
||||
<option value="UTF-8">UTF-8</option>
|
||||
<option value="UTF-8-BOM">UTF-8 mit BOM</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|PDF-Dateien exportieren:|}</td>
|
||||
<td><input type="checkbox" name="pdfexport" value="1" [PDFEXPORT] /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
784
www/pages/content/gruppen_edit.tpl
Normal file
784
www/pages/content/gruppen_edit.tpl
Normal file
@ -0,0 +1,784 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1"></a></li>
|
||||
</ul>
|
||||
<!-- Example for multiple tabs
|
||||
<ul hidden">
|
||||
<li><a href="#tabs-1">First Tab</a></li>
|
||||
<li><a href="#tabs-2">Second Tab</a></li>
|
||||
</ul>
|
||||
-->
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
<form action="" method="post">
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Gruppe|}</legend><i>Gruppe für die Zuordnung zu Preislisten, Onlineshop-Preislisten oder Adressgruppen</i>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr>
|
||||
<td>
|
||||
{|Aktiv|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="aktiv" id="aktiv" value="1" [AKTIV] size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Name|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="name" id="name" value="[NAME]" required size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Kennziffer|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="kennziffer" id="kennziffer" pattern="[a-zA-Z0-9_\-]+" value="[KENNZIFFER]" required size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Internebemerkung|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="internebemerkung" id="internebemerkung" rows="6" style="width:100%;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Art|}:
|
||||
</td>
|
||||
<td>
|
||||
<select name="art" id="art">
|
||||
[ARTSELECT]
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Projekt|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="projekt" id="projekt" value="[PROJEKT]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr [PREISGRUPPEHIDDEN]>
|
||||
<td>
|
||||
{|Grundrabatt|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="grundrabatt" id="grundrabatt" value="[GRUNDRABATT]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr [PREISGRUPPEHIDDEN]>
|
||||
<td>
|
||||
{|Zahlungszieltage|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="zahlungszieltage" id="zahlungszieltage" value="[ZAHLUNGSZIELTAGE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr [PREISGRUPPEHIDDEN]>
|
||||
<td>
|
||||
{|Zahlungszielskonto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="zahlungszielskonto" id="zahlungszielskonto" value="[ZAHLUNGSZIELSKONTO]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr [PREISGRUPPEHIDDEN]>
|
||||
<td>
|
||||
{|Zahlungszieltageskonto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="zahlungszieltageskonto" id="zahlungszieltageskonto" value="[ZAHLUNGSZIELTAGESKONTO]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr [PREISGRUPPEHIDDEN]>
|
||||
<td>
|
||||
{|Portofrei_aktiv|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="portofrei_aktiv" id="portofrei_aktiv" value="[PORTOFREI_AKTIV]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr [PREISGRUPPEHIDDEN]>
|
||||
<td>
|
||||
{|Portofreiab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="portofreiab" id="portofreiab" value="[PORTOFREIAB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Example for 2nd row
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Another legend|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr>
|
||||
<td>
|
||||
{|Name|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="name" id="name" value="[NAME]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Art|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="art" id="art" value="[ART]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Kennziffer|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="kennziffer" id="kennziffer" value="[KENNZIFFER]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Internebemerkung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="internebemerkung" id="internebemerkung" value="[INTERNEBEMERKUNG]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Grundrabatt|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="grundrabatt" id="grundrabatt" value="[GRUNDRABATT]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rabatt1|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rabatt1" id="rabatt1" value="[RABATT1]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rabatt2|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rabatt2" id="rabatt2" value="[RABATT2]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rabatt3|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rabatt3" id="rabatt3" value="[RABATT3]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rabatt4|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rabatt4" id="rabatt4" value="[RABATT4]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rabatt5|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rabatt5" id="rabatt5" value="[RABATT5]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Sonderrabatt_skonto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="sonderrabatt_skonto" id="sonderrabatt_skonto" value="[SONDERRABATT_SKONTO]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Provision|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="provision" id="provision" value="[PROVISION]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Kundennummer|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="kundennummer" id="kundennummer" value="[KUNDENNUMMER]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Partnerid|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="partnerid" id="partnerid" value="[PARTNERID]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Dta_aktiv|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="dta_aktiv" id="dta_aktiv" value="[DTA_AKTIV]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Dta_periode|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="dta_periode" id="dta_periode" value="[DTA_PERIODE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Dta_dateiname|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="dta_dateiname" id="dta_dateiname" value="[DTA_DATEINAME]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Dta_mail|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="dta_mail" id="dta_mail" value="[DTA_MAIL]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Dta_mail_betreff|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="dta_mail_betreff" id="dta_mail_betreff" value="[DTA_MAIL_BETREFF]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Dta_mail_text|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="dta_mail_text" id="dta_mail_text" value="[DTA_MAIL_TEXT]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Dtavariablen|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="dtavariablen" id="dtavariablen" value="[DTAVARIABLEN]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Dta_variante|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="dta_variante" id="dta_variante" value="[DTA_VARIANTE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus1|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus1" id="bonus1" value="[BONUS1]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus1_ab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus1_ab" id="bonus1_ab" value="[BONUS1_AB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus2|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus2" id="bonus2" value="[BONUS2]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus2_ab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus2_ab" id="bonus2_ab" value="[BONUS2_AB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus3|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus3" id="bonus3" value="[BONUS3]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus3_ab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus3_ab" id="bonus3_ab" value="[BONUS3_AB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus4|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus4" id="bonus4" value="[BONUS4]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus4_ab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus4_ab" id="bonus4_ab" value="[BONUS4_AB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus5|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus5" id="bonus5" value="[BONUS5]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus5_ab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus5_ab" id="bonus5_ab" value="[BONUS5_AB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus6|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus6" id="bonus6" value="[BONUS6]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus6_ab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus6_ab" id="bonus6_ab" value="[BONUS6_AB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus7|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus7" id="bonus7" value="[BONUS7]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus7_ab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus7_ab" id="bonus7_ab" value="[BONUS7_AB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus8|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus8" id="bonus8" value="[BONUS8]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus8_ab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus8_ab" id="bonus8_ab" value="[BONUS8_AB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus9|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus9" id="bonus9" value="[BONUS9]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus9_ab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus9_ab" id="bonus9_ab" value="[BONUS9_AB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus10|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus10" id="bonus10" value="[BONUS10]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bonus10_ab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="bonus10_ab" id="bonus10_ab" value="[BONUS10_AB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Zahlungszieltage|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="zahlungszieltage" id="zahlungszieltage" value="[ZAHLUNGSZIELTAGE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Zahlungszielskonto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="zahlungszielskonto" id="zahlungszielskonto" value="[ZAHLUNGSZIELSKONTO]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Zahlungszieltageskonto|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="zahlungszieltageskonto" id="zahlungszieltageskonto" value="[ZAHLUNGSZIELTAGESKONTO]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Portoartikel|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="portoartikel" id="portoartikel" value="[PORTOARTIKEL]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Portofreiab|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="portofreiab" id="portofreiab" value="[PORTOFREIAB]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Erweiterteoptionen|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="erweiterteoptionen" id="erweiterteoptionen" value="[ERWEITERTEOPTIONEN]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Zentralerechnung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="zentralerechnung" id="zentralerechnung" value="[ZENTRALERECHNUNG]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Zentralregulierung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="zentralregulierung" id="zentralregulierung" value="[ZENTRALREGULIERUNG]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Gruppe|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="gruppe" id="gruppe" value="[GRUPPE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Preisgruppe|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="preisgruppe" id="preisgruppe" value="[PREISGRUPPE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Verbandsgruppe|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="verbandsgruppe" id="verbandsgruppe" value="[VERBANDSGRUPPE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnung_name|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung_name" id="rechnung_name" value="[RECHNUNG_NAME]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnung_strasse|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung_strasse" id="rechnung_strasse" value="[RECHNUNG_STRASSE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnung_ort|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung_ort" id="rechnung_ort" value="[RECHNUNG_ORT]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnung_plz|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung_plz" id="rechnung_plz" value="[RECHNUNG_PLZ]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnung_abteilung|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung_abteilung" id="rechnung_abteilung" value="[RECHNUNG_ABTEILUNG]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnung_land|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung_land" id="rechnung_land" value="[RECHNUNG_LAND]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnung_email|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung_email" id="rechnung_email" value="[RECHNUNG_EMAIL]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnung_periode|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung_periode" id="rechnung_periode" value="[RECHNUNG_PERIODE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnung_anzahlpapier|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung_anzahlpapier" id="rechnung_anzahlpapier" value="[RECHNUNG_ANZAHLPAPIER]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Rechnung_permail|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnung_permail" id="rechnung_permail" value="[RECHNUNG_PERMAIL]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Webid|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="webid" id="webid" value="[WEBID]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Portofrei_aktiv|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="portofrei_aktiv" id="portofrei_aktiv" value="[PORTOFREI_AKTIV]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Projekt|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="projekt" id="projekt" value="[PROJEKT]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Objektname|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="objektname" id="objektname" value="[OBJEKTNAME]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Objekttyp|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="objekttyp" id="objekttyp" value="[OBJEKTTYP]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Parameter|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="parameter" id="parameter" value="[PARAMETER]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Objektname2|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="objektname2" id="objektname2" value="[OBJEKTNAME2]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Objekttyp2|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="objekttyp2" id="objekttyp2" value="[OBJEKTTYP2]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Parameter2|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="parameter2" id="parameter2" value="[PARAMETER2]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Objektname3|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="objektname3" id="objektname3" value="[OBJEKTNAME3]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Objekttyp3|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="objekttyp3" id="objekttyp3" value="[OBJEKTTYP3]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Parameter3|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="parameter3" id="parameter3" value="[PARAMETER3]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Kategorie|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="kategorie" id="kategorie" value="[KATEGORIE]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Aktiv|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="aktiv" id="aktiv" value="[AKTIV]" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<input type="submit" name="submit" value="Speichern" style="float:right"/>
|
||||
</form>
|
||||
</div>
|
||||
<!-- Example for 2nd tab
|
||||
<div id="tabs-2">
|
||||
[MESSAGE]
|
||||
<form action="" method="post">
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|...|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
...
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" name="submit" value="Speichern" style="float:right"/>
|
||||
</form>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
|
@ -1,661 +1,10 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1"></a></li>
|
||||
<li><a href="#tabs-2"></a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
|
||||
[MESSAGE]
|
||||
|
||||
<div class="filter-box filter-usersave">
|
||||
<div class="filter-block filter-inline">
|
||||
<div class="filter-title">{|Filter|}</div>
|
||||
<ul class="filter-list">
|
||||
<li class="filter-item">
|
||||
<label for="inaktiv" class="switch">
|
||||
<input type="checkbox" id="inaktiv" title="inaktive">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="inaktiv">{|nur inaktive|}</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
[TAB1]
|
||||
<ul>
|
||||
<li><a href="#tabs-1">[TABTEXT1]</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
[TAB1]
|
||||
[TAB1NEXT]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tabs-3">
|
||||
[TAB3]
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
[EXTRA]
|
||||
|
||||
<!--<div id="editGruppen" style="display:none;" title="Bearbeiten">
|
||||
<form method="post">
|
||||
<input type="hidden" id="e_id">
|
||||
|
||||
<table class="tableborder" border="0" cellpadding="3" cellspacing="0" width="100%">
|
||||
<tbody>
|
||||
<tr valign="top" colspan="3">
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend>{|Einstellung|}</legend>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="200">{|Aktiv|}:</td><td><input type="checkbox" name="aktiv" id="aktiv" value="1"> <i>{|Bitte aktivieren|}! ({|Ist die Gruppe nicht aktiv wird diese für die Neuanlage von Verknüpfungen ausgeblendet. Die Gruppe besteht in den aktuellen Verknüpfungen weiterhin|}.)</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Bezeichnung|}:</td><td><input type="text" name="name" id="name" size="80" rule="notempty" msg="Pflichfeld!" tabindex="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Kennziffer|}:</td><td><input type="text" name="kennziffer" id="kennziffer" size="80" tabindex="2" rule="notempty" msg="Pflichfeld!"> <i>{|z.B.|} 01, 02, ...</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Interne Bemerkung|}:</td><td><textarea rows="10" cols="130" name="internebemerkung" id="internebemerkung"></textarea></td><td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Art|}:</td><td><select name="art" id="art">[ART]<!--<option value="gruppe">Gruppe</option><option value="preisgruppe">Preisgruppe</option>
|
||||
<!--<option value="verband">Verband</option>--></select></td>
|
||||
<!--</tr>
|
||||
<tr>
|
||||
<td width="200">{|Projekt|}:</td><td><input type="text" name="projekt" id="projekt" size="80" tabindex="2"> <i>{|optionale Angabe|}</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Kategorie|}:</td><td><input type="text" name="kategorie" id="kategorie" size="80" tabindex="2"> <i>{|optionale Angabe|}</i></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<div id="rabatte">
|
||||
<fieldset>
|
||||
<legend>{|Rabatte / Zahlungen|}</legend>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="200">{|Grundrabatt|}:</td><td><input type="text" name="grundrabatt" id="grundrabatt" size="20" tabindex="2"> % <i>{|z.B.|} 20 {|für|} 20% ({|der Rabatt gilt nur für Standardpreise, nicht für Gruppen- oder Kundenspezifische Preise|}.)</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Zahlungszieltage|}:</td><td><input type="text" name="zahlungszieltage" id="zahlungszieltage" size="20" tabindex="2"> {|Tage|} <i>{|z.B.|} 30</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Skonto|}:</td><td><input type="text" name="zahlungszielskonto" id="zahlungszielskonto" size="20" tabindex="2"> % <i>{|z.B.|} 2</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Skonto Tage|}:</td><td><input type="text" name="zahlungszieltageskonto" id="zahlungszieltageskonto" size="20" tabindex="2"> {|Tage|} <i>{|z.B.|} 10</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Porto frei aktiv|}:</td><td><input type="checkbox" name="portofrei_aktiv" id="portofrei_aktiv" value="1"> {|ab|} <input type="text" name="portofreiab" id="portofreiab" size="12"> € <i>{|Porto frei ab bestimmtem Umsatz (netto)|}</i></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="rabatte2">
|
||||
<fieldset>
|
||||
<legend>{|Verbandsoptionen|}</legend>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="200">{|Rabatte|}*:</td><td>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>{|Rabatt 1|}:</td><td><input type="text" name="rabatt1" id="rabatt1" size="5"> %</td><td width="100"> </td>
|
||||
<td>{|Bonus 1|}:</td><td><input type="text" name="bonus1" id="bonus1" size="5"> % {|ab|} <input type="text" name="bonus1_ab" id="bonus1_ab" size="10"> €</td><td width="50"> </td>
|
||||
<td>{|Bonus 6|}:</td><td><input type="text" name="bonus6" id="bonus6" size="5"> % {|ab|} <input type="text" name="bonus6_ab" id="bonus6_ab" size="10"> €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Rabatt 2|}:</td><td><input type="text" name="rabatt2" id="rabatt2" size="5"> %</td><td width="100"> </td>
|
||||
<td>{|Bonus 2|}:</td><td><input type="text" name="bonus2" id="bonus2" size="5"> % {|ab|} <input type="text" name="bonus2_ab" id="bonus2_ab" size="10"> €</td><td width="50"> </td>
|
||||
<td>{|Bonus 7|}:</td><td><input type="text" name="bonus7" id="bonus7" size="5"> % {|ab|} <input type="text" name="bonus7_ab" id="bonus7_ab" size="10"> €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Rabatt 3|}:</td><td><input type="text" name="rabatt3" id="rabatt3" size="5"> %</td><td width="100"> </td>
|
||||
<td>{|Bonus 3|}:</td><td><input type="text" name="bonus3" id="bonus3" size="5"> % {|ab|} <input type="text" name="bonus3_ab" id="bonus3_ab" size="10"> €</td><td width="50"> </td>
|
||||
<td>{|Bonus 8|}:</td><td><input type="text" name="bonus8" id="bonus8" size="5"> % {|ab|} <input type="text" name="bonus8_ab" id="bonus8_ab" size="10"> €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Rabatt 4|}:</td><td><input type="text" name="rabatt4" id="rabatt4" size="5"> %</td><td width="100"> </td>
|
||||
<td>{|Bonus 4|}:</td><td><input type="text" name="bonus4" id="bonus4" size="5"> % {|ab|} <input type="text" name="bonus4_ab" id="bonus4_ab" size="10"> €</td><td width="50"> </td>
|
||||
<td>{|Bonus 9|}:</td><td><input type="text" name="bonus9" id="bonus9" size="5"> % {|ab|} <input type="text" name="bonus9_ab" id="bonus9_ab" size="10"> €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Rabatt 5|}:</td><td><input type="text" name="rabatt5" id="rabatt5" size="5"> %</td><td width="100"> </td>
|
||||
<td>{|Bonus 5|}:</td><td><input type="text" name="bonus5" id="bonus5" size="5"> % {|ab|} <input type="text" name="bonus5_ab" id="bonus5_ab" size="10"> €</td><td width="50"> </td>
|
||||
<td>{|Bonus 10|}:</td><td><input type="text" name="bonus10" id="bonus10" size="5"> % {|ab|} <input type="text" name="bonus10_ab" id="bonus10_ab" size="10"> €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Provision|}:</td><td><input type="text" name="provision" id="provision" size="5"> %</td><td width="100"> </td>
|
||||
<td></td><td></td><td width="50"> </td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Sonderrabatt|}:</td><td colspan="2"><input type="text" name="sonderrabatt_skonto" id="sonderrabatt_skonto" size="5"> % ({|bei Skonto|})</td>
|
||||
<td></td><td></td><td width="50"> </td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8">* {|der Rabatt gilt nur für Standardpreise, nicht für Gruppen- oder Kundenspezifische Preise|}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td><td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>{|Buchhaltung Einstellungen|}</legend>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="200">{|Zentralregulierung|}:</td><td><input type="checkbox" name="zentralregulierung" id="zentralregulierung" value="1"></td>
|
||||
</tr>
|
||||
<!--<tr><td width="200">{|Zentrale Rechnungsadresse|}:</td><td><input type="checkbox" name="zentralerechnung" value="1"></td></tr>-->
|
||||
<!--<tr>
|
||||
<td>{|Periode der Rechnung|}:</td><td><select name="rechnung_periode" id="rechnung_periode"><option value="1">täglich</option><option value="2">wöchentlich</option><option value="4">14tägig</option><option value="5">monatlich</option><option value="6">einzel</option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Anzahl Papierrechnungen|}:</td><td><input type="text" name="rechnung_anzahlpapier" id="rechnung_anzahlpapier" size="5" tabindex="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Rechnung per Mail|}:</td><td><input type="checkbox" name="rechnung_permail" id="rechnung_permail" value="1" tabindex="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Name / Firma|}:</td><td><input type="text" name="rechnung_name" id="rechnung_name" size="50" tabindex="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Abteilung|}:</td><td><input type="text" name="rechnung_abteilung" id="rechnung_abteilung" size="50" tabindex="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">Strasse + Hausnummer:</td><td><input type="text" name="rechnung_strasse" id="rechnung_strasse" size="50" tabindex="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|PLZ / Ort|}:</td><td><input type="text" name="rechnung_plz" id="rechnung_plz" size="10"> <input type="text" name="rechnung_ort" id="rechnung_ort" size="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Land|}:</td><td><input type="text" name="rechnung_land" id="rechnung_land"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|E-Mail|}:</td><td><input type="text" name="rechnung_email" id="rechnung_email"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Kundennummer im Verband|}:</td><td><input type="text" name="kundennummer" id="kundennummer"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend>{|DTA - Datenträger Austausch Einstellungen|}</legend>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="200">{|Aktiv|}:</td><td><input type="checkbox" name="dta_aktiv" id="dta_aktiv" value="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Variante|}:</td><td><select name="dta_variante" id="dta_variante">
|
||||
<option value="1">Variante 1</option>
|
||||
<option value="2">Variante 2</option>
|
||||
<option value="3">Variante 3</option>
|
||||
<option value="4">Variante 4</option>
|
||||
<option value="5">Variante 5</option>
|
||||
<option value="6">Variante 6</option>
|
||||
<option value="7">Variante 7</option>
|
||||
<option value="8">Variante 8</option>
|
||||
<option value="9">Variante 9</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|DTA Variablen|}:</td><td><textarea name="dtavariablen" id="dtavariablen" rows="10" cols="50"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Periode|}:</td><td><select name="dta_periode" id="dta_periode"><option value="1">15,30</option>
|
||||
<option value="2">7,15,22,30</option>
|
||||
<option value="3">Dienstag</option>
|
||||
<option value="4">Montag</option>
|
||||
<option value="5">2,11,27</option>
|
||||
<option value="6">2</option>
|
||||
<option value="7">Freitags</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Partner ID für DTA|}:</td><td><input type="text" name="partnerid" id="partnerid" size="50"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|Dateiname|}:</td><td><input type="text" name="dta_dateiname" id="dta_dateiname" size="50" tabindex="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|E-Mail Empfänger|}:</td><td><input type="text" name="dta_mail" id="dta_mail" size="50" tabindex="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|E-Mail Betreff|}:</td><td><input type="text" name="dta_mail_betreff" id="dta_mail_betreff" size="50" tabindex="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200">{|E-Mail Textvorlage|}:</td><td><textarea name="dta_mail_text" id="dta_mail_text" rows="10" cols="50"></textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!--<tr valign="" height="" bgcolor="" align="" bordercolor="" class="klein" classname="klein">
|
||||
<td width="" valign="" height="" bgcolor="" align="right" colspan="3" bordercolor="" classname="orange2" class="orange2">
|
||||
<input type="submit" value="Speichern" />
|
||||
</tr>-->
|
||||
|
||||
<!--</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</form>-->
|
||||
|
||||
|
||||
<!--<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
art = document.getElementById('art');
|
||||
rabatt = document.getElementById('rabatte');
|
||||
rabatt2 = document.getElementById('rabatte2');
|
||||
if(art){
|
||||
// Hide the target field if priority isn't critical
|
||||
if(art.options[art.selectedIndex].value =='gruppe'){
|
||||
rabatt.style.display='none';
|
||||
rabatt2.style.display='none';
|
||||
}else if(art.options[art.selectedIndex].value =='preisgruppe'){
|
||||
rabatt.style.display='';
|
||||
rabatt2.style.display='none';
|
||||
}else if(art.options[art.selectedIndex].value =='verband'){
|
||||
rabatt.style.display='';
|
||||
rabatt2.style.display='';
|
||||
}else{
|
||||
rabatt.style.display='none';
|
||||
rabatt2.style.display='none';
|
||||
}
|
||||
|
||||
art.onchange=function(){
|
||||
if(art.options[art.selectedIndex].value == 'gruppe'){
|
||||
rabatt.style.display='none';
|
||||
rabatt2.style.display='none';
|
||||
}else if(art.options[art.selectedIndex].value == 'preisgruppe'){
|
||||
rabatt.style.display='';
|
||||
rabatt2.style.display='none';
|
||||
}else if(art.options[art.selectedIndex].value == 'verband'){
|
||||
rabatt.style.display='';
|
||||
rabatt2.style.display='';
|
||||
}else{
|
||||
rabatt.style.display='none';
|
||||
rabatt2.style.display='none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$('#aktiv').focus();
|
||||
|
||||
$("#editGruppen").dialog({
|
||||
modal: true,
|
||||
bgiframe: true,
|
||||
closeOnEscape:false,
|
||||
minWidth:1200,
|
||||
maxHeight:900,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
ABBRECHEN: function() {
|
||||
GruppenReset();
|
||||
$(this).dialog('close');
|
||||
},
|
||||
SPEICHERN: function() {
|
||||
GruppenEditSave();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#editGruppen").dialog({
|
||||
|
||||
close: function( event, ui ) { GruppenReset();}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
function GruppenReset()
|
||||
{
|
||||
$('#editGruppen').find('#e_id').val('');
|
||||
$('#editGruppen').find('#aktiv').prop("checked",false);
|
||||
$('#editGruppen').find('#name').val('');
|
||||
$('#editGruppen').find('#kennziffer').val('');
|
||||
$('#editGruppen').find('#internebemerkung').val('');
|
||||
$('#editGruppen').find('#art').val('gruppe');
|
||||
$('#editGruppen').find('#projekt').val('');
|
||||
$('#editGruppen').find('#kategorie').val('');
|
||||
$('#editGruppen').find('#grundrabatt').val('');
|
||||
$('#editGruppen').find('#zahlungszieltage').val('');
|
||||
$('#editGruppen').find('#zahlungszielskonto').val('');
|
||||
$('#editGruppen').find('#zahlungszieltageskonto').val('');
|
||||
$('#editGruppen').find('#portofrei_aktiv').prop("checked",false);
|
||||
$('#editGruppen').find('#portofreiab').val('');
|
||||
$('#editGruppen').find('#rabatt1').val('');
|
||||
$('#editGruppen').find('#bonus1').val('');
|
||||
$('#editGruppen').find('#bonus1_ab').val('');
|
||||
$('#editGruppen').find('#bonus6').val('');
|
||||
$('#editGruppen').find('#bonus6_ab').val('');
|
||||
$('#editGruppen').find('#rabatt2').val('');
|
||||
$('#editGruppen').find('#bonus2').val('');
|
||||
$('#editGruppen').find('#bonus2_ab').val('');
|
||||
$('#editGruppen').find('#bonus7').val('');
|
||||
$('#editGruppen').find('#bonus7_ab').val('');
|
||||
$('#editGruppen').find('#rabatt3').val('');
|
||||
$('#editGruppen').find('#bonus3').val('');
|
||||
$('#editGruppen').find('#bonus3_ab').val('');
|
||||
$('#editGruppen').find('#bonus8').val('');
|
||||
$('#editGruppen').find('#bonus8_ab').val('');
|
||||
$('#editGruppen').find('#rabatt4').val('');
|
||||
$('#editGruppen').find('#bonus4').val('');
|
||||
$('#editGruppen').find('#bonus4_ab').val('');
|
||||
$('#editGruppen').find('#bonus9').val('');
|
||||
$('#editGruppen').find('#bonus9_ab').val('');
|
||||
$('#editGruppen').find('#rabatt5').val('');
|
||||
$('#editGruppen').find('#bonus5').val('');
|
||||
$('#editGruppen').find('#bonus5_ab').val('');
|
||||
$('#editGruppen').find('#bonus10').val('');
|
||||
$('#editGruppen').find('#bonus10_ab').val('');
|
||||
$('#editGruppen').find('#provision').val('');
|
||||
$('#editGruppen').find('#sonderrabatt_skonto').val('');
|
||||
$('#editGruppen').find('#zentralregulierung').prop("checked",false);
|
||||
$('#editGruppen').find('#rechnung_periode').val('1');
|
||||
$('#editGruppen').find('#rechnung_anzahlpapier').val('');
|
||||
$('#editGruppen').find('#rechnung_permail').prop("checked",false);
|
||||
$('#editGruppen').find('#rechnung_name').val('');
|
||||
$('#editGruppen').find('#rechnung_abteilung').val('');
|
||||
$('#editGruppen').find('#rechnung_strasse').val('');
|
||||
$('#editGruppen').find('#rechnung_plz').val('');
|
||||
$('#editGruppen').find('#rechnung_ort').val('');
|
||||
$('#editGruppen').find('#rechnung_land').val('');
|
||||
$('#editGruppen').find('#rechnung_email').val('');
|
||||
$('#editGruppen').find('#kundennummer').val('');
|
||||
$('#editGruppen').find('#dta_aktiv').prop("checked",false);
|
||||
$('#editGruppen').find('#dta_variante').val('1');
|
||||
$('#editGruppen').find('#dtavariablen').val('');
|
||||
$('#editGruppen').find('#dta_periode').val('1');
|
||||
$('#editGruppen').find('#partnerid').val('');
|
||||
$('#editGruppen').find('#dta_dateiname').val('');
|
||||
$('#editGruppen').find('#dta_mail').val('');
|
||||
$('#editGruppen').find('#dta_mail_betreff').val('');
|
||||
$('#editGruppen').find('#dta_mail_text').val('');
|
||||
|
||||
|
||||
|
||||
art = document.getElementById('art');
|
||||
rabatt = document.getElementById('rabatte');
|
||||
rabatt2 = document.getElementById('rabatte2');
|
||||
if(art){
|
||||
// Hide the target field if priority isn't critical
|
||||
if(art.options[art.selectedIndex].value =='gruppe'){
|
||||
rabatt.style.display='none';
|
||||
rabatt2.style.display='none';
|
||||
}else if(art.options[art.selectedIndex].value =='preisgruppe'){
|
||||
rabatt.style.display='';
|
||||
rabatt2.style.display='none';
|
||||
}else if(art.options[art.selectedIndex].value =='verband'){
|
||||
rabatt.style.display='';
|
||||
rabatt2.style.display='';
|
||||
}else{
|
||||
rabatt.style.display='none';
|
||||
rabatt2.style.display='none';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function GruppenEditSave() {
|
||||
$.ajax({
|
||||
url: 'index.php?module=gruppen&action=edit&cmd=save',
|
||||
data: {
|
||||
//Alle Felder die fürs editieren vorhanden sind
|
||||
id: $('#e_id').val(),
|
||||
eaktiv: $('#aktiv').prop("checked")?1:0,
|
||||
ename: $('#name').val(),
|
||||
ekennziffer: $('#kennziffer').val(),
|
||||
einternebemerkung: $('#internebemerkung').val(),
|
||||
eart: $('#art').val(),
|
||||
eprojekt: $('#projekt').val(),
|
||||
ekategorie: $('#kategorie').val(),
|
||||
egrundrabatt: $('#grundrabatt').val(),
|
||||
ezahlungszieltage: $('#zahlungszieltage').val(),
|
||||
ezahlungszielskonto: $('#zahlungszielskonto').val(),
|
||||
ezahlungszieltageskonto: $('#zahlungszieltageskonto').val(),
|
||||
eportofrei_aktiv: $('#portofrei_aktiv').prop("checked")?1:0,
|
||||
eportofreiab: $('#portofreiab').val(),
|
||||
erabatt1: $('#rabatt1').val(),
|
||||
ebonus1: $('#bonus1').val(),
|
||||
ebonus1_ab: $('#bonus1_ab').val(),
|
||||
ebonus6: $('#bonus6').val(),
|
||||
ebonus6_ab: $('#bonus6_ab').val(),
|
||||
erabatt2: $('#rabatt2').val(),
|
||||
ebonus2: $('#bonus2').val(),
|
||||
ebonus2_ab: $('#bonus2_ab').val(),
|
||||
ebonus7: $('#bonus7').val(),
|
||||
ebonus7_ab: $('#bonus7_ab').val(),
|
||||
erabatt3: $('#rabatt3').val(),
|
||||
ebonus3: $('#bonus3').val(),
|
||||
ebonus3_ab: $('#bonus3_ab').val(),
|
||||
ebonus8: $('#bonus8').val(),
|
||||
ebonus8_ab: $('#bonus8_ab').val(),
|
||||
erabatt4: $('#rabatt4').val(),
|
||||
ebonus4: $('#bonus4').val(),
|
||||
ebonus4_ab: $('#bonus4_ab').val(),
|
||||
ebonus9: $('#bonus9').val(),
|
||||
ebonus9_ab: $('#bonus9_ab').val(),
|
||||
erabatt5: $('#rabatt5').val(),
|
||||
ebonus5: $('#bonus5').val(),
|
||||
ebonus5_ab: $('#bonus5_ab').val(),
|
||||
ebonus10: $('#bonus10').val(),
|
||||
ebonus10_ab: $('#bonus10_ab').val(),
|
||||
eprovision: $('#provision').val(),
|
||||
esonderrabatt_skonto: $('#sonderrabatt_skonto').val(),
|
||||
ezentralregulierung: $('#zentralregulierung').prop("checked")?1:0,
|
||||
erechnung_periode: $('#rechnung_periode').val(),
|
||||
erechnung_anzahlpapier: $('#rechnung_anzahlpapier').val(),
|
||||
erechnung_permail: $('#rechnung_permail').prop("checked")?1:0,
|
||||
erechnung_name: $('#rechnung_name').val(),
|
||||
erechnung_abteilung: $('#rechnung_abteilung').val(),
|
||||
erechnung_strasse: $('#rechnung_strasse').val(),
|
||||
erechnung_plz: $('#rechnung_plz').val(),
|
||||
erechnung_ort: $('#rechnung_ort').val(),
|
||||
erechnung_land: $('#rechnung_land').val(),
|
||||
erechnung_email: $('#rechnung_email').val(),
|
||||
ekundennummer: $('#kundennummer').val(),
|
||||
edta_aktiv: $('#dta_aktiv').prop("checked")?1:0,
|
||||
edta_variante: $('#dta_variante').val(),
|
||||
edtavariablen: $('#dtavariablen').val(),
|
||||
edta_periode: $('#dta_periode').val(),
|
||||
epartnerid: $('#partnerid').val(),
|
||||
edta_dateiname: $('#dta_dateiname').val(),
|
||||
edta_mail: $('#dta_mail').val(),
|
||||
edta_mail_betreff: $('#dta_mail_betreff').val(),
|
||||
edta_mail_text: $('#dta_mail_text').val()
|
||||
|
||||
|
||||
},
|
||||
method: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
App.loading.open();
|
||||
},
|
||||
success: function(data) {
|
||||
App.loading.close();
|
||||
if (data.status == 1) {
|
||||
GruppenReset();
|
||||
updateLiveTable();
|
||||
$("#editGruppen").dialog('close');
|
||||
} else {
|
||||
alert(data.statusText);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function GruppenEdit(id) {
|
||||
if(id > 0)
|
||||
{
|
||||
$.ajax({
|
||||
url: 'index.php?module=gruppen&action=edit&cmd=get',
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
method: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
App.loading.open();
|
||||
},
|
||||
success: function(data) {
|
||||
if(data.id > 0)
|
||||
{
|
||||
$('#editGruppen').find('#e_id').val(data.id);
|
||||
$('#editGruppen').find('#aktiv').prop("checked", data.aktiv==1?true:false);
|
||||
$('#editGruppen').find('#name').val(data.name);
|
||||
$('#editGruppen').find('#kennziffer').val(data.kennziffer);
|
||||
$('#editGruppen').find('#internebemerkung').val(data.internebemerkung);
|
||||
$('#editGruppen').find('#art').val(data.art);
|
||||
$('#editGruppen').find('#projekt').val(data.projekt);
|
||||
$('#editGruppen').find('#kategorie').val(data.kategorie);
|
||||
$('#editGruppen').find('#grundrabatt').val(data.grundrabatt);
|
||||
$('#editGruppen').find('#zahlungszieltage').val(data.zahlungszieltage);
|
||||
$('#editGruppen').find('#zahlungszielskonto').val(data.zahlungszielskonto);
|
||||
$('#editGruppen').find('#zahlungszieltageskonto').val(data.zahlungszieltageskonto);
|
||||
$('#editGruppen').find('#portofrei_aktiv').prop("checked", data.portofrei_aktiv==1?true:false);
|
||||
$('#editGruppen').find('#portofreiab').val(data.portofreiab);
|
||||
$('#editGruppen').find('#rabatt1').val(data.rabatt1);
|
||||
$('#editGruppen').find('#bonus1').val(data.bonus1);
|
||||
$('#editGruppen').find('#bonus1_ab').val(data.bonus1_ab);
|
||||
$('#editGruppen').find('#bonus6').val(data.bonus6);
|
||||
$('#editGruppen').find('#bonus6_ab').val(data.bonus6_ab);
|
||||
$('#editGruppen').find('#rabatt2').val(data.rabatt2);
|
||||
$('#editGruppen').find('#bonus2').val(data.bonus2);
|
||||
$('#editGruppen').find('#bonus2_ab').val(data.bonus2_ab);
|
||||
$('#editGruppen').find('#bonus7').val(data.bonus7);
|
||||
$('#editGruppen').find('#bonus7_ab').val(data.bonus7_ab);
|
||||
$('#editGruppen').find('#rabatt3').val(data.rabatt3);
|
||||
$('#editGruppen').find('#bonus3').val(data.bonus3);
|
||||
$('#editGruppen').find('#bonus3_ab').val(data.bonus3_ab);
|
||||
$('#editGruppen').find('#bonus8').val(data.bonus8);
|
||||
$('#editGruppen').find('#bonus8_ab').val(data.bonus8_ab);
|
||||
$('#editGruppen').find('#rabatt4').val(data.rabatt4);
|
||||
$('#editGruppen').find('#bonus4').val(data.bonus4);
|
||||
$('#editGruppen').find('#bonus4_ab').val(data.bonus4_ab);
|
||||
$('#editGruppen').find('#bonus9').val(data.bonus9);
|
||||
$('#editGruppen').find('#bonus9_ab').val(data.bonus9_ab);
|
||||
$('#editGruppen').find('#rabatt5').val(data.rabatt5);
|
||||
$('#editGruppen').find('#bonus5').val(data.bonus5);
|
||||
$('#editGruppen').find('#bonus5_ab').val(data.bonus5_ab);
|
||||
$('#editGruppen').find('#bonus10').val(data.bonus10);
|
||||
$('#editGruppen').find('#bonus10_ab').val(data.bonus10_ab);
|
||||
$('#editGruppen').find('#provision').val(data.provision);
|
||||
$('#editGruppen').find('#sonderrabatt_skonto').val(data.sonderrabatt_skonto);
|
||||
$('#editGruppen').find('#zentralregulierung').prop("checked", data.zentralregulierung==1?true:false);
|
||||
$('#editGruppen').find('#rechnung_periode').val(data.rechnung_periode);
|
||||
$('#editGruppen').find('#rechnung_anzahlpapier').val(data.rechnung_anzahlpapier);
|
||||
$('#editGruppen').find('#rechnung_permail').prop("checked", data.rechnung_permail==1?true:false);
|
||||
$('#editGruppen').find('#rechnung_name').val(data.rechnung_name);
|
||||
$('#editGruppen').find('#rechnung_abteilung').val(data.rechnung_abteilung);
|
||||
$('#editGruppen').find('#rechnung_strasse').val(data.rechnung_strasse);
|
||||
$('#editGruppen').find('#rechnung_plz').val(data.rechnung_plz);
|
||||
$('#editGruppen').find('#rechnung_ort').val(data.rechnung_ort);
|
||||
$('#editGruppen').find('#rechnung_land').val(data.rechnung_land);
|
||||
$('#editGruppen').find('#rechnung_email').val(data.rechnung_email);
|
||||
$('#editGruppen').find('#kundennummer').val(data.kundennummer);
|
||||
$('#editGruppen').find('#dta_aktiv').prop("checked", data.dta_aktiv==1?true:false);
|
||||
$('#editGruppen').find('#dta_variante').val(data.dta_variante);
|
||||
$('#editGruppen').find('#dtavariablen').val(data.dtavariablen);
|
||||
$('#editGruppen').find('#dta_periode').val(data.dta_periode);
|
||||
$('#editGruppen').find('#partnerid').val(data.partnerid);
|
||||
$('#editGruppen').find('#dta_dateiname').val(data.dta_dateiname);
|
||||
$('#editGruppen').find('#dta_mail').val(data.dta_mail);
|
||||
$('#editGruppen').find('#dta_mail_betreff').val(data.dta_mail_betreff);
|
||||
$('#editGruppen').find('#dta_mail_text').val(data.dta_mail_text);
|
||||
|
||||
|
||||
art = document.getElementById('art');
|
||||
rabatt = document.getElementById('rabatte');
|
||||
rabatt2 = document.getElementById('rabatte2');
|
||||
if(art){
|
||||
// Hide the target field if priority isn't critical
|
||||
if(art.options[art.selectedIndex].value =='gruppe'){
|
||||
rabatt.style.display='none';
|
||||
rabatt2.style.display='none';
|
||||
}else if(art.options[art.selectedIndex].value =='preisgruppe'){
|
||||
rabatt.style.display='';
|
||||
rabatt2.style.display='none';
|
||||
}else if(art.options[art.selectedIndex].value =='verband'){
|
||||
rabatt.style.display='';
|
||||
rabatt2.style.display='';
|
||||
}else{
|
||||
rabatt.style.display='none';
|
||||
rabatt2.style.display='none';
|
||||
}
|
||||
}
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
App.loading.close();
|
||||
$("#editGruppen").dialog('open');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
GruppenReset();
|
||||
$("#editGruppen").dialog('open');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updateLiveTable(i) {
|
||||
var oTableL = $('#gruppenlist').dataTable();
|
||||
var tmp = $('.dataTables_filter input[type=search]').val();
|
||||
oTableL.fnFilter('%');
|
||||
//oTableL.fnFilter('');
|
||||
oTableL.fnFilter(tmp);
|
||||
}
|
||||
|
||||
/*function GruppenDelete(id) {
|
||||
var conf = confirm('Wirklich löschen?');
|
||||
if (conf) {
|
||||
$.ajax({
|
||||
url: 'index.php?module=gruppen&action=delete',
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
method: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
App.loading.open();
|
||||
},
|
||||
success: function(data) {
|
||||
if (data.status == 1) {
|
||||
updateLiveTable();
|
||||
} else {
|
||||
alert(data.statusText);
|
||||
}
|
||||
App.loading.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}*/
|
||||
|
||||
</script>-->
|
||||
|
@ -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>
|
||||
|
@ -62,7 +62,7 @@
|
||||
{|Rechnungsdatum|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="rechnungsdatum" id="rechnungsdatum" value="[RECHNUNGSDATUM]" size="20" [SAVEDISABLED]>
|
||||
<input type="text" name="rechnungsdatum" id="rechnungsdatum" value="[RECHNUNGSDATUM]" size="20" [SAVEDISABLED] required>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -103,7 +103,7 @@
|
||||
{|Zahlbar bis|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="zahlbarbis" id="zahlbarbis" value="[ZAHLBARBIS]" size="20" [SAVEDISABLED]>
|
||||
<input type="text" name="zahlbarbis" id="zahlbarbis" value="[ZAHLBARBIS]" size="20" [SAVEDISABLED]> <input type="number" name="zahlbarbis_tage" id="zahlbarbis_tage" size="4" [SAVEDISABLED]> Tage
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -119,7 +119,7 @@
|
||||
{|Skonto bis|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="skontobis" id="skontobis" value="[SKONTOBIS]" size="20" [SAVEDISABLED]>
|
||||
<input type="text" name="skontobis" id="skontobis" value="[SKONTOBIS]" size="20" [SAVEDISABLED]> <input type="number" name="skontobis_tage" id="skontobis_tage" size="4" [SAVEDISABLED]> Tage
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -75,8 +75,10 @@
|
||||
[MANUELLFREIGABEEINKAUF]
|
||||
[MANUELLFREIGABEBUCHHALTUNG]
|
||||
[ALSBEZAHLTMARKIEREN]
|
||||
<option value="drucken">{|drucken|}</option>
|
||||
</select>
|
||||
<button name="submit" value="ausfuehren" class="ui-button-icon">{|Ausführen|}</button>
|
||||
{|Drucker|}: <select name="seldrucker">[SELDRUCKER]</select>
|
||||
<button name="submit" value="ausfuehren" class="ui-button-icon">{|Ausführen|}</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
[TAB1NEXT]
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*/
|
||||
@ -21,13 +21,13 @@
|
||||
|
||||
class ConsistencyException extends Exception {
|
||||
|
||||
/*
|
||||
contains the result data as array(string 'belegnr', float 'betrag_gesamt', float 'betrag_summe'))
|
||||
/*
|
||||
contains the result data as array(string 'belegnr', float 'betrag_gesamt', float 'betrag_summe'))
|
||||
*/
|
||||
|
||||
private $_data = array();
|
||||
|
||||
public function __construct($message, $data)
|
||||
public function __construct($message, $data)
|
||||
{
|
||||
$this->_data = $data;
|
||||
parent::__construct($message);
|
||||
@ -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.
|
||||
*
|
||||
@ -57,12 +142,12 @@ class Exportbuchhaltung
|
||||
$this->app = $app;
|
||||
if ($intern == true) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$this->app->ActionHandlerInit($this);
|
||||
$this->app->ActionHandler("export", "ExportBuchhaltungList");
|
||||
$this->app->ActionHandlerListen($app);
|
||||
$this->app->erp->Headlines('Buchhaltung Export DATEV');
|
||||
$this->app->erp->Headlines('Buchhaltung Export DATEV');
|
||||
}
|
||||
|
||||
function ExportBuchhaltungList() {
|
||||
@ -70,7 +155,7 @@ class Exportbuchhaltung
|
||||
$von_form = $this->app->Secure->GetPOST("von");
|
||||
$bis_form = $this->app->Secure->GetPOST("bis");
|
||||
$von = date_create($this->app->erp->ReplaceDatum(true, $von_form, true));
|
||||
$bis = date_create($this->app->erp->ReplaceDatum(true, $bis_form, true));
|
||||
$bis = date_create($this->app->erp->ReplaceDatum(true, $bis_form, true));
|
||||
$projektkuerzel = $this->app->Secure->GetPOST("projekt");
|
||||
$projekt = $this->app->erp->ReplaceProjekt(true, $projektkuerzel, true);
|
||||
|
||||
@ -80,12 +165,14 @@ class Exportbuchhaltung
|
||||
$lgchecked = $this->app->Secure->GetPOST("lieferantengutschrift");
|
||||
$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)) {
|
||||
$sachkonto_kennung = explode(' ',$sachkonto)[0];
|
||||
$account_id = $this->app->DB->SelectArr("SELECT id from kontorahmen WHERE sachkonto = '".$sachkonto_kennung."'")[0]['id'];
|
||||
}
|
||||
$account_id = $this->app->DB->SelectArr("SELECT id from kontorahmen WHERE sachkonto = '".$sachkonto_kennung."'")[0]['id'];
|
||||
}
|
||||
|
||||
$msg = "";
|
||||
|
||||
@ -100,13 +187,13 @@ class Exportbuchhaltung
|
||||
$vbchecked = true;
|
||||
$lgchecked = true;
|
||||
}
|
||||
|
||||
|
||||
$missing_obligatory = array();
|
||||
|
||||
$buchhaltung_berater = $this->app->erp->Firmendaten('buchhaltung_berater');
|
||||
$buchhaltung_mandant = $this->app->erp->Firmendaten('buchhaltung_mandant');
|
||||
$buchhaltung_wj_beginn = $this->app->erp->Firmendaten('buchhaltung_wj_beginn');
|
||||
$buchhaltung_sachkontenlaenge = $this->app->erp->Firmendaten('buchhaltung_sachkontenlaenge');
|
||||
$buchhaltung_sachkontenlaenge = $this->app->erp->Firmendaten('buchhaltung_sachkontenlaenge');
|
||||
|
||||
$buchhaltung_berater = $this->app->erp->Firmendaten('buchhaltung_berater');
|
||||
if (empty($buchhaltung_berater)) {
|
||||
@ -123,15 +210,15 @@ class Exportbuchhaltung
|
||||
$buchhaltung_sachkontenlaenge = $this->app->erp->Firmendaten('buchhaltung_sachkontenlaenge');
|
||||
if (empty($buchhaltung_sachkontenlaenge)) {
|
||||
$missing_obligatory[] = "Sachkontenlänge";
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($missing_obligatory)) {
|
||||
$msg = "<div class=warning>Angaben in den Grundeinstellungen fehlen: ".implode(", ",$missing_obligatory).".</div>";
|
||||
}
|
||||
}
|
||||
|
||||
//---------- DOWNLOAD HERE
|
||||
if ($submit == 'Download') {
|
||||
$dataok = true;
|
||||
$dataok = true;
|
||||
|
||||
if (
|
||||
!$rgchecked &&
|
||||
@ -147,7 +234,7 @@ class Exportbuchhaltung
|
||||
$von_next_year = $von_next_year->modify("+1 year");;
|
||||
|
||||
$buchhaltung_wj_beginn = date_create(date_format($von,'Y').$buchhaltung_wj_beginn);
|
||||
if ($buchhaltung_wj_beginn > $von) {
|
||||
if ($buchhaltung_wj_beginn > $von) {
|
||||
$buchhaltung_wj_beginn = $buchhaltung_wj_beginn->modify("-1 year");
|
||||
}
|
||||
|
||||
@ -160,20 +247,100 @@ 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);
|
||||
header("Content-Disposition: attachment; filename=" . $filename);
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: 0");
|
||||
echo($csv);
|
||||
$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) {
|
||||
$msg = "<div class=error>Inkonsistente Daten (".$e->getMessage()."): <br>";
|
||||
|
||||
$data = $e->getData();
|
||||
|
||||
|
||||
$count = 0;
|
||||
foreach($data as $item) {
|
||||
$msg .= $item['typ']." ".$item['belegnr']." (Kopf ".$this->app->erp->ReplaceMengeBetrag(false,$item['betrag_gesamt'],false)." Positionen ".$this->app->erp->ReplaceMengeBetrag(false,$item['betrag_summe'],false).")<br>";
|
||||
@ -186,7 +353,7 @@ class Exportbuchhaltung
|
||||
$msg .= "</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------- DOWNLOAD HERE
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=exportbuchhaltung&action=export", "Übersicht");
|
||||
@ -203,20 +370,22 @@ 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);
|
||||
$this->app->Tpl->SET('PROJEKT', $projektkuerzel);
|
||||
$this->app->Tpl->SET('SACHKONTO', $sachkonto);
|
||||
|
||||
$this->app->Tpl->SET('VON', $von_form);
|
||||
$this->app->Tpl->SET('BIS', $bis_form);
|
||||
$this->app->Tpl->SET('PROJEKT', $projektkuerzel);
|
||||
$this->app->Tpl->SET('SACHKONTO', $sachkonto);
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "exportbuchhaltung_export.tpl");
|
||||
}
|
||||
|
||||
/*
|
||||
* Create DATEV Buchhungsstapel
|
||||
* @throws ConsistencyException with string (list of items) if consistency check fails and no sachkonto for differences is given
|
||||
*/
|
||||
function DATEV_Buchuchungsstapel(bool $rechnung, bool $gutschrift, bool $verbindlichkeit, bool $lieferantengutschrift, string $berater, string $mandant, datetime $wj_beginn, int $sachkontenlaenge, datetime $von, datetime $bis, int $projekt = 0, string $filename = 'EXTF_Buchungsstapel_DATEV_export.csv', $diffignore = false, $sachkonto_differences) : string {
|
||||
* format: "ISO-8859-1", "UTF-8", "UTF-8-BOM"
|
||||
* @throws ConsistencyException with string (list of items) if consistency check fails and no sachkonto for differences is given
|
||||
*/
|
||||
function DATEV_Buchuchungsstapel(bool $rechnung, bool $gutschrift, bool $verbindlichkeit, bool $lieferantengutschrift, string $berater, string $mandant, datetime $wj_beginn, int $sachkontenlaenge, datetime $von, datetime $bis, int $projekt = 0, string $filename = 'EXTF_Buchungsstapel_DATEV_export.csv', $diffignore = false, $sachkonto_differences, string $format = "ISO-8859-1") : string {
|
||||
|
||||
$datev_header_definition = array (
|
||||
'1' => 'Kennzeichen',
|
||||
@ -252,7 +421,7 @@ class Exportbuchhaltung
|
||||
'31' => 'Anwendungs- information'
|
||||
);
|
||||
|
||||
$datev_buchungsstapel_definition = array (
|
||||
$datev_buchungsstapel_definition = array (
|
||||
'1' => 'Umsatz',
|
||||
'2' => 'Soll-/Haben-Kennzeichen',
|
||||
'3' => 'WKZ Umsatz',
|
||||
@ -385,7 +554,7 @@ class Exportbuchhaltung
|
||||
}
|
||||
else {
|
||||
$kuerzel = $usernamearr[0][0].$usernamearr[1][0];
|
||||
}
|
||||
}
|
||||
|
||||
$data['Kennzeichen'] = 'EXTF';
|
||||
$data['Versionsnummer'] = '700';
|
||||
@ -422,12 +591,12 @@ class Exportbuchhaltung
|
||||
// Start
|
||||
$csv = "";
|
||||
|
||||
// Output data header row
|
||||
// Output data header row
|
||||
$comma = "";
|
||||
foreach ($datev_header_definition as $key => $value) {
|
||||
if (!isset($data[$value])) {
|
||||
$data[$value] = '';
|
||||
}
|
||||
}
|
||||
$csv .= $comma.'"'.$data[$value].'"';
|
||||
$comma = ";";
|
||||
}
|
||||
@ -436,104 +605,27 @@ class Exportbuchhaltung
|
||||
// Output column captions
|
||||
$comma = "";
|
||||
foreach ($datev_buchungsstapel_definition as $key => $value) {
|
||||
$csv .= $comma.'"'.$value.'"';
|
||||
$csv .= $comma.'"'.$value.'"';
|
||||
$comma = ";";
|
||||
}
|
||||
$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
|
||||
)
|
||||
);
|
||||
|
||||
foreach ($typen as $typ) {
|
||||
// Collate data and transform in RAM
|
||||
$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
|
||||
} else
|
||||
{
|
||||
$sql_gegenkonto = "NULL";
|
||||
}
|
||||
|
||||
$sql = "SELECT
|
||||
|
||||
$sql = "SELECT
|
||||
".$typ['typ']." id,
|
||||
".$typ['field_belegnr']." as belegnr,
|
||||
".$typ['field_auftrag']." as auftrag,
|
||||
@ -548,18 +640,18 @@ class Exportbuchhaltung
|
||||
ROUND(".$typ['field_betrag'].",2) as betrag,
|
||||
".$sql_gegenkonto." as gegenkonto,
|
||||
b.waehrung as pos_waehrung
|
||||
FROM
|
||||
".$typ['typ']." b
|
||||
LEFT JOIN
|
||||
".$typ['subtable']." p
|
||||
ON
|
||||
b.id = p.".$typ['typ']."
|
||||
INNER JOIN
|
||||
adresse a ON a.id = b.adresse
|
||||
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'];
|
||||
FROM
|
||||
".$typ['typ']." b
|
||||
LEFT JOIN
|
||||
".$typ['subtable']." p
|
||||
ON
|
||||
b.id = p.".$typ['typ']."
|
||||
INNER JOIN
|
||||
adresse a ON a.id = b.adresse
|
||||
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'];
|
||||
|
||||
// Check consistency of positions
|
||||
// Check consistency of positions
|
||||
if (!$diffignore) {
|
||||
$sql_check = "SELECT *
|
||||
FROM
|
||||
@ -579,52 +671,52 @@ class Exportbuchhaltung
|
||||
GROUP BY
|
||||
id
|
||||
) summen
|
||||
WHERE betrag_gesamt <> betrag_summe OR betrag_summe IS NULL";
|
||||
|
||||
WHERE betrag_gesamt <> betrag_summe OR betrag_summe IS NULL";
|
||||
|
||||
$result = $this->app->DB->SelectArr($sql_check);
|
||||
if (!empty($result)) {
|
||||
|
||||
if (!$sachkonto_differences) {
|
||||
if (!empty($result)) {
|
||||
|
||||
if (!$sachkonto_differences) {
|
||||
$e = new ConsistencyException(ucfirst($typ['typ']),$result);
|
||||
throw $e;
|
||||
} else {
|
||||
// Create differences entries
|
||||
// Create differences entries
|
||||
foreach ($result as $row) {
|
||||
|
||||
|
||||
$posid = $row['pos_id'];
|
||||
$tmpsteuersatz = 0;
|
||||
$tmpsteuertext = '';
|
||||
$erloes = '';
|
||||
$result = array();
|
||||
$this->app->erp->GetSteuerPosition($typ['typ'], $posid, $tmpsteuersatz, $tmpsteuertext, $erloes);
|
||||
|
||||
$data = array();
|
||||
|
||||
$difference = $row['betrag_gesamt']-$row['betrag_summe'];
|
||||
|
||||
$this->app->erp->GetSteuerPosition($typ['typ'], $posid, $tmpsteuersatz, $tmpsteuertext, $erloes);
|
||||
|
||||
$data = array();
|
||||
|
||||
$difference = $row['betrag_gesamt']-$row['betrag_summe'];
|
||||
|
||||
$data['Umsatz'] = number_format(abs($difference), 2, ',', ''); // obligatory
|
||||
$data['EU-Steuersatz (Bestimmung)'] = 0;
|
||||
$data['WKZ Umsatz'] = $row['waehrung'];
|
||||
$data['Belegfeld 1'] = mb_strimwidth($row['belegnr'],0,36);
|
||||
$data['Konto'] = $row['kundennummer'];
|
||||
$data['Soll-/Haben-Kennzeichen'] = ($difference < 0)?'S':'H'; // obligatory
|
||||
|
||||
$data['Gegenkonto (ohne BU-Schlüssel)'] = $sachkonto_differences; // obligatory
|
||||
|
||||
$data['Belegdatum'] = date_format(date_create($row['datum']),"dm"); // obligatory
|
||||
$data['Soll-/Haben-Kennzeichen'] = ($difference < 0)?'S':'H'; // obligatory
|
||||
|
||||
$data['Gegenkonto (ohne BU-Schlüssel)'] = $sachkonto_differences; // obligatory
|
||||
|
||||
$data['Belegdatum'] = date_format(date_create($row['datum']),"dm"); // obligatory
|
||||
$data['Buchungstext'] = "Differenz";
|
||||
$data['EU-Mitgliedstaat u. UStID (Bestimmung)'] = $row['ustid'];
|
||||
$data['Auftragsnummer'] = $row['auftrag'];
|
||||
$data['Zahlweise'] = $row['zahlweise'];
|
||||
$csv .= $this->create_line($datev_buchungsstapel_definition,$data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // diffignore
|
||||
} // diffignore
|
||||
|
||||
// Query position data
|
||||
$arr = $this->app->DB->Query($sql);
|
||||
while ($row = $this->app->DB->Fetch_Assoc($arr)) {
|
||||
$arr = $this->app->DB->Query($sql);
|
||||
while ($row = $this->app->DB->Fetch_Assoc($arr)) {
|
||||
|
||||
//print_r($row);
|
||||
|
||||
@ -633,7 +725,7 @@ class Exportbuchhaltung
|
||||
$tmpsteuertext = '';
|
||||
$erloes = '';
|
||||
$result = array();
|
||||
$this->app->erp->GetSteuerPosition($typ['typ'], $posid, $tmpsteuersatz, $tmpsteuertext, $erloes);
|
||||
$this->app->erp->GetSteuerPosition($typ['typ'], $posid, $tmpsteuersatz, $tmpsteuertext, $erloes);
|
||||
|
||||
$data = array();
|
||||
|
||||
@ -642,7 +734,7 @@ class Exportbuchhaltung
|
||||
$data['Soll-/Haben-Kennzeichen'] = $typ['kennzeichen']; // obligatory
|
||||
} else if ($row['betrag'] < 0) {
|
||||
$data['Umsatz'] = number_format(-$row['betrag'], 2, ',', ''); // obligatory
|
||||
$data['Soll-/Haben-Kennzeichen'] = $typ['kennzeichen_negativ']; // obligatory
|
||||
$data['Soll-/Haben-Kennzeichen'] = $typ['kennzeichen_negativ']; // obligatory
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
@ -651,44 +743,54 @@ class Exportbuchhaltung
|
||||
$data['WKZ Umsatz'] = $row['pos_waehrung'];
|
||||
$data['Belegfeld 1'] = mb_strimwidth($row['belegnr'],0,36);
|
||||
$data['Konto'] = $row['kundennummer']; // obligatory
|
||||
|
||||
|
||||
if (!empty($typ['field_gegenkonto'])) {
|
||||
$data['Gegenkonto (ohne BU-Schlüssel)'] = $row['gegenkonto']; // obligatory
|
||||
$data['Gegenkonto (ohne BU-Schlüssel)'] = $row['gegenkonto']; // obligatory
|
||||
} else {
|
||||
$data['Gegenkonto (ohne BU-Schlüssel)'] = $erloes; // obligatory
|
||||
}
|
||||
|
||||
|
||||
$data['Belegdatum'] = date_format(date_create($row['datum']),"dm"); // obligatory
|
||||
$data['Buchungstext'] = mb_strimwidth($row['name'],0,60);
|
||||
$data['EU-Mitgliedstaat u. UStID (Bestimmung)'] = $row['ustid'];
|
||||
|
||||
|
||||
$data['Auftragsnummer'] = ($row['auftrag']!=0)?$row['auftrag']:'';
|
||||
$data['Zahlweise'] = $row['zahlweise'];
|
||||
|
||||
|
||||
$csv .= $this->create_line($datev_buchungsstapel_definition,$data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$csv .= '"0";"S";"EUR";"0";"";"";"1234";"1370";"";"101";"";"";"";"Testbuchung";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"0";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""'; // Testbuchung
|
||||
|
||||
$csv = mb_convert_encoding($csv, "ISO-8859-1", "UTF-8");
|
||||
switch ($format) {
|
||||
case "UTF-8":
|
||||
break;
|
||||
case "UTF-8-BOM":
|
||||
$csv = "\xef\xbb\xbf".$csv;
|
||||
break;
|
||||
default:
|
||||
$csv = mb_convert_encoding($csv, "ISO-8859-1", "UTF-8");
|
||||
break;
|
||||
}
|
||||
|
||||
return($csv);
|
||||
}
|
||||
|
||||
function create_line($definition, $data) : string {
|
||||
}
|
||||
|
||||
function create_line($definition, $data) : string {
|
||||
$csv = "";
|
||||
$comma = "";
|
||||
$comma = "";
|
||||
foreach ($definition as $key => $value) {
|
||||
if (!isset($data[$value])) {
|
||||
$data[$value] = '';
|
||||
}
|
||||
}
|
||||
$csv .= $comma.'"'.$data[$value].'"';
|
||||
$comma = ";";
|
||||
}
|
||||
$csv .= "\r\n";
|
||||
return($csv);
|
||||
$csv .= "\r\n";
|
||||
return($csv);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,43 +1,322 @@
|
||||
<?php
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
if(!class_exists('Gruppen'))
|
||||
{
|
||||
class Gruppen
|
||||
{
|
||||
function __construct($app, $intern = false)
|
||||
{
|
||||
$this->app=$app;
|
||||
if($intern) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->app->ActionHandlerInit($this);
|
||||
/*
|
||||
* Copyright (c) 2022 OpenXE project
|
||||
*/
|
||||
|
||||
$this->app->ActionHandler("list","GruppenList");
|
||||
$this->app->DefaultActionHandler("list");
|
||||
use Xentral\Components\Database\Exception\QueryFailureException;
|
||||
|
||||
class Gruppen {
|
||||
|
||||
$this->app->ActionHandlerListen($app);
|
||||
}
|
||||
function GruppenList()
|
||||
{
|
||||
$this->app->Tpl->Set('VERS','Professional');
|
||||
$this->app->Tpl->Set('MODUL','Professional');
|
||||
$this->app->Tpl->Parse('PAGE', "only_version.tpl");
|
||||
function __construct($app, $intern = false) {
|
||||
$this->app = $app;
|
||||
if ($intern)
|
||||
return;
|
||||
|
||||
$this->app->ActionHandlerInit($this);
|
||||
$this->app->ActionHandler("list", "gruppen_list");
|
||||
$this->app->ActionHandler("create", "gruppen_edit"); // This automatically adds a "New" button
|
||||
$this->app->ActionHandler("edit", "gruppen_edit");
|
||||
$this->app->ActionHandler("delete", "gruppen_delete");
|
||||
$this->app->DefaultActionHandler("list");
|
||||
$this->app->ActionHandlerListen($app);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public function Install() {
|
||||
/* Fill out manually later */
|
||||
}
|
||||
|
||||
static function TableSearch(&$app, $name, $erlaubtevars) {
|
||||
switch ($name) {
|
||||
case "gruppen_list":
|
||||
$allowed['gruppen_list'] = array('list');
|
||||
$heading = array(
|
||||
'',
|
||||
'',
|
||||
'Kennziffer',
|
||||
'Name',
|
||||
'Art',
|
||||
'Internebemerkung',
|
||||
'Projekt',
|
||||
'Aktiv',
|
||||
'Menü');
|
||||
$width = array('1%','1%','10%'); // Fill out manually later
|
||||
|
||||
// columns that are aligned right (numbers etc)
|
||||
// $alignright = array(4,5,6,7,8);
|
||||
|
||||
$findcols = array(
|
||||
'g.id',
|
||||
'g.id',
|
||||
'g.kennziffer',
|
||||
'g.name',
|
||||
'g.art',
|
||||
'g.internebemerkung',
|
||||
'p.abkuerzung',
|
||||
'g.aktiv',
|
||||
'g.id'
|
||||
);
|
||||
$searchsql = array('g.name', 'g.art', 'g.kennziffer', 'g.internebemerkung');
|
||||
|
||||
$defaultorder = 1;
|
||||
$defaultorderdesc = 0;
|
||||
$aligncenter = array();
|
||||
$alignright = array();
|
||||
$numbercols = array();
|
||||
$sumcol = array();
|
||||
|
||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',g.id,'\" />') AS `auswahl`";
|
||||
|
||||
// $moreinfo = true; // Allow drop down details
|
||||
// $moreinfoaction = "lieferschein"; // specify suffix for minidetail-URL to allow different minidetails
|
||||
// $menucol = 11; // Set id col for moredata/menu
|
||||
|
||||
$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap>" . "<a href=\"index.php?module=gruppen&action=edit&id=%value%\"><img src=\"./themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=gruppen&action=delete&id=%value%\");>" . "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>" . "</td></tr></table>";
|
||||
|
||||
$sql = "SELECT SQL_CALC_FOUND_ROWS g.id, $dropnbox, g.kennziffer, g.name, g.art, g.internebemerkung, p.abkuerzung, g.aktiv, g.id FROM gruppen g LEFT JOIN projekt p ON g.projekt = p.id";
|
||||
|
||||
$where = "1";
|
||||
$count = "SELECT count(DISTINCT id) FROM gruppen WHERE $where";
|
||||
// $groupby = "";
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$erg = false;
|
||||
|
||||
foreach ($erlaubtevars as $k => $v) {
|
||||
if (isset($$v)) {
|
||||
$erg[$v] = $$v;
|
||||
}
|
||||
}
|
||||
return $erg;
|
||||
}
|
||||
|
||||
function gruppen_list() {
|
||||
$this->app->erp->MenuEintrag("index.php?module=gruppen&action=list", "Übersicht");
|
||||
$this->app->erp->MenuEintrag("index.php?module=gruppen&action=create", "Neu anlegen");
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php", "Zurück");
|
||||
|
||||
$this->app->YUI->TableSearch('TAB1', 'gruppen_list', "show", "", "", basename(__FILE__), __CLASS__);
|
||||
$this->app->Tpl->Parse('PAGE', "gruppen_list.tpl");
|
||||
}
|
||||
|
||||
public function gruppen_delete() {
|
||||
$id = (int) $this->app->Secure->GetGET('id');
|
||||
|
||||
$this->app->DB->Delete("DELETE FROM `gruppen` WHERE `id` = '{$id}'");
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">Der Eintrag wurde gelöscht.</div>");
|
||||
|
||||
$this->gruppen_list();
|
||||
}
|
||||
|
||||
/*
|
||||
* Edit gruppen item
|
||||
* If id is empty, create a new one
|
||||
*/
|
||||
|
||||
function gruppen_edit() {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
|
||||
// Check if other users are editing this id
|
||||
/* if($this->app->erp->DisableModul('gruppen',$id))
|
||||
{
|
||||
return;
|
||||
} */
|
||||
|
||||
$this->app->Tpl->Set('ID', $id);
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=gruppen&action=edit&id=$id", "Details");
|
||||
$this->app->erp->MenuEintrag("index.php?module=gruppen&action=list", "Zurück zur Übersicht");
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$input = $this->GetInput();
|
||||
|
||||
// Convert here
|
||||
$input['aktiv'] = !empty($this->app->Secure->GetPOST('aktiv'))?"1":"0";
|
||||
|
||||
$submit = $this->app->Secure->GetPOST('submit');
|
||||
|
||||
if (empty($id)) {
|
||||
// New item
|
||||
$id = 'NULL';
|
||||
}
|
||||
|
||||
if ($submit != '')
|
||||
{
|
||||
|
||||
// Write to database
|
||||
|
||||
// Add checks here
|
||||
|
||||
$input['projekt'] = $this->app->erp->ReplaceProjekt(true,$input['projekt'],true); // Parameters: Target db?, value, from form?
|
||||
|
||||
$columns = "id, ";
|
||||
$values = "$id, ";
|
||||
$update = "";
|
||||
|
||||
$fix = "";
|
||||
|
||||
foreach ($input as $key => $value) {
|
||||
$columns = $columns.$fix.$key;
|
||||
$values = $values.$fix."'".$value."'";
|
||||
$update = $update.$fix.$key." = '$value'";
|
||||
|
||||
$fix = ", ";
|
||||
}
|
||||
|
||||
// echo($columns."<br>");
|
||||
// echo($values."<br>");
|
||||
// echo($update."<br>");
|
||||
|
||||
$sql = "INSERT INTO gruppen (".$columns.") VALUES (".$values.") ON DUPLICATE KEY UPDATE ".$update;
|
||||
|
||||
// echo($sql);
|
||||
|
||||
$this->app->DB->Update($sql);
|
||||
|
||||
if ($id == 'NULL') {
|
||||
$msg = $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>");
|
||||
header("Location: index.php?module=gruppen&action=list&msg=$msg");
|
||||
} else {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich übernommen.</div>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Load values again from database
|
||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',g.id,'\" />') AS `auswahl`";
|
||||
$result = $this->app->DB->SelectArr("SELECT SQL_CALC_FOUND_ROWS g.id, $dropnbox, g.name, g.art, g.kennziffer, g.internebemerkung, g.grundrabatt, g.rabatt1, g.rabatt2, g.rabatt3, g.rabatt4, g.rabatt5, g.sonderrabatt_skonto, g.provision, g.kundennummer, g.partnerid, g.dta_aktiv, g.dta_periode, g.dta_dateiname, g.dta_mail, g.dta_mail_betreff, g.dta_mail_text, g.dtavariablen, g.dta_variante, g.bonus1, g.bonus1_ab, g.bonus2, g.bonus2_ab, g.bonus3, g.bonus3_ab, g.bonus4, g.bonus4_ab, g.bonus5, g.bonus5_ab, g.bonus6, g.bonus6_ab, g.bonus7, g.bonus7_ab, g.bonus8, g.bonus8_ab, g.bonus9, g.bonus9_ab, g.bonus10, g.bonus10_ab, g.zahlungszieltage, g.zahlungszielskonto, g.zahlungszieltageskonto, g.portoartikel, g.portofreiab, g.erweiterteoptionen, g.zentralerechnung, g.zentralregulierung, g.gruppe, g.preisgruppe, g.verbandsgruppe, g.rechnung_name, g.rechnung_strasse, g.rechnung_ort, g.rechnung_plz, g.rechnung_abteilung, g.rechnung_land, g.rechnung_email, g.rechnung_periode, g.rechnung_anzahlpapier, g.rechnung_permail, g.webid, g.portofrei_aktiv, g.projekt, g.objektname, g.objekttyp, g.parameter, g.objektname2, g.objekttyp2, g.parameter2, g.objektname3, g.objekttyp3, g.parameter3, g.kategorie, g.aktiv, g.id FROM gruppen g"." WHERE id=$id");
|
||||
|
||||
foreach ($result[0] as $key => $value) {
|
||||
$this->app->Tpl->Set(strtoupper($key), $value);
|
||||
}
|
||||
|
||||
if (!empty($result)) {
|
||||
$gruppen_from_db = $result[0];
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Add displayed items later
|
||||
*
|
||||
|
||||
$this->app->Tpl->Add('KURZUEBERSCHRIFT2', $email);
|
||||
$this->app->Tpl->Add('EMAIL', $email);
|
||||
$this->app->Tpl->Add('ANGEZEIGTERNAME', $angezeigtername);
|
||||
|
||||
$this->app->YUI->AutoComplete("artikel", "artikelnummer");
|
||||
|
||||
*/
|
||||
|
||||
$this->app->YUI->AutoComplete("kennziffer", "gruppekennziffer");
|
||||
|
||||
if ($gruppen_from_db['art'] != 'preisgruppe') {
|
||||
$this->app->Tpl->Set('PREISGRUPPEHIDDEN','hidden');
|
||||
}
|
||||
|
||||
$art_select = Array(
|
||||
'gruppe' => 'Gruppe',
|
||||
'preisgruppe' => 'Preisgruppe'
|
||||
);
|
||||
$art_select = $this->app->erp->GetSelectAsso($art_select,$gruppen_from_db['art']);
|
||||
$this->app->Tpl->Set('ARTSELECT',$art_select);
|
||||
|
||||
$this->app->YUI->AutoComplete("projekt","projektname",1);
|
||||
$this->app->Tpl->Set('PROJEKT',$this->app->erp->ReplaceProjekt(false,$gruppen_from_db['projekt'],false));
|
||||
|
||||
$this->app->Tpl->Set('AKTIV', $gruppen_from_db['aktiv']==1?"checked":"");
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "gruppen_edit.tpl");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all paramters from html form and save into $input
|
||||
*/
|
||||
public function GetInput(): array {
|
||||
$input = array();
|
||||
//$input['EMAIL'] = $this->app->Secure->GetPOST('email');
|
||||
|
||||
$input['name'] = $this->app->Secure->GetPOST('name');
|
||||
$input['art'] = $this->app->Secure->GetPOST('art');
|
||||
$input['kennziffer'] = $this->app->Secure->GetPOST('kennziffer');
|
||||
$input['internebemerkung'] = $this->app->Secure->GetPOST('internebemerkung');
|
||||
$input['grundrabatt'] = $this->app->Secure->GetPOST('grundrabatt');
|
||||
$input['rabatt1'] = $this->app->Secure->GetPOST('rabatt1');
|
||||
$input['rabatt2'] = $this->app->Secure->GetPOST('rabatt2');
|
||||
$input['rabatt3'] = $this->app->Secure->GetPOST('rabatt3');
|
||||
$input['rabatt4'] = $this->app->Secure->GetPOST('rabatt4');
|
||||
$input['rabatt5'] = $this->app->Secure->GetPOST('rabatt5');
|
||||
$input['sonderrabatt_skonto'] = $this->app->Secure->GetPOST('sonderrabatt_skonto');
|
||||
$input['provision'] = $this->app->Secure->GetPOST('provision');
|
||||
$input['kundennummer'] = $this->app->Secure->GetPOST('kundennummer');
|
||||
$input['partnerid'] = $this->app->Secure->GetPOST('partnerid');
|
||||
$input['dta_aktiv'] = $this->app->Secure->GetPOST('dta_aktiv');
|
||||
$input['dta_periode'] = $this->app->Secure->GetPOST('dta_periode');
|
||||
$input['dta_dateiname'] = $this->app->Secure->GetPOST('dta_dateiname');
|
||||
$input['dta_mail'] = $this->app->Secure->GetPOST('dta_mail');
|
||||
$input['dta_mail_betreff'] = $this->app->Secure->GetPOST('dta_mail_betreff');
|
||||
$input['dta_mail_text'] = $this->app->Secure->GetPOST('dta_mail_text');
|
||||
$input['dtavariablen'] = $this->app->Secure->GetPOST('dtavariablen');
|
||||
$input['dta_variante'] = $this->app->Secure->GetPOST('dta_variante');
|
||||
$input['bonus1'] = $this->app->Secure->GetPOST('bonus1');
|
||||
$input['bonus1_ab'] = $this->app->Secure->GetPOST('bonus1_ab');
|
||||
$input['bonus2'] = $this->app->Secure->GetPOST('bonus2');
|
||||
$input['bonus2_ab'] = $this->app->Secure->GetPOST('bonus2_ab');
|
||||
$input['bonus3'] = $this->app->Secure->GetPOST('bonus3');
|
||||
$input['bonus3_ab'] = $this->app->Secure->GetPOST('bonus3_ab');
|
||||
$input['bonus4'] = $this->app->Secure->GetPOST('bonus4');
|
||||
$input['bonus4_ab'] = $this->app->Secure->GetPOST('bonus4_ab');
|
||||
$input['bonus5'] = $this->app->Secure->GetPOST('bonus5');
|
||||
$input['bonus5_ab'] = $this->app->Secure->GetPOST('bonus5_ab');
|
||||
$input['bonus6'] = $this->app->Secure->GetPOST('bonus6');
|
||||
$input['bonus6_ab'] = $this->app->Secure->GetPOST('bonus6_ab');
|
||||
$input['bonus7'] = $this->app->Secure->GetPOST('bonus7');
|
||||
$input['bonus7_ab'] = $this->app->Secure->GetPOST('bonus7_ab');
|
||||
$input['bonus8'] = $this->app->Secure->GetPOST('bonus8');
|
||||
$input['bonus8_ab'] = $this->app->Secure->GetPOST('bonus8_ab');
|
||||
$input['bonus9'] = $this->app->Secure->GetPOST('bonus9');
|
||||
$input['bonus9_ab'] = $this->app->Secure->GetPOST('bonus9_ab');
|
||||
$input['bonus10'] = $this->app->Secure->GetPOST('bonus10');
|
||||
$input['bonus10_ab'] = $this->app->Secure->GetPOST('bonus10_ab');
|
||||
$input['zahlungszieltage'] = $this->app->Secure->GetPOST('zahlungszieltage');
|
||||
$input['zahlungszielskonto'] = $this->app->Secure->GetPOST('zahlungszielskonto');
|
||||
$input['zahlungszieltageskonto'] = $this->app->Secure->GetPOST('zahlungszieltageskonto');
|
||||
$input['portoartikel'] = $this->app->Secure->GetPOST('portoartikel');
|
||||
$input['portofreiab'] = $this->app->Secure->GetPOST('portofreiab');
|
||||
$input['erweiterteoptionen'] = $this->app->Secure->GetPOST('erweiterteoptionen');
|
||||
$input['zentralerechnung'] = $this->app->Secure->GetPOST('zentralerechnung');
|
||||
$input['zentralregulierung'] = $this->app->Secure->GetPOST('zentralregulierung');
|
||||
$input['gruppe'] = $this->app->Secure->GetPOST('gruppe');
|
||||
$input['preisgruppe'] = $this->app->Secure->GetPOST('preisgruppe');
|
||||
$input['verbandsgruppe'] = $this->app->Secure->GetPOST('verbandsgruppe');
|
||||
$input['rechnung_name'] = $this->app->Secure->GetPOST('rechnung_name');
|
||||
$input['rechnung_strasse'] = $this->app->Secure->GetPOST('rechnung_strasse');
|
||||
$input['rechnung_ort'] = $this->app->Secure->GetPOST('rechnung_ort');
|
||||
$input['rechnung_plz'] = $this->app->Secure->GetPOST('rechnung_plz');
|
||||
$input['rechnung_abteilung'] = $this->app->Secure->GetPOST('rechnung_abteilung');
|
||||
$input['rechnung_land'] = $this->app->Secure->GetPOST('rechnung_land');
|
||||
$input['rechnung_email'] = $this->app->Secure->GetPOST('rechnung_email');
|
||||
$input['rechnung_periode'] = $this->app->Secure->GetPOST('rechnung_periode');
|
||||
$input['rechnung_anzahlpapier'] = $this->app->Secure->GetPOST('rechnung_anzahlpapier');
|
||||
$input['rechnung_permail'] = $this->app->Secure->GetPOST('rechnung_permail');
|
||||
$input['webid'] = $this->app->Secure->GetPOST('webid');
|
||||
$input['portofrei_aktiv'] = $this->app->Secure->GetPOST('portofrei_aktiv');
|
||||
$input['projekt'] = $this->app->Secure->GetPOST('projekt');
|
||||
$input['objektname'] = $this->app->Secure->GetPOST('objektname');
|
||||
$input['objekttyp'] = $this->app->Secure->GetPOST('objekttyp');
|
||||
$input['parameter'] = $this->app->Secure->GetPOST('parameter');
|
||||
$input['objektname2'] = $this->app->Secure->GetPOST('objektname2');
|
||||
$input['objekttyp2'] = $this->app->Secure->GetPOST('objekttyp2');
|
||||
$input['parameter2'] = $this->app->Secure->GetPOST('parameter2');
|
||||
$input['objektname3'] = $this->app->Secure->GetPOST('objektname3');
|
||||
$input['objekttyp3'] = $this->app->Secure->GetPOST('objekttyp3');
|
||||
$input['parameter3'] = $this->app->Secure->GetPOST('parameter3');
|
||||
$input['kategorie'] = $this->app->Secure->GetPOST('kategorie');
|
||||
$input['aktiv'] = $this->app->Secure->GetPOST('aktiv');
|
||||
|
||||
|
||||
return $input;
|
||||
}
|
||||
}
|
||||
|
@ -3990,7 +3990,6 @@ class Importvorlage extends GenImportvorlage {
|
||||
|
||||
if($this->app->DB->Select("SELECT id FROM artikel WHERE id ='$artikelid' LIMIT 1")){
|
||||
//Sprachen
|
||||
if($this->app->erp->ModulVorhanden('artikel_texte')){
|
||||
$erlaubtefelder= array('name','kurztext','beschreibung','beschreibung_online','meta_title',
|
||||
'meta_description','meta_keywords','katalog_bezeichnung','katalog_text','katalogartikel','shop','aktiv');
|
||||
$zuImportierendeSprachen = [];
|
||||
@ -4066,8 +4065,26 @@ 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) {
|
||||
|
@ -1,215 +1,219 @@
|
||||
<?php
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
|
||||
class Laender {
|
||||
var $app;
|
||||
|
||||
static function TableSearch(&$app, $name, $erlaubtevars)
|
||||
{
|
||||
// in dieses switch alle lokalen Tabellen (diese Live Tabellen mit Suche etc.) für dieses Modul
|
||||
switch($name)
|
||||
{
|
||||
case "laender_list":
|
||||
$allowed['laender'] = array('list');
|
||||
|
||||
$heading = array('ISO', 'Bezeichnung DE', 'Bezeichnung EN','EU', 'Menü');
|
||||
$width = array('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');
|
||||
|
||||
$defaultorder = 1;
|
||||
$defaultorderdesc = 0;
|
||||
|
||||
$menu = "<a href=\"index.php?module=laender&action=edit&id=%value%\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=laender&action=delete&id=%value%\")><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>";
|
||||
|
||||
$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";
|
||||
|
||||
$count = "SELECT count(l.id) FROM laender l WHERE $where";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
$erg = false;
|
||||
|
||||
foreach($erlaubtevars as $k => $v)
|
||||
{
|
||||
if(isset($$v))$erg[$v] = $$v;
|
||||
}
|
||||
return $erg;
|
||||
}
|
||||
|
||||
function __construct($app, $intern = false) {
|
||||
$this->app=$app;
|
||||
if($intern)return;
|
||||
$this->app->ActionHandlerInit($this);
|
||||
|
||||
// ab hier alle Action Handler definieren die das Modul hat
|
||||
$this->app->ActionHandler("list", "LaenderList");
|
||||
$this->app->ActionHandler("create", "LaenderCreate");
|
||||
$this->app->ActionHandler("edit", "LaenderEdit");
|
||||
$this->app->ActionHandler("delete", "LaenderDelete");
|
||||
$this->app->ActionHandler('test', 'LaenderTest');
|
||||
|
||||
$this->app->ActionHandlerListen($app);
|
||||
}
|
||||
|
||||
function LaenderTest(){
|
||||
$countryModule = $this->app->Container->get('CountryMigrationService');
|
||||
if($countryModule->needsMigration()){
|
||||
$countryModule->doMigration();
|
||||
}
|
||||
}
|
||||
|
||||
function LaenderMenu()
|
||||
{
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zurück zur Übersicht");
|
||||
}
|
||||
|
||||
function LaenderList()
|
||||
{
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=create","Neues Land");
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Übersicht");
|
||||
|
||||
$this->app->YUI->TableSearch('TAB1','laender_list', "show","","",basename(__FILE__), __CLASS__);
|
||||
$this->app->Tpl->Parse("PAGE","laender_list.tpl");
|
||||
}
|
||||
|
||||
function LaenderEdit()
|
||||
{
|
||||
$id = (int)$this->app->Secure->GetGET('id');
|
||||
$submit = $this->app->Secure->GetPOST('submitland');
|
||||
|
||||
$this->app->Tpl->Add('KURZUEBERSCHRIFT2',$bezeichnung_de);
|
||||
|
||||
|
||||
|
||||
$input = array();
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=edit&id=$id","Details");
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zurück zur Übersicht");
|
||||
|
||||
$input = $this->GetInput();
|
||||
|
||||
if(is_numeric($id) && $submit!=''){
|
||||
|
||||
$error = '';
|
||||
if($input['iso']=='' || strlen(trim($input['iso'])) > 2) $error .= 'Geben Sie bitte einen zweistelligen ISO-Code ein.<br>';
|
||||
if($input['bezeichnung_de'] == '') $error .= 'Geben Sie bitte eine deutsche Länderbezeichnung ein.<br>';
|
||||
if($input['bezeichnung_en'] =='') $error .= 'Geben Sie bitte eine englische Länderbezeichnung ein.<br>';
|
||||
|
||||
if($error!=''){
|
||||
$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");
|
||||
if($input['eu']==1){
|
||||
$this->app->Tpl->Set('EU', "checked");
|
||||
}
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich übernommen.</div>");
|
||||
}
|
||||
}
|
||||
}
|
||||
$iso = $this->app->DB->Select("SELECT iso 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('BEZEICHNUNG_DE', $bezeichnung_de);
|
||||
$this->app->Tpl->Set('BEZEICHNUNG_EN', $bezeichnung_en);
|
||||
if($eu == 1){
|
||||
$this->app->Tpl->Set('EU', "checked");
|
||||
}
|
||||
|
||||
|
||||
//$this->SetInput($input);
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "laender_edit.tpl");
|
||||
}
|
||||
|
||||
function LaenderDelete()
|
||||
{
|
||||
$ref = $_SERVER['HTTP_REFERER'];
|
||||
$id = $this->app->Secure->GetGET("id");
|
||||
$this->app->DB->DELETE("DELETE FROM laender WHERE id = '$id' LIMIT 1");
|
||||
|
||||
//$this->VorlageList();
|
||||
header("Location: $ref");
|
||||
exit;
|
||||
}
|
||||
|
||||
function LaenderCreate(){
|
||||
// $this->app->Tpl->Add(KURZUEBERSCHRIFT,"Benutzer");
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zurück zur Übersicht");
|
||||
|
||||
$input = $this->GetInput();
|
||||
$submit = $this->app->Secure->GetPOST('submitland');
|
||||
|
||||
if($submit!='') {
|
||||
|
||||
$error = '';
|
||||
|
||||
if($input['iso']=='' || strlen(trim($input['iso'])) > 2) $error .= 'Geben Sie bitte einen zweistelligen ISO-Code ein.<br>';
|
||||
if($input['bezeichnung_de']=='') $error .= 'Geben Sie bitte eine deutsche Länderbezeichnung ein.<br>';
|
||||
if($input['bezeichnung_en']=='') $error .= 'Geben Sie bitte eine englische Länderbezeichnung ein.<br>';
|
||||
|
||||
if($this->app->DB->Select("SELECT '1' FROM laender WHERE iso='{$input['iso']}' LIMIT 1")=='1')
|
||||
$error .= "Es existiert bereits ein ISO-Code mit diesem Namen.<br />";
|
||||
|
||||
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']}')");
|
||||
$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");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$this->SetInput($input);
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "laender_edit.tpl");
|
||||
}
|
||||
|
||||
|
||||
function GetInput(){
|
||||
$input = array();
|
||||
$input['iso'] = $this->app->Secure->GetPOST('iso');
|
||||
$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');
|
||||
return $input;
|
||||
|
||||
}
|
||||
|
||||
function SetInput($input){
|
||||
$this->app->Tpl->Set('ISO', $input['iso']);
|
||||
$this->app->Tpl->Set('BEZEICHNUNG_DE', $input['bezeichnung_de']);
|
||||
$this->app->Tpl->Set('BEZEICHNUNG_EN', $input['bezeichnung_en']);
|
||||
if($input['eu']==1){
|
||||
$this->app->Tpl->Set('EU', "checked");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
class Laender {
|
||||
var $app;
|
||||
|
||||
static function TableSearch(&$app, $name, $erlaubtevars)
|
||||
{
|
||||
// in dieses switch alle lokalen Tabellen (diese Live Tabellen mit Suche etc.) für dieses Modul
|
||||
switch($name)
|
||||
{
|
||||
case "laender_list":
|
||||
$allowed['laender'] = array('list');
|
||||
|
||||
$heading = array('ISO', 'ISO3','Bezeichnung DE', 'Bezeichnung EN','EU', 'Menü');
|
||||
$width = array('9%', '9%','40%', '40%','10%','1%');
|
||||
|
||||
$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;
|
||||
|
||||
$menu = "<a href=\"index.php?module=laender&action=edit&id=%value%\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=laender&action=delete&id=%value%\")><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>";
|
||||
|
||||
$where = " l.id > 0 ";
|
||||
|
||||
$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;
|
||||
|
||||
}
|
||||
|
||||
$erg = false;
|
||||
|
||||
foreach($erlaubtevars as $k => $v)
|
||||
{
|
||||
if(isset($$v))$erg[$v] = $$v;
|
||||
}
|
||||
return $erg;
|
||||
}
|
||||
|
||||
function __construct($app, $intern = false) {
|
||||
$this->app=$app;
|
||||
if($intern)return;
|
||||
$this->app->ActionHandlerInit($this);
|
||||
|
||||
// ab hier alle Action Handler definieren die das Modul hat
|
||||
$this->app->ActionHandler("list", "LaenderList");
|
||||
$this->app->ActionHandler("create", "LaenderCreate");
|
||||
$this->app->ActionHandler("edit", "LaenderEdit");
|
||||
$this->app->ActionHandler("delete", "LaenderDelete");
|
||||
$this->app->ActionHandler('test', 'LaenderTest');
|
||||
|
||||
$this->app->ActionHandlerListen($app);
|
||||
}
|
||||
|
||||
function LaenderTest(){
|
||||
$countryModule = $this->app->Container->get('CountryMigrationService');
|
||||
if($countryModule->needsMigration()){
|
||||
$countryModule->doMigration();
|
||||
}
|
||||
}
|
||||
|
||||
function LaenderMenu()
|
||||
{
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zurück zur Übersicht");
|
||||
}
|
||||
|
||||
function LaenderList()
|
||||
{
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=create","Neues Land");
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Übersicht");
|
||||
|
||||
$this->app->YUI->TableSearch('TAB1','laender_list', "show","","",basename(__FILE__), __CLASS__);
|
||||
$this->app->Tpl->Parse("PAGE","laender_list.tpl");
|
||||
}
|
||||
|
||||
function LaenderEdit()
|
||||
{
|
||||
$id = (int)$this->app->Secure->GetGET('id');
|
||||
$submit = $this->app->Secure->GetPOST('submitland');
|
||||
|
||||
$this->app->Tpl->Add('KURZUEBERSCHRIFT2',$bezeichnung_de);
|
||||
|
||||
|
||||
|
||||
$input = array();
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=edit&id=$id","Details");
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zurück zur Übersicht");
|
||||
|
||||
$input = $this->GetInput();
|
||||
|
||||
if(is_numeric($id) && $submit!=''){
|
||||
|
||||
$error = '';
|
||||
if($input['iso']=='' || strlen(trim($input['iso'])) > 2) $error .= 'Geben Sie bitte einen zweistelligen ISO-Code ein.<br>';
|
||||
if($input['bezeichnung_de'] == '') $error .= 'Geben Sie bitte eine deutsche Länderbezeichnung ein.<br>';
|
||||
if($input['bezeichnung_en'] =='') $error .= 'Geben Sie bitte eine englische Länderbezeichnung ein.<br>';
|
||||
|
||||
if($error!=''){
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
|
||||
}else{
|
||||
if($error == ""){
|
||||
$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");
|
||||
}
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich übernommen.</div>");
|
||||
}
|
||||
}
|
||||
}
|
||||
$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){
|
||||
$this->app->Tpl->Set('EU', "checked");
|
||||
}
|
||||
|
||||
|
||||
//$this->SetInput($input);
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "laender_edit.tpl");
|
||||
}
|
||||
|
||||
function LaenderDelete()
|
||||
{
|
||||
$ref = $_SERVER['HTTP_REFERER'];
|
||||
$id = $this->app->Secure->GetGET("id");
|
||||
$this->app->DB->DELETE("DELETE FROM laender WHERE id = '$id' LIMIT 1");
|
||||
|
||||
//$this->VorlageList();
|
||||
header("Location: $ref");
|
||||
exit;
|
||||
}
|
||||
|
||||
function LaenderCreate(){
|
||||
// $this->app->Tpl->Add(KURZUEBERSCHRIFT,"Benutzer");
|
||||
$this->app->erp->MenuEintrag("index.php?module=laender&action=list","Zurück zur Übersicht");
|
||||
|
||||
$input = $this->GetInput();
|
||||
$submit = $this->app->Secure->GetPOST('submitland');
|
||||
|
||||
if($submit!='') {
|
||||
|
||||
$error = '';
|
||||
|
||||
if($input['iso']=='' || strlen(trim($input['iso'])) > 2) $error .= 'Geben Sie bitte einen zweistelligen ISO-Code ein.<br>';
|
||||
if($input['bezeichnung_de']=='') $error .= 'Geben Sie bitte eine deutsche Länderbezeichnung ein.<br>';
|
||||
if($input['bezeichnung_en']=='') $error .= 'Geben Sie bitte eine englische Länderbezeichnung ein.<br>';
|
||||
|
||||
if($this->app->DB->Select("SELECT '1' FROM laender WHERE iso='{$input['iso']}' LIMIT 1")=='1')
|
||||
$error .= "Es existiert bereits ein ISO-Code mit diesem Namen.<br />";
|
||||
|
||||
if($error!=''){
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"error\">$error</div>");
|
||||
}else {
|
||||
$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");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$this->SetInput($input);
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "laender_edit.tpl");
|
||||
}
|
||||
|
||||
|
||||
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');
|
||||
return $input;
|
||||
|
||||
}
|
||||
|
||||
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){
|
||||
$this->app->Tpl->Set('EU', "checked");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -3339,7 +3339,7 @@ INNER JOIN shopexport s ON
|
||||
}
|
||||
|
||||
if($this->app->Secure->GetPOST('pruefen')) {
|
||||
|
||||
|
||||
$className = 'Remote';
|
||||
$methodName = 'RemoteConnection';
|
||||
$r = new ReflectionMethod($className, $methodName);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,134 +1,133 @@
|
||||
<?php
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
|
||||
use Xentral\Components\Http\JsonResponse;
|
||||
use Xentral\Modules\TOTPLogin\TOTPLoginService;
|
||||
|
||||
class Totp
|
||||
{
|
||||
/** @var Application */
|
||||
private $app;
|
||||
|
||||
/**
|
||||
* Totp constructor.
|
||||
*
|
||||
* @param Application $app
|
||||
* @param bool $intern
|
||||
*/
|
||||
public function __construct($app, $intern = false)
|
||||
{
|
||||
$this->app = $app;
|
||||
|
||||
if($intern) return;
|
||||
|
||||
$app->ActionHandlerInit($this);
|
||||
|
||||
$app->ActionHandler('generate', 'TOTPGenerateSecretJSON');
|
||||
$app->ActionHandler('enable', 'TOTPEnable');
|
||||
$app->ActionHandler('disable', 'TOTPDisable');
|
||||
|
||||
$app->ActionHandlerListen($app);
|
||||
}
|
||||
|
||||
public function Install()
|
||||
{
|
||||
$tableName = 'user_totp';
|
||||
$this->app->erp->CheckTable($tableName);
|
||||
$this->app->erp->CheckColumn('id', 'UNSIGNED INT', $tableName, 'NOT NULL AUTO_INCREMENT');
|
||||
$this->app->erp->CheckColumn('user_id', 'INT', $tableName, 'UNSIGNED NOT NULL');
|
||||
$this->app->erp->CheckColumn('active', 'TINYINT(1)', $tableName, 'UNSIGNED DEFAULT 0');
|
||||
$this->app->erp->CheckColumn('secret', 'VARCHAR(100)', $tableName, 'NOT NULL');
|
||||
$this->app->erp->CheckColumn('created_at', 'TIMESTAMP', $tableName, 'DEFAULT NOW()');
|
||||
$this->app->erp->CheckColumn('modified_at', 'TIMESTAMP', $tableName);
|
||||
$this->app->erp->CheckIndex($tableName, 'user_id', true);
|
||||
|
||||
$this->app->erp->RegisterHook('login_password_check_otp', 'totp', 'TOTPCheckLogin', 1, false, null, 3);
|
||||
}
|
||||
|
||||
function TOTPDisable(){
|
||||
$action = $this->app->Secure->GetPOST('action');
|
||||
|
||||
if($action !== 'disable'){
|
||||
return new JsonResponse(['status' => 'error', 'msg' => 'muss POST sein'], 400);
|
||||
}
|
||||
|
||||
/** @var TOTPLoginService $totpLoginService */
|
||||
$totpLoginService = $this->app->Container->get('TOTPLoginService');
|
||||
|
||||
$userId = $this->app->User->GetID();
|
||||
|
||||
$totpLoginService->disableTotp($userId);
|
||||
|
||||
return new JsonResponse(['status' => 'success']);
|
||||
}
|
||||
|
||||
function TOTPEnable(){
|
||||
$secret = $this->app->Secure->GetPOST('secret');
|
||||
|
||||
if(empty($secret)){
|
||||
return new JsonResponse(['status' => 'error', 'msg' => 'Secret Empty'], 400);
|
||||
}
|
||||
|
||||
/** @var TOTPLoginService $totpLoginService */
|
||||
$totpLoginService = $this->app->Container->get('TOTPLoginService');
|
||||
|
||||
$userId = $this->app->User->GetID();
|
||||
|
||||
$totpLoginService->enableTotp($userId);
|
||||
$totpLoginService->setUserSecret($userId, $secret);
|
||||
|
||||
return new JsonResponse(['status' => 'success']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $userID
|
||||
* @param $token
|
||||
* @param $passwordValid
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function TOTPCheckLogin($userID, $token, &$passwordValid)
|
||||
{
|
||||
/** @var TOTPLoginService $totpLoginService */
|
||||
$totpLoginService = $this->app->Container->get('TOTPLoginService');
|
||||
|
||||
if(!$totpLoginService->isTOTPEnabled($userID)){
|
||||
return;
|
||||
}
|
||||
$passwordValid = $totpLoginService->isTokenValid($userID, $token);
|
||||
}
|
||||
|
||||
public function TOTPGenerateSecretJSON(){
|
||||
/** @var TOTPLoginService $totpLoginService */
|
||||
$totpLoginService = $this->app->Container->get('TOTPLoginService');
|
||||
|
||||
/** @var \Xentral\Components\Token\TOTPTokenManager $tokenManager */
|
||||
$tokenManager = $this->app->Container->get('TOTPTokenManager');
|
||||
|
||||
$secret = $tokenManager->generateBase32Secret();
|
||||
|
||||
$label = 'Xentral' . ' | ' . $this->app->erp->GetFirmaName();
|
||||
|
||||
$qr = $totpLoginService->generatePairingQrCode($this->app->User->GetID(), $label, $secret);
|
||||
|
||||
return new JsonResponse(
|
||||
[
|
||||
'secret' => $secret,
|
||||
'qr' => $qr->toHtml(4, 4)
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
use Xentral\Components\Http\JsonResponse;
|
||||
use Xentral\Modules\TOTPLogin\TOTPLoginService;
|
||||
|
||||
class Totp
|
||||
{
|
||||
/** @var Application */
|
||||
private $app;
|
||||
|
||||
/**
|
||||
* Totp constructor.
|
||||
*
|
||||
* @param Application $app
|
||||
* @param bool $intern
|
||||
*/
|
||||
public function __construct($app, $intern = false)
|
||||
{
|
||||
$this->app = $app;
|
||||
|
||||
if($intern) return;
|
||||
|
||||
$app->ActionHandlerInit($this);
|
||||
|
||||
$app->ActionHandler('generate', 'TOTPGenerateSecretJSON');
|
||||
$app->ActionHandler('enable', 'TOTPEnable');
|
||||
$app->ActionHandler('disable', 'TOTPDisable');
|
||||
|
||||
$app->ActionHandlerListen($app);
|
||||
}
|
||||
|
||||
public function Install()
|
||||
{
|
||||
$tableName = 'user_totp';
|
||||
$this->app->erp->CheckTable($tableName);
|
||||
$this->app->erp->CheckColumn('id', 'UNSIGNED INT', $tableName, 'NOT NULL AUTO_INCREMENT');
|
||||
$this->app->erp->CheckColumn('user_id', 'INT', $tableName, 'UNSIGNED NOT NULL');
|
||||
$this->app->erp->CheckColumn('active', 'TINYINT(1)', $tableName, 'UNSIGNED DEFAULT 0');
|
||||
$this->app->erp->CheckColumn('secret', 'VARCHAR(100)', $tableName, 'NOT NULL');
|
||||
$this->app->erp->CheckColumn('created_at', 'TIMESTAMP', $tableName, 'DEFAULT NOW()');
|
||||
$this->app->erp->CheckColumn('modified_at', 'TIMESTAMP', $tableName);
|
||||
$this->app->erp->CheckIndex($tableName, 'user_id', true);
|
||||
|
||||
$this->app->erp->RegisterHook('login_password_check_otp', 'totp', 'TOTPCheckLogin', 1, false, null, 3);
|
||||
}
|
||||
|
||||
function TOTPDisable(){
|
||||
$action = $this->app->Secure->GetPOST('action');
|
||||
|
||||
if($action !== 'disable'){
|
||||
return new JsonResponse(['status' => 'error', 'msg' => 'muss POST sein'], 400);
|
||||
}
|
||||
|
||||
/** @var TOTPLoginService $totpLoginService */
|
||||
$totpLoginService = $this->app->Container->get('TOTPLoginService');
|
||||
|
||||
$userId = $this->app->User->GetID();
|
||||
|
||||
$totpLoginService->disableTotp($userId);
|
||||
|
||||
return new JsonResponse(['status' => 'success']);
|
||||
}
|
||||
|
||||
function TOTPEnable(){
|
||||
$secret = $this->app->Secure->GetPOST('secret');
|
||||
|
||||
if(empty($secret)){
|
||||
return new JsonResponse(['status' => 'error', 'msg' => 'Secret Empty'], 400);
|
||||
}
|
||||
|
||||
/** @var TOTPLoginService $totpLoginService */
|
||||
$totpLoginService = $this->app->Container->get('TOTPLoginService');
|
||||
|
||||
$userId = $this->app->User->GetID();
|
||||
|
||||
$totpLoginService->enableTotp($userId);
|
||||
$totpLoginService->setUserSecret($userId, $secret);
|
||||
|
||||
return new JsonResponse(['status' => 'success']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $userID
|
||||
* @param $token
|
||||
* @param $passwordValid
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function TOTPCheckLogin($userID, $token, &$passwordValid)
|
||||
{
|
||||
/** @var TOTPLoginService $totpLoginService */
|
||||
$totpLoginService = $this->app->Container->get('TOTPLoginService');
|
||||
if(!$totpLoginService->isTOTPEnabled($userID)){
|
||||
return;
|
||||
}
|
||||
$passwordValid = $totpLoginService->isTokenValid($userID, $token);
|
||||
}
|
||||
|
||||
public function TOTPGenerateSecretJSON(){
|
||||
/** @var TOTPLoginService $totpLoginService */
|
||||
$totpLoginService = $this->app->Container->get('TOTPLoginService');
|
||||
|
||||
/** @var \Xentral\Components\Token\TOTPTokenManager $tokenManager */
|
||||
$tokenManager = $this->app->Container->get('TOTPTokenManager');
|
||||
|
||||
$secret = $tokenManager->generateBase32Secret();
|
||||
|
||||
$label = 'OpenXE' . ':' . $this->app->User->Getname();
|
||||
|
||||
$qr = $totpLoginService->generatePairingQrCode($this->app->User->GetID(), $label, $secret);
|
||||
|
||||
return new JsonResponse(
|
||||
[
|
||||
'secret' => $secret,
|
||||
'qr' => $qr->toHtml(4, 4)
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
8
www/themes/new/images/sidebar/beschaffung.svg
Normal file
8
www/themes/new/images/sidebar/beschaffung.svg
Normal file
@ -0,0 +1,8 @@
|
||||
<svg width="14" height="12" viewBox="0 0 14 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.625 4.03125L5.25 0.96875" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M11.375 4.03125L8.75 0.96875" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.0455 11.0312H2.95353C2.56348 11.0242 2.2295 10.7498 2.14678 10.3686L0.899611 5.11858C0.831972 4.86388 0.884041 4.59223 1.04107 4.38059C1.1981 4.16894 1.44298 4.04036 1.70636 4.03125H12.2927C12.5561 4.04036 12.801 4.16894 12.958 4.38059C13.115 4.59223 13.1671 4.86388 13.0994 5.11858L11.8523 10.3686C11.7696 10.7498 11.4356 11.0242 11.0455 11.0312Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M4.375 5.78125V9.28125" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M7 5.78125V9.28125" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9.625 5.78125V9.28125" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
@ -566,11 +566,13 @@
|
||||
<div class="inside inside-full-height">
|
||||
|
||||
|
||||
<fieldset><legend> {|Beschreibung|} </legend>
|
||||
<fieldset>
|
||||
<legend> {|Beschreibung|} </legend>
|
||||
<table class="mkTableFormular" border="0">
|
||||
|
||||
<tr valign="top"><td width="500">{|Artikel (DE) (Bitte im ersten Tab bearbeiten)|}:<br>[ARTIKEL_DE_ANZEIGE]</td><td width="20"></td>
|
||||
<td width="500">{|Artikel (EN)|}:<br>[NAME_EN][MSGNAME_EN]</td></tr>
|
||||
<td width="500">{|Artikel (EN)|}:<br>[NAME_EN][MSGNAME_EN]</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr><td>{|Kurztext (DE) (Bitte im ersten Tab bearbeiten)|}:<br>[KURZTEXT_DE_ANZEIGE]</td><td width="20"></td>
|
||||
|
@ -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