Revision cdd2f4c8
Von Bernd Bleßmann vor mehr als 6 Jahren hinzugefügt
SL/DATEV/CSV.pm | ||
---|---|---|
10 | 10 |
use SL::DB::Chart; |
11 | 11 |
use SL::Helper::DateTime; |
12 | 12 |
use SL::Locale::String qw(t8); |
13 |
use SL::Util qw(trim); |
|
13 | 14 |
|
14 | 15 |
use Rose::Object::MakeMethods::Generic ( |
15 | 16 |
scalar => [ qw(datev_lines from to locked warnings) ], |
... | ... | |
112 | 113 |
type => 'Text', |
113 | 114 |
default => '', |
114 | 115 |
input_check => sub { my ($check) = @_; return 1 unless $check; return (ref (DateTime->from_kivitendo($check)) eq 'DateTime') }, |
115 |
formatter => sub { my ($input) = @_; my $date = DateTime->from_kivitendo($input)->strftime('%e%m%y'); $date =~ s/^\s+//; return $date },
|
|
116 |
formatter => sub { my ($input) = @_; return trim(DateTime->from_kivitendo($input)->strftime('%e%m%y')) },
|
|
116 | 117 |
valid_check => sub { my ($check) = @_; return ($check =~ m/^[0-9]{5,6}$/) }, |
117 | 118 |
}, |
118 | 119 |
{ |
... | ... | |
548 | 549 |
my $lines = $datev_csv->lines; |
549 | 550 |
die if @{ $datev_csv->warnings }; |
550 | 551 |
somethin_with($lines); |
551 |
|
Auch abrufbar als: Unified diff
DATEV-CSV-Export Belegfeld 2: trim statt regex verwenden