Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
529587c0f5 | ||
|
|
35f6532520 | ||
|
|
84eaf1b495 | ||
|
|
c519d8030a | ||
|
|
0848148b9e | ||
|
|
6c9d8b7594 | ||
|
|
51f9929228 | ||
|
|
508ee0ae8e | ||
|
|
ca9b48cb58 | ||
|
|
817dd802aa | ||
|
|
6a5679ba23 | ||
|
|
724c57d309 |
+1
-2
@@ -1,5 +1,4 @@
|
|||||||
conf/user.inc.php
|
conf/user.inc.php
|
||||||
conf/user_defined.php
|
conf/user_defined.php
|
||||||
userdata/cronjobkey.txt
|
userdata
|
||||||
userdata/tmp/
|
|
||||||
www/cache/
|
www/cache/
|
||||||
@@ -1261,6 +1261,16 @@ Allow from all
|
|||||||
Order Allow,Deny
|
Order Allow,Deny
|
||||||
Allow from all
|
Allow from all
|
||||||
</Files>
|
</Files>
|
||||||
|
# Allow access to setup.php
|
||||||
|
<Files setup.php>
|
||||||
|
Order Allow,Deny
|
||||||
|
Allow from all
|
||||||
|
</Files>
|
||||||
|
# Allow access to inline PDF viewer
|
||||||
|
<Files viewer.html>
|
||||||
|
Order Allow,Deny
|
||||||
|
Allow from all
|
||||||
|
</Files>
|
||||||
# end
|
# end
|
||||||
');
|
');
|
||||||
|
|
||||||
|
|||||||
@@ -135,8 +135,10 @@ class Secure
|
|||||||
{
|
{
|
||||||
foreach($this->POST as $key=>$value)
|
foreach($this->POST as $key=>$value)
|
||||||
{
|
{
|
||||||
$key = $this->GetPOST($key,"alpha+digit+specialchars",20);
|
$value = $this->GetPOST($key);
|
||||||
$ret[$key]=$this->GetPOST($value);
|
if ($value !== null) {
|
||||||
|
$ret[$key] = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!empty($ret))
|
if(!empty($ret))
|
||||||
@@ -153,8 +155,10 @@ class Secure
|
|||||||
{
|
{
|
||||||
foreach($this->GET as $key=>$value)
|
foreach($this->GET as $key=>$value)
|
||||||
{
|
{
|
||||||
$key = $this->GetGET($key,"alpha+digit+specialchars",20);
|
$value = $this->GetGET($key);
|
||||||
$ret[$key]=$this->GetGET($value);
|
if ($value !== null) {
|
||||||
|
$ret[$key] = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!empty($ret))
|
if(!empty($ret))
|
||||||
|
|||||||
+6
-3
@@ -1,16 +1,19 @@
|
|||||||
Upgrade the OpenXE system.
|
OpenXE upgrade system
|
||||||
|
|
||||||
NOTE:
|
NOTE:
|
||||||
The upgrade system is for use in LINUX only and needs to have git installed.
|
The upgrade system is for use in LINUX only and needs to have git installed.
|
||||||
|
|
||||||
|
The following steps are executed:
|
||||||
1. get files from git
|
1. get files from git
|
||||||
2. run database upgrade
|
2. run database upgrade
|
||||||
|
|
||||||
Files in this directory:
|
Files in this directory:
|
||||||
UPGRADE.md -> This file
|
UPGRADE.md -> This file
|
||||||
upgrade.php -> The upgrade program
|
upgrade.sh -> The upgrade starter, execute with "./upgrade.sh". Execute without parameters to view possible options.
|
||||||
|
|
||||||
Files in the data subdirectory:
|
Files in the data subdirectory:
|
||||||
.in_progress.flag -> if this file exists, an upgrade is in progress, system will be locked
|
upgrade.php -> The upgrade program
|
||||||
db_schema.json -> Contains the nominal database structure
|
db_schema.json -> Contains the nominal database structure
|
||||||
|
exported_db_schema.json -> Contains the exported database structure (optional)
|
||||||
remote.json -> Contains the git remote & branch which should be used for upgrade
|
remote.json -> Contains the git remote & branch which should be used for upgrade
|
||||||
|
upgrade.log -> Contains the output from the last run that was started from within OpenXE
|
||||||
|
|||||||
@@ -114243,17 +114243,17 @@
|
|||||||
{
|
{
|
||||||
"name": "belege",
|
"name": "belege",
|
||||||
"type": "VIEW",
|
"type": "VIEW",
|
||||||
"Create": "CREATE ALGORITHM=UNDEFINED DEFINER=`openxe`@`localhost` SQL SECURITY DEFINER VIEW `belege` AS select `rechnung`.`id` AS `id`,`rechnung`.`adresse` AS `adresse`,`rechnung`.`datum` AS `datum`,`rechnung`.`belegnr` AS `belegnr`,`rechnung`.`status` AS `status`,`rechnung`.`land` AS `land`,'rechnung' AS `typ`,`rechnung`.`umsatz_netto` AS `umsatz_netto`,`rechnung`.`erloes_netto` AS `erloes_netto`,`rechnung`.`deckungsbeitrag` AS `deckungsbeitrag`,`rechnung`.`provision_summe` AS `provision_summe`,`rechnung`.`vertriebid` AS `vertriebid`,`rechnung`.`gruppe` AS `gruppe` from `rechnung` where (`rechnung`.`status` <> 'angelegt') union all select `gutschrift`.`id` AS `id`,`gutschrift`.`adresse` AS `adresse`,`gutschrift`.`datum` AS `datum`,`gutschrift`.`belegnr` AS `belegnr`,`gutschrift`.`status` AS `status`,`gutschrift`.`land` AS `land`,'gutschrift' AS `typ`,(`gutschrift`.`umsatz_netto` * -(1)) AS `umsatz_netto*-1`,(`gutschrift`.`erloes_netto` * -(1)) AS `erloes_netto*-1`,(`gutschrift`.`deckungsbeitrag` * -(1)) AS `deckungsbeitrag*-1`,(`gutschrift`.`provision_summe` * -(1)) AS `provision_summe*-1`,`gutschrift`.`vertriebid` AS `vertriebid`,`gutschrift`.`gruppe` AS `gruppe` from `gutschrift` where (`gutschrift`.`status` <> 'angelegt')"
|
"Create": "CREATE VIEW `belege` AS select `rechnung`.`id` AS `id`,`rechnung`.`adresse` AS `adresse`,`rechnung`.`datum` AS `datum`,`rechnung`.`belegnr` AS `belegnr`,`rechnung`.`status` AS `status`,`rechnung`.`land` AS `land`,'rechnung' AS `typ`,`rechnung`.`umsatz_netto` AS `umsatz_netto`,`rechnung`.`erloes_netto` AS `erloes_netto`,`rechnung`.`deckungsbeitrag` AS `deckungsbeitrag`,`rechnung`.`provision_summe` AS `provision_summe`,`rechnung`.`vertriebid` AS `vertriebid`,`rechnung`.`gruppe` AS `gruppe` from `rechnung` where `rechnung`.`status` <> 'angelegt' union all select `gutschrift`.`id` AS `id`,`gutschrift`.`adresse` AS `adresse`,`gutschrift`.`datum` AS `datum`,`gutschrift`.`belegnr` AS `belegnr`,`gutschrift`.`status` AS `status`,`gutschrift`.`land` AS `land`,'gutschrift' AS `typ`,`gutschrift`.`umsatz_netto` * -1 AS `umsatz_netto*-1`,`gutschrift`.`erloes_netto` * -1 AS `erloes_netto*-1`,`gutschrift`.`deckungsbeitrag` * -1 AS `deckungsbeitrag*-1`,`gutschrift`.`provision_summe` * -1 AS `provision_summe*-1`,`gutschrift`.`vertriebid` AS `vertriebid`,`gutschrift`.`gruppe` AS `gruppe` from `gutschrift` where `gutschrift`.`status` <> 'angelegt'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "belegegesamt",
|
"name": "belegegesamt",
|
||||||
"type": "VIEW",
|
"type": "VIEW",
|
||||||
"Create": "CREATE ALGORITHM=UNDEFINED DEFINER=`openxe`@`localhost` SQL SECURITY DEFINER VIEW `belegegesamt` AS select `rechnung`.`id` AS `id`,`rechnung`.`adresse` AS `adresse`,`rechnung`.`datum` AS `datum`,`rechnung`.`belegnr` AS `belegnr`,`rechnung`.`status` AS `status`,`rechnung`.`land` AS `land`,'rechnung' AS `typ`,`rechnung`.`umsatz_netto` AS `umsatz_netto`,`rechnung`.`soll` AS `umsatz_brutto`,`rechnung`.`erloes_netto` AS `erloes_netto`,`rechnung`.`deckungsbeitrag` AS `deckungsbeitrag`,`rechnung`.`provision_summe` AS `provision_summe`,`rechnung`.`vertriebid` AS `vertriebid`,`rechnung`.`gruppe` AS `gruppe`,`rechnung`.`projekt` AS `projekt` from `rechnung` union all select `gutschrift`.`id` AS `id`,`gutschrift`.`adresse` AS `adresse`,`gutschrift`.`datum` AS `datum`,`gutschrift`.`belegnr` AS `belegnr`,`gutschrift`.`status` AS `status`,`gutschrift`.`land` AS `land`,'gutschrift' AS `typ`,(`gutschrift`.`umsatz_netto` * -(1)) AS `umsatz_netto*-1`,(`gutschrift`.`soll` * -(1)) AS `umsatz_brutto*-1`,(`gutschrift`.`erloes_netto` * -(1)) AS `erloes_netto*-1`,(`gutschrift`.`deckungsbeitrag` * -(1)) AS `deckungsbeitrag*-1`,(`gutschrift`.`provision_summe` * -(1)) AS `provision_summe*-1`,`gutschrift`.`vertriebid` AS `vertriebid`,`gutschrift`.`gruppe` AS `gruppe`,`gutschrift`.`projekt` AS `projekt` from `gutschrift` union all select `auftrag`.`id` AS `id`,`auftrag`.`adresse` AS `adresse`,`auftrag`.`datum` AS `datum`,`auftrag`.`belegnr` AS `belegnr`,`auftrag`.`status` AS `status`,`auftrag`.`land` AS `land`,'auftrag' AS `typ`,`auftrag`.`umsatz_netto` AS `umsatz_netto`,`auftrag`.`gesamtsumme` AS `umsatz_brutto`,`auftrag`.`erloes_netto` AS `erloes_netto`,`auftrag`.`deckungsbeitrag` AS `deckungsbeitrag`,`auftrag`.`provision_summe` AS `provision_summe`,`auftrag`.`vertriebid` AS `vertriebid`,`auftrag`.`gruppe` AS `gruppe`,`auftrag`.`projekt` AS `projekt` from `auftrag` union all select `bestellung`.`id` AS `id`,`bestellung`.`adresse` AS `adresse`,`bestellung`.`datum` AS `datum`,`bestellung`.`belegnr` AS `belegnr`,`bestellung`.`status` AS `status`,`bestellung`.`land` AS `land`,'bestellung' AS `typ`,`bestellung`.`gesamtsumme` AS `umsatz_netto`,`bestellung`.`gesamtsumme` AS `umsatz_brutto`,'0' AS `erloes_netto`,'0' AS `deckungsbeitrag`,'0' AS `provision_summe`,'0' AS `vertriebid`,'0' AS `gruppe`,`bestellung`.`projekt` AS `projekt` from `bestellung` union all select `lieferschein`.`id` AS `id`,`lieferschein`.`adresse` AS `adresse`,`lieferschein`.`datum` AS `datum`,`lieferschein`.`belegnr` AS `belegnr`,`lieferschein`.`status` AS `status`,`lieferschein`.`land` AS `land`,'lieferschein' AS `typ`,'0' AS `umsatz_netto`,'0' AS `umsatz_brutto`,'0' AS `erloes_netto`,'0' AS `deckungsbeitrag`,'0' AS `provision_summe`,'0' AS `vertriebid`,'0' AS `gruppe`,`lieferschein`.`projekt` AS `projekt` from `lieferschein` union all select `angebot`.`id` AS `id`,`angebot`.`adresse` AS `adresse`,`angebot`.`datum` AS `datum`,`angebot`.`belegnr` AS `belegnr`,`angebot`.`status` AS `status`,`angebot`.`land` AS `land`,'angebot' AS `typ`,`angebot`.`umsatz_netto` AS `umsatz_netto`,`angebot`.`gesamtsumme` AS `umsatz_brutto`,'0' AS `erloes_netto`,`angebot`.`deckungsbeitrag` AS `deckungsbeitrag`,'0' AS `provision_summe`,`angebot`.`vertriebid` AS `vertriebid`,'0' AS `gruppe`,`angebot`.`projekt` AS `projekt` from `angebot`"
|
"Create": "CREATE VIEW `belegegesamt` AS select `rechnung`.`id` AS `id`,`rechnung`.`adresse` AS `adresse`,`rechnung`.`datum` AS `datum`,`rechnung`.`belegnr` AS `belegnr`,`rechnung`.`status` AS `status`,`rechnung`.`land` AS `land`,'rechnung' AS `typ`,`rechnung`.`umsatz_netto` AS `umsatz_netto`,`rechnung`.`soll` AS `umsatz_brutto`,`rechnung`.`erloes_netto` AS `erloes_netto`,`rechnung`.`deckungsbeitrag` AS `deckungsbeitrag`,`rechnung`.`provision_summe` AS `provision_summe`,`rechnung`.`vertriebid` AS `vertriebid`,`rechnung`.`gruppe` AS `gruppe`,`rechnung`.`projekt` AS `projekt` from `rechnung` union all select `gutschrift`.`id` AS `id`,`gutschrift`.`adresse` AS `adresse`,`gutschrift`.`datum` AS `datum`,`gutschrift`.`belegnr` AS `belegnr`,`gutschrift`.`status` AS `status`,`gutschrift`.`land` AS `land`,'gutschrift' AS `typ`,`gutschrift`.`umsatz_netto` * -1 AS `umsatz_netto*-1`,`gutschrift`.`soll` * -1 AS `umsatz_brutto*-1`,`gutschrift`.`erloes_netto` * -1 AS `erloes_netto*-1`,`gutschrift`.`deckungsbeitrag` * -1 AS `deckungsbeitrag*-1`,`gutschrift`.`provision_summe` * -1 AS `provision_summe*-1`,`gutschrift`.`vertriebid` AS `vertriebid`,`gutschrift`.`gruppe` AS `gruppe`,`gutschrift`.`projekt` AS `projekt` from `gutschrift` union all select `auftrag`.`id` AS `id`,`auftrag`.`adresse` AS `adresse`,`auftrag`.`datum` AS `datum`,`auftrag`.`belegnr` AS `belegnr`,`auftrag`.`status` AS `status`,`auftrag`.`land` AS `land`,'auftrag' AS `typ`,`auftrag`.`umsatz_netto` AS `umsatz_netto`,`auftrag`.`gesamtsumme` AS `umsatz_brutto`,`auftrag`.`erloes_netto` AS `erloes_netto`,`auftrag`.`deckungsbeitrag` AS `deckungsbeitrag`,`auftrag`.`provision_summe` AS `provision_summe`,`auftrag`.`vertriebid` AS `vertriebid`,`auftrag`.`gruppe` AS `gruppe`,`auftrag`.`projekt` AS `projekt` from `auftrag` union all select `bestellung`.`id` AS `id`,`bestellung`.`adresse` AS `adresse`,`bestellung`.`datum` AS `datum`,`bestellung`.`belegnr` AS `belegnr`,`bestellung`.`status` AS `status`,`bestellung`.`land` AS `land`,'bestellung' AS `typ`,`bestellung`.`gesamtsumme` AS `umsatz_netto`,`bestellung`.`gesamtsumme` AS `umsatz_brutto`,'0' AS `erloes_netto`,'0' AS `deckungsbeitrag`,'0' AS `provision_summe`,'0' AS `vertriebid`,'0' AS `gruppe`,`bestellung`.`projekt` AS `projekt` from `bestellung` union all select `lieferschein`.`id` AS `id`,`lieferschein`.`adresse` AS `adresse`,`lieferschein`.`datum` AS `datum`,`lieferschein`.`belegnr` AS `belegnr`,`lieferschein`.`status` AS `status`,`lieferschein`.`land` AS `land`,'lieferschein' AS `typ`,'0' AS `umsatz_netto`,'0' AS `umsatz_brutto`,'0' AS `erloes_netto`,'0' AS `deckungsbeitrag`,'0' AS `provision_summe`,'0' AS `vertriebid`,'0' AS `gruppe`,`lieferschein`.`projekt` AS `projekt` from `lieferschein` union all select `angebot`.`id` AS `id`,`angebot`.`adresse` AS `adresse`,`angebot`.`datum` AS `datum`,`angebot`.`belegnr` AS `belegnr`,`angebot`.`status` AS `status`,`angebot`.`land` AS `land`,'angebot' AS `typ`,`angebot`.`umsatz_netto` AS `umsatz_netto`,`angebot`.`gesamtsumme` AS `umsatz_brutto`,'0' AS `erloes_netto`,`angebot`.`deckungsbeitrag` AS `deckungsbeitrag`,'0' AS `provision_summe`,`angebot`.`vertriebid` AS `vertriebid`,'0' AS `gruppe`,`angebot`.`projekt` AS `projekt` from `angebot`"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "belegeregs",
|
"name": "belegeregs",
|
||||||
"type": "VIEW",
|
"type": "VIEW",
|
||||||
"Create": "CREATE ALGORITHM=UNDEFINED DEFINER=`openxe`@`localhost` SQL SECURITY DEFINER VIEW `belegeregs` AS select `rechnung`.`id` AS `id`,`rechnung`.`adresse` AS `adresse`,`rechnung`.`datum` AS `datum`,`rechnung`.`belegnr` AS `belegnr`,`rechnung`.`status` AS `status`,`rechnung`.`land` AS `land`,'rechnung' AS `typ`,`rechnung`.`umsatz_netto` AS `umsatz_netto`,`rechnung`.`erloes_netto` AS `erloes_netto`,`rechnung`.`deckungsbeitrag` AS `deckungsbeitrag`,`rechnung`.`provision_summe` AS `provision_summe`,`rechnung`.`vertriebid` AS `vertriebid`,`rechnung`.`gruppe` AS `gruppe`,`rechnung`.`projekt` AS `projekt` from `rechnung` union all select `gutschrift`.`id` AS `id`,`gutschrift`.`adresse` AS `adresse`,`gutschrift`.`datum` AS `datum`,`gutschrift`.`belegnr` AS `belegnr`,`gutschrift`.`status` AS `status`,`gutschrift`.`land` AS `land`,'gutschrift' AS `typ`,(`gutschrift`.`umsatz_netto` * -(1)) AS `umsatz_netto*-1`,(`gutschrift`.`erloes_netto` * -(1)) AS `erloes_netto*-1`,(`gutschrift`.`deckungsbeitrag` * -(1)) AS `deckungsbeitrag*-1`,(`gutschrift`.`provision_summe` * -(1)) AS `provision_summe*-1`,`gutschrift`.`vertriebid` AS `vertriebid`,`gutschrift`.`gruppe` AS `gruppe`,`gutschrift`.`projekt` AS `projekt` from `gutschrift`"
|
"Create": "CREATE VIEW `belegeregs` AS select `rechnung`.`id` AS `id`,`rechnung`.`adresse` AS `adresse`,`rechnung`.`datum` AS `datum`,`rechnung`.`belegnr` AS `belegnr`,`rechnung`.`status` AS `status`,`rechnung`.`land` AS `land`,'rechnung' AS `typ`,`rechnung`.`umsatz_netto` AS `umsatz_netto`,`rechnung`.`erloes_netto` AS `erloes_netto`,`rechnung`.`deckungsbeitrag` AS `deckungsbeitrag`,`rechnung`.`provision_summe` AS `provision_summe`,`rechnung`.`vertriebid` AS `vertriebid`,`rechnung`.`gruppe` AS `gruppe`,`rechnung`.`projekt` AS `projekt` from `rechnung` union all select `gutschrift`.`id` AS `id`,`gutschrift`.`adresse` AS `adresse`,`gutschrift`.`datum` AS `datum`,`gutschrift`.`belegnr` AS `belegnr`,`gutschrift`.`status` AS `status`,`gutschrift`.`land` AS `land`,'gutschrift' AS `typ`,`gutschrift`.`umsatz_netto` * -1 AS `umsatz_netto*-1`,`gutschrift`.`erloes_netto` * -1 AS `erloes_netto*-1`,`gutschrift`.`deckungsbeitrag` * -1 AS `deckungsbeitrag*-1`,`gutschrift`.`provision_summe` * -1 AS `provision_summe*-1`,`gutschrift`.`vertriebid` AS `vertriebid`,`gutschrift`.`gruppe` AS `gruppe`,`gutschrift`.`projekt` AS `projekt` from `gutschrift`"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,26 +48,23 @@ function git(string $command, &$output, bool $show_command, bool $show_output, s
|
|||||||
echo_output($output);
|
echo_output($output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($retval != 0) {
|
||||||
|
echo_out($error_text."\n");
|
||||||
|
}
|
||||||
return($retval);
|
return($retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------- START
|
// -------------------------------- START
|
||||||
|
|
||||||
// Check for correct call method
|
// Check for correct call method
|
||||||
$directory = "";
|
|
||||||
if (php_sapi_name() == "cli") {
|
if (php_sapi_name() == "cli") {
|
||||||
$cli = true;
|
|
||||||
$directory = ".";
|
$directory = getcwd();
|
||||||
} else if (basename(getcwd()) != 'upgrade') {
|
if (basename($directory) != 'upgrade') {
|
||||||
// Started from "www"
|
|
||||||
$directory = "../upgrade";
|
|
||||||
} else {
|
|
||||||
abort("Must be executed from 'upgrade' directory.");
|
abort("Must be executed from 'upgrade' directory.");
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cli) {
|
|
||||||
|
|
||||||
$check_git = false;
|
$check_git = false;
|
||||||
$do_git = false;
|
$do_git = false;
|
||||||
$check_db = false;
|
$check_db = false;
|
||||||
@@ -94,6 +91,12 @@ if ($cli) {
|
|||||||
$force = false;
|
$force = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (in_array('-o', $argv)) {
|
||||||
|
$origin = true;
|
||||||
|
} else {
|
||||||
|
$origin = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (in_array('-connection', $argv)) {
|
if (in_array('-connection', $argv)) {
|
||||||
$connection = true;
|
$connection = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -124,7 +127,7 @@ if ($cli) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($check_git || $check_db || $do_git || $do_db) {
|
if ($check_git || $check_db || $do_git || $do_db) {
|
||||||
upgrade_main($directory,$verbose,$check_git,$do_git,$export_db,$check_db,$do_db,$force,$connection);
|
upgrade_main($directory,$verbose,$check_git,$do_git,$export_db,$check_db,$do_db,$force,$connection,$origin);
|
||||||
} else {
|
} else {
|
||||||
info();
|
info();
|
||||||
}
|
}
|
||||||
@@ -136,40 +139,9 @@ if ($cli) {
|
|||||||
}
|
}
|
||||||
// -------------------------------- END
|
// -------------------------------- END
|
||||||
|
|
||||||
function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do_git, bool $export_db, bool $check_db, bool $do_db, bool $force, bool $connection) {
|
function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do_git, bool $export_db, bool $check_db, bool $do_db, bool $force, bool $connection, bool $origin) {
|
||||||
|
|
||||||
if ($connection) {
|
|
||||||
$connection_file_name = $directory."/data/connection.json";
|
|
||||||
$connection_file_contents = file_get_contents($connection_file_name);
|
|
||||||
if (!$connection_file_contents) {
|
|
||||||
abort("Unable to load $connection_file_name");
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
$connection_info = json_decode($connection_file_contents, true);
|
|
||||||
|
|
||||||
$host = $connection_info['host'];
|
|
||||||
$user = $connection_info['user'];
|
|
||||||
$passwd = $connection_info['passwd'];
|
|
||||||
$schema = $connection_info['schema'];
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
class DatabaseConnectionInfo {
|
|
||||||
function __construct($dir) {
|
|
||||||
require($dir."/../conf/user.inc.php");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$dbci = new DatabaseConnectionInfo($directory);
|
|
||||||
|
|
||||||
$host = $dbci->WFdbhost;
|
|
||||||
$user = $dbci->WFdbuser;
|
|
||||||
$passwd = $dbci->WFdbpass;
|
|
||||||
$schema = $dbci->WFdbname;
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once($directory.'/../vendor/mustal/mustal_mysql_upgrade_tool.php');
|
|
||||||
|
|
||||||
|
$mainfolder = dirname($directory);
|
||||||
$datafolder = $directory."/data";
|
$datafolder = $directory."/data";
|
||||||
$lockfile_name = $datafolder."/.in_progress.flag";
|
$lockfile_name = $datafolder."/.in_progress.flag";
|
||||||
$remote_file_name = $datafolder."/remote.json";
|
$remote_file_name = $datafolder."/remote.json";
|
||||||
@@ -180,34 +152,34 @@ function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do
|
|||||||
|
|
||||||
//require_once($directory.'/../cronjobs/githash.php');
|
//require_once($directory.'/../cronjobs/githash.php');
|
||||||
|
|
||||||
|
if ($origin) {
|
||||||
|
$remote_info = array('host' => 'origin','branch' => 'master');
|
||||||
|
} else {
|
||||||
$remote_info_contents = file_get_contents($remote_file_name);
|
$remote_info_contents = file_get_contents($remote_file_name);
|
||||||
if (!$remote_info_contents) {
|
if (!$remote_info_contents) {
|
||||||
abort("Unable to load $remote_file_name");
|
abort("Unable to load $remote_file_name");
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
$remote_info = json_decode($remote_info_contents, true);
|
$remote_info = json_decode($remote_info_contents, true);
|
||||||
|
|
||||||
$modified_files = false;
|
|
||||||
|
|
||||||
if ($check_git || $do_git) {
|
|
||||||
// Get changed files on system -> Should be empty
|
|
||||||
$output = array();
|
|
||||||
$retval = git("ls-files -m ..", $output,$verbose,false,"Git not initialized.");
|
|
||||||
if (!empty($output)) {
|
|
||||||
$modified_files = true;
|
|
||||||
echo_out("There are modified files:\n");
|
|
||||||
echo_output($output);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($check_git || $do_git) {
|
||||||
|
|
||||||
|
$retval = git("log HEAD --", $output,$verbose,false,"");
|
||||||
// Not a git repository -> Create it and then go ahead
|
// Not a git repository -> Create it and then go ahead
|
||||||
if ($retval == 128) {
|
if ($retval == 128) {
|
||||||
|
if (!$do_git) {
|
||||||
|
abort("Git not initialized, use -do to initialize.");
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
|
|
||||||
echo_out("Setting up git...");
|
echo_out("Setting up git...");
|
||||||
$retval = git("init ..", $output,$verbose,$verbose,"Error while initializing git!");
|
$retval = git("init $mainfolder", $output,$verbose,$verbose,"Error while initializing git!");
|
||||||
if ($retval != 0) {
|
if ($retval != 0) {
|
||||||
abort("");
|
abort("");
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
$retval = git("add ../.", $output,$verbose,$verbose,"Error while initializing git!");
|
$retval = git("add $mainfolder", $output,$verbose,$verbose,"Error while initializing git!");
|
||||||
if ($retval != 0) {
|
if ($retval != 0) {
|
||||||
abort("");
|
abort("");
|
||||||
return(-1);
|
return(-1);
|
||||||
@@ -218,7 +190,7 @@ function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$retval = git("checkout FETCH_HEAD -f", $output,$verbose,$verbose,"Error while initializing git!");
|
$retval = git("checkout FETCH_HEAD -f --", $output,$verbose,$verbose,"Error while initializing git!");
|
||||||
if ($retval != 0) {
|
if ($retval != 0) {
|
||||||
abort("");
|
abort("");
|
||||||
return(-1);
|
return(-1);
|
||||||
@@ -228,16 +200,26 @@ function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get changed files on system -> Should be empty
|
||||||
|
$modified_files = false;
|
||||||
|
$output = array();
|
||||||
|
$retval = git("ls-files -m $mainfolder", $output,$verbose,false,"Error while checking Git status.");
|
||||||
|
if (!empty($output)) {
|
||||||
|
$modified_files = true;
|
||||||
|
echo_out("There are modified files:\n");
|
||||||
|
echo_output($output);
|
||||||
|
}
|
||||||
|
|
||||||
if ($verbose) {
|
if ($verbose) {
|
||||||
echo_out("--------------- Upgrade history ---------------\n");
|
echo_out("--------------- Upgrade history ---------------\n");
|
||||||
$retval = git("log --date=short-local --pretty=\"%cd (%h): %s\" HEAD --not HEAD~5",$output,$verbose,$verbose,"Error while showing history!");
|
$retval = git("log --date=short-local --pretty=\"%cd (%h): %s\" HEAD --not HEAD~5 --",$output,$verbose,$verbose,"Error while showing history!");
|
||||||
if ($retval != 0) {
|
if ($retval != 0) {
|
||||||
abort("");
|
abort("");
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo_out("--------------- Current version ---------------\n");
|
echo_out("--------------- Current version ---------------\n");
|
||||||
$retval = git("log -1 --date=short-local --pretty=\"%cd (%h): %s\" HEAD",$output,$verbose,true,"Error while showing history!");
|
$retval = git("log -1 --date=short-local --pretty=\"%cd (%h): %s\" HEAD --",$output,$verbose,true,"Error while showing history!");
|
||||||
if ($retval != 0) {
|
if ($retval != 0) {
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
@@ -302,6 +284,39 @@ function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do
|
|||||||
} // $check_git
|
} // $check_git
|
||||||
|
|
||||||
if ($check_db || $do_db || $export_db) {
|
if ($check_db || $do_db || $export_db) {
|
||||||
|
|
||||||
|
if ($connection) {
|
||||||
|
$connection_file_name = $directory."/data/connection.json";
|
||||||
|
$connection_file_contents = file_get_contents($connection_file_name);
|
||||||
|
if (!$connection_file_contents) {
|
||||||
|
abort("Unable to load $connection_file_name");
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
|
$connection_info = json_decode($connection_file_contents, true);
|
||||||
|
|
||||||
|
$host = $connection_info['host'];
|
||||||
|
$user = $connection_info['user'];
|
||||||
|
$passwd = $connection_info['passwd'];
|
||||||
|
$schema = $connection_info['schema'];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
class DatabaseConnectionInfo {
|
||||||
|
function __construct($dir) {
|
||||||
|
require($dir."/../conf/user.inc.php");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$dbci = new DatabaseConnectionInfo($directory);
|
||||||
|
|
||||||
|
$host = $dbci->WFdbhost;
|
||||||
|
$user = $dbci->WFdbuser;
|
||||||
|
$passwd = $dbci->WFdbpass;
|
||||||
|
$schema = $dbci->WFdbname;
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once($directory.'/../vendor/mustal/mustal_mysql_upgrade_tool.php');
|
||||||
|
|
||||||
echo_out("--------------- Loading from database '$schema@$host'... ---------------\n");
|
echo_out("--------------- Loading from database '$schema@$host'... ---------------\n");
|
||||||
$db_def = mustal_load_tables_from_db($host, $schema, $user, $passwd, $mustal_replacers);
|
$db_def = mustal_load_tables_from_db($host, $schema, $user, $passwd, $mustal_replacers);
|
||||||
|
|
||||||
@@ -458,6 +473,7 @@ function info() {
|
|||||||
echo_out("\t-do: execute all upgrades\n");
|
echo_out("\t-do: execute all upgrades\n");
|
||||||
echo_out("\t-v: verbose output\n");
|
echo_out("\t-v: verbose output\n");
|
||||||
echo_out("\t-f: force override of existing files\n");
|
echo_out("\t-f: force override of existing files\n");
|
||||||
|
echo_out("\t-o: update from origin instead of remote.json\n");
|
||||||
echo_out("\t-connection use connection.json in data folder instead of user.inc.php\n");
|
echo_out("\t-connection use connection.json in data folder instead of user.inc.php\n");
|
||||||
echo_out("\t-clean: (not yet implemented) create the needed SQL to remove items from the database not in the JSON\n");
|
echo_out("\t-clean: (not yet implemented) create the needed SQL to remove items from the database not in the JSON\n");
|
||||||
echo_out("\n");
|
echo_out("\n");
|
||||||
Executable
+2
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
sudo -u www-data php data/upgrade.php "$@"
|
||||||
+4
-2
@@ -68,7 +68,7 @@ $mustal_replacers = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Load all db_def from a DB connection into a db_def array
|
// Load all db_def from a DB connection into a db_def array
|
||||||
function mustal_load_tables_from_db(string $host, string $schema, string $user, string $passwd, $replacers) : array {
|
function mustal_load_tables_from_db(string $host, string $schema, string $user, string $passwd, array $replacers) : array {
|
||||||
|
|
||||||
// First get the contents of the database table structure
|
// First get the contents of the database table structure
|
||||||
$mysqli = mysqli_connect($host, $user, $passwd, $schema);
|
$mysqli = mysqli_connect($host, $user, $passwd, $schema);
|
||||||
@@ -167,7 +167,9 @@ function mustal_load_tables_from_db(string $host, string $schema, string $user,
|
|||||||
return(array());
|
return(array());
|
||||||
}
|
}
|
||||||
$viewdef = mysqli_fetch_assoc($query_result);
|
$viewdef = mysqli_fetch_assoc($query_result);
|
||||||
$view['Create'] = $viewdef['Create View'];
|
|
||||||
|
// Remove the security info from view definition
|
||||||
|
$view['Create'] = "CREATE ".stristr($viewdef['Create View'],"VIEW");
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$version="OSS";
|
$version="OSS";
|
||||||
$version_revision="1.6";
|
$version_revision="1.7";
|
||||||
$githash = file_get_contents("../githash.txt");
|
$githash = file_get_contents("../githash.txt");
|
||||||
if (!empty($githash)) {
|
if (!empty($githash)) {
|
||||||
$version_revision .= " (".substr($githash,0,8).")";
|
$version_revision .= " (".substr($githash,0,8).")";
|
||||||
|
|||||||
@@ -13,4 +13,14 @@ Allow from all
|
|||||||
Order Allow,Deny
|
Order Allow,Deny
|
||||||
Allow from all
|
Allow from all
|
||||||
</Files>
|
</Files>
|
||||||
|
# Allow access to setup.php
|
||||||
|
<Files setup.php>
|
||||||
|
Order Allow,Deny
|
||||||
|
Allow from all
|
||||||
|
</Files>
|
||||||
|
# Allow access to inline PDF viewer
|
||||||
|
<Files viewer.html>
|
||||||
|
Order Allow,Deny
|
||||||
|
Allow from all
|
||||||
|
</Files>
|
||||||
# end
|
# end
|
||||||
|
|||||||
+181
-5
@@ -40,6 +40,7 @@ class Auftrag extends GenAuftrag
|
|||||||
*/
|
*/
|
||||||
public function TableSearch($app, $name, $erlaubtevars)
|
public function TableSearch($app, $name, $erlaubtevars)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch($name)
|
switch($name)
|
||||||
{
|
{
|
||||||
case 'auftraege':
|
case 'auftraege':
|
||||||
@@ -711,6 +712,55 @@ class Auftrag extends GenAuftrag
|
|||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
case 'positionen_teillieferung':
|
||||||
|
|
||||||
|
$id = $app->Secure->GetGET('id');
|
||||||
|
$allowed['positionen_teillieferung'] = array('list');
|
||||||
|
$heading = array('Position','Artikel','Nr.','Menge','Lager','Teilmenge','');
|
||||||
|
$width = array( '1%', '60%', '29%','5%','5%'); // Fill out manually later
|
||||||
|
|
||||||
|
// columns that are aligned right (numbers etc)
|
||||||
|
// $alignright = array(4,5,6,7,8);
|
||||||
|
|
||||||
|
$findcols = array('ap.sort','a.name_de','a.nummer','ap.menge','lager','teilmenge');
|
||||||
|
$searchsql = array('');
|
||||||
|
|
||||||
|
$defaultorder = 2;
|
||||||
|
$defaultorderdesc = 0;
|
||||||
|
|
||||||
|
$input_for_menge = "CONCAT(
|
||||||
|
'<input type = \"number\" min=\"0\" max=\"',
|
||||||
|
ap.menge,
|
||||||
|
'\" name=\"teilmenge_',
|
||||||
|
ap.id,
|
||||||
|
'\"',
|
||||||
|
' value=\"',
|
||||||
|
|
||||||
|
'\">',
|
||||||
|
'</input>'
|
||||||
|
)";
|
||||||
|
|
||||||
|
|
||||||
|
// .'(SELECT TRIM(IFNULL(SUM(l.menge),0))+0 FROM lager_platz_inhalt l WHERE l.artikel=a.id) as lager'
|
||||||
|
|
||||||
|
$sql = "SELECT SQL_CALC_FOUND_ROWS
|
||||||
|
ap.sort,
|
||||||
|
ap.sort,
|
||||||
|
a.name_de,
|
||||||
|
a.nummer,"
|
||||||
|
.$this->app->erp->FormatMenge('ap.menge').","
|
||||||
|
."(SELECT TRIM(IFNULL(SUM(l.menge),0))+0 FROM lager_platz_inhalt l WHERE l.artikel=a.id) as lager,"
|
||||||
|
.$input_for_menge
|
||||||
|
." FROM auftrag_position ap
|
||||||
|
INNER JOIN
|
||||||
|
artikel a
|
||||||
|
ON ap.artikel = a.id";
|
||||||
|
|
||||||
|
$where = " ap.auftrag = $id ";
|
||||||
|
$count = "SELECT count(DISTINCT ap.id) FROM auftrag_position ap WHERE $where";
|
||||||
|
// $groupby = "";
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
$erg = [];
|
$erg = [];
|
||||||
@@ -765,7 +815,7 @@ class Auftrag extends GenAuftrag
|
|||||||
$this->app->ActionHandler("rechnung","AuftragRechnung");
|
$this->app->ActionHandler("rechnung","AuftragRechnung");
|
||||||
$this->app->ActionHandler("lieferschein","AuftragLieferschein");
|
$this->app->ActionHandler("lieferschein","AuftragLieferschein");
|
||||||
$this->app->ActionHandler("lieferscheinrechnung","AuftragLieferscheinRechnung");
|
$this->app->ActionHandler("lieferscheinrechnung","AuftragLieferscheinRechnung");
|
||||||
|
$this->app->ActionHandler("teillieferung","AuftragTeillieferung");
|
||||||
$this->app->ActionHandler("nachlieferung","AuftragNachlieferung");
|
$this->app->ActionHandler("nachlieferung","AuftragNachlieferung");
|
||||||
// $this->app->ActionHandler("versand","AuftragVersand");
|
// $this->app->ActionHandler("versand","AuftragVersand");
|
||||||
$this->app->ActionHandler("freigabe","AuftragFreigabe");
|
$this->app->ActionHandler("freigabe","AuftragFreigabe");
|
||||||
@@ -1271,7 +1321,11 @@ class Auftrag extends GenAuftrag
|
|||||||
$kommissionierart = $this->app->DB->Select("SELECT kommissionierverfahren FROM projekt WHERE id='$projekt' LIMIT 1");
|
$kommissionierart = $this->app->DB->Select("SELECT kommissionierverfahren FROM projekt WHERE id='$projekt' LIMIT 1");
|
||||||
//$art = $this->app->DB->Select("SELECT art FROM auftrag WHERE id='$id' LIMIT 1");
|
//$art = $this->app->DB->Select("SELECT art FROM auftrag WHERE id='$id' LIMIT 1");
|
||||||
$alleartikelreservieren = '';
|
$alleartikelreservieren = '';
|
||||||
$teillieferungen = '';
|
|
||||||
|
if ($status==='angelegt' || $status==='freigegeben') {
|
||||||
|
$teillieferungen = '<option value="teillieferung">Teilauftrag erstellen</option>';
|
||||||
|
}
|
||||||
|
|
||||||
if($status==='freigegeben') {
|
if($status==='freigegeben') {
|
||||||
$alleartikelreservieren = "<option value=\"reservieren\">alle Artikel reservieren</option>";
|
$alleartikelreservieren = "<option value=\"reservieren\">alle Artikel reservieren</option>";
|
||||||
|
|
||||||
@@ -1369,9 +1423,14 @@ class Auftrag extends GenAuftrag
|
|||||||
{
|
{
|
||||||
switch(cmd)
|
switch(cmd)
|
||||||
{
|
{
|
||||||
case 'storno': if(!confirm('Wirklich stornieren?')) return document.getElementById('aktion$prefix').selectedIndex = 0; else window.location.href='index.php?module=auftrag&action=delete&id=%value%'; break;
|
case 'storno':
|
||||||
case 'unstorno': if(!confirm('Wirklich stornierten Auftrag wieder freigeben?')) return document.getElementById('aktion$prefix').selectedIndex = 0; else window.location.href='index.php?module=auftrag&action=undelete&id=%value%'; break;
|
if(!confirm('Wirklich stornieren?')) return document.getElementById('aktion$prefix').selectedIndex = 0; else window.location.href='index.php?module=auftrag&action=delete&id=%value%'; break;
|
||||||
case 'teillieferung': window.location.href='index.php?module=auftrag&action=teillieferung&id=%value%'; break;
|
case 'unstorno':
|
||||||
|
if(!confirm('Wirklich stornierten Auftrag wieder freigeben?')) return document.getElementById('aktion$prefix').selectedIndex = 0; else window.location.href='index.php?module=auftrag&action=undelete&id=%value%';
|
||||||
|
break;
|
||||||
|
case 'teillieferung':
|
||||||
|
window.location.href='index.php?module=auftrag&action=teillieferung&id=%value%';
|
||||||
|
break;
|
||||||
case 'anfrage': if(!confirm('Wirklich rückführen?')) return document.getElementById('aktion$prefix').selectedIndex = 0; else window.location.href='index.php?module=auftrag&action=anfrage&id=%value%'; break;
|
case 'anfrage': if(!confirm('Wirklich rückführen?')) return document.getElementById('aktion$prefix').selectedIndex = 0; else window.location.href='index.php?module=auftrag&action=anfrage&id=%value%'; break;
|
||||||
case 'kreditlimit': if(!confirm('Wirklich Kreditlimit für diesen Auftrag freigeben?')) return document.getElementById('aktion$prefix').selectedIndex = 0; else window.location.href='index.php?module=auftrag&action=kreditlimit&id=%value%'; break;
|
case 'kreditlimit': if(!confirm('Wirklich Kreditlimit für diesen Auftrag freigeben?')) return document.getElementById('aktion$prefix').selectedIndex = 0; else window.location.href='index.php?module=auftrag&action=kreditlimit&id=%value%'; break;
|
||||||
case 'copy': if(!confirm('Wirklich kopieren?')) return document.getElementById('aktion$prefix').selectedIndex = 0; else window.location.href='index.php?module=auftrag&action=copy&id=%value%'; break;
|
case 'copy': if(!confirm('Wirklich kopieren?')) return document.getElementById('aktion$prefix').selectedIndex = 0; else window.location.href='index.php?module=auftrag&action=copy&id=%value%'; break;
|
||||||
@@ -7004,4 +7063,121 @@ Die Gesamtsumme stimmt nicht mehr mit ursprünglich festgelegten Betrag '.
|
|||||||
header('Location: index.php?module=auftrag&action=versandzentrum');
|
header('Location: index.php?module=auftrag&action=versandzentrum');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Split auftrag into separate documents with submit -> do it and return jump to the new split part
|
||||||
|
*/
|
||||||
|
function AuftragTeillieferung() {
|
||||||
|
|
||||||
|
$id = $this->app->Secure->GetGET('id');
|
||||||
|
$this->AuftragMenu();
|
||||||
|
$submit = $this->app->Secure->GetPOST('submit');
|
||||||
|
|
||||||
|
|
||||||
|
$sql = "SELECT * from auftrag WHERE id = $id";
|
||||||
|
$auftrag_alt = $this->app->DB->SelectArr($sql)[0];
|
||||||
|
$msg = "";
|
||||||
|
|
||||||
|
if (in_array($auftrag_alt['status'],array('angelegt','freigegeben'))) {
|
||||||
|
if ($submit != '') {
|
||||||
|
$msg = "";
|
||||||
|
switch ($submit) {
|
||||||
|
case 'speichern':
|
||||||
|
// Get parameters
|
||||||
|
|
||||||
|
$teilmenge_input = $this->app->Secure->GetPOSTArray();
|
||||||
|
|
||||||
|
$teilmengen = array();
|
||||||
|
|
||||||
|
foreach ($teilmenge_input as $key => $value) {
|
||||||
|
|
||||||
|
if ((strpos($key,'teilmenge_') === 0) && ($value !== '')) {
|
||||||
|
$posid = substr($key,'10');
|
||||||
|
$teilmenge = array('posid' => $posid, 'menge' => $value);
|
||||||
|
$teilmengen[] = $teilmenge;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($teilmengen)) {
|
||||||
|
|
||||||
|
// Create new auftrag
|
||||||
|
$sql = "SELECT * from auftrag WHERE id = $id";
|
||||||
|
$auftrag_alt = $this->app->DB->SelectArr($sql)[0];
|
||||||
|
|
||||||
|
// Part auftrag of part auftrag -> select parent
|
||||||
|
$hauptauftrag_id = $auftrag_alt['teillieferungvon'];
|
||||||
|
if ($hauptauftrag_id != 0) {
|
||||||
|
$sql = "SELECT belegnr FROM auftrag WHERE id = $hauptauftrag_id";
|
||||||
|
$hauptauftrag_belegnr = $this->app->DB->SelectArr($sql)[0]['belegnr'];
|
||||||
|
} else {
|
||||||
|
$hauptauftrag_id = $auftrag_alt['id'];
|
||||||
|
$hauptauftrag_belegnr = $auftrag_alt['belegnr'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT MAX(teillieferungnummer) as tpn FROM auftrag WHERE teillieferungvon = $hauptauftrag_id";
|
||||||
|
$teillieferungnummer = $this->app->DB->SelectArr($sql)[0]['tpn'];
|
||||||
|
if (empty($teillieferungnummer) || $teillieferungnummer == 0) {
|
||||||
|
$teillieferungnummer = '1';
|
||||||
|
} else {
|
||||||
|
$teillieferungnummer++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$belegnr_neu = $hauptauftrag_belegnr."-".$teillieferungnummer;
|
||||||
|
|
||||||
|
$auftrag_neu = $auftrag_alt;
|
||||||
|
$auftrag_neu['id'] = null;
|
||||||
|
$auftrag_neu['belegnr'] = $belegnr_neu;
|
||||||
|
$auftrag_neu['teillieferungvon'] = $hauptauftrag_id;
|
||||||
|
$auftrag_neu['teillieferungnummer'] = $teillieferungnummer;
|
||||||
|
|
||||||
|
$id_neu = $this->app->DB->MysqlCopyRow('auftrag','id',$id);
|
||||||
|
$sql = "UPDATE auftrag SET belegnr = '$belegnr_neu', teillieferungvon = $hauptauftrag_id, teillieferungnummer = $teillieferungnummer WHERE id = $id_neu";
|
||||||
|
echo("---------------------------".$sql."<br>");
|
||||||
|
$this->app->DB->Update($sql);
|
||||||
|
|
||||||
|
// Adjust quantities
|
||||||
|
foreach ($teilmengen as $teilmenge) {
|
||||||
|
|
||||||
|
$sql = "SELECT menge FROM auftrag_position WHERE id = ".$teilmenge['posid'];
|
||||||
|
$menge_alt = $this->app->DB->SelectArr($sql)[0]['menge'];
|
||||||
|
|
||||||
|
$menge_neu = $teilmenge['menge'];
|
||||||
|
if ($menge_neu > $menge_alt) {
|
||||||
|
$menge_neu = $menge_alt;
|
||||||
|
}
|
||||||
|
|
||||||
|
$menge_reduziert = $menge_alt-$menge_neu;
|
||||||
|
|
||||||
|
$posid_alt = $teilmenge['posid'];
|
||||||
|
$posid_neu = $this->app->DB->MysqlCopyRow('auftrag_position','id',$posid_alt);
|
||||||
|
|
||||||
|
$sql = "UPDATE auftrag_position SET menge = $menge_reduziert WHERE id = $posid_alt";
|
||||||
|
echo("---------------------------".$sql."<br>");
|
||||||
|
$this->app->DB->Update($sql);
|
||||||
|
$sql = "UPDATE auftrag_position SET auftrag = $id_neu, menge = $menge_neu WHERE id = $posid_neu";
|
||||||
|
echo("---------------------------".$sql."<br>");
|
||||||
|
$this->app->DB->Update($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'abbrechen':
|
||||||
|
header('Location: index.php?module=auftrag&action=edit&id='.$id);
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} // Submit
|
||||||
|
else {
|
||||||
|
$msg = "Teilauftrag: Auswahl der Artikel für den Teilauftrag.";
|
||||||
|
}
|
||||||
|
} // Status ok
|
||||||
|
else {
|
||||||
|
$msg = 'Teilauftrag in diesem Status nicht möglich.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->app->Tpl->Add('INFOTEXT',$msg);
|
||||||
|
$this->app->YUI->TableSearch('TABLE','positionen_teillieferung', 'show','','',basename(__FILE__), __CLASS__);
|
||||||
|
|
||||||
|
$this->app->Tpl->Parse('PAGE','auftrag_teillieferung.tpl');
|
||||||
|
} // AuftragTeillieferung
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,35 @@
|
|||||||
<!-- gehort zu tabview -->
|
|
||||||
<div id="tabs">
|
<div id="tabs">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#tabs-1">[TABTEXT]</a></li>
|
<li><a href="#tabs-1">[TABTEXT]</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- ende gehort zu tabview -->
|
|
||||||
|
|
||||||
<!-- erstes tab -->
|
|
||||||
<div id="tabs-1">
|
<div id="tabs-1">
|
||||||
<div class="info">Teillieferung: Auswahl der Artikel für eine Teillieferung. Bestimmen Sie welche Artikel als Teillieferung vorab versendet werden sollen,<br>
|
<div class="info">[INFOTEXT]</div>
|
||||||
und wann die Rechnung versendet wird (bei aktueller oder nächster Lieferung).</div>
|
|
||||||
<br>
|
<br>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
[MESSAGE]
|
[MESSAGE]
|
||||||
[TAB1]
|
<div class="row">
|
||||||
[TAB1NEXT]
|
<div class="row-height">
|
||||||
|
<div class="col-xs-14 col-md-12 col-md-height">
|
||||||
|
<div class="inside inside-full-height">
|
||||||
|
<fieldset>
|
||||||
|
[TABLE]
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-14 col-md-2 col-md-height">
|
||||||
|
<div class="inside inside-full-height">
|
||||||
|
<fieldset>
|
||||||
|
<table width="100%" border="0" class="mkTableFormular">
|
||||||
|
<legend>{|Aktionen|}</legend>
|
||||||
|
<tr><td><button name="submit" id="speichern" value="speichern" class="ui-button-icon" style="width:100%";>Teilauftrag erzeugen</button></td></tr>
|
||||||
|
<tr><td><button name="submit" id="abbrechen" value="abbrechen" class="ui-button-icon" style="width:100%";>Vorgang abbrechen</button></td></tr>
|
||||||
|
</table>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- tab view schließen -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,20 @@
|
|||||||
-->
|
-->
|
||||||
<div id="tabs-1">
|
<div id="tabs-1">
|
||||||
[MESSAGE]
|
[MESSAGE]
|
||||||
|
<div class="row">
|
||||||
|
<div class="row-height">
|
||||||
|
<div class="col-xs-14 col-md-12 col-md-height">
|
||||||
|
<div class="inside inside-full-height">
|
||||||
|
<fieldset>
|
||||||
|
<legend>{|OpenXE Upgrade-System|}</legend>
|
||||||
|
Das Upgrade funktioniert in 2 Schritten: Dateien aktualisieren, Datenbank auffrischen. Wenn das Upgrade lange läuft, kann der Fortschritt in einem neuen Fenster mit "Anzeige auffrischen" angezeigt werden.<br><br>
|
||||||
|
Falls nach einem Abbruch oder schwerwiegenden Fehler kein Upgrade möglich ist, im Hauptordner den Ordner ".git" löschen und das Upgrade in der Konsole erneut durchführen.
|
||||||
|
Dazu im Unterordner "upgrade" diesen Befehl starten: <pre>./upgrade.sh -do</pre>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
[FORMHANDLEREVENT]
|
[FORMHANDLEREVENT]
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -53,12 +67,12 @@
|
|||||||
<table width="100%" border="0" class="mkTableFormular">
|
<table width="100%" border="0" class="mkTableFormular">
|
||||||
<tr><td colspan=2><button name="submit" value="refresh" class="ui-button-icon" style="width:100%;">Anzeige auffrischen</button></td></tr>
|
<tr><td colspan=2><button name="submit" value="refresh" class="ui-button-icon" style="width:100%;">Anzeige auffrischen</button></td></tr>
|
||||||
<tr><td colspan=2><button name="submit" value="check_upgrade" class="ui-button-icon" style="width:100%;">Upgrades prüfen</button></td></tr>
|
<tr><td colspan=2><button name="submit" value="check_upgrade" class="ui-button-icon" style="width:100%;">Upgrades prüfen</button></td></tr>
|
||||||
<tr><td style="width:100%;">{|Upgrade-Details anzeigen|}:</td><td><input type="checkbox" name="details_anzeigen" value=1 size="20"></td></tr>
|
<tr><td style="width:100%;">{|Upgrade-Details anzeigen|}:</td><td><input type="checkbox" name="details_anzeigen" value=1 [DETAILS_ANZEIGEN] size="20"></td></tr>
|
||||||
<tr [UPGRADE_VISIBLE]><td colspan=2><button name="submit" value="do_upgrade" class="ui-button-icon" style="width:100%;">UPGRADE</button></td></tr>
|
<tr [UPGRADE_VISIBLE]><td colspan=2><button name="submit" formtarget="_blank" value="do_upgrade" class="ui-button-icon" style="width:100%;">UPGRADE</button></td></tr>
|
||||||
<tr [UPGRADE_VISIBLE]><td style="width:100%;">{|Erzwingen (-f)|}:</td><td><input type="checkbox" name="erzwingen" value=1 size="20"></td></tr>
|
<tr [UPGRADE_VISIBLE]><td style="width:100%;">{|Erzwingen (-f)|}:</td><td><input type="checkbox" name="erzwingen" value=1 [ERZWINGEN] size="20"></td></tr>
|
||||||
<tr><td colspan=2><button name="submit" value="check_db" class="ui-button-icon" style="width:100%;">Datenbank prüfen</button></td></tr>
|
<tr><td colspan=2><button name="submit" value="check_db" class="ui-button-icon" style="width:100%;">Datenbank prüfen</button></td></tr>
|
||||||
<tr><td style="width:100%;">{|Datenbank-Details anzeigen|}:</td><td><input type="checkbox" name="db_details_anzeigen" value=1 size="20"></td></tr>
|
<tr><td style="width:100%;">{|Datenbank-Details anzeigen|}:</td><td><input type="checkbox" name="db_details_anzeigen" value=1 [DB_DETAILS_ANZEIGEN] size="20"></td></tr>
|
||||||
<tr [UPGRADE_DB_VISIBLE]><td colspan=2><button name="submit" value="do_db_upgrade" class="ui-button-icon" style="width:100%;">Datenbank UPGRADE</button></td></tr>
|
<tr [UPGRADE_DB_VISIBLE]><td colspan=2><button name="submit" formtarget="_blank" value="do_db_upgrade" class="ui-button-icon" style="width:100%;">Datenbank UPGRADE</button></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ class Shopimporter_Shopware6 extends ShopimporterBase
|
|||||||
{
|
{
|
||||||
$accessToken = $this->shopwareToken();
|
$accessToken = $this->shopwareToken();
|
||||||
$url = $this->ShopUrl;
|
$url = $this->ShopUrl;
|
||||||
$url .= 'v2/' . $endpoint;
|
$url .= $endpoint;
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
$headerInformation[] = 'Content-Type:application/json';
|
$headerInformation[] = 'Content-Type:application/json';
|
||||||
@@ -1430,7 +1430,7 @@ class Shopimporter_Shopware6 extends ShopimporterBase
|
|||||||
];
|
];
|
||||||
$this->shopwareRequest('POST', '_action/sync?_response=true', $mediaAssociationData);
|
$this->shopwareRequest('POST', '_action/sync?_response=true', $mediaAssociationData);
|
||||||
|
|
||||||
$url = $this->ShopUrl . 'v2/_action/media/' . $mediaId . '/upload?extension=' . $extension . '&fileName=' . $filename;
|
$url = $this->ShopUrl . '_action/media/' . $mediaId . '/upload?extension=' . $extension . '&fileName=' . $filename;
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
$setHeaders = [
|
$setHeaders = [
|
||||||
'Content-Type:image/' . $extension,
|
'Content-Type:image/' . $extension,
|
||||||
@@ -3480,7 +3480,7 @@ class Shopimporter_Shopware6 extends ShopimporterBase
|
|||||||
$documentId = $documentData['documentId'];
|
$documentId = $documentData['documentId'];
|
||||||
|
|
||||||
$accessToken = $this->shopwareToken();
|
$accessToken = $this->shopwareToken();
|
||||||
$url = $this->ShopUrl . 'v2/_action/document/' . $documentId . '/upload?_response=true&extension=pdf&fileName=' . $documentNumber;
|
$url = $this->ShopUrl . '_action/document/' . $documentId . '/upload?_response=true&extension=pdf&fileName=' . $documentNumber;
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
$setHeaders = [
|
$setHeaders = [
|
||||||
|
|||||||
+12
-6
@@ -30,7 +30,10 @@ class upgrade {
|
|||||||
$db_verbose = $this->app->Secure->GetPOST('db_details_anzeigen') === '1';
|
$db_verbose = $this->app->Secure->GetPOST('db_details_anzeigen') === '1';
|
||||||
$force = $this->app->Secure->GetPOST('erzwingen') === '1';
|
$force = $this->app->Secure->GetPOST('erzwingen') === '1';
|
||||||
|
|
||||||
include("../upgrade/upgrade.php");
|
$this->app->Tpl->Set('DETAILS_ANZEIGEN', $verbose?"checked":"");
|
||||||
|
$this->app->Tpl->Set('DB_DETAILS_ANZEIGEN', $db_verbose?"checked":"");
|
||||||
|
|
||||||
|
include("../upgrade/data/upgrade.php");
|
||||||
|
|
||||||
$logfile = "../upgrade/data/upgrade.log";
|
$logfile = "../upgrade/data/upgrade.log";
|
||||||
upgrade_set_out_file_name($logfile);
|
upgrade_set_out_file_name($logfile);
|
||||||
@@ -38,27 +41,29 @@ class upgrade {
|
|||||||
$this->app->Tpl->Set('UPGRADE_VISIBLE', "hidden");
|
$this->app->Tpl->Set('UPGRADE_VISIBLE', "hidden");
|
||||||
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "hidden");
|
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "hidden");
|
||||||
|
|
||||||
//function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do_git, bool $export_db, bool $check_db, bool $do_db, bool $force, bool $connection)
|
//function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do_git, bool $export_db, bool $check_db, bool $do_db, bool $force, bool $connection, bool $origin) {
|
||||||
|
|
||||||
|
$directory = dirname(getcwd())."/upgrade";
|
||||||
|
|
||||||
switch ($submit) {
|
switch ($submit) {
|
||||||
case 'check_upgrade':
|
case 'check_upgrade':
|
||||||
$this->app->Tpl->Set('UPGRADE_VISIBLE', "");
|
$this->app->Tpl->Set('UPGRADE_VISIBLE', "");
|
||||||
unlink($logfile);
|
unlink($logfile);
|
||||||
upgrade_main("../upgrade",$verbose,true,false,false,true,false,$force,false);
|
upgrade_main($directory,$verbose,true,false,false,true,false,$force,false,false);
|
||||||
break;
|
break;
|
||||||
case 'do_upgrade':
|
case 'do_upgrade':
|
||||||
unlink($logfile);
|
unlink($logfile);
|
||||||
upgrade_main("../upgrade",$verbose,true,true,false,true,true,$force,false);
|
upgrade_main($directory,$verbose,true,true,false,true,true,$force,false,false);
|
||||||
break;
|
break;
|
||||||
case 'check_db':
|
case 'check_db':
|
||||||
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "");
|
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "");
|
||||||
unlink($logfile);
|
unlink($logfile);
|
||||||
upgrade_main("../upgrade",$db_verbose,false,false,false,true,false,$force,false);
|
upgrade_main($directory,$db_verbose,false,false,false,true,false,$force,false,false);
|
||||||
break;
|
break;
|
||||||
case 'do_db_upgrade':
|
case 'do_db_upgrade':
|
||||||
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "");
|
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "");
|
||||||
unlink($logfile);
|
unlink($logfile);
|
||||||
upgrade_main("../upgrade",$db_verbose,false,false,false,true,true,$force,false);
|
upgrade_main($directory,$db_verbose,false,false,false,true,true,$force,false,false);
|
||||||
break;
|
break;
|
||||||
case 'refresh':
|
case 'refresh':
|
||||||
break;
|
break;
|
||||||
@@ -73,3 +78,4 @@ class upgrade {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user