Revision 7caf72ff
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/Controller/CsvImport.pm | ||
---|---|---|
18 | 18 |
use Rose::Object::MakeMethods::Generic |
19 | 19 |
( |
20 | 20 |
scalar => [ qw(type profile file all_profiles all_charsets sep_char all_sep_chars quote_char all_quote_chars escape_char all_escape_chars all_buchungsgruppen |
21 |
import_status errors headers raw_data_headers data num_imported num_importable) ], |
|
21 |
import_status errors headers raw_data_headers data num_imported num_importable worker displayable_columns) ],
|
|
22 | 22 |
); |
23 | 23 |
|
24 | 24 |
__PACKAGE__->run_before('check_auth'); |
... | ... | |
124 | 124 |
|
125 | 125 |
$self->all_buchungsgruppen(SL::DB::Manager::Buchungsgruppe->get_all_sorted); |
126 | 126 |
|
127 |
$self->setup_help; |
|
128 |
|
|
127 | 129 |
$self->render('csv_import/form', title => $title); |
128 | 130 |
} |
129 | 131 |
|
... | ... | |
233 | 235 |
: die "Program logic error"; |
234 | 236 |
} |
235 | 237 |
|
238 |
sub setup_help { |
|
239 |
my ($self) = @_; |
|
240 |
|
|
241 |
$self->create_worker->setup_displayable_columns; |
|
242 |
} |
|
243 |
|
|
244 |
|
|
236 | 245 |
1; |
SL/Controller/CsvImport/Base.pm | ||
---|---|---|
13 | 13 |
use Rose::Object::MakeMethods::Generic |
14 | 14 |
( |
15 | 15 |
scalar => [ qw(controller file csv) ], |
16 |
'scalar --get_set_init' => [ qw(profile existing_objects class manager_class cvar_columns all_cvar_configs all_languages payment_terms_by) ], |
|
16 |
'scalar --get_set_init' => [ qw(profile displayable_columns existing_objects class manager_class cvar_columns all_cvar_configs all_languages payment_terms_by) ],
|
|
17 | 17 |
); |
18 | 18 |
|
19 | 19 |
sub run { |
... | ... | |
145 | 145 |
$self->profile(\%profile); |
146 | 146 |
} |
147 | 147 |
|
148 |
sub add_displayable_columns { |
|
149 |
my ($self, @columns) = @_; |
|
150 |
|
|
151 |
my @cols = @{ $self->controller->displayable_columns || [] }; |
|
152 |
my %ex_col_map = map { $_->{name} => $_ } @cols; |
|
153 |
|
|
154 |
foreach my $column (@columns) { |
|
155 |
if ($ex_col_map{ $column->{name} }) { |
|
156 |
@{ $ex_col_map{ $column->{name} } }{ keys %{ $column } } = @{ $column }{ keys %{ $column } }; |
|
157 |
} else { |
|
158 |
push @cols, $column; |
|
159 |
} |
|
160 |
} |
|
161 |
|
|
162 |
$self->controller->displayable_columns([ sort { $a->{name} cmp $b->{name} } @cols ]); |
|
163 |
} |
|
164 |
|
|
165 |
sub setup_displayable_columns { |
|
166 |
my ($self) = @_; |
|
167 |
|
|
168 |
$self->add_displayable_columns(map { { name => $_ } } keys %{ $self->profile }); |
|
169 |
} |
|
170 |
|
|
171 |
sub add_cvar_columns_to_displayable_columns { |
|
172 |
my ($self) = @_; |
|
173 |
|
|
174 |
return unless $self->can('all_cvar_configs'); |
|
175 |
|
|
176 |
$self->add_displayable_columns(map { { name => 'cvar_' . $_->name, |
|
177 |
description => $::locale->text('#1 (custom variable)', $_->description) } } |
|
178 |
@{ $self->all_cvar_configs }); |
|
179 |
} |
|
180 |
|
|
148 | 181 |
sub init_existing_objects { |
149 | 182 |
my ($self) = @_; |
150 | 183 |
|
SL/Controller/CsvImport/CustomerVendor.pm | ||
---|---|---|
201 | 201 |
return $profile; |
202 | 202 |
} |
203 | 203 |
|
204 |
sub setup_displayable_columns { |
|
205 |
my ($self) = @_; |
|
206 |
|
|
207 |
$self->SUPER::setup_displayable_columns; |
|
208 |
$self->add_cvar_columns_to_displayable_columns; |
|
209 |
} |
|
210 |
|
|
204 | 211 |
# TODO: |
205 | 212 |
# salesman_id -- Kunden mit Typ 'Verkäufer', falls $::vertreter an ist, ansonsten Employees |
206 | 213 |
|
SL/Controller/CsvImport/Part.pm | ||
---|---|---|
369 | 369 |
my ($self) = @_; |
370 | 370 |
|
371 | 371 |
my $profile = $self->SUPER::init_profile; |
372 |
delete @{$profile}{qw(type priceupdate)};
|
|
372 |
delete @{$profile}{qw(alternate assembly bom expense_accno_id income_accno_id inventory_accno_id makemodel priceupdate stockable type)};
|
|
373 | 373 |
|
374 | 374 |
return $profile; |
375 | 375 |
} |
... | ... | |
386 | 386 |
$self->SUPER::save_objects(data => $without_number); |
387 | 387 |
} |
388 | 388 |
|
389 |
sub setup_displayable_columns { |
|
390 |
my ($self) = @_; |
|
391 |
|
|
392 |
$self->SUPER::setup_displayable_columns; |
|
393 |
$self->add_cvar_columns_to_displayable_columns; |
|
394 |
|
|
395 |
$self->add_displayable_columns({ name => 'bin', description => $::locale->text('Bin') }, |
|
396 |
{ name => 'binding_max_qty', description => $::locale->text('Binding Max Qty') }, |
|
397 |
{ name => 'buchungsgruppen_id', description => $::locale->text('Buchungsgruppe (database ID)') }, |
|
398 |
{ name => 'buchungsgruppe', description => $::locale->text('Buchungsgruppe (name)') }, |
|
399 |
{ name => 'description', description => $::locale->text('Description') }, |
|
400 |
{ name => 'drawing', description => $::locale->text('Drawing') }, |
|
401 |
{ name => 'ean', description => $::locale->text('EAN') }, |
|
402 |
{ name => 'formel', description => $::locale->text('Formula') }, |
|
403 |
{ name => 'gv', description => $::locale->text('Business Volume') }, |
|
404 |
{ name => 'has_sernumber', description => $::locale->text('Has serial number') }, |
|
405 |
{ name => 'image', description => $::locale->text('Image') }, |
|
406 |
{ name => 'lastcost', description => $::locale->text('Last Cost') }, |
|
407 |
{ name => 'listprice', description => $::locale->text('List Price') }, |
|
408 |
{ name => 'microfiche', description => $::locale->text('Microfiche') }, |
|
409 |
{ name => 'min_sellprice', description => $::locale->text('Minimum Sell Price') }, |
|
410 |
{ name => 'not_discountable', description => $::locale->text('Not Discountable') }, |
|
411 |
{ name => 'notes', description => $::locale->text('Notes') }, |
|
412 |
{ name => 'obsolete', description => $::locale->text('Obsolete') }, |
|
413 |
{ name => 'onhand', description => $::locale->text('On Hand') }, |
|
414 |
{ name => 'packing_type_id', description => $::locale->text('Packing type (database ID)') }, |
|
415 |
{ name => 'packing_type', description => $::locale->text('Packing type (name)') }, |
|
416 |
{ name => 'partnumber', description => $::locale->text('Part Number') }, |
|
417 |
{ name => 'partsgroup_id', description => $::locale->text('Partsgroup (database ID)') }, |
|
418 |
{ name => 'partsgroup', description => $::locale->text('Partsgroup (name)') }, |
|
419 |
{ name => 'payment_id', description => $::locale->text('Payment terms (database ID)') }, |
|
420 |
{ name => 'payment', description => $::locale->text('Payment terms (name)') }, |
|
421 |
{ name => 'price_factor_id', description => $::locale->text('Price factor (database ID)') }, |
|
422 |
{ name => 'price_factor', description => $::locale->text('Price factor (name)') }, |
|
423 |
{ name => 'rop', description => $::locale->text('ROP') }, |
|
424 |
{ name => 'sellprice', description => $::locale->text('Sellprice') }, |
|
425 |
{ name => 'shop', description => $::locale->text('Shopartikel') }, |
|
426 |
{ name => 'unit', description => $::locale->text('Unit') }, |
|
427 |
{ name => 've', description => $::locale->text('Verrechnungseinheit') }, |
|
428 |
{ name => 'weight', description => $::locale->text('Weight') }, |
|
429 |
); |
|
430 |
|
|
431 |
foreach my $language (@{ $self->all_languages }) { |
|
432 |
$self->add_displayable_columns({ name => 'description_' . $language->article_code, |
|
433 |
description => $::locale->text('Description (translation for #1)', $language->description) }, |
|
434 |
{ name => 'notes_' . $language->article_code, |
|
435 |
description => $::locale->text('Notes (translation for #1)', $language->description) }); |
|
436 |
} |
|
437 |
} |
|
438 |
|
|
439 |
# TODO: |
|
440 |
# Preisgruppen |
|
441 |
|
|
389 | 442 |
1; |
locale/de/all | ||
---|---|---|
13 | 13 |
' Date missing!' => ' Datum fehlt!', |
14 | 14 |
' Part Number missing!' => ' Artikelnummer fehlt!', |
15 | 15 |
' missing!' => ' fehlt!', |
16 |
'#1 (custom variable)' => '#1 (benutzerdefinierte Variable)', |
|
16 | 17 |
'#1 of #2 importable objects were imported.' => '#1 von #2 importierbaren Objekten wurden importiert.', |
17 | 18 |
'#1 prices were updated.' => '#1 Preise wurden aktualisiert.', |
18 | 19 |
'*/' => '*/', |
... | ... | |
274 | 275 |
'Bin From' => 'Quelllagerplatz', |
275 | 276 |
'Bin List' => 'Lagerliste', |
276 | 277 |
'Bin To' => 'Ziellagerplatz', |
278 |
'Binding Max Qty' => '', |
|
277 | 279 |
'Binding to the LDAP server as "#1" failed. Please check config/lx_office.conf.' => 'Die Anmeldung am LDAP-Server als "#1" schlug fehl. Bitte überprüfen Sie die Angaben in config/lx_office.conf.', |
278 | 280 |
'Bins saved.' => 'Lagerplätze gespeichert.', |
279 | 281 |
'Bins that have been used in the past cannot be deleted anymore. For these bins there\'s no checkbox in the "Delete" column.' => 'Lagerplätze, die bereits benutzt wurden, können nicht mehr gelöscht werden. Deswegen fehlt bei ihnen die Checkbox in der Spalte "Löschen".', |
... | ... | |
291 | 293 |
'Bought' => 'Gekauft', |
292 | 294 |
'Buchungsdatum' => 'Buchungsdatum', |
293 | 295 |
'Buchungsgruppe' => 'Buchungsgruppe', |
296 |
'Buchungsgruppe (database ID)' => 'Buchungsgruppe (Datenbank-ID)', |
|
297 |
'Buchungsgruppe (name)' => 'Buchungsgruppe (Name)', |
|
294 | 298 |
'Buchungsgruppen' => 'Buchungsgruppen', |
295 | 299 |
'Buchungskonto' => 'Buchungskonto', |
296 | 300 |
'Buchungsnummer' => 'Buchungsnummer', |
... | ... | |
387 | 391 |
'Close Window' => 'Fenster Schließen', |
388 | 392 |
'Closed' => 'Geschlossen', |
389 | 393 |
'Collective Orders only work for orders from one customer!' => 'Sammelaufträge funktionieren nur für Aufträge von einem Kunden!', |
394 |
'Column name' => 'Spaltenname', |
|
390 | 395 |
'Comma' => 'Komma', |
391 | 396 |
'Comment' => 'Kommentar', |
392 | 397 |
'Company' => 'Firma', |
... | ... | |
564 | 569 |
'Deposit' => 'Gutschrift', |
565 | 570 |
'Description' => 'Beschreibung', |
566 | 571 |
'Description (Click on Description for details)' => 'Beschreibung (Klick öffnet einzelne Kontendetails)', |
572 |
'Description (translation for #1)' => 'Beschreibung (Übersetzung für #1)', |
|
567 | 573 |
'Description missing!' => 'Beschreibung fehlt.', |
568 | 574 |
'Description must not be empty!' => 'Beschreibung darf nicht leer sein', |
569 | 575 |
'Destination BIC' => 'Ziel-BIC', |
... | ... | |
728 | 734 |
'Error message from the database driver:' => 'Fehlermeldung des Datenbanktreibers:', |
729 | 735 |
'Error when saving: #1' => 'Fehler beim Speichern: #2', |
730 | 736 |
'Error!' => 'Fehler!', |
737 |
'Error: Buchungsgruppe missing or invalid' => 'Fehler: Buchungsgruppe fehlt oder ungültig', |
|
731 | 738 |
'Error: Customer/vendor not found' => 'Fehler: Kunde/Lieferant nicht gefunden', |
732 | 739 |
'Error: Gender (cp_gender) missing or invalid' => 'Fehler: Geschlecht (cp_gender) fehlt oder ungültig', |
740 |
'Error: Invalid business' => 'Fehler: Kunden-/Lieferantentyp ungültig', |
|
741 |
'Error: Invalid language' => 'Fehler: Sprache ungültig', |
|
742 |
'Error: Invalid packing type' => 'Fehler: Packtyp ungültig', |
|
743 |
'Error: Invalid part type' => 'Fehler: Artikeltyp ungültig', |
|
744 |
'Error: Invalid parts group' => 'Fehler: Warengruppe ungültig', |
|
745 |
'Error: Invalid payment terms' => 'Fehler: Zahlungsbedingungen ungültig', |
|
746 |
'Error: Invalid price factor' => 'Fehler: Preisfaktor ungültig', |
|
733 | 747 |
'Error: Name missing' => 'Fehler: Name fehlt', |
748 |
'Error: Unit missing or invalid' => 'Fehler: Einheit fehlt oder ungültig', |
|
734 | 749 |
'Errors' => 'Fehler', |
735 | 750 |
'Ertrag' => 'Ertrag', |
736 | 751 |
'Ertrag prozentual' => 'Ertrag prozentual', |
... | ... | |
849 | 864 |
'Headings' => 'Überschriften', |
850 | 865 |
'Help' => 'Hilfe', |
851 | 866 |
'Help Template Variables' => 'Hilfe zu Dokumenten-Variablen', |
867 |
'Help on column names' => 'Hilfe zu Spaltennamen', |
|
852 | 868 |
'Here\'s an example command line:' => 'Hier ist eine Kommandozeile, die als Beispiel dient:', |
853 | 869 |
'Hide by default' => 'Standardmäßig verstecken', |
870 |
'Hide help text' => 'Hilfetext vergeben', |
|
854 | 871 |
'History' => 'Historie', |
855 | 872 |
'History Search' => 'Historien Suche', |
856 | 873 |
'History Search Engine' => 'Historien Suchmaschine', |
... | ... | |
964 | 981 |
'Konten' => 'Konten', |
965 | 982 |
'Kontonummernerweiterung (KNE)' => 'Kontonummernerweiterung (KNE)', |
966 | 983 |
'L' => 'L', |
967 |
'LANGUAGES' => '', |
|
968 | 984 |
'LIABILITIES' => 'PASSIVA', |
969 | 985 |
'LP' => 'LP', |
970 | 986 |
'LaTeX Templates' => 'LaTeX-Vorlagen', |
... | ... | |
1068 | 1084 |
'May' => 'Mai', |
1069 | 1085 |
'May ' => 'Mai', |
1070 | 1086 |
'May set the BCC field when sending emails' => 'Beim Verschicken von Emails das Feld \'BCC\' setzen', |
1087 |
'Meaning' => 'Bedeutung', |
|
1071 | 1088 |
'Medium Number' => 'Datenträgernummer', |
1072 | 1089 |
'Memo' => 'Memo', |
1073 | 1090 |
'Menu' => 'Menü', |
... | ... | |
1075 | 1092 |
'Method' => 'Verfahren', |
1076 | 1093 |
'Microfiche' => 'Mikrofilm', |
1077 | 1094 |
'Minimum Amount' => 'Mindestbetrag', |
1095 |
'Minimum Sell Price' => '', |
|
1078 | 1096 |
'Miscellaneous' => 'Verschiedenes', |
1079 | 1097 |
'Missing \'description\' field.' => 'Fehlendes Feld \'description\'.', |
1080 | 1098 |
'Missing \'tag\' field.' => 'Fehlendes Feld \'tag\'.', |
... | ... | |
1165 | 1183 |
'Note: For Firefox 4 and later the menu XUL menu requires the addon <a href="#1">Remote XUL Manager</a> and the Lx-Office server to be white listed.' => 'Bitte beachten: Ab Firefox 4 benötigt das XUL Menü das Addon <a href="#1">Remote XUL Manager</a>, in dem der Lx-Office Server eingetragen sein muss.', |
1166 | 1184 |
'Note: Taxkeys must have a "valid from" date, and will not behave correctly without.' => 'Hinweis: Steuerschlüssel sind fehlerhaft ohne "Gültig ab" Datum', |
1167 | 1185 |
'Notes' => 'Bemerkungen', |
1186 |
'Notes (translation for #1)' => 'Bemerkungen (Übersetzung für #1)', |
|
1168 | 1187 |
'Notes (will appear on hard copy)' => 'Bemerkungen', |
1169 | 1188 |
'Nothing has been selected for removal.' => 'Es wurde nichts für eine Entnahme ausgewählt.', |
1170 | 1189 |
'Nothing has been selected for transfer.' => 'Es wurde nichts zum Umlagern ausgewählt.', |
... | ... | |
1235 | 1254 |
'POSTED AS NEW' => 'Als neu gebucht', |
1236 | 1255 |
'PRINTED' => 'Gedruckt', |
1237 | 1256 |
'Packing Lists' => 'Lieferschein', |
1257 |
'Packing type (database ID)' => 'Pack-Typ (Datenbank-ID)', |
|
1258 |
'Packing type (name)' => 'Pack-Typ (Name)', |
|
1238 | 1259 |
'Page #1/#2' => 'Seite #1/#2', |
1239 | 1260 |
'Paid' => 'bezahlt', |
1240 | 1261 |
'Part' => 'Ware', |
... | ... | |
1250 | 1271 |
'Parts must have an entry type.' => 'Waren müssen eine Buchungsgruppe haben.', |
1251 | 1272 |
'Parts with existing part numbers' => 'Artikel mit existierender Artikelnummer', |
1252 | 1273 |
'Parts, services and assemblies' => 'Waren, Dienstleistungen und Erzeugnisse', |
1274 |
'Partsgroup (database ID)' => 'Warengruppe (Datenbank-ID)', |
|
1275 |
'Partsgroup (name)' => 'Warengruppe (Name)', |
|
1253 | 1276 |
'Password' => 'Passwort', |
1254 | 1277 |
'Payables' => 'Verbindlichkeiten', |
1255 | 1278 |
'Payment' => 'Zahlungsausgang', |
... | ... | |
1262 | 1285 |
'Payment list as PDF' => 'Zahlungsliste als PDF', |
1263 | 1286 |
'Payment posted!' => 'Zahlung gebucht!', |
1264 | 1287 |
'Payment terms' => 'Zahlungsbedingungen', |
1265 |
'Payments' => 'Zahlungsausgänge', |
|
1288 |
'Payment terms (database ID)' => 'Zahlungsbedingungen (Datenbank-ID)', |
|
1289 |
'Payment terms (name)' => 'Zahlungsbedingungen (Name)', |
|
1290 |
'Payments' => 'Zahlungsausgünge', |
|
1266 | 1291 |
'Per. Inv.' => 'Wied. Rech.', |
1267 | 1292 |
'Period' => 'Zeitraum', |
1268 | 1293 |
'Period:' => 'Zeitraum:', |
... | ... | |
1327 | 1352 |
'Price' => 'Preis', |
1328 | 1353 |
'Price Factor' => 'Preisfaktor', |
1329 | 1354 |
'Price Factors' => 'Preisfaktoren', |
1355 |
'Price factor (database ID)' => 'Preisfaktor (Datenbank-ID)', |
|
1356 |
'Price factor (name)' => 'Preisfaktor (Name)', |
|
1330 | 1357 |
'Price factor deleted!' => 'Preisfaktor gelöscht.', |
1331 | 1358 |
'Price factor saved!' => 'Preisfaktor gespeichert.', |
1332 | 1359 |
'Pricegroup' => 'Preisgruppe', |
... | ... | |
1529 | 1556 |
'Selection' => 'Auswahlbox', |
1530 | 1557 |
'Selection fields: The option field must contain the available options for the selection. Options are separated by \'##\', for example \'Early##Normal##Late\'.' => 'Auswahlboxen: Das Optionenfeld muss die für die Auswahl verfügbaren Einträge enthalten. Die Einträge werden mit \'##\' voneinander getrennt. Beispiel: \'Früh##Normal##Spät\'.', |
1531 | 1558 |
'Sell Price' => 'Verkaufspreis', |
1559 |
'Sellprice' => '', |
|
1532 | 1560 |
'Sellprice adjustment' => 'Verkaufspreis: Preisanpassung', |
1533 | 1561 |
'Sellprice significant places' => 'Verkaufspreis: Nachkommastellen', |
1534 | 1562 |
'Semicolon' => 'Semikolon', |
... | ... | |
1563 | 1591 |
'Show custom variable search inputs' => 'Suchoptionen für Benutzerdefinierte Variablen verstecken', |
1564 | 1592 |
'Show details' => 'Detailsanzeige', |
1565 | 1593 |
'Show follow ups...' => 'Zeige Wiedervorlagen...', |
1594 |
'Show help text' => 'Hilfetext anzeigen', |
|
1566 | 1595 |
'Show old dunnings' => 'Alte Mahnungen anzeigen', |
1567 | 1596 |
'Show overdue sales quotations and requests for quotations...' => 'Überfällige Angebote und Preisanfragen anzeigen...', |
1568 | 1597 |
'Show your TODO list after loggin in' => 'Aufgabenliste nach dem Anmelden anzeigen', |
templates/webpages/csv_import/form.html | ||
---|---|---|
45 | 45 |
|
46 | 46 |
<hr> |
47 | 47 |
|
48 |
<h2>[%- LxERP.t8('Help on column names') %]</h2> |
|
49 |
|
|
50 |
<div class="help_toggle"> |
|
51 |
<a href="#" onClick="javascript:$('.help_toggle').toggle()">[% LxERP.t8("Show help text") %]</a> |
|
52 |
</div> |
|
53 |
|
|
54 |
<div class="help_toggle" style="display:none"> |
|
55 |
<p><a href="#" onClick="javascript:$('.help_toggle').toggle()">[% LxERP.t8("Hide help text") %]</a></p> |
|
56 |
|
|
57 |
<p><b>Dieser Hilfetext wird demnaechst noch verbessert und wandert vermutlich in ein Popup.</b></p> |
|
58 |
|
|
59 |
<table> |
|
60 |
<tr class="listheading"> |
|
61 |
<th>[%- LxERP.t8('Column name') %]</th> |
|
62 |
<th>[%- LxERP.t8('Meaning') %]</th> |
|
63 |
</tr> |
|
64 |
|
|
65 |
[%- FOREACH row = SELF.displayable_columns %] |
|
66 |
<tr class="listrow[% loop.count % 2 %]"> |
|
67 |
<td>[%- HTML.escape(row.name) %]</td> |
|
68 |
<td>[%- HTML.escape(row.description) %]</td> |
|
69 |
</tr> |
|
70 |
[%- END %] |
|
71 |
</table> |
|
72 |
</div> |
|
73 |
|
|
74 |
<hr> |
|
75 |
|
|
48 | 76 |
<h2>[%- LxERP.t8('Settings') %]</h2> |
49 | 77 |
|
50 | 78 |
<table> |
Auch abrufbar als: Unified diff
Hilfetexte anzeigen; sehr viele Übersetzungen