Revision 51cbfc64
Von Bernd Bleßmann vor mehr als 4 Jahren hinzugefügt
t/datev/datev_format_2018.t | ||
---|---|---|
234 | 234 |
'', '', '1', '', '', '', '', '', '', ] |
235 | 235 |
); |
236 | 236 |
|
237 |
|
|
238 |
# check deliverydate |
|
239 |
$invoice->deliverydate(DateTime->new(year => 2017, month => 7, day => 18)); |
|
240 |
$invoice->save(); |
|
241 |
|
|
242 |
$datev1 = SL::DATEV->new( |
|
243 |
dbh => $dbh, |
|
244 |
trans_id => $invoice->id, |
|
245 |
); |
|
246 |
|
|
247 |
$datev1->from($startdate); |
|
248 |
$datev1->to($enddate); |
|
249 |
$datev1->generate_datev_data; |
|
250 |
$datev1->generate_datev_lines; |
|
251 |
|
|
252 |
$datev_csv = SL::DATEV::CSV->new(datev_lines => $datev1->generate_datev_lines, |
|
253 |
from => $startdate, |
|
254 |
to => $enddate, |
|
255 |
locked => $datev1->locked, |
|
256 |
); |
|
257 |
@sorted = sort { $a->[0] cmp $b->[0] } @{ $datev_csv->lines }; |
|
258 |
cmp_deeply $sorted[0], [ '1963,5', 'S', 'EUR', '', '', '', |
|
259 |
'1400', '8400', '', '1907', 'meine muh', |
|
260 |
'', '', 'Test customer', '', '', '', '', '', '', |
|
261 |
'', '', '', '', '', '', '', '', '', |
|
262 |
'', '', '', '', '', '', '', "K\x{e4}stchen", |
|
263 |
'299', '', $ustid, '', '', '', |
|
264 |
'', '', '', '', '', '', '', '', '', |
|
265 |
'', '', '', '', '', '', '', '', '', |
|
266 |
'', '', '', '', '', '', '', '', '', |
|
267 |
'', '', '', '', '', '', '', '', '', |
|
268 |
'', '', '', '', '', '', '', '', '', |
|
269 |
'', '', '', '', '', '', '', '', '', |
|
270 |
'', '', '', '', '', '', '', '', '', |
|
271 |
'', '', '', '', '', '', '', '1', '18072017', |
|
272 |
'', '', '', '', '', |
|
273 |
]; |
|
274 |
cmp_deeply $sorted[1], [ '535', 'S', 'EUR', '', '', '', |
|
275 |
'1400', '8300', '', '1907','meine muh', |
|
276 |
'', '', 'Test customer', '', '', '', '', '', '', |
|
277 |
'', '', '', '', '', '', '', '', '', |
|
278 |
'', '', '', '', '', '', '', "K\x{e4}stchen", |
|
279 |
'299', '', $ustid, '', '', '', |
|
280 |
'', '', '', '', '', '', '', '', '', |
|
281 |
'', '', '', '', '', '', '', '', '', |
|
282 |
'', '', '', '', '', '', '', '', '', |
|
283 |
'', '', '', '', '', '', '', '', '', |
|
284 |
'', '', '', '', '', '', '', '', '', |
|
285 |
'', '', '', '', '', '', '', '', '', |
|
286 |
'', '', '', '', '', '', '', '', '', |
|
287 |
'', '', '', '', '', '', '', '1', '18072017', |
|
288 |
'', '', '', '', '', |
|
289 |
]; |
|
290 |
|
|
291 |
$gl_transaction->deliverydate(DateTime->new(year => 2017, month => 7, day => 18)); |
|
292 |
$gl_transaction->save; |
|
293 |
|
|
294 |
$datev1 = SL::DATEV->new( |
|
295 |
dbh => $dbh, |
|
296 |
trans_id => $gl_transaction->id, |
|
297 |
); |
|
298 |
|
|
299 |
$datev1->from($startdate); |
|
300 |
$datev1->to($enddate); |
|
301 |
$datev1->generate_datev_data; |
|
302 |
|
|
303 |
$datev_csv = SL::DATEV::CSV->new(datev_lines => $datev1->generate_datev_lines, |
|
304 |
from => $startdate, |
|
305 |
to => $enddate, |
|
306 |
locked => $datev1->locked, |
|
307 |
); |
|
308 |
|
|
309 |
@sorted = sort { $a->[0] cmp $b->[0] } @{ $datev_csv->lines }; |
|
310 |
cmp_deeply($sorted[0], [ '100', 'S', 'EUR', '', '', '', '4660', '1000', 9, '1703', 'Reise März 2', |
|
311 |
'', '', 'Reisekonsten März 2018 / Ma Schmidt', '', '', '', '', '', '', '', '', |
|
312 |
'', '', '', '', '', '', '', '', '', '', '', '', '', |
|
313 |
'', '', '', '', '', '', '', '', '', '', '', |
|
314 |
'', '', '', '', '', '', '', '', '', '', '', '', '', |
|
315 |
'', '', '', '', '', '', '', '', '', '', '', '', '', |
|
316 |
'', '', '', '', '', '', '', '', '', '', '', '', '', |
|
317 |
'', '', '', '', '', '', '', '', '', '', '', '', '', |
|
318 |
'', '', '', '', '', '', '', '', '', '', '', '', '', |
|
319 |
'', '', '1', '18072017', '', '', '', '', '', ] |
|
320 |
); |
|
321 |
|
|
322 |
|
|
237 | 323 |
# TODO warnings are not yet tested |
238 | 324 |
# currently most of the valid_checks are senseless because of |
239 | 325 |
# the strict input_checks before. Maybe something like encoding mismatch of invnumber, |
Auch abrufbar als: Unified diff
Tests: DATEV-CSV-Export: Lieferdatum/Leistungsdatum