X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=lxo-import%2Fimport_lib.php;h=9e25c3dc6cede559ca48c320c1025de1ec05eba0;hb=dc3d3e707934cd1f26bdc81b8b436f59156b8cc8;hp=9678472bf0ed8a264085f0733adab0de21db14e9;hpb=9dda820f45ce31c9c42902d61949d7679d2de94a;p=kivitendo-erp.git diff --git a/lxo-import/import_lib.php b/lxo-import/import_lib.php index 9678472bf..9e25c3dc6 100644 --- a/lxo-import/import_lib.php +++ b/lxo-import/import_lib.php @@ -1,4 +1,4 @@ - "Einheit", "weight" => "Gewicht in Benutzerdefinition", "onhand" => "Lagerbestand", + "bin" => "Lagerplatz", "notes" => "Beschreibung", "notes1" => "Beschreibung", //"makemodel" => "Hersteller", @@ -168,12 +169,12 @@ global $db; } function getKdId() { -// die nächste freie Kunden-/Lieferantennummer holen +// die nächste freie Kunden-/Lieferantennummer holen global $db,$file,$test; if ($test) { return "#####"; } $sql1="select * from defaults"; $sql2="update defaults set ".$file."number = '%s'"; - $db->lock(); + $db->begin(); $rs=$db->getAll($sql1); $nr=$rs[0][$file."number"]; preg_match("/^([^0-9]*)([0-9]+)/",$nr,$hits); @@ -254,7 +255,8 @@ $land=array("DEUTSC"=>"D","FRANKR"=>"F","SPANIE"=>"ES","ITALIE"=>"I","HOLLAN"=>" function mkland($data) { global $land; - $data=strtr($data,array("Ö"=>"OE","Ä"=>"AE","Ü"=>"UE","ö"=>"OE","ä"=>"AE","ü"=>"UE","ß"=>"SS")); + $data=strtr($data,array("Ö"=>"OE","Ä"=>"AE","Ü"=>"UE","ö"=>"OE","ä"=>"AE","ü"=>"UE","ß"=>"SS", + 'Ö'=>'OE','Ä'=>'AE','Ü'=>'UE','ö'=>'OE','ä'=>'AE','ü'=>'UE','ß'=>'SS')); $data=strtoupper(substr($data,0,6)); $cntr=$land[$data]; return (strlen($cntr)>0)?$cntr:substr($data,0,3); @@ -300,9 +302,9 @@ function anmelden() { $dbuser=$hits[1]; preg_match("/'host'[ ]*=> '(.+)'/",$tmp,$hits); $dbhost=($hits[1])?$hits[1]:"localhost"; - preg_match("/'port'[ ]*=> '(.+)'/",$tmp,$hits); + preg_match("/'port'[ ]*=> '?(.+)'?/",$tmp,$hits); $dbport=($hits[1])?$hits[1]:"5432"; - preg_match("/^[ ]*\$self->\{cookie_name\}[ ]*=[ ]*'(.+)'/",$tmp,$hits); + preg_match("/[ ]*\\\$self->\{cookie_name\}[ ]*=[ ]*'(.+)'/",$tmp,$hits); $cookiename=$hits[1]; if (!$cookiename) $cookiename='lx_office_erp_session_id'; $cookie=$_COOKIE[$cookiename]; @@ -363,10 +365,14 @@ function authuser($dbhost,$dbport,$dbuser,$dbpasswd,$dbname,$cookie) { $db->query($sql2,"authuser_B"); $sql3="insert into session ";*/ } + $sql="select * from auth.user where id=".$rs[0]["id"]; + $rs1=$db->getAll($sql,"authuser_1"); + if (!$rs1) return false; + $auth=array(); + $auth["login"]=$rs1[0]["login"]; $sql="select * from auth.user_config where user_id=".$rs[0]["id"]; $rs1=$db->getAll($sql,"authuser_2"); - $auth=array(); - $keys=array("login","dbname","dbpasswd","dbhost","dbport","dbuser"); + $keys=array("dbname","dbpasswd","dbhost","dbport","dbuser"); foreach ($rs1 as $row) { if (in_array($row["cfg_key"],$keys)) { $auth[$row["cfg_key"]]=$row["cfg_value"]; @@ -377,3 +383,9 @@ function authuser($dbhost,$dbport,$dbuser,$dbpasswd,$dbname,$cookie) { return $auth; } +function getLager($db) { + $sql="select w.description as ort,bin.id,bin.description as platz from warehouse w left join bin on w.id=bin.warehouse_id"; + $rs=$db->getAll($sql,"getLager"); + return $rs; +} +?>