X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=lxo-import%2Fimport_lib.php;h=9e25c3dc6cede559ca48c320c1025de1ec05eba0;hb=dc3d3e707934cd1f26bdc81b8b436f59156b8cc8;hp=a383e0a56bd38792c8a131f39a1b88a4beaefdb1;hpb=e2903b0d056db3b97b846ddde87a44b4f5a10954;p=kivitendo-erp.git diff --git a/lxo-import/import_lib.php b/lxo-import/import_lib.php index a383e0a56..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", @@ -123,9 +124,7 @@ $contactscrm = array( "cp_privatemail" => "private eMail", "cp_notes" => "Bemerkungen", "cp_stichwort1" => "Stichwort(e)", - "katalog" => "Katalog", - "inhaber" => "Inhaber", - "contact_id" => "Kontakt ID" + "cp_id" => "Kontakt ID" ); $contacts = array( @@ -146,9 +145,7 @@ $contacts = array( "cp_privatphone" => "Privattelefon", "cp_privatemail" => "private eMail", "cp_homepage" => "Homepage", - "katalog" => "Katalog", - "inhaber" => "Inhaber", - "contact_id" => "Kontakt ID" + "cp_id" => "Kontakt ID" ); function checkCRM() { @@ -172,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); @@ -205,7 +202,16 @@ global $db,$file,$test; return $data; } } - +function chkContact($id) { +global $db; + $sql="select * from contact where cp_id = $id"; + $rs=$db->getAll($sql); + if ($rs[0]["cp_id"]==$id) { + return true; + } else { + return false; + } +} function getKdRefId($data) { // gibt es die Nummer schon? global $db,$file,$test; @@ -249,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); @@ -295,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]; @@ -358,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"]; @@ -372,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; +} +?>