Revision 98255c88
Von Holger Lindemann vor etwa 18 Jahren hinzugefügt
lxo-import/addressB.php | ||
---|---|---|
42 | 42 |
clearstatcache (); |
43 | 43 |
//print_r($_FILES); |
44 | 44 |
$test=$_POST["test"]; |
45 |
if (!empty($_FILES["Datei"]["name"])) {
|
|
45 |
if (!empty($_FILES["Datei"]["name"])) { |
|
46 | 46 |
$file=$_POST["ziel"]; |
47 |
echo $_FILES["Datei"]["tmp_name"]; |
|
47 | 48 |
if (!move_uploaded_file($_FILES["Datei"]["tmp_name"],$file.".csv")) { |
48 | 49 |
$file=false; |
49 | 50 |
echo "Upload von ".$_FILES["Datei"]["name"]." fehlerhaft. (".$_FILES["Datei"]["error"].")<br>"; |
50 |
}
|
|
51 |
} |
|
51 | 52 |
} else if (is_file($_POST["ziel"].".csv")) { |
52 | 53 |
$file=$_POST["ziel"]; |
53 | 54 |
} else { |
54 | 55 |
$file=false; |
55 |
}
|
|
56 |
} |
|
56 | 57 |
|
57 | 58 |
if (!$file) ende (2); |
58 | 59 |
|
... | ... | |
74 | 75 |
$f=fopen("$file.csv","r"); |
75 | 76 |
$zeile=fgets($f,1200); |
76 | 77 |
$infld=split($trenner,strtolower($zeile)); |
77 |
//echo "$zeile<br>"; |
|
78 |
//print_r($infld); echo "<br>"; |
|
79 | 78 |
$first=true; |
80 | 79 |
$ok=true; |
81 | 80 |
foreach ($infld as $fld) { |
... | ... | |
105 | 104 |
continue; |
106 | 105 |
}; |
107 | 106 |
$data=trim($data); |
107 |
$data=mb_convert_encoding($data,"ISO-8859-15","auto"); |
|
108 | 108 |
//$data=htmlentities($data); |
109 | 109 |
$data=addslashes($data); |
110 |
if (trim($in_fld[$i])==$file."number") { // customernumber || vendornumber
|
|
110 |
if ($in_fld[$i]==$file."number") { // customernumber || vendornumber
|
|
111 | 111 |
if (empty($data) or !$data) { |
112 |
$data=getKdId();
|
|
112 |
$data=getKdId(); |
|
113 | 113 |
$number=true; |
114 | 114 |
} else { |
115 | 115 |
$data=chkKdId($data); |
... | ... | |
118 | 118 |
} else if ($in_fld[$i]=="taxincluded"){ |
119 | 119 |
$data=strtolower(substr($data,0,1)); |
120 | 120 |
if ($data!="f" && $data!="t") $data="f"; |
121 |
} else if ($in_fld[$i]=="language") { |
|
122 |
$data=strtolower(substr($data,0,2)); |
|
123 |
if (!in_array($data,array("de","en","fr"))) $data=false; |
|
124 |
} |
|
125 |
if ($in_fld[$i]=="matchcode") { |
|
121 |
} /*else if ($in_fld[$i]=="matchcode") { |
|
126 | 122 |
$matchcode=$data; |
127 | 123 |
$i++; |
128 | 124 |
continue; |
129 |
} |
|
130 |
|
|
131 | 125 |
if ($data==false or empty($data) or !$data) { |
132 | 126 |
if (in_array($in_fld[$i],array("name"))) { |
133 | 127 |
$data=$matchcode; |
134 |
}
|
|
128 |
} |
|
135 | 129 |
} |
130 |
}*/ |
|
131 |
|
|
136 | 132 |
$keys.=$in_fld[$i].","; |
137 | 133 |
if ($data==false or empty($data) or !$data) { |
138 |
if (in_array($in_fld[$i],array("name"))) { |
|
139 |
$keys="("; |
|
140 |
break; |
|
141 |
} |
|
142 | 134 |
$vals.="null,"; |
143 | 135 |
} else { |
144 | 136 |
if ($in_fld[$i]=="contact"){ |
... | ... | |
169 | 161 |
//echo "Import $j<br>\n"; |
170 | 162 |
flush(); |
171 | 163 |
} else { |
172 |
$sql.=$keys."import)"; |
|
173 |
$sql.=$vals."$nun)";
|
|
164 |
$sql.=$keys."taxzone_id,import)";
|
|
165 |
$sql.=$vals."0,$nun)";
|
|
174 | 166 |
$rc=$db->query($sql); |
175 | 167 |
if (!$rc) echo "Fehler: ".$vals."<br>"; |
176 | 168 |
} |
lxo-import/import_lib.php | ||
---|---|---|
31 | 31 |
"customernumber" => "Kundennummer", |
32 | 32 |
"vendornumber" => "Lieferantennummer", |
33 | 33 |
"taxnumber" => "Steuernummer", |
34 |
"ustid" => "Umsatzsteuer-ID", |
|
34 | 35 |
"account_number" => "Kontonummer", |
35 | 36 |
"bank_code" => "Bankleitzahl", |
36 | 37 |
"bank" => "Bankname", |
37 | 38 |
"branche" => "Branche", |
38 |
"language" => "Sprache (de,en,fr)", |
|
39 |
//"language" => "Sprache (de,en,fr)",
|
|
39 | 40 |
"sw" => "Stichwort", |
40 |
"creditlimit" => "Kreditlimit (nnnnnn.nn)", |
|
41 |
"creditlimit" => "Kreditlimit (nnnnnn.nn)"); /*,
|
|
41 | 42 |
"hierarchie" => "Hierarchie", |
42 | 43 |
"potenzial" => "Potenzial", |
43 | 44 |
"ar" => "Debitorenkonto", |
44 | 45 |
"ap" => "Kreditorenkonto", |
45 | 46 |
"matchcode" => "Matchcode", |
46 |
"customernumber2" => "Kundennummer 2"); |
|
47 |
"customernumber2" => "Kundennummer 2"); |
|
48 |
Kundenspezifisch */ |
|
47 | 49 |
|
48 | 50 |
$shiptos = array( |
49 | 51 |
"shiptoname" => "Firmenname", |
... | ... | |
64 | 66 |
"partnumber" => "Artikelnummer", |
65 | 67 |
"description" => "Artikeltext", |
66 | 68 |
"unit" => "Einheit", |
67 |
"weight" => "Gewicht (kg)",
|
|
69 |
"weight" => "Gewicht in Benutzerdefinition",
|
|
68 | 70 |
"onhand" => "Lagerbestand", |
69 | 71 |
"notes" => "Beschreibung", |
70 | 72 |
"makemodel" => "Hersteller", |
71 | 73 |
"model" => "Modellbezeichnung", |
72 |
"income_accno_id" => "Erlöskonto", |
|
73 |
"expense_accno_id" => "Konto Umsatzkosten", |
|
74 | 74 |
"bin" => "Lagerort", |
75 | 75 |
"image" => "Pfad/Dateiname", |
76 | 76 |
"drawing" => "Pfad/Dateiname", |
77 | 77 |
"microfiche" => "Pfad/Dateiname", |
78 |
"partsgroup_id" => "Name Warengruppe", |
|
79 | 78 |
"listprice" => "Listenpreis", |
80 | 79 |
"sellprice" => "Verkaufspreis", |
81 | 80 |
"lastcost" => "letzter EK", |
82 |
"art" => "Ware/Dienstleistung (*/d)"); |
|
81 |
"art" => "Ware/Dienstleistung (*/d), muß vor den Konten kommen", |
|
82 |
"inventory_accno" => "Bestandskonto", |
|
83 |
"income_accno" => "Erlöskonto", |
|
84 |
"expense_accno" => "Konto Umsatzkosten", |
|
85 |
"obsolete" => "Gesperrt (Y/N)", |
|
86 |
"lastcost" => "letzer EK-Preis", |
|
87 |
"rop" => "Mindestbestand", |
|
88 |
"shop" => "Shopartikel (Y/N)", |
|
89 |
"assembly" => "St?ckliste (Y/N); wird noch nicht unterst?tzt", |
|
90 |
"partsgroup" => "Warengruppenbezeichnung", |
|
91 |
//"income_accno_0" => "?Nummer? f?r Erl?se Inland", |
|
92 |
//"income_accno_1" => "?Nummer? f?r Erl?se EG", |
|
93 |
//"income_accno_3" => "?Nummer? f?r Erl?se Ausland", |
|
94 |
); |
|
83 | 95 |
|
84 | 96 |
$contactscrm = array( |
85 | 97 |
"customernumber" => "Kundennummer", |
86 | 98 |
"vendornumber" => "Lieferantennummer", |
87 | 99 |
"cp_cv_id" => "FirmenID in der db", |
88 | 100 |
"firma" => "Firmenname", |
101 |
"cp_abteilung" => "Abteilung", |
|
102 |
"cp_position" => "Position/Hierarchie", |
|
89 | 103 |
"cp_greeting" => "Anrede", |
90 | 104 |
"cp_title" => "Titel", |
91 | 105 |
"cp_givenname" => "Vorname", |
92 |
"cp_greeting" => "Anrede", |
|
93 | 106 |
"cp_name" => "Nachname", |
94 | 107 |
"cp_email" => "eMail", |
95 | 108 |
"cp_phone1" => "Telefon 1", |
96 | 109 |
"cp_phone2" => "Telefon 2", |
110 |
"cp_mobile1" => "Mobiltelefon 1", |
|
111 |
"cp_mobile2" => "Mobiltelefon 2", |
|
112 |
"cp_homepage" => "Homepage", |
|
97 | 113 |
"cp_street" => "Strasse", |
114 |
"cp_country" => "Land", |
|
98 | 115 |
"cp_zipcode" => "PLZ", |
99 | 116 |
"cp_city" => "Ort", |
117 |
"cp_privatphone" => "Privattelefon", |
|
118 |
"cp_privatemail" => "private eMail", |
|
100 | 119 |
"cp_notes" => "Bemerkungen", |
101 |
"cp_country" => "Land", |
|
102 | 120 |
"cp_stichwort1" => "Stichwort(e)", |
103 | 121 |
"katalog" => "Katalog", |
104 | 122 |
"inhaber" => "Inhaber", |
... | ... | |
118 | 136 |
"cp_email" => "eMail", |
119 | 137 |
"cp_phone1" => "Telefon 1", |
120 | 138 |
"cp_phone2" => "Telefon 2", |
139 |
"cp_mobile1" => "Mobiltelefon 1", |
|
140 |
"cp_mobile2" => "Mobiltelefon 2", |
|
141 |
"cp_privatphone" => "Privattelefon", |
|
142 |
"cp_privatemail" => "private eMail", |
|
143 |
"cp_homepage" => "Homepage", |
|
121 | 144 |
"katalog" => "Katalog", |
122 | 145 |
"inhaber" => "Inhaber", |
123 | 146 |
"contact_id" => "Kontakt ID" |
... | ... | |
251 | 274 |
} |
252 | 275 |
} |
253 | 276 |
|
277 |
function getAllBG($db) { |
|
278 |
$sql = "select * from buchungsgruppen order by description"; |
|
279 |
$rs=$db->getAll($sql); |
|
280 |
return $rs; |
|
281 |
} |
|
282 |
|
|
254 | 283 |
class myDB extends DB { |
255 | 284 |
// Datenbankklasse |
256 | 285 |
|
lxo-import/shiptoB.php | ||
---|---|---|
39 | 39 |
if ($_POST["ok"]=="Hilfe") { |
40 | 40 |
echo "Importfelder:<br>"; |
41 | 41 |
echo "Feldname => Bedeutung<br>"; |
42 |
foreach($contact as $key=>$val) {
|
|
42 |
foreach($shiptos as $key=>$val) {
|
|
43 | 43 |
echo "$key => $val<br>"; |
44 | 44 |
} |
45 | 45 |
exit(0); |
Auch abrufbar als: Unified diff
Einige Änderungen, Fehler