68 |
68 |
# check conversion to csv
|
69 |
69 |
$datev1->from($startdate);
|
70 |
70 |
$datev1->to($enddate);
|
71 |
|
my ($datev_ref, $warnings_ref, $die_message);
|
|
71 |
my ($datev_csv, $die_message);
|
72 |
72 |
eval {
|
73 |
|
($datev_ref, $warnings_ref) = SL::DATEV::CSV->new(datev_lines => $datev1->generate_datev_lines,
|
74 |
|
from => $startdate,
|
75 |
|
to => $enddate,
|
76 |
|
locked => $datev1->locked,
|
77 |
|
);
|
|
73 |
$datev_csv = SL::DATEV::CSV->new(datev_lines => $datev1->generate_datev_lines,
|
|
74 |
from => $startdate,
|
|
75 |
to => $enddate,
|
|
76 |
locked => $datev1->locked,
|
|
77 |
);
|
|
78 |
my $lines_aref = $datev_csv->lines; # dies only if we assign (do stuff with the data)
|
78 |
79 |
1;
|
79 |
80 |
} or do {
|
80 |
81 |
$die_message = $@;
|
81 |
82 |
};
|
82 |
|
|
83 |
83 |
ok($die_message =~ m/Falscher Feldwert 'ݗݘݰݶ' für Feld 'belegfeld1' bei der Transaktion mit dem Umsatz von/, 'wrong_encoding');
|
84 |
84 |
|
85 |
85 |
|
... | ... | |
95 |
95 |
$datev3->to($enddate);
|
96 |
96 |
$datev3->generate_datev_data;
|
97 |
97 |
$datev3->generate_datev_lines;
|
98 |
|
my ($datev_ref2, $warnings_ref2, $die_message2);
|
|
98 |
my ($datev_csv2, $die_message2);
|
99 |
99 |
eval {
|
100 |
|
($datev_ref2, $warnings_ref2) = SL::DATEV::CSV->new(datev_lines => $datev3->generate_datev_lines,
|
101 |
|
from => $startdate,
|
102 |
|
to => $enddate,
|
103 |
|
locked => $datev3->locked,
|
104 |
|
);
|
|
100 |
$datev_csv2 = SL::DATEV::CSV->new(datev_lines => $datev3->generate_datev_lines,
|
|
101 |
from => $startdate,
|
|
102 |
to => $enddate,
|
|
103 |
locked => $datev3->locked,
|
|
104 |
);
|
|
105 |
my $lines_aref = $datev_csv2->lines; # dies only if we assign (do stuff with the data)
|
|
106 |
|
105 |
107 |
1;
|
106 |
108 |
} or do {
|
107 |
109 |
$die_message2 = $@;
|
... | ... | |
172 |
174 |
$datev2->generate_datev_data;
|
173 |
175 |
$datev2->generate_datev_lines;
|
174 |
176 |
|
175 |
|
my ($datev_ref3, $warnings_ref3) = SL::DATEV::CSV->new(datev_lines => $datev2->generate_datev_lines,
|
176 |
|
from => $startdate,
|
177 |
|
to => $enddate,
|
178 |
|
locked => $datev2->locked,
|
179 |
|
);
|
|
177 |
my $datev_csv3 = SL::DATEV::CSV->new(datev_lines => $datev2->generate_datev_lines,
|
|
178 |
from => $startdate,
|
|
179 |
to => $enddate,
|
|
180 |
locked => $datev2->locked,
|
|
181 |
);
|
180 |
182 |
|
181 |
|
my @data_csv = splice @{ $datev_ref3 }, 2, 5;
|
182 |
|
@data_csv = sort { $a->[0] cmp $b->[0] } @data_csv;
|
|
183 |
my @data_csv = $datev_csv3->lines;
|
|
184 |
@data_csv = sort { $a->[0] cmp $b->[0] } @{ $datev_csv3->lines };
|
183 |
185 |
cmp_deeply($data_csv[0], [ 100, 'H', 'EUR', '', '', '', '4660', '1000', 9, '1703', 'Reise März 2',
|
184 |
186 |
'', '', '', '', '', '', '', '', '', '', '',
|
185 |
187 |
'', '', '', '', '', '', '', '', '', '', '', '', '',
|
... | ... | |
192 |
194 |
'', '', '', '', '' ]
|
193 |
195 |
);
|
194 |
196 |
|
|
197 |
# TODO warnings are not yet tested
|
|
198 |
# currently most of the valid_checks are senseless because of
|
|
199 |
# the strict input_checks before. Maybe something like encoding mismatch of invnumber,
|
|
200 |
# can be altered to just a warning (not a mandantory field!)
|
|
201 |
|
195 |
202 |
done_testing();
|
196 |
203 |
clear_up();
|
197 |
204 |
|
Testfälle für neue API von DATEV angepasst