Einige Änderungen, Fehler
authorHolger Lindemann <hli@lx-system.de>
Thu, 18 Jan 2007 14:25:25 +0000 (14:25 +0000)
committerHolger Lindemann <hli@lx-system.de>
Thu, 18 Jan 2007 14:25:25 +0000 (14:25 +0000)
lxo-import/addressB.php
lxo-import/import_lib.php
lxo-import/shiptoB.php

index 5e19f7b..23fa4f6 100644 (file)
@@ -42,17 +42,18 @@ if ($_POST["ok"]=="Hilfe") {
 clearstatcache ();
 //print_r($_FILES);
 $test=$_POST["test"];
-if (!empty($_FILES["Datei"]["name"])) { 
+if (!empty($_FILES["Datei"]["name"])) {
        $file=$_POST["ziel"];
+       echo $_FILES["Datei"]["tmp_name"];
        if (!move_uploaded_file($_FILES["Datei"]["tmp_name"],$file.".csv")) {
                $file=false;
                echo "Upload von ".$_FILES["Datei"]["name"]." fehlerhaft. (".$_FILES["Datei"]["error"].")<br>";
-       } 
+       }
 } else if (is_file($_POST["ziel"].".csv")) {
        $file=$_POST["ziel"];
 } else {
        $file=false;
-} 
+}
 
 if (!$file) ende (2);
 
@@ -74,8 +75,6 @@ $kunde_fld = array_keys($address);
 $f=fopen("$file.csv","r");
 $zeile=fgets($f,1200);
 $infld=split($trenner,strtolower($zeile));
-//echo "$zeile<br>";
-//print_r($infld); echo "<br>";
 $first=true;
 $ok=true;
 foreach ($infld as $fld) {
@@ -105,11 +104,12 @@ if ($ok) while (!feof($f)){
                        continue;
                };
                $data=trim($data);
+               $data=mb_convert_encoding($data,"ISO-8859-15","auto");
                //$data=htmlentities($data);
                $data=addslashes($data);
-               if (trim($in_fld[$i])==$file."number") {  // customernumber || vendornumber
+               if ($in_fld[$i]==$file."number") {  // customernumber || vendornumber
                        if (empty($data) or !$data) {
-                               $data=getKdId(); 
+                               $data=getKdId();
                                $number=true;
                        } else {
                                $data=chkKdId($data);
@@ -118,27 +118,19 @@ if ($ok) while (!feof($f)){
                } else if ($in_fld[$i]=="taxincluded"){
                        $data=strtolower(substr($data,0,1));
                        if ($data!="f" && $data!="t") $data="f";
-               } else if ($in_fld[$i]=="language") {
-                       $data=strtolower(substr($data,0,2));
-                       if (!in_array($data,array("de","en","fr"))) $data=false;
-               }
-               if ($in_fld[$i]=="matchcode") {  
+               } /*else if ($in_fld[$i]=="matchcode") {
                   $matchcode=$data;
                   $i++;
                   continue;
-                }
-
                 if ($data==false or empty($data) or !$data) {
                        if (in_array($in_fld[$i],array("name"))) {
                                $data=$matchcode;
-                       }                
+                       }
                }
+                }*/
+
                $keys.=$in_fld[$i].",";
                if ($data==false or empty($data) or !$data) {
-                       if (in_array($in_fld[$i],array("name"))) {
-                               $keys="(";
-                               break;
-                       }
                        $vals.="null,";
                } else {
                        if ($in_fld[$i]=="contact"){
@@ -169,8 +161,8 @@ if ($ok) while (!feof($f)){
                         //echo "Import $j<br>\n";
                        flush();
                } else {
-                       $sql.=$keys."import)";
-                       $sql.=$vals."$nun)";            
+                       $sql.=$keys."taxzone_id,import)";
+                       $sql.=$vals."0,$nun)";
                        $rc=$db->query($sql);
                        if (!$rc) echo "Fehler: ".$vals."<br>";
                }
index 89ca76f..72f3ae3 100644 (file)
@@ -31,19 +31,21 @@ $address = array(
        "customernumber" => "Kundennummer",
        "vendornumber" => "Lieferantennummer",
        "taxnumber" => "Steuernummer",
+       "ustid" => "Umsatzsteuer-ID",
        "account_number" => "Kontonummer",
        "bank_code" => "Bankleitzahl",
        "bank" => "Bankname",
        "branche" => "Branche",
-       "language" => "Sprache (de,en,fr)",
+       //"language" => "Sprache (de,en,fr)",
        "sw" => "Stichwort",
-       "creditlimit" => "Kreditlimit (nnnnnn.nn)",
+       "creditlimit" => "Kreditlimit (nnnnnn.nn)"); /*,
        "hierarchie" => "Hierarchie",
        "potenzial" => "Potenzial",
         "ar" => "Debitorenkonto",
         "ap" => "Kreditorenkonto",
         "matchcode" => "Matchcode",
-       "customernumber2" => "Kundennummer 2");
+       "customernumber2" => "Kundennummer 2"); 
+       Kundenspezifisch */
         
 $shiptos = array(
        "shiptoname" => "Firmenname",
@@ -64,41 +66,57 @@ $parts = array(
        "partnumber" => "Artikelnummer",
        "description" => "Artikeltext",
        "unit" => "Einheit",
-       "weight" => "Gewicht (kg)",
+       "weight" => "Gewicht in Benutzerdefinition",
        "onhand" => "Lagerbestand",
        "notes" => "Beschreibung",
        "makemodel" => "Hersteller",
        "model" => "Modellbezeichnung",
-       "income_accno_id" => "Erlöskonto",
-       "expense_accno_id" => "Konto Umsatzkosten",
        "bin" => "Lagerort",
        "image" => "Pfad/Dateiname",
        "drawing" => "Pfad/Dateiname",
        "microfiche" => "Pfad/Dateiname",
-       "partsgroup_id" => "Name Warengruppe",
        "listprice" => "Listenpreis",
        "sellprice" => "Verkaufspreis",
        "lastcost" => "letzter EK",
-       "art" => "Ware/Dienstleistung (*/d)");
+       "art" => "Ware/Dienstleistung (*/d), mu&szlig; vor den Konten kommen",
+       "inventory_accno" => "Bestandskonto",
+       "income_accno" => "Erl&ouml;skonto",
+       "expense_accno" => "Konto Umsatzkosten",
+       "obsolete" => "Gesperrt (Y/N)",
+       "lastcost" => "letzer EK-Preis",
+       "rop" => "Mindestbestand",
+       "shop" => "Shopartikel (Y/N)",
+       "assembly" => "Stückliste (Y/N); wird noch nicht unterstützt",
+       "partsgroup" => "Warengruppenbezeichnung",
+       //"income_accno_0" => "?Nummer? für Erlöse Inland",
+       //"income_accno_1" => "?Nummer? für Erlöse EG",
+       //"income_accno_3" => "?Nummer? für Erlöse Ausland",
+       );
        
 $contactscrm = array(
        "customernumber" => "Kundennummer",
        "vendornumber" => "Lieferantennummer",
        "cp_cv_id" => "FirmenID in der db",
        "firma" => "Firmenname",
+       "cp_abteilung" => "Abteilung",
+       "cp_position" => "Position/Hierarchie",
        "cp_greeting" => "Anrede",
        "cp_title" => "Titel",
        "cp_givenname" => "Vorname",
-       "cp_greeting" => "Anrede",
        "cp_name" => "Nachname",
        "cp_email" => "eMail",
        "cp_phone1" => "Telefon 1",
        "cp_phone2" => "Telefon 2",
+       "cp_mobile1" => "Mobiltelefon 1",
+       "cp_mobile2" => "Mobiltelefon 2",
+       "cp_homepage" => "Homepage",
        "cp_street" => "Strasse",
+       "cp_country" => "Land",
        "cp_zipcode" => "PLZ",
        "cp_city" => "Ort",
+       "cp_privatphone" => "Privattelefon",
+       "cp_privatemail" => "private eMail",
        "cp_notes" => "Bemerkungen",
-       "cp_country" => "Land",
        "cp_stichwort1" => "Stichwort(e)",
        "katalog" => "Katalog",
        "inhaber" => "Inhaber",
@@ -118,6 +136,11 @@ $contacts = array(
        "cp_email" => "eMail",
        "cp_phone1" => "Telefon 1",
        "cp_phone2" => "Telefon 2",
+       "cp_mobile1" => "Mobiltelefon 1",
+       "cp_mobile2" => "Mobiltelefon 2",
+       "cp_privatphone" => "Privattelefon",
+       "cp_privatemail" => "private eMail",
+       "cp_homepage" => "Homepage",
        "katalog" => "Katalog",
        "inhaber" => "Inhaber",
        "contact_id" => "Kontakt ID"
@@ -251,6 +274,12 @@ global $db;
        }
 }
 
+function getAllBG($db) {
+       $sql  = "select * from buchungsgruppen order by description";
+       $rs=$db->getAll($sql);
+       return $rs;
+}
+
 class myDB extends DB {
 // Datenbankklasse
 
index 946b172..c911514 100644 (file)
@@ -39,7 +39,7 @@ if ($_POST["ok"]) {
        if ($_POST["ok"]=="Hilfe") {
                echo "Importfelder:<br>";
                echo "Feldname => Bedeutung<br>";
-               foreach($contact as $key=>$val) {
+               foreach($shiptos as $key=>$val) {
                        echo "$key => $val<br>";
                }
                exit(0);