DATEV::CSV Feld Umsatz strikter beschreiben
authorJan Büren <jan@kivitendo-premium.de>
Thu, 9 Nov 2017 12:59:28 +0000 (13:59 +0100)
committerJan Büren <jan@kivitendo-premium.de>
Thu, 9 Nov 2017 13:01:50 +0000 (14:01 +0100)
Hier der genaue DATEV-Wortlaut:
"Muss immer ein positiver Wert sein."
=> 0 verbieten.

SL/DATEV/CSV.pm

index 3d81e62..6d65945 100644 (file)
@@ -22,7 +22,7 @@ my @kivitendo_to_datev = (
                               max_length      => 13,
                               type            => 'Value',
                               required        => 1,
-                              input_check     => sub { my ($input) = @_; return (looks_like_number($input) && length($input) <= 13) },
+                              input_check     => sub { my ($input) = @_; return (looks_like_number($input) && length($input) <= 13 && $input > 0) },
                               formatter       => \&_format_amount,
                               valid_check     => sub { my ($check) = @_; return ($check =~ m/^\d{1,10}(\,\d{1,2})?$/) },
                             },