Compare commits

...

4 Commits

4 changed files with 31 additions and 54 deletions

View File

@ -1313,6 +1313,7 @@ Allow from all
}
function refresh_githash() {
$gitinfo = array();
$path = '../.git/';
if (!is_dir($path)) {
return;
@ -1321,12 +1322,13 @@ Allow from all
$refs = trim(substr($head,0,4));
if ($refs == 'ref:') {
$ref = substr($head,5);
$hash = trim(file_get_contents($path . $ref));
$gitinfo['hash'] = trim(file_get_contents($path . $ref));
$gitinfo['branch'] = basename($path . $ref);
} else {
$hash = $head;
$gitinfo['hash'] = $head;
}
if (!empty($hash)) {
file_put_contents("../githash.txt", $hash);
if (!empty($gitinfo)) {
file_put_contents("../gitinfo.json", json_encode($gitinfo));
}
}

View File

@ -2,9 +2,19 @@
$version="OSS";
$version_revision="1.11";
$githash = file_get_contents("../githash.txt");
if (!empty($githash)) {
$version_revision .= " (".substr($githash,0,8).")";
$gitinfo = file_get_contents("../gitinfo.json");
if (!empty($gitinfo)) {
$gitinfo = json_decode($gitinfo);
if ($gitinfo->branch != 'master') {
$version_revision .= " (".substr($gitinfo->hash,0,8)." - ".$gitinfo->branch.")";
}
else {
$version_revision .= " (".substr($gitinfo->hash,0,8).")";
}
} else {
$version_revision .= " (?)";
}
?>

View File

@ -4318,39 +4318,6 @@ title: 'Abschicken',
$result[0]['lieferemail'] = $auftragArr['lieferemail'];
}
if($type==='bestellung' || $type==='angebot' || $type==='proformarechnung' || $type==='retoure')
{
$typeArr = $this->app->DB->SelectRow("SELECT * FROM $type WHERE id = '$id' LIMIT 1");
$result[0]['abweichendelieferadresse']=$typeArr['abweichendelieferadresse'];
$result[0]['liefername']=$typeArr['liefername'];
$result[0]['lieferabteilung']=$typeArr['lieferabteilung'];
$result[0]['lieferunterabteilung']=$typeArr['lieferunterabteilung'];
$result[0]['lieferadresszusatz']=$typeArr['lieferadresszusatz'];
$result[0]['liefertitel']=$typeArr['liefertitel'];
$result[0]['lieferansprechpartner']=$typeArr['lieferansprechpartner'];
$result[0]['lieferstrasse']=$typeArr['lieferstrasse'];
$result[0]['lieferplz']=$typeArr['lieferplz'];
$result[0]['lieferland']=$typeArr['lieferland'];
$result[0]['lieferort'] = $typeArr['lieferort'];
$result[0]['liefergln'] = $typeArr['liefergln'];
$result[0]['lieferemail'] = $typeArr['lieferemail'];
if($type === 'proformarechnung')
{
$result[0]['verzollungadresse']=$typeArr['verzollungadresse'];
$result[0]['verzollungname']=$typeArr['verzollungname'];
$result[0]['verzollungabteilung']=$typeArr['verzollungabteilung'];
$result[0]['verzollungunterabteilung']=$typeArr['verzollungunterabteilung'];
$result[0]['verzollungadresszusatz']=$typeArr['verzollungadresszusatz'];
$result[0]['verzollungtitel']=$typeArr['verzollungtitel'];
$result[0]['verzollungansprechpartner']=$typeArr['verzollungansprechpartner'];
$result[0]['verzollungstrasse']=$typeArr['verzollungstrasse'];
$result[0]['verzollungplz']=$typeArr['verzollungplz'];
$result[0]['verzollungland']=$typeArr['verzollungland'];
$result[0]['verzollungort'] = $typeArr['verzollungort'];
$result[0]['verzollunginformationen'] = $typeArr['verzollunginformationen'];
}
}
if($type=="angebot" || $type=="auftrag")
{
$soll = $result[0]['gesamtsumme'];
@ -4586,7 +4553,7 @@ title: 'Abschicken',
$text = str_replace('{NETTOGEWICHT}',number_format((float)$nettogewicht,2,",",""),$text);
$zahlungsweise = '';
if($type !== 'lieferschein'){
$zahlungsweise = $this->app->DB->Select("SELECT zahlungsweise FROM $type WHERE id='$id' LIMIT 1");
$zahlungsweise = $result[0]['zahlungsweise'];
}
$text = str_replace("{ZAHLUNGSWEISE}",$zahlungsweise,$text);
} else {
@ -4600,8 +4567,6 @@ title: 'Abschicken',
$result[0][$key]=str_replace('NONBLOCKINGZERO','',$result[0][$key]);
}
$result[0]['anschreiben'] = $this->app->DB->Select("SELECT anschreiben FROM `$type` WHERE id='".$id."' LIMIT 1");
if($type === 'adresse') {
$tmpAddr = $result[0];
}
@ -4663,7 +4628,7 @@ title: 'Abschicken',
if($type=="rechnung" || $type=="lieferschein")
{
$tmpauftragid = $this->app->DB->Select("SELECT auftragid FROM $type WHERE id='$id' LIMIT 1");
$tmpauftragid =$result[0]['auftragid'];
$result[0]['lieferdatum'] = $this->app->DB->Select("SELECT lieferdatum FROM auftrag WHERE id='$tmpauftragid' LIMIT 1");
$result[0]['tatsaechlicheslieferdatum'] = $this->app->DB->Select("SELECT tatsaechlicheslieferdatum FROM auftrag WHERE id='$tmpauftragid' LIMIT 1");
}
@ -4872,7 +4837,7 @@ title: 'Abschicken',
if($type=="rechnung" || $type=="lieferschein")
{
$tmpauftragid = $this->app->DB->Select("SELECT auftragid FROM $type WHERE id='$id' LIMIT 1");
$tmpauftragid = $resul[0]['auftragid'];
$auftragsadresse = $this->app->DB->SelectRow("SELECT * FROM auftrag WHERE id='$tmpauftragid' LIMIT 1");
if(!empty($auftragsadresse)){
$auftragsadressetext = '';

View File

@ -1643,7 +1643,7 @@ class Shopimport
$this->drawShopOrderTable($deletedRows);
} else
{
return $count+(isset($gesamtanzahl)?$gesamtanzahl:0);
return $count+(is_numeric($gesamtanzahl)?$gesamtanzahl:0);
}
}
@ -1703,9 +1703,9 @@ class Shopimport
$adresseprojekt = '';
}
$checkid = $this->app->DB->Select("SELECT kundennummer FROM adresse WHERE `name`='".$this->app->erp->ReadyForPDF($warenkorb['name'])."' AND abteilung='".$this->app->erp->ReadyForPDF($warenkorb['abteilung'])."'
AND strasse='".$this->app->erp->ReadyForPDF($warenkorb['strasse'])."' AND plz='".$this->app->erp->ReadyForPDF($warenkorb['plz'])."' AND ort='".$this->app->erp->ReadyForPDF($warenkorb['ort'])."' AND kundennummer <> '' AND geloescht!=1 $adresseprojekt
ORDER BY email='".$this->app->erp->ReadyForPDF($warenkorb['email'])."' DESC
$checkid = $this->app->DB->Select("SELECT kundennummer FROM adresse WHERE `name`='".$this->app->DB->real_escape_string($warenkorb['name'])."' AND abteilung='".$this->app->DB->real_escape_string($warenkorb['abteilung'])."'
AND strasse='".$this->app->DB->real_escape_string($warenkorb['strasse'])."' AND plz='".$this->app->DB->real_escape_string($warenkorb['plz'])."' AND ort='".$this->app->DB->real_escape_string($warenkorb['ort'])."' AND kundennummer <> '' AND geloescht!=1 $adresseprojekt
ORDER BY email='".$this->app->DB->real_escape_string($warenkorb['email'])."' DESC
LIMIT 1");
@ -1719,7 +1719,7 @@ class Shopimport
$checkidemail = $this->app->DB->Select("SELECT kundennummer FROM adresse WHERE name LIKE '" . $warenkorb['name'] . "' AND ort LIKE '" . $warenkorb['ort'] . "' AND geloescht!=1 $adresseprojekt AND kundennummer <> '' LIMIT 1");
}
}else{
$checkidemail = $this->app->DB->Select("SELECT kundennummer FROM adresse WHERE name='".$this->app->erp->ReadyForPDF($warenkorb['name'])."' AND strasse='".$this->app->erp->ReadyForPDF($warenkorb['strasse'])."' AND plz='".$this->app->erp->ReadyForPDF($warenkorb['plz'])."' AND ort='".$this->app->erp->ReadyForPDF($warenkorb['ort'])."' $adresseprojekt AND geloescht!=1 AND kundennummer <> '' LIMIT 1");
$checkidemail = $this->app->DB->Select("SELECT kundennummer FROM adresse WHERE name='".$this->app->DB->real_escape_string($warenkorb['name'])."' AND strasse='".$this->app->DB->real_escape_string($warenkorb['strasse'])."' AND plz='".$this->app->DB->real_escape_string($warenkorb['plz'])."' AND ort='".$this->app->DB->real_escape_string($warenkorb['ort'])."' $adresseprojekt AND geloescht!=1 AND kundennummer <> '' LIMIT 1");
}
if($warenkorb['kundennummer']!='' && !empty($validkundennummer) && $validkundennummer==$warenkorb['kundennummer'])
@ -1871,9 +1871,9 @@ class Shopimport
$adresseprojekt = '';
}
$checkid = $this->app->DB->Select("SELECT kundennummer FROM adresse WHERE `name`='".$this->app->erp->ReadyForPDF($warenkorb['name'])."' AND abteilung='".$this->app->erp->ReadyForPDF($warenkorb['abteilung'])."'
AND strasse='".$this->app->erp->ReadyForPDF($warenkorb['strasse'])."' AND plz='".$this->app->erp->ReadyForPDF($warenkorb['plz'])."' AND ort='".$this->app->erp->ReadyForPDF($warenkorb['ort'])."' AND kundennummer <> '' AND geloescht!=1 $adresseprojekt
ORDER BY email='".$this->app->erp->ReadyForPDF($warenkorb['email'])."' DESC
$checkid = $this->app->DB->Select("SELECT kundennummer FROM adresse WHERE `name`='".$this->app->DB->real_escape_string($warenkorb['name'])."' AND abteilung='".$this->app->DB->real_escape_string($warenkorb['abteilung'])."'
AND strasse='".$this->app->DB->real_escape_string($warenkorb['strasse'])."' AND plz='".$this->app->DB->real_escape_string($warenkorb['plz'])."' AND ort='".$this->app->DB->real_escape_string($warenkorb['ort'])."' AND kundennummer <> '' AND geloescht!=1 $adresseprojekt
ORDER BY email='".$this->app->DB->real_escape_string($warenkorb['email'])."' DESC
LIMIT 1");
@ -1887,7 +1887,7 @@ class Shopimport
$checkidemail = $this->app->DB->Select("SELECT kundennummer FROM adresse WHERE name LIKE '" . $warenkorb['name'] . "' AND ort LIKE '" . $warenkorb['ort'] . "' AND geloescht!=1 $adresseprojekt AND kundennummer <> '' LIMIT 1");
}
}else{
$checkidemail = $this->app->DB->Select("SELECT kundennummer FROM adresse WHERE name='".$this->app->erp->ReadyForPDF($warenkorb['name'])."' AND strasse='".$this->app->erp->ReadyForPDF($warenkorb['strasse'])."' AND plz='".$this->app->erp->ReadyForPDF($warenkorb['plz'])."' AND ort='".$this->app->erp->ReadyForPDF($warenkorb['ort'])."' $adresseprojekt AND geloescht!=1 AND kundennummer <> '' LIMIT 1");
$checkidemail = $this->app->DB->Select("SELECT kundennummer FROM adresse WHERE name='".$this->app->DB->real_escape_string($warenkorb['name'])."' AND strasse='".$this->app->DB->real_escape_string($warenkorb['strasse'])."' AND plz='".$this->app->DB->real_escape_string($warenkorb['plz'])."' AND ort='".$this->app->DB->real_escape_string($warenkorb['ort'])."' $adresseprojekt AND geloescht!=1 AND kundennummer <> '' LIMIT 1");
}
if($warenkorb['kundennummer']!='' && !empty($validkundennummer) && $validkundennummer==$warenkorb['kundennummer'])