Revision d02f30a9
Von Bernd Bleßmann vor mehr als 1 Jahr hinzugefügt
SL/Controller/CsvImport/APTransaction.pm | ||
---|---|---|
my ($self) = @_;
|
||
|
||
$self->controller->profile->_set_defaults(
|
||
ap_column => $::locale->text('Invoice'),
|
||
transaction_column => $::locale->text('AccTransaction'),
|
||
max_amount_diff => 0.02,
|
||
);
|
||
ap_column => $::locale->text('Invoice'),
|
||
transaction_column => $::locale->text('AccTransaction'),
|
||
max_amount_diff => 0.02,
|
||
dont_save_anything_on_errors => 0,
|
||
);
|
||
};
|
||
|
||
|
||
sub init_settings {
|
||
my ($self) = @_;
|
||
|
||
return { map { ( $_ => $self->controller->profile->get($_) ) } qw(ap_column transaction_column max_amount_diff) };
|
||
return { map { ( $_ => $self->controller->profile->get($_) ) } qw(ap_column transaction_column max_amount_diff dont_save_anything_on_errors) };
|
||
}
|
||
|
||
sub init_profile {
|
||
... | ... | |
|
||
$self->add_info_columns($self->_transaction_column, { header => $::locale->text('Project Number'), method => 'projectnumber' }) if $self->controller->data->[1]->{info_data}->{projectnumber};
|
||
|
||
# If requested to not save anything on errors, set all ap rows without error to an error
|
||
if ($self->controller->profile->get('dont_save_anything_on_errors')) {
|
||
my $any_errors = any { scalar @{ $_->{errors} } } @{ $self->controller->data };
|
||
if ($any_errors) {
|
||
foreach my $entry (grep { ($_->{raw_data}->{datatype} eq $self->_ap_column) && !scalar @{ $_->{errors} } } @{ $self->controller->data }) {
|
||
push @{ $entry->{errors} }, $::locale->text('There are some errors in the file and it was requested to not save any datasets on errors.');
|
||
}
|
||
}
|
||
}
|
||
|
||
# If invoice has errors, add error for acc_trans items
|
||
# If acc_trans item has an error, add an error to the invoice item
|
||
my $ap_entry;
|
locale/de/all | ||
---|---|---|
'Do not link to a project.' => 'Nicht mit einem Projekt verknüpfen.',
|
||
'Do not modify this position' => 'Diese Position nicht verändern',
|
||
'Do not run the task server for this client' => 'Task-Server nicht für diesen Mandanten ausführen',
|
||
'Do not save any datasets on errors' => 'Bei Fehlern überhaupt keine Datensätze speichern',
|
||
'Do not set default booking group' => 'Nie Standardbuchungsgruppe setzen',
|
||
'Do not set this bin' => 'Diesen Lagerplatz nicht setzen',
|
||
'Do not set this comment' => 'Diesen Kommentar nicht setzen',
|
||
... | ... | |
'There are no record templates yet.' => 'Es gibt noch keine Belegvorlagen.',
|
||
'There are parts with no reclamation reason at position:' => 'Es git Artikel mit keinem Reklamationsgrund an Position:',
|
||
'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:',
|
||
'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.',
|
||
'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?',
|
||
'There are undefined currencies in your system.' => 'In Ihrer Datenbank wurden Währungen benutzt, die nicht ordnungsgemäß in den Währungen eingetragen wurden.',
|
||
'There are usually three ways to install Perl modules.' => 'Es gibt normalerweise drei Arten, ein Perlmodul zu installieren.',
|
locale/en/all | ||
---|---|---|
'Do not link to a project.' => '',
|
||
'Do not modify this position' => '',
|
||
'Do not run the task server for this client' => '',
|
||
'Do not save any datasets on errors' => '',
|
||
'Do not set default booking group' => '',
|
||
'Do not set this bin' => '',
|
||
'Do not set this comment' => '',
|
||
... | ... | |
'There are no record templates yet.' => '',
|
||
'There are parts with no reclamation reason at position:' => '',
|
||
'There are several options you can handle this problem, please select one:' => '',
|
||
'There are some errors in the file and it was requested to not save any datasets on errors.' => '',
|
||
'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?' => '',
|
||
'There are undefined currencies in your system.' => '',
|
||
'There are usually three ways to install Perl modules.' => '',
|
templates/design40_webpages/csv_import/_form_aptransactions.html | ||
---|---|---|
[% L.input_tag('settings.max_amount_diff', LxERP.format_amount(SELF.profile.get('max_amount_diff')), size => "5") %]
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th align="right">[%- LxERP.t8('Error handling') %]:</th>
|
||
<td colspan="10">
|
||
[% L.checkbox_tag('settings.dont_save_anything_on_errors',
|
||
label => LxERP.t8('Do not save any datasets on errors'),
|
||
checked => SELF.profile.get('dont_save_anything_on_errors')) %]
|
||
</td>
|
||
</tr>
|
templates/webpages/csv_import/_form_aptransactions.html | ||
---|---|---|
[% L.input_tag('settings.max_amount_diff', LxERP.format_amount(SELF.profile.get('max_amount_diff')), size => "5") %]
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th align="right">[%- LxERP.t8('Error handling') %]:</th>
|
||
<td colspan="10">
|
||
[% L.checkbox_tag('settings.dont_save_anything_on_errors',
|
||
label => LxERP.t8('Do not save any datasets on errors'),
|
||
checked => SELF.profile.get('dont_save_anything_on_errors')) %]
|
||
</td>
|
||
</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.