From 98255c8891bd9b772f73be9a72e4f456998c8b3b Mon Sep 17 00:00:00 2001 From: Holger Lindemann Date: Thu, 18 Jan 2007 14:25:25 +0000 Subject: [PATCH] =?utf8?q?Einige=20=C3=84nderungen,=20Fehler?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lxo-import/addressB.php | 34 +++++++++++---------------- lxo-import/import_lib.php | 49 +++++++++++++++++++++++++++++++-------- lxo-import/shiptoB.php | 2 +- 3 files changed, 53 insertions(+), 32 deletions(-) diff --git a/lxo-import/addressB.php b/lxo-import/addressB.php index 5e19f7b4e..23fa4f69a 100644 --- a/lxo-import/addressB.php +++ b/lxo-import/addressB.php @@ -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"].")
"; - } + } } 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
"; -//print_r($infld); echo "
"; $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
\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."
"; } diff --git a/lxo-import/import_lib.php b/lxo-import/import_lib.php index 89ca76f20..72f3ae39d 100644 --- a/lxo-import/import_lib.php +++ b/lxo-import/import_lib.php @@ -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ß vor den Konten kommen", + "inventory_accno" => "Bestandskonto", + "income_accno" => "Erlö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 diff --git a/lxo-import/shiptoB.php b/lxo-import/shiptoB.php index 946b17296..c9115145b 100644 --- a/lxo-import/shiptoB.php +++ b/lxo-import/shiptoB.php @@ -39,7 +39,7 @@ if ($_POST["ok"]) { if ($_POST["ok"]=="Hilfe") { echo "Importfelder:
"; echo "Feldname => Bedeutung
"; - foreach($contact as $key=>$val) { + foreach($shiptos as $key=>$val) { echo "$key => $val
"; } exit(0); -- 2.20.1