Willkommen im kivitendo Forum! Hier erweitern und teilen AnwenderInnen und EntwicklerInnen ihr Wissen.

Teste kivitendo!

kivitendo Demo

kivitendo Demo mit Schweizer Kontenplan und neuem Layout

Unterstützt kivitendo mit der Basis-Subskription!

0 Punkte

Hallo,

ich lade meine Umsätze von einer Bankwebseite herunter (Kein MT940 Format). In der Datei befinde sich 13 Spalten für Verwendungszwecke (VWZ1-14) diese sollen zu einem Verwendungszweck zusammengefasst werden. Prinzipiell ist das ja in Kivitendo schon vorgesehen, nur leider funktioniert das über den Importassistenten bzw. Spaltenzuordnung nicht, da man nur einmal "purpose" als Feld zur Auswahl hat. Wenn man allen VWZ-Feldern das Zielfeld "purpose" zuordnet wird beim Import nur ein Feld zugeordnet.

Das war in der 3.4er Version auch schon so, ich habe das damals folgendermaßen gelöst.
In der Datei SL/Controller/CsvImport/BankTransaction.pm habe ich in den Auflistungen "purpose1" bis "purpose13" hinzugefügt:

86 sub _displayable_columns {
 87  (
 88    { name => 'local_bank_code',       description => $::locale->text('Own bank code') },
 89    { name => 'local_account_number',  description => $::locale->text('Own bank account number or IBAN') },
 90    { name => 'local_bank_account_id', description => $::locale->text('ID of own bank account') },
 91    { name => 'remote_bank_code',      description => $::locale->text('Bank code of the goal/source') },
 92    { name => 'remote_account_number', description => $::locale->text('Account number of the goal/source') },
 93    { name => 'transdate',             description => $::locale->text('Transdate') },
 94    { name => 'valutadate',            description => $::locale->text('Valutadate') },
 95    { name => 'amount',                description => $::locale->text('Amount') },
 96    { name => 'currency',              description => $::locale->text('Currency') },
 97    { name => 'currency_id',           description => $::locale->text('Currency (database ID)')          },
 98    { name => 'remote_name',           description => $::locale->text('Name of the goal/source (if field names remote_name and remote_name_1 exist they will be combined into field "remote_name")') },
 99    { name => 'purpose',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
100    { name => 'purpose1',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
101    { name => 'purpose2',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
102    { name => 'purpose3',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
103    { name => 'purpose4',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
104    { name => 'purpose5',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
105    { name => 'purpose6',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
106    { name => 'purpose7',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
107    { name => 'purpose8',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
108    { name => 'purpose9',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
109    { name => 'purpose10',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
110    { name => 'purpose11',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
111    { name => 'purpose12',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
112    { name => 'purpose13',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
113  );
177   my $purpose = join('', $entry->{raw_data}->{purpose},
178                          $entry->{raw_data}->{purpose1},
179                          $entry->{raw_data}->{purpose2},
180                          $entry->{raw_data}->{purpose3},
181                          $entry->{raw_data}->{purpose4},
182                          $entry->{raw_data}->{purpose5},
183                          $entry->{raw_data}->{purpose6},
184                          $entry->{raw_data}->{purpose7},
185                          $entry->{raw_data}->{purpose8},
186                          $entry->{raw_data}->{purpose9},
187                          $entry->{raw_data}->{purpose10},
188                          $entry->{raw_data}->{purpose11},
189                          $entry->{raw_data}->{purpose12},
190                          $entry->{raw_data}->{purpose13});

So kann man im Importassistenten die Verwendungszwecke zuordnen und beim Import werden Sie dann zusammengefasst. Ob das eine optimale Lösung ist kann ich nicht sagen, bin kein Entwickler. Aber Sie funktioniert. Vielleicht kann das jemand in den Sourcecode einfügen, dann fliegt es mir nicht bei jedem Update um die Ohren. ;-)

Ein weiteres Problem sind Umlaute bei Spaltenüberschriften z.B. 'Auftraggeber / Empfänger' oder 'Währung'. Die werden in der Spaltenzuordnung als "Auftraggeber/Empf\xE4nger" und "W\xE4hrung" angezeigt und auch so in die Datenbank im Importprofil geschrieben. Die muss man dann direkt in der Datenbank wieder auf die korrekten Umlaute ändern, damit die Felder auch importiert werden können.

Vielleicht mag sich ja jemand auch mal dieses Thema anschauen.

Grüße
Andreas

von (480 Punkte)

1 Antwort

0 Punkte

Hi Andreas,

der erste Punkt ist wie gestern besprochen in den Standard gewandert.

Bei einer git-Installation kann das wie folgt geholt werden:

service apache2 stop
git checkout master
git pull
git checkout mein_eigener_branch
git cherry-pick 0f37ddcd492b271a6b
service apache2 start

Das zweite Problem sollte so auch nicht passieren.
Stimmt den das Encoding der CSV-Datei mit dem Encoding der im CSV-Profil überein?

von (17.8k Punkte)

Hi Jan,

danke für´s fixen. Dann kann es mir ja beim nächsten git pull auch nicht mehr um die Ohren fliegen.

Das Encoding der Datei stimmt mit dem Profil überein.
Hier zur Überprüfung mal ein Screenshot wenn ich die CSV-Datei mit Libre Calc öffnen will:
Import in Calc

Hier dann die Anzeige, wenn die Spalten aus der Datei ins Kivitendo hochgeladen wurden
Anzeige im Kivi

Und hier dann der Eintrag in der Datenbank wenn man das Importprofil abgespeichert hat
Eintrag in der Datenbank
enter image description here

Hi,
ok verifiziert.

e4 ist in CP1252 auch das ä

Ich hab auf die Schnelle keine gute Idee.

Der Standard für die HTML-Seite und für die Datenbank ist UTF8.

Falls möglich würde ich die Daten vorher nach UTF8 konvertieren und dann als UTF8 importieren.

Hier die bash-Anweisung dazu:

iconv -fcp1252 -tutf8 bankimport_cp1252.csv > bankimport_utf8.csv

Damit erhalte ich dann:

Umlaute für Import korrekt

Ähnliche Fragen

0 Punkte
1 Antwort
Gefragt 7, Mär 2013 von Jenny (130 Punkte)
0 Punkte
0 Antworten
0 Punkte
3 Antworten
Gefragt 14, Jun 2012 von Anonym
0 Punkte
2 Antworten
...