Merge pull request #115 from creatronics-de/bugfix_rabatt_in_rechnung_erste_zeile_fehler

Fehler bei Änderung des Rabatts in der ersten Zeile von Angeboten, Rechnungen, etc.
This commit is contained in:
OpenXE-ERP 2024-01-21 13:39:32 +01:00 committed by GitHub
commit 00333f8762
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -736,9 +736,10 @@ class YUI {
if($value == '')$value = '0';
$this->app->DB->Update("UPDATE $table SET rabatt='$value',keinrabatterlaubt=1 WHERE id='$id' LIMIT 1");
$result = $this->app->DB->Select("SELECT ".$this->FormatPreis('rabatt')." FROM $table WHERE id='$id' LIMIT 1");
$sort = $this->app->DB->Select("SELECT sort FROM $table WHERE id='$id' LIMIT 1");
$parent = $this->app->DB->Select("SELECT $module FROM $table WHERE id='$id' LIMIT 1");
if($parent && $sort == 1)$this->app->DB->Update("UPDATE $module SET rabatt = '$value',keinrabatterlaubt=1 WHERE id = '$parent' LIMIT 1");
//$sort = $this->app->DB->Select("SELECT sort FROM $table WHERE id='$id' LIMIT 1");
//$parent = $this->app->DB->Select("SELECT $module FROM $table WHERE id='$id' LIMIT 1");
//if($parent && $sort == 1)$this->app->DB->Update("UPDATE $module SET rabatt = '$value',keinrabatterlaubt=1 WHERE id = '$parent' LIMIT 1");
if(in_array($module, array('auftrag','rechnung','gutschrift')))
{
$tmptable_value = $this->app->DB->Select("SELECT $module FROM $table WHERE id = '$id' LIMIT 1");