Bugfixes angebot ajax positionen

This commit is contained in:
Xenomporio 2022-05-24 16:09:30 +02:00
parent 0b0224f6ba
commit b7f553664b
4 changed files with 9781 additions and 9771 deletions

View File

@ -2301,10 +2301,11 @@ class YUI {
$originalpreis = $preis;
$originalwaehrung = $waehrung;
$ekpreisp = $this->app->erp->GetEinkaufspreisWaehrung($artikel_id, $menge, $waehrung, $originalwaehrung, $originalpreis);
$dbeitrag = 1;
if($ekpreisp && $preis*(100-$rabatt)/100 != 0)
$dbeitrag = 1;
if(!is_null($ekpreisp) && (int)$preis*(100-(int)$rabatt)/100 != 0)
{
$dbeitrag = ($preis*(100-$rabatt)/100-$ekpreisp)/($preis*(100-$rabatt)/100);
$dbeitrag = ((int)$preis*(100-(int)$rabatt)/100-(int)$ekpreisp)/((int)$preis*(100-(int)$rabatt)/100);
}
$this->app->DB->Update("UPDATE $table SET einkaufspreis = '$ekpreisp', einkaufspreisurspruenglich = '$originalpreis',ekwaehrung = '$originalwaehrung', deckungsbeitrag = '$dbeitrag' WHERE id = '$newposid' LIMIT 1");
$ust_befreit = $this->app->DB->Select("SELECT ust_befreit FROM $module WHERE id = '$id' LIMIT 1");
@ -7118,7 +7119,9 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
}
}
for ($j = 0;$j < count($subwhere);$j++) $tmp.= " AND " . $subwhere[$j];
if (!is_null($subwhere)) {
for ($j = 0;$j < count($subwhere);$j++) $tmp.= " AND " . $subwhere[$j];
}
// START EXTRA more
$where = " b.id!='' AND b.status!='angelegt' $tmp " . $this->app->erp->ProjektRechte();

View File

@ -1503,6 +1503,7 @@ function processData( xmlHttp, intID )
case 'fillArtikel':
var myString = xmlHttp.responseText;
var mySplitResult = myString.split("#*#");
if(myString.length>3)
{
render=1;

File diff suppressed because it is too large Load Diff

View File

@ -223,23 +223,28 @@ function fillArtikel(id,menge)
menge = res.substr(0,first_space)
id = tmp[0];
strSource = "./index.php";
id = $.base64Encode( id);
strData = "module=artikel&action=ajaxwerte&id="+id+"&smodule=[MODULE]&sid=[KID]&menge="+menge;
intType= 0; //GET
intID = 0;
command = 'fillArtikel';
sendRequest(strSource,strData,intType,intID);
} else {
strSource = "./index.php";
id = $.base64Encode( id);
strData = "module=artikel&action=ajaxwerte&id="+id+"&smodule=[MODULE]&sid=[KID]&menge="+menge;
intType= 0; //GET
intID = 0;
command = 'fillArtikel';
sendRequest(strSource,strData,intType,intID);
}
strSource = "./index.php";
// Force string type
id = ""+id;
id = $.base64Encode(id);
strData = "module=artikel&action=ajaxwerte&id="+id+"&smodule=[MODULE]&sid=[KID]&menge="+menge;
intType= 0; //GET
intID = 0;
command = 'fillArtikel';
sendRequest(strSource,strData,intType,intID);
} else {
strSource = "./index.php";
// Force string type
id = ""+id;
id = $.base64Encode( id);
strData = "module=artikel&action=ajaxwerte&id="+id+"&smodule=[MODULE]&sid=[KID]&menge="+menge;
intType= 0; //GET
intID = 0;
command = 'fillArtikel';
sendRequest(strSource,strData,intType,intID);
}
}