8
0

add shell scripts for changing article tax rates via mysql command

Dieser Commit ist enthalten in:
Daniel Seifert 2020-06-30 09:26:28 +02:00
Ursprung 2c5b8589c0
Commit 686f07f642
Signiert von: DanielS
GPG-Schlüssel-ID: 8A7C4C6ED1915C6F
2 geänderte Dateien mit 64 neuen und 0 gelöschten Zeilen

32
bin/raiseArticleTaxMysql Normale Datei
Datei anzeigen

@ -0,0 +1,32 @@
#!/bin/bash
# Mail-Versand erfolgt bei Profihost ueber den Cronjob selbst, andere Provider erfordern ggf. expliziten Versand
TODAY=$(date)
HOST=$(hostname)
DOMAIN='myhost.de'
DOMAIN='myhost.de'
MYSQLUSER='mysql_user'
MYSQLPASS='mysql_pass'
MYSQLDB='mysql_db'
MYSQLHOST='127.0.0.1'
MYSQLPORT='3306'
echo "------------------------------------------------------------------------------------------"
echo "USt.-Anpassung 01.01.2021"
echo "Date: $TODAY Host: $HOST ($DOMAIN)"
echo "------------------------------------------------------------------------------------------"
printf '\n 16%% -> 19%%\n\n'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'SELECT CONCAT("Vor Umstellung: ", COUNT(*), " Artikel gefunden") as result FROM oxarticles WHERE oxvat = 16;'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'UPDATE oxarticles SET oxvat = 19 WHERE oxvat = 16;'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'SELECT CONCAT("Nach Umstellung: ", COUNT(*), " Artikel gefunden") as result FROM oxarticles WHERE oxvat = 16;'
printf '\n'
echo "------------------------------------------------------------------------------------------"
printf '\n 5%% -> 7%%\n\n'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'SELECT CONCAT("Vor Umstellung: ", COUNT(*), " Artikel gefunden") as result FROM oxarticles WHERE oxvat = 5;'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'UPDATE oxarticles SET oxvat = 7 WHERE oxvat = 5;'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'SELECT CONCAT("Nach Umstellung: ", COUNT(*), " Artikel gefunden") as result FROM oxarticles WHERE oxvat = 5;'
printf '\n'

32
bin/reduceArticleTaxMysql Normale Datei
Datei anzeigen

@ -0,0 +1,32 @@
#!/bin/bash
# Mail-Versand erfolgt bei Profihost ueber den Cronjob selbst, andere Provider erfordern ggf. expliziten Versand
TODAY=$(date)
HOST=$(hostname)
DOMAIN='myhost.de'
DOMAIN='myhost.de'
MYSQLUSER='mysql_user'
MYSQLPASS='mysql_pass'
MYSQLDB='mysql_db'
MYSQLHOST='127.0.0.1'
MYSQLPORT='3306'
echo "------------------------------------------------------------------------------------------"
echo "USt.-Anpassung 01.07.2020"
echo "Date: $TODAY Host: $HOST ($DOMAIN)"
echo "------------------------------------------------------------------------------------------"
printf '\n 19%% -> 16%%\n\n'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'SELECT CONCAT("Vor Umstellung: ", COUNT(*), " Artikel gefunden") as result FROM oxarticles WHERE oxvat = 19;'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'UPDATE oxarticles SET oxvat = 16 WHERE oxvat = 19;'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'SELECT CONCAT("Nach Umstellung: ", COUNT(*), " Artikel gefunden") as result FROM oxarticles WHERE oxvat = 19;'
printf '\n'
echo "------------------------------------------------------------------------------------------"
printf '\n 7%% -> 5%%\n\n'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'SELECT CONCAT("Vor Umstellung: ", COUNT(*), " Artikel gefunden") as result FROM oxarticles WHERE oxvat = 7;'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'UPDATE oxarticles SET oxvat = 5 WHERE oxvat = 7;'
mysql5 -u$MYSQLUSER -p$MYSQLPASS -D$MYSQLDB -h$MYSQLHOST -P$MYSQLPORT -e 'SELECT CONCAT("Nach Umstellung: ", COUNT(*), " Artikel gefunden") as result FROM oxarticles WHERE oxvat = 7;'
printf '\n'