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 data num_imported) ],
+ import_status errors headers data num_imported num_importable) ],
);
__PACKAGE__->run_before('check_auth');
$worker->run;
$worker->save_objects if !$params{test};
+ $self->num_importable(scalar grep { !$_ } map { scalar @{ $_->{errors} } } @{ $self->data });
$self->import_status($params{test} ? 'tested' : 'imported');
$self->action_new;
my %by_name;
if ('check_db' eq $self->controller->profile->get('duplicates')) {
- %by_name = map { ( $normalizer->($_->name) => 1 ) } @{ $self->existing_objects };
+ %by_name = map { ( $normalizer->($_->name) => 'db' ) } @{ $self->existing_objects };
}
foreach my $entry (@{ $self->controller->data }) {
my $name = $normalizer->($entry->{object}->name);
if (!$by_name{$name}) {
- $by_name{$name} = 1;
+ $by_name{$name} = 'csv';
} else {
- push @{ $entry->{errors} }, $::locale->text('Duplicate');
+ push @{ $entry->{errors} }, $by_name{$name} eq 'db' ? $::locale->text('Duplicate in database') : $::locale->text('Duplicate in CSV file');
}
}
}
' Date missing!' => ' Datum fehlt!',
' Part Number missing!' => ' Artikelnummer fehlt!',
' missing!' => ' fehlt!',
- '#1 objects were imported.' => '#1 Objekte wurden importiert.',
+ '#1 of #2 importable objects were imported.' => '#1 von #2 importierbaren Objekten wurden importiert.',
'#1 prices were updated.' => '#1 Preise wurden aktualisiert.',
'*/' => '*/',
'---please select---' => '---bitte auswählen---',
'Dunning number' => 'Mahnungsnummer',
'Dunning overview' => 'Mahnungsübersicht',
'Dunnings' => 'Mahnungen',
- 'Duplicate' => 'Duplikat',
+ 'Duplicate in CSV file' => 'Duplikat in CSV-Datei',
+ 'Duplicate in database' => 'Duplikat in Datenbank',
'During this user migration Lx-Office can create such a group for you and grant all users access to all of Lx-Office\'s functions.' => 'Im Rahmen dieser Benutzerdatenmigration kann Lx-Office eine solche Gruppe für Sie anlegen und allen Benutzern Zugriff auf alle Lx-Office-Funktionen gewähren.',
'E-mail' => 'eMail',
'E-mail Statement to' => 'Fälligkeitsabrechnung als eMail an',
'Form details (second row)' => 'Formulardetails (zweite Positionszeile)',
'Formula' => 'Formel',
'Found #1 errors.' => '#1 Fehler gefunden.',
- 'Found #1 objects to import.' => '#1 zu importierende Objekte gefunden.',
+ 'Found #1 objects of which #2 can be imported.' => 'Es wurden #1 Objekte gefunden, von denen #2 importiert werden können.',
'Free report period' => 'Freier Zeitraum',
'Free-form text' => 'Textzeile',
'Fristsetzung' => 'Fristsetzung',
+++ /dev/null
-[% USE LxERP %]
-
-[%- IF SELF.errors %]
- [%- PROCESS 'csv_import/_errors.html' %]
-[%- END %]
-
-[%- IF SELF.import_status == 'imported' %]
- [%- PROCESS 'csv_import/_result.html' %]
-[%- END %]
-
-[%- PROCESS 'csv_import/_preview.html' %]
[%- END %]
</h3>
-<p>[%- LxERP.t8('Found #1 objects to import.', SELF.data.size || 0) %]</p>
-
[% IF SELF.data.size %]
<table>
<tr class="listheading">
<h3>[%- LxERP.t8('Import summary') %]</h3>
-<p>[%- LxERP.t8('#1 objects were imported.', SELF.data.size || 0) %]</p>
+[%- IF SELF.import_status == 'imported' %]
+ <p>[%- LxERP.t8('#1 of #2 importable objects were imported.', SELF.num_imported, SELF.num_importable || 0) %]</p>
+[%- ELSE %]
+ <p>[%- LxERP.t8('Found #1 objects of which #2 can be imported.', SELF.data.size || 0, SELF.num_importable || 0) %]</p>
+[%- END %]
</table>
[% L.submit_tag('action_test', LxERP.t8('Test and preview')) %]
- [% IF SELF.import_status && SELF.data.size %]
+ [% IF SELF.import_status && SELF.num_importable %]
[% L.submit_tag('action_import', LxERP.t8('Import')) %]
[%- END %]
</form>
[%- IF SELF.import_status %]
- [%- PROCESS 'csv_import/_data.html' %]
+ [%- IF SELF.errors %]
+ [%- PROCESS 'csv_import/_errors.html' %]
+ [%- END %]
+
+ [%- PROCESS 'csv_import/_result.html' %]
+ [%- PROCESS 'csv_import/_preview.html' %]
[%- END %]
<script type="text/javascript">