Revision d02f30a9
Von Bernd Bleßmann vor mehr als 1 Jahr hinzugefügt
SL/Controller/CsvImport/APTransaction.pm | ||
---|---|---|
32 | 32 |
my ($self) = @_; |
33 | 33 |
|
34 | 34 |
$self->controller->profile->_set_defaults( |
35 |
ap_column => $::locale->text('Invoice'), |
|
36 |
transaction_column => $::locale->text('AccTransaction'), |
|
37 |
max_amount_diff => 0.02, |
|
38 |
); |
|
35 |
ap_column => $::locale->text('Invoice'), |
|
36 |
transaction_column => $::locale->text('AccTransaction'), |
|
37 |
max_amount_diff => 0.02, |
|
38 |
dont_save_anything_on_errors => 0, |
|
39 |
); |
|
39 | 40 |
}; |
40 | 41 |
|
41 | 42 |
|
42 | 43 |
sub init_settings { |
43 | 44 |
my ($self) = @_; |
44 | 45 |
|
45 |
return { map { ( $_ => $self->controller->profile->get($_) ) } qw(ap_column transaction_column max_amount_diff) }; |
|
46 |
return { map { ( $_ => $self->controller->profile->get($_) ) } qw(ap_column transaction_column max_amount_diff dont_save_anything_on_errors) };
|
|
46 | 47 |
} |
47 | 48 |
|
48 | 49 |
sub init_profile { |
... | ... | |
288 | 289 |
|
289 | 290 |
$self->add_info_columns($self->_transaction_column, { header => $::locale->text('Project Number'), method => 'projectnumber' }) if $self->controller->data->[1]->{info_data}->{projectnumber}; |
290 | 291 |
|
292 |
# If requested to not save anything on errors, set all ap rows without error to an error |
|
293 |
if ($self->controller->profile->get('dont_save_anything_on_errors')) { |
|
294 |
my $any_errors = any { scalar @{ $_->{errors} } } @{ $self->controller->data }; |
|
295 |
if ($any_errors) { |
|
296 |
foreach my $entry (grep { ($_->{raw_data}->{datatype} eq $self->_ap_column) && !scalar @{ $_->{errors} } } @{ $self->controller->data }) { |
|
297 |
push @{ $entry->{errors} }, $::locale->text('There are some errors in the file and it was requested to not save any datasets on errors.'); |
|
298 |
} |
|
299 |
} |
|
300 |
} |
|
301 |
|
|
291 | 302 |
# If invoice has errors, add error for acc_trans items |
292 | 303 |
# If acc_trans item has an error, add an error to the invoice item |
293 | 304 |
my $ap_entry; |
locale/de/all | ||
---|---|---|
1224 | 1224 |
'Do not link to a project.' => 'Nicht mit einem Projekt verknüpfen.', |
1225 | 1225 |
'Do not modify this position' => 'Diese Position nicht verändern', |
1226 | 1226 |
'Do not run the task server for this client' => 'Task-Server nicht für diesen Mandanten ausführen', |
1227 |
'Do not save any datasets on errors' => 'Bei Fehlern überhaupt keine Datensätze speichern', |
|
1227 | 1228 |
'Do not set default booking group' => 'Nie Standardbuchungsgruppe setzen', |
1228 | 1229 |
'Do not set this bin' => 'Diesen Lagerplatz nicht setzen', |
1229 | 1230 |
'Do not set this comment' => 'Diesen Kommentar nicht setzen', |
... | ... | |
4137 | 4138 |
'There are no record templates yet.' => 'Es gibt noch keine Belegvorlagen.', |
4138 | 4139 |
'There are parts with no reclamation reason at position:' => 'Es git Artikel mit keinem Reklamationsgrund an Position:', |
4139 | 4140 |
'There are several options you can handle this problem, please select one:' => 'Bitte wählen Sie eine der folgenden Optionen, um mit dem Problem umzugehen:', |
4141 |
'There are some errors in the file and it was requested to not save any datasets on errors.' => 'Es sind Fehler aufgetreten und es sollen bei Fehlern überhaupt keine Datensätze gespeichert werden.', |
|
4140 | 4142 |
'There are still transfers not matching the qty of the delivery order. Stock operations can not be changed later. Do you really want to proceed?' => 'Einige der Lagerbewegungen sind nicht vollständig und Lagerbewegungen können nachträglich nicht mehr verändert werden. Möchten Sie wirklich fortfahren?', |
4141 | 4143 |
'There are undefined currencies in your system.' => 'In Ihrer Datenbank wurden Währungen benutzt, die nicht ordnungsgemäß in den Währungen eingetragen wurden.', |
4142 | 4144 |
'There are usually three ways to install Perl modules.' => 'Es gibt normalerweise drei Arten, ein Perlmodul zu installieren.', |
locale/en/all | ||
---|---|---|
1224 | 1224 |
'Do not link to a project.' => '', |
1225 | 1225 |
'Do not modify this position' => '', |
1226 | 1226 |
'Do not run the task server for this client' => '', |
1227 |
'Do not save any datasets on errors' => '', |
|
1227 | 1228 |
'Do not set default booking group' => '', |
1228 | 1229 |
'Do not set this bin' => '', |
1229 | 1230 |
'Do not set this comment' => '', |
... | ... | |
4135 | 4136 |
'There are no record templates yet.' => '', |
4136 | 4137 |
'There are parts with no reclamation reason at position:' => '', |
4137 | 4138 |
'There are several options you can handle this problem, please select one:' => '', |
4139 |
'There are some errors in the file and it was requested to not save any datasets on errors.' => '', |
|
4138 | 4140 |
'There are still transfers not matching the qty of the delivery order. Stock operations can not be changed later. Do you really want to proceed?' => '', |
4139 | 4141 |
'There are undefined currencies in your system.' => '', |
4140 | 4142 |
'There are usually three ways to install Perl modules.' => '', |
templates/design40_webpages/csv_import/_form_aptransactions.html | ||
---|---|---|
13 | 13 |
[% L.input_tag('settings.max_amount_diff', LxERP.format_amount(SELF.profile.get('max_amount_diff')), size => "5") %] |
14 | 14 |
</td> |
15 | 15 |
</tr> |
16 |
<tr> |
|
17 |
<th align="right">[%- LxERP.t8('Error handling') %]:</th> |
|
18 |
<td colspan="10"> |
|
19 |
[% L.checkbox_tag('settings.dont_save_anything_on_errors', |
|
20 |
label => LxERP.t8('Do not save any datasets on errors'), |
|
21 |
checked => SELF.profile.get('dont_save_anything_on_errors')) %] |
|
22 |
</td> |
|
23 |
</tr> |
templates/webpages/csv_import/_form_aptransactions.html | ||
---|---|---|
13 | 13 |
[% L.input_tag('settings.max_amount_diff', LxERP.format_amount(SELF.profile.get('max_amount_diff')), size => "5") %] |
14 | 14 |
</td> |
15 | 15 |
</tr> |
16 |
<tr> |
|
17 |
<th align="right">[%- LxERP.t8('Error handling') %]:</th> |
|
18 |
<td colspan="10"> |
|
19 |
[% L.checkbox_tag('settings.dont_save_anything_on_errors', |
|
20 |
label => LxERP.t8('Do not save any datasets on errors'), |
|
21 |
checked => SELF.profile.get('dont_save_anything_on_errors')) %] |
|
22 |
</td> |
|
23 |
</tr> |
Auch abrufbar als: Unified diff
CSV-Import Kreditorenbuchungen: Optional nichts Speichern bei Fehlern
Wenn gewünscht, werden auch fehlerfreie Datensätze auf Fehler gesetzt,
wenn in der Datei irgendwelche Datensätze mit Fehlern sind.