Bugfixes lieferschein

This commit is contained in:
Xenomporio 2022-05-24 21:50:35 +02:00
parent ebc8f31781
commit c1a56db38d
7 changed files with 12334 additions and 12274 deletions

View File

@ -1870,13 +1870,21 @@ class YUI {
if($waehrung=="") if($waehrung=="")
{ {
// schaue ob es gebuchte positionen gibt dann diese waehrung // schaue ob es gebuchte positionen gibt dann diese waehrung
$waehrung = $this->app->DB->Select("SELECT waehrung FROM $table WHERE $module='$id' LIMIT 1");
$waehrung = "";
if (!is_null($table)) {
if ($this->app->DB->Select("SHOW COLUMNS FROM `$table` LIKE 'waehrung'")) {
$waehrung = $this->app->DB->Select("SELECT waehrung FROM $table WHERE $module='$id' LIMIT 1");
}
}
if($waehrung==""){ if($waehrung==""){
$waehrung = $this->app->erp->GetStandardWaehrung($projekt); $waehrung = $this->app->erp->GetStandardWaehrung($projekt);
} }
if($waehrung!="") $this->app->DB->Update("UPDATE $module SET waehrung='$waehrung' WHERE id='$id' AND waehrung='' LIMIT 1"); if ($this->app->DB->Select("SHOW COLUMNS FROM `$module` LIKE 'waehrung'")) {
if($waehrung!="") $this->app->DB->Update("UPDATE $module SET waehrung='$waehrung' WHERE id='$id' AND waehrung='' LIMIT 1");
}
} }
$umsatzsteuer = $articleArr['umsatzsteuer'];//$this->app->DB->Select("SELECT umsatzsteuer FROM artikel WHERE id='$artikel_id' LIMIT 1"); $umsatzsteuer = $articleArr['umsatzsteuer'];//$this->app->DB->Select("SELECT umsatzsteuer FROM artikel WHERE id='$artikel_id' LIMIT 1");
@ -14504,7 +14512,8 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
if ($module == "lieferschein" || $module == "retoure") { if ($module == "lieferschein" || $module == "retoure") {
$table->headings[6] = 'ausgeliefert'; $table->headings[6] = 'ausgeliefert';
$zwischensumme = $this->app->DB->Select("SELECT sum(menge*preis) FROM $module"."_position WHERE $module = '$id'"); // $zwischensumme = $this->app->DB->Select("SELECT sum(menge*preis) FROM $module"."_position WHERE $module = '$id'");
// lieferschein has no preis
} else } else
if($module == "anfrage" || $module == "preisanfrage" ) { if($module == "anfrage" || $module == "preisanfrage" ) {
$table->headings[6] = 'Aktion'; $table->headings[6] = 'Aktion';

View File

@ -33069,7 +33069,9 @@ function MailSendFinal($from,$from_name,$to,$to_name,$betreff,$text,$files="",$p
$this->app->DB->Update("UPDATE firmendaten_werte SET wert = '".$this->app->DB->real_escape_string($value)."' WHERE id = '".$check['id']."'"); $this->app->DB->Update("UPDATE firmendaten_werte SET wert = '".$this->app->DB->real_escape_string($value)."' WHERE id = '".$check['id']."'");
} }
} }
$this->app->DB->Update("UPDATE firmendaten SET " . $field . "='$value' WHERE id='" . $firmendatenid . "'"); else {
$this->app->DB->Update("UPDATE firmendaten SET " . $field . "='$value' WHERE id='" . $firmendatenid . "'");
}
$db = $this->app->Conf->WFdbname; $db = $this->app->Conf->WFdbname;
if(!empty($this->firmendaten[$db])) { if(!empty($this->firmendaten[$db])) {
$this->firmendaten[$db][$field] = $value; $this->firmendaten[$db][$field] = $value;
@ -33087,11 +33089,14 @@ function MailSendFinal($from,$from_name,$to,$to_name,$betreff,$text,$files="",$p
if(strpos($field,'next') !== false) if(strpos($field,'next') !== false)
{ {
$firmendatenid = (int)$this->app->DB->Select('SELECT MAX(id) FROM firmendaten LIMIT 1'); $firmendatenid = (int)$this->app->DB->Select('SELECT MAX(id) FROM firmendaten LIMIT 1');
$firmendaten_value = $this->app->DB->Select(
sprintf( if ($this->app->DB->Select("SHOW COLUMNS FROM firmendaten LIKE '$field'")) {
'SELECT `%s` FROM firmendaten WHERE id = %d LIMIT 1', $firmendaten_value = $this->app->DB->Select(
$field, $firmendatenid) sprintf(
); 'SELECT `%s` FROM firmendaten WHERE id = %d LIMIT 1',
$field, $firmendatenid)
);
}
if(!$this->app->DB->error()) { if(!$this->app->DB->error()) {
return $firmendaten_value; return $firmendaten_value;
} }
@ -44997,6 +45002,10 @@ function Firmendaten($field,$projekt="")
} }
} }
if(is_null($rabatt)) {
$rabatt = 0;
}
if(!$guenstigste_vk) if(!$guenstigste_vk)
{ {
$vkarr = $this->app->DB->SelectArr("SELECT v.*,if((v.adresse > 0 OR v.gruppe > 0),v.preis,(v.preis*(100-$rabatt))/100.0) as rabattpreis FROM verkaufspreise v WHERE $vkarr = $this->app->DB->SelectArr("SELECT v.*,if((v.adresse > 0 OR v.gruppe > 0),v.preis,(v.preis*(100-$rabatt))/100.0) as rabattpreis FROM verkaufspreise v WHERE

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3678,7 +3678,14 @@ class Artikel extends GenArtikel {
$id = $this->app->DB->Select("SELECT id FROM artikel WHERE nummer='$id' AND intern_gesperrt!=1 LIMIT 1"); $id = $this->app->DB->Select("SELECT id FROM artikel WHERE nummer='$id' AND intern_gesperrt!=1 LIMIT 1");
$warnung = 1-(int)$this->app->DB->Select("SELECT if(rabatt=1,1,vkmeldungunterdruecken) FROM artikel WHERE id = '$id' LIMIT 1"); $warnung = 1-(int)$this->app->DB->Select("SELECT if(rabatt=1,1,vkmeldungunterdruecken) FROM artikel WHERE id = '$id' LIMIT 1");
$adresse = $this->app->DB->Select("SELECT adresse FROM $smodule WHERE id='$sid' LIMIT 1"); $adresse = $this->app->DB->Select("SELECT adresse FROM $smodule WHERE id='$sid' LIMIT 1");
$waehrung = $this->app->DB->Select("SELECT waehrung FROM $smodule WHERE id='$sid' LIMIT 1");
if (!is_null($module)) {
if ($this->app->DB->Select("SHOW COLUMNS FROM `$module` LIKE 'waehrung'")) {
$waehrung = $this->app->DB->Select("SELECT waehrung FROM $smodule WHERE id='$sid' LIMIT 1");
}
}
$posanz = (int)$this->app->DB->Select("SELECT count(id) FROM $smodule"."_position WHERE $smodule = '$sid'"); $posanz = (int)$this->app->DB->Select("SELECT count(id) FROM $smodule"."_position WHERE $smodule = '$sid'");
//if($posanz == 0){ //if($posanz == 0){
// $waehrung = ''; // $waehrung = '';

File diff suppressed because it is too large Load Diff

View File

@ -301,7 +301,8 @@ function fillArtikelProduktion(id,menge)
strSource = "./index.php"; strSource = "./index.php";
id = $.base64Encode( id);
id = $.base64Encode( id);
strData = "module=artikel&action=ajaxwerte&id="+id+"&smodule=[MODULE]&sid=[KID]&menge="+menge; strData = "module=artikel&action=ajaxwerte&id="+id+"&smodule=[MODULE]&sid=[KID]&menge="+menge;
intType= 0; //GET intType= 0; //GET
intID = 0; intID = 0;
@ -320,7 +321,11 @@ function fillArtikelLieferschein(id,menge)
if(menge < 1) if(menge < 1)
menge=1; menge=1;
strSource = "./index.php"; strSource = "./index.php";
id = $.base64Encode( id);
// Force string type
id = ""+id;
id = $.base64Encode(id);
strData = "module=artikel&action=ajaxwerte&id="+id+"&smodule=[MODULE]&sid=[KID]&menge="+menge; strData = "module=artikel&action=ajaxwerte&id="+id+"&smodule=[MODULE]&sid=[KID]&menge="+menge;
intType= 0; //GET intType= 0; //GET
intID = 0; intID = 0;