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);
$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) {
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);
} 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"){
//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>";
}
"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",
"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",
"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"
}
}
+function getAllBG($db) {
+ $sql = "select * from buchungsgruppen order by description";
+ $rs=$db->getAll($sql);
+ return $rs;
+}
+
class myDB extends DB {
// Datenbankklasse