Revision 9e99dce5
Von Jan Büren vor mehr als 7 Jahren hinzugefügt
SL/DATEV.pm | ||
---|---|---|
215 | 215 |
return $self->{trans_id}; |
216 | 216 |
} |
217 | 217 |
|
218 |
sub warnings { |
|
219 |
my $self = shift; |
|
220 |
|
|
221 |
if (@_) { |
|
222 |
$self->{warnings} = \@_; |
|
223 |
} else { |
|
224 |
return $self->{warnings}; |
|
225 |
} |
|
226 |
} |
|
227 |
|
|
218 | 228 |
sub accnofrom { |
219 | 229 |
my $self = shift; |
220 | 230 |
|
... | ... | |
1365 | 1375 |
push @array_of_datev, \@csv_headers; |
1366 | 1376 |
push @array_of_datev, [ map { $_->{csv_header_name} } @csv_columns ]; |
1367 | 1377 |
|
1378 |
my @warnings; |
|
1368 | 1379 |
foreach my $row ( @datev_lines ) { |
1369 | 1380 |
my @current_datev_row; |
1370 | 1381 |
|
... | ... | |
1389 | 1400 |
die "Incorrect lenght of field" if length($row->{ $column->{kivi_datev_name} }) > $column->{max_length}; |
1390 | 1401 |
} |
1391 | 1402 |
if (exists $column->{valid_check} && $column->{kivi_datev_name} ne 'not yet implemented') { |
1392 |
# more checks |
|
1393 |
die "Not a valid value: '$row->{ $column->{kivi_datev_name} }'" . |
|
1394 |
" for '$column->{kivi_datev_name}' with amount '$row->{umsatz}'" |
|
1395 |
unless ($column->{valid_check}->($row->{ $column->{kivi_datev_name} })); |
|
1403 |
# more checks, listed as user warnings |
|
1404 |
push @warnings, t8("Wrong field value '#1' for field '#2' for the transaction" . |
|
1405 |
" with amount '#3'",$row->{ $column->{kivi_datev_name} }, |
|
1406 |
$column->{kivi_datev_name},$row->{umsatz}) |
|
1407 |
unless ($column->{valid_check}->($row->{ $column->{kivi_datev_name} })); |
|
1396 | 1408 |
} |
1397 | 1409 |
push @current_datev_row, $row->{ $column->{kivi_datev_name} }; |
1398 | 1410 |
} |
1399 | 1411 |
push @array_of_datev, \@current_datev_row; |
1400 | 1412 |
} |
1413 |
$self->warnings(@warnings) if @warnings; |
|
1401 | 1414 |
return \@array_of_datev; |
1402 | 1415 |
} |
1403 | 1416 |
|
Auch abrufbar als: Unified diff
DATEV-Export: Feldprüfung als Warnungen ausgeben
Anstatt hart auszusteigen (die), erhält der Anwender jetzt eine
Übersicht der fehlerhaften Feldwerte mit einem Minimum an
Zusatz-Info (Umsatz der Transaktion). Entsprechend den
Test-Fall angepasst.