Revision 7caf72ff
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/Controller/CsvImport.pm | ||
---|---|---|
use Rose::Object::MakeMethods::Generic
|
||
(
|
||
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
|
||
import_status errors headers raw_data_headers data num_imported num_importable) ],
|
||
import_status errors headers raw_data_headers data num_imported num_importable worker displayable_columns) ],
|
||
);
|
||
|
||
__PACKAGE__->run_before('check_auth');
|
||
... | ... | |
|
||
$self->all_buchungsgruppen(SL::DB::Manager::Buchungsgruppe->get_all_sorted);
|
||
|
||
$self->setup_help;
|
||
|
||
$self->render('csv_import/form', title => $title);
|
||
}
|
||
|
||
... | ... | |
: die "Program logic error";
|
||
}
|
||
|
||
sub setup_help {
|
||
my ($self) = @_;
|
||
|
||
$self->create_worker->setup_displayable_columns;
|
||
}
|
||
|
||
|
||
1;
|
SL/Controller/CsvImport/Base.pm | ||
---|---|---|
use Rose::Object::MakeMethods::Generic
|
||
(
|
||
scalar => [ qw(controller file csv) ],
|
||
'scalar --get_set_init' => [ qw(profile existing_objects class manager_class cvar_columns all_cvar_configs all_languages payment_terms_by) ],
|
||
'scalar --get_set_init' => [ qw(profile displayable_columns existing_objects class manager_class cvar_columns all_cvar_configs all_languages payment_terms_by) ],
|
||
);
|
||
|
||
sub run {
|
||
... | ... | |
$self->profile(\%profile);
|
||
}
|
||
|
||
sub add_displayable_columns {
|
||
my ($self, @columns) = @_;
|
||
|
||
my @cols = @{ $self->controller->displayable_columns || [] };
|
||
my %ex_col_map = map { $_->{name} => $_ } @cols;
|
||
|
||
foreach my $column (@columns) {
|
||
if ($ex_col_map{ $column->{name} }) {
|
||
@{ $ex_col_map{ $column->{name} } }{ keys %{ $column } } = @{ $column }{ keys %{ $column } };
|
||
} else {
|
||
push @cols, $column;
|
||
}
|
||
}
|
||
|
||
$self->controller->displayable_columns([ sort { $a->{name} cmp $b->{name} } @cols ]);
|
||
}
|
||
|
||
sub setup_displayable_columns {
|
||
my ($self) = @_;
|
||
|
||
$self->add_displayable_columns(map { { name => $_ } } keys %{ $self->profile });
|
||
}
|
||
|
||
sub add_cvar_columns_to_displayable_columns {
|
||
my ($self) = @_;
|
||
|
||
return unless $self->can('all_cvar_configs');
|
||
|
||
$self->add_displayable_columns(map { { name => 'cvar_' . $_->name,
|
||
description => $::locale->text('#1 (custom variable)', $_->description) } }
|
||
@{ $self->all_cvar_configs });
|
||
}
|
||
|
||
sub init_existing_objects {
|
||
my ($self) = @_;
|
||
|
SL/Controller/CsvImport/CustomerVendor.pm | ||
---|---|---|
return $profile;
|
||
}
|
||
|
||
sub setup_displayable_columns {
|
||
my ($self) = @_;
|
||
|
||
$self->SUPER::setup_displayable_columns;
|
||
$self->add_cvar_columns_to_displayable_columns;
|
||
}
|
||
|
||
# TODO:
|
||
# salesman_id -- Kunden mit Typ 'Verkäufer', falls $::vertreter an ist, ansonsten Employees
|
||
|
SL/Controller/CsvImport/Part.pm | ||
---|---|---|
my ($self) = @_;
|
||
|
||
my $profile = $self->SUPER::init_profile;
|
||
delete @{$profile}{qw(type priceupdate)};
|
||
delete @{$profile}{qw(alternate assembly bom expense_accno_id income_accno_id inventory_accno_id makemodel priceupdate stockable type)};
|
||
|
||
return $profile;
|
||
}
|
||
... | ... | |
$self->SUPER::save_objects(data => $without_number);
|
||
}
|
||
|
||
sub setup_displayable_columns {
|
||
my ($self) = @_;
|
||
|
||
$self->SUPER::setup_displayable_columns;
|
||
$self->add_cvar_columns_to_displayable_columns;
|
||
|
||
$self->add_displayable_columns({ name => 'bin', description => $::locale->text('Bin') },
|
||
{ name => 'binding_max_qty', description => $::locale->text('Binding Max Qty') },
|
||
{ name => 'buchungsgruppen_id', description => $::locale->text('Buchungsgruppe (database ID)') },
|
||
{ name => 'buchungsgruppe', description => $::locale->text('Buchungsgruppe (name)') },
|
||
{ name => 'description', description => $::locale->text('Description') },
|
||
{ name => 'drawing', description => $::locale->text('Drawing') },
|
||
{ name => 'ean', description => $::locale->text('EAN') },
|
||
{ name => 'formel', description => $::locale->text('Formula') },
|
||
{ name => 'gv', description => $::locale->text('Business Volume') },
|
||
{ name => 'has_sernumber', description => $::locale->text('Has serial number') },
|
||
{ name => 'image', description => $::locale->text('Image') },
|
||
{ name => 'lastcost', description => $::locale->text('Last Cost') },
|
||
{ name => 'listprice', description => $::locale->text('List Price') },
|
||
{ name => 'microfiche', description => $::locale->text('Microfiche') },
|
||
{ name => 'min_sellprice', description => $::locale->text('Minimum Sell Price') },
|
||
{ name => 'not_discountable', description => $::locale->text('Not Discountable') },
|
||
{ name => 'notes', description => $::locale->text('Notes') },
|
||
{ name => 'obsolete', description => $::locale->text('Obsolete') },
|
||
{ name => 'onhand', description => $::locale->text('On Hand') },
|
||
{ name => 'packing_type_id', description => $::locale->text('Packing type (database ID)') },
|
||
{ name => 'packing_type', description => $::locale->text('Packing type (name)') },
|
||
{ name => 'partnumber', description => $::locale->text('Part Number') },
|
||
{ name => 'partsgroup_id', description => $::locale->text('Partsgroup (database ID)') },
|
||
{ name => 'partsgroup', description => $::locale->text('Partsgroup (name)') },
|
||
{ name => 'payment_id', description => $::locale->text('Payment terms (database ID)') },
|
||
{ name => 'payment', description => $::locale->text('Payment terms (name)') },
|
||
{ name => 'price_factor_id', description => $::locale->text('Price factor (database ID)') },
|
||
{ name => 'price_factor', description => $::locale->text('Price factor (name)') },
|
||
{ name => 'rop', description => $::locale->text('ROP') },
|
||
{ name => 'sellprice', description => $::locale->text('Sellprice') },
|
||
{ name => 'shop', description => $::locale->text('Shopartikel') },
|
||
{ name => 'unit', description => $::locale->text('Unit') },
|
||
{ name => 've', description => $::locale->text('Verrechnungseinheit') },
|
||
{ name => 'weight', description => $::locale->text('Weight') },
|
||
);
|
||
|
||
foreach my $language (@{ $self->all_languages }) {
|
||
$self->add_displayable_columns({ name => 'description_' . $language->article_code,
|
||
description => $::locale->text('Description (translation for #1)', $language->description) },
|
||
{ name => 'notes_' . $language->article_code,
|
||
description => $::locale->text('Notes (translation for #1)', $language->description) });
|
||
}
|
||
}
|
||
|
||
# TODO:
|
||
# Preisgruppen
|
||
|
||
1;
|
locale/de/all | ||
---|---|---|
' Date missing!' => ' Datum fehlt!',
|
||
' Part Number missing!' => ' Artikelnummer fehlt!',
|
||
' missing!' => ' fehlt!',
|
||
'#1 (custom variable)' => '#1 (benutzerdefinierte Variable)',
|
||
'#1 of #2 importable objects were imported.' => '#1 von #2 importierbaren Objekten wurden importiert.',
|
||
'#1 prices were updated.' => '#1 Preise wurden aktualisiert.',
|
||
'*/' => '*/',
|
||
... | ... | |
'Bin From' => 'Quelllagerplatz',
|
||
'Bin List' => 'Lagerliste',
|
||
'Bin To' => 'Ziellagerplatz',
|
||
'Binding Max Qty' => '',
|
||
'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.',
|
||
'Bins saved.' => 'Lagerplätze gespeichert.',
|
||
'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".',
|
||
... | ... | |
'Bought' => 'Gekauft',
|
||
'Buchungsdatum' => 'Buchungsdatum',
|
||
'Buchungsgruppe' => 'Buchungsgruppe',
|
||
'Buchungsgruppe (database ID)' => 'Buchungsgruppe (Datenbank-ID)',
|
||
'Buchungsgruppe (name)' => 'Buchungsgruppe (Name)',
|
||
'Buchungsgruppen' => 'Buchungsgruppen',
|
||
'Buchungskonto' => 'Buchungskonto',
|
||
'Buchungsnummer' => 'Buchungsnummer',
|
||
... | ... | |
'Close Window' => 'Fenster Schließen',
|
||
'Closed' => 'Geschlossen',
|
||
'Collective Orders only work for orders from one customer!' => 'Sammelaufträge funktionieren nur für Aufträge von einem Kunden!',
|
||
'Column name' => 'Spaltenname',
|
||
'Comma' => 'Komma',
|
||
'Comment' => 'Kommentar',
|
||
'Company' => 'Firma',
|
||
... | ... | |
'Deposit' => 'Gutschrift',
|
||
'Description' => 'Beschreibung',
|
||
'Description (Click on Description for details)' => 'Beschreibung (Klick öffnet einzelne Kontendetails)',
|
||
'Description (translation for #1)' => 'Beschreibung (Übersetzung für #1)',
|
||
'Description missing!' => 'Beschreibung fehlt.',
|
||
'Description must not be empty!' => 'Beschreibung darf nicht leer sein',
|
||
'Destination BIC' => 'Ziel-BIC',
|
||
... | ... | |
'Error message from the database driver:' => 'Fehlermeldung des Datenbanktreibers:',
|
||
'Error when saving: #1' => 'Fehler beim Speichern: #2',
|
||
'Error!' => 'Fehler!',
|
||
'Error: Buchungsgruppe missing or invalid' => 'Fehler: Buchungsgruppe fehlt oder ungültig',
|
||
'Error: Customer/vendor not found' => 'Fehler: Kunde/Lieferant nicht gefunden',
|
||
'Error: Gender (cp_gender) missing or invalid' => 'Fehler: Geschlecht (cp_gender) fehlt oder ungültig',
|
||
'Error: Invalid business' => 'Fehler: Kunden-/Lieferantentyp ungültig',
|
||
'Error: Invalid language' => 'Fehler: Sprache ungültig',
|
||
'Error: Invalid packing type' => 'Fehler: Packtyp ungültig',
|
||
'Error: Invalid part type' => 'Fehler: Artikeltyp ungültig',
|
||
'Error: Invalid parts group' => 'Fehler: Warengruppe ungültig',
|
||
'Error: Invalid payment terms' => 'Fehler: Zahlungsbedingungen ungültig',
|
||
'Error: Invalid price factor' => 'Fehler: Preisfaktor ungültig',
|
||
'Error: Name missing' => 'Fehler: Name fehlt',
|
||
'Error: Unit missing or invalid' => 'Fehler: Einheit fehlt oder ungültig',
|
||
'Errors' => 'Fehler',
|
||
'Ertrag' => 'Ertrag',
|
||
'Ertrag prozentual' => 'Ertrag prozentual',
|
||
... | ... | |
'Headings' => 'Überschriften',
|
||
'Help' => 'Hilfe',
|
||
'Help Template Variables' => 'Hilfe zu Dokumenten-Variablen',
|
||
'Help on column names' => 'Hilfe zu Spaltennamen',
|
||
'Here\'s an example command line:' => 'Hier ist eine Kommandozeile, die als Beispiel dient:',
|
||
'Hide by default' => 'Standardmäßig verstecken',
|
||
'Hide help text' => 'Hilfetext vergeben',
|
||
'History' => 'Historie',
|
||
'History Search' => 'Historien Suche',
|
||
'History Search Engine' => 'Historien Suchmaschine',
|
||
... | ... | |
'Konten' => 'Konten',
|
||
'Kontonummernerweiterung (KNE)' => 'Kontonummernerweiterung (KNE)',
|
||
'L' => 'L',
|
||
'LANGUAGES' => '',
|
||
'LIABILITIES' => 'PASSIVA',
|
||
'LP' => 'LP',
|
||
'LaTeX Templates' => 'LaTeX-Vorlagen',
|
||
... | ... | |
'May' => 'Mai',
|
||
'May ' => 'Mai',
|
||
'May set the BCC field when sending emails' => 'Beim Verschicken von Emails das Feld \'BCC\' setzen',
|
||
'Meaning' => 'Bedeutung',
|
||
'Medium Number' => 'Datenträgernummer',
|
||
'Memo' => 'Memo',
|
||
'Menu' => 'Menü',
|
||
... | ... | |
'Method' => 'Verfahren',
|
||
'Microfiche' => 'Mikrofilm',
|
||
'Minimum Amount' => 'Mindestbetrag',
|
||
'Minimum Sell Price' => '',
|
||
'Miscellaneous' => 'Verschiedenes',
|
||
'Missing \'description\' field.' => 'Fehlendes Feld \'description\'.',
|
||
'Missing \'tag\' field.' => 'Fehlendes Feld \'tag\'.',
|
||
... | ... | |
'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.',
|
||
'Note: Taxkeys must have a "valid from" date, and will not behave correctly without.' => 'Hinweis: Steuerschlüssel sind fehlerhaft ohne "Gültig ab" Datum',
|
||
'Notes' => 'Bemerkungen',
|
||
'Notes (translation for #1)' => 'Bemerkungen (Übersetzung für #1)',
|
||
'Notes (will appear on hard copy)' => 'Bemerkungen',
|
||
'Nothing has been selected for removal.' => 'Es wurde nichts für eine Entnahme ausgewählt.',
|
||
'Nothing has been selected for transfer.' => 'Es wurde nichts zum Umlagern ausgewählt.',
|
||
... | ... | |
'POSTED AS NEW' => 'Als neu gebucht',
|
||
'PRINTED' => 'Gedruckt',
|
||
'Packing Lists' => 'Lieferschein',
|
||
'Packing type (database ID)' => 'Pack-Typ (Datenbank-ID)',
|
||
'Packing type (name)' => 'Pack-Typ (Name)',
|
||
'Page #1/#2' => 'Seite #1/#2',
|
||
'Paid' => 'bezahlt',
|
||
'Part' => 'Ware',
|
||
... | ... | |
'Parts must have an entry type.' => 'Waren müssen eine Buchungsgruppe haben.',
|
||
'Parts with existing part numbers' => 'Artikel mit existierender Artikelnummer',
|
||
'Parts, services and assemblies' => 'Waren, Dienstleistungen und Erzeugnisse',
|
||
'Partsgroup (database ID)' => 'Warengruppe (Datenbank-ID)',
|
||
'Partsgroup (name)' => 'Warengruppe (Name)',
|
||
'Password' => 'Passwort',
|
||
'Payables' => 'Verbindlichkeiten',
|
||
'Payment' => 'Zahlungsausgang',
|
||
... | ... | |
'Payment list as PDF' => 'Zahlungsliste als PDF',
|
||
'Payment posted!' => 'Zahlung gebucht!',
|
||
'Payment terms' => 'Zahlungsbedingungen',
|
||
'Payments' => 'Zahlungsausgänge',
|
||
'Payment terms (database ID)' => 'Zahlungsbedingungen (Datenbank-ID)',
|
||
'Payment terms (name)' => 'Zahlungsbedingungen (Name)',
|
||
'Payments' => 'Zahlungsausgünge',
|
||
'Per. Inv.' => 'Wied. Rech.',
|
||
'Period' => 'Zeitraum',
|
||
'Period:' => 'Zeitraum:',
|
||
... | ... | |
'Price' => 'Preis',
|
||
'Price Factor' => 'Preisfaktor',
|
||
'Price Factors' => 'Preisfaktoren',
|
||
'Price factor (database ID)' => 'Preisfaktor (Datenbank-ID)',
|
||
'Price factor (name)' => 'Preisfaktor (Name)',
|
||
'Price factor deleted!' => 'Preisfaktor gelöscht.',
|
||
'Price factor saved!' => 'Preisfaktor gespeichert.',
|
||
'Pricegroup' => 'Preisgruppe',
|
||
... | ... | |
'Selection' => 'Auswahlbox',
|
||
'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\'.',
|
||
'Sell Price' => 'Verkaufspreis',
|
||
'Sellprice' => '',
|
||
'Sellprice adjustment' => 'Verkaufspreis: Preisanpassung',
|
||
'Sellprice significant places' => 'Verkaufspreis: Nachkommastellen',
|
||
'Semicolon' => 'Semikolon',
|
||
... | ... | |
'Show custom variable search inputs' => 'Suchoptionen für Benutzerdefinierte Variablen verstecken',
|
||
'Show details' => 'Detailsanzeige',
|
||
'Show follow ups...' => 'Zeige Wiedervorlagen...',
|
||
'Show help text' => 'Hilfetext anzeigen',
|
||
'Show old dunnings' => 'Alte Mahnungen anzeigen',
|
||
'Show overdue sales quotations and requests for quotations...' => 'Überfällige Angebote und Preisanfragen anzeigen...',
|
||
'Show your TODO list after loggin in' => 'Aufgabenliste nach dem Anmelden anzeigen',
|
templates/webpages/csv_import/form.html | ||
---|---|---|
|
||
<hr>
|
||
|
||
<h2>[%- LxERP.t8('Help on column names') %]</h2>
|
||
|
||
<div class="help_toggle">
|
||
<a href="#" onClick="javascript:$('.help_toggle').toggle()">[% LxERP.t8("Show help text") %]</a>
|
||
</div>
|
||
|
||
<div class="help_toggle" style="display:none">
|
||
<p><a href="#" onClick="javascript:$('.help_toggle').toggle()">[% LxERP.t8("Hide help text") %]</a></p>
|
||
|
||
<p><b>Dieser Hilfetext wird demnaechst noch verbessert und wandert vermutlich in ein Popup.</b></p>
|
||
|
||
<table>
|
||
<tr class="listheading">
|
||
<th>[%- LxERP.t8('Column name') %]</th>
|
||
<th>[%- LxERP.t8('Meaning') %]</th>
|
||
</tr>
|
||
|
||
[%- FOREACH row = SELF.displayable_columns %]
|
||
<tr class="listrow[% loop.count % 2 %]">
|
||
<td>[%- HTML.escape(row.name) %]</td>
|
||
<td>[%- HTML.escape(row.description) %]</td>
|
||
</tr>
|
||
[%- END %]
|
||
</table>
|
||
</div>
|
||
|
||
<hr>
|
||
|
||
<h2>[%- LxERP.t8('Settings') %]</h2>
|
||
|
||
<table>
|
Auch abrufbar als: Unified diff
Hilfetexte anzeigen; sehr viele Übersetzungen